fix copy-paste error that caused -DDEBUG build to fail
[librdf.sqlite.git] / rdf_storage_sqlite_mro.h
blob390ec2169a4d579347876d8d91e2e8434c72080b
1 //
2 // rdf_storage_sqlite_mro.h
3 //
4 // Created by Marcus Rohrmoser on 19.05.14.
5 //
6 // Copyright (c) 2014-2015, Marcus Rohrmoser mobile Software, http://mro.name/me
7 // All rights reserved.
8 //
9 // Redistribution and use in source and binary forms, with or without modification, are permitted
10 // provided that the following conditions are met:
12 // 1. Redistributions of source code must retain the above copyright notice, this list of conditions
13 // and the following disclaimer.
15 // 2. The software must not be used for military or intelligence or related purposes nor
16 // anything that's in conflict with human rights as declared in http://www.un.org/en/documents/udhr/ .
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24 // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
25 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #ifndef Redland_rdf_storage_sqlite_mro_h
29 #define Redland_rdf_storage_sqlite_mro_h
31 #ifndef LIBRDF_STORAGE_SQLITE_MRO_CONVENIENCE
32 #define LIBRDF_STORAGE_SQLITE_MRO_CONVENIENCE 0
33 #endif
35 #if LIBRDF_STORAGE_SQLITE_MRO_CONVENIENCE
36 #include <stdbool.h>
37 #endif
39 #include <librdf.h>
41 /** Storage Factory name. */
42 extern const char *LIBRDF_STORAGE_SQLITE_MRO;
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
48 /** Register factory.
50 * # Typical Usage
52 * #include "rdf_storage_sqlite_mro.h"
53 * ....
54 * librdf_world *world = librdf_new_world();
55 * librdf_init_storage_sqlite_mro(world); // register storage factory
56 * ....
57 * const char* options = "new='yes', contexts='no'";
58 * librdf_storage *newStorage = librdf_new_storage(world, LIBRDF_STORAGE_SQLITE_MRO, file_path, options);
60 int librdf_init_storage_sqlite_mro(librdf_world *);
63 #if LIBRDF_STORAGE_SQLITE_MRO_CONVENIENCE
65 /** Typed convenience wrapper for librdf_storage_set_feature(storage,uri,literal) */
66 int librdf_storage_set_feature_mro_bool(librdf_storage *, const unsigned char *feature, bool value);
68 /** Typed convenience wrapper for librdf_storage_set_feature(storage,uri,literal) */
69 int librdf_storage_set_feature_mro_int(librdf_storage *, const unsigned char *feature, int value);
71 /** Typed convenience wrapper for librdf_storage_get_feature(storage,uri) */
72 int librdf_storage_get_feature_mro_bool(librdf_storage *, const unsigned char *feature, bool *value);
74 /** Typed convenience wrapper for librdf_storage_get_feature(storage,uri) */
75 int librdf_storage_get_feature_mro_int(librdf_storage *, const unsigned char *feature, int *value);
77 #endif
79 #ifdef __cplusplus
80 } // extern "C"
81 #endif
83 /** Which triple-find-queries should be cached. Bitmask, http://www.w3.org/2000/10/XMLSchema#unsignedShort.
84 * Clipped to 0x1FF.
86 extern const unsigned char *LIBRDF_STORAGE_SQLITE_MRO_FEATURE_SQL_CACHE_MASK;
88 /** Register sqlite3_profile or not. http://www.w3.org/2000/10/XMLSchema#boolean. */
89 extern const unsigned char *LIBRDF_STORAGE_SQLITE_MRO_FEATURE_SQLITE3_PROFILE;
91 /** Print (some) sqlite3 'EXPLAIN QUERY PLAN' or not. http://www.w3.org/2000/10/XMLSchema#boolean. */
92 extern const unsigned char *LIBRDF_STORAGE_SQLITE_MRO_FEATURE_SQLITE3_EXPLAIN_QUERY_PLAN;
94 #endif