]>
Commit | Line | Data |
---|---|---|
4e1d97bb | 1 | diff -ur redland-1.0.9.orig/configure.ac redland-1.0.9/configure.ac |
2 | --- redland-1.0.9.orig/configure.ac 2009-04-13 04:01:30.000000000 +0300 | |
3 | +++ redland-1.0.9/configure.ac 2009-08-12 20:23:18.000000000 +0300 | |
4 | @@ -675,7 +675,7 @@ | |
5 | SQLITE_CONFIG="$PKG_CONFIG sqlite" | |
6 | fi | |
7 | sqlite_version=`$SQLITE_CONFIG --modversion 2>/dev/null` | |
8 | - AC_DEFINE_UNQUOTED(SQLITE_API, $sqlite_api_version, [SQLite API version]) | |
9 | + AC_DEFINE_UNQUOTED(REDLAND_SQLITE_API, $sqlite_api_version, [SQLite API version]) | |
10 | ||
11 | storages_available="$storages_available sqlite($sqlite_version)" | |
12 | sqlite_storage_available=yes | |
13 | diff -ur redland-1.0.9.orig/src/rdf_config.h.in redland-1.0.9/src/rdf_config.h.in | |
14 | --- redland-1.0.9.orig/src/rdf_config.h.in 2009-04-13 04:04:50.000000000 +0300 | |
15 | +++ redland-1.0.9/src/rdf_config.h.in 2009-08-12 20:23:14.000000000 +0300 | |
16 | @@ -313,7 +313,7 @@ | |
17 | #undef SIZEOF_UNSIGNED_LONG_LONG | |
18 | ||
19 | /* SQLite API version */ | |
20 | -#undef SQLITE_API | |
21 | +#undef REDLAND_SQLITE_API | |
22 | ||
23 | /* Define to 1 if you have the ANSI C header files. */ | |
24 | #undef STDC_HEADERS | |
25 | diff -ur redland-1.0.9.orig/src/rdf_storage_sqlite.c redland-1.0.9/src/rdf_storage_sqlite.c | |
26 | --- redland-1.0.9.orig/src/rdf_storage_sqlite.c 2009-04-13 02:59:01.000000000 +0300 | |
27 | +++ redland-1.0.9/src/rdf_storage_sqlite.c 2009-08-12 20:22:54.000000000 +0300 | |
28 | @@ -45,7 +45,7 @@ | |
29 | #include <rdf_storage.h> | |
30 | ||
31 | ||
32 | -#if SQLITE_API == 3 | |
33 | +#if REDLAND_SQLITE_API == 3 | |
34 | #include <sqlite3.h> | |
35 | #define sqlite_DB sqlite3 | |
36 | #define sqlite_STATEMENT sqlite3_stmt | |
37 | @@ -57,7 +57,7 @@ | |
38 | #define sqlite_last_insert_rowid sqlite3_last_insert_rowid | |
39 | #endif | |
40 | ||
41 | -#if SQLITE_API == 2 | |
42 | +#if REDLAND_SQLITE_API == 2 | |
43 | #include <sqlite.h> | |
44 | #define sqlite_DB sqlite | |
45 | #define sqlite_STATEMENT sqlite_vm | |
46 | @@ -68,11 +68,11 @@ | |
47 | #endif | |
48 | ||
49 | ||
50 | -#if SQLITE_API == 3 | |
51 | +#if REDLAND_SQLITE_API == 3 | |
52 | #define GET_COLUMN_VALUE_TEXT(vm, col) sqlite3_column_text(vm, col) | |
53 | #define GET_COLUMN_VALUE_INT(vm, col) sqlite3_column_int(vm, col) | |
54 | #endif | |
55 | -#if SQLITE_API == 2 | |
56 | +#if REDLAND_SQLITE_API == 2 | |
57 | #define GET_COLUMN_VALUE_TEXT(vm, col) (unsigned char*)pazValue[col] | |
58 | #define GET_COLUMN_VALUE_INT(vm, col) atoi(pazValue[col]) | |
59 | #endif | |
60 | @@ -791,7 +791,7 @@ | |
61 | librdf_storage_sqlite_instance* context=(librdf_storage_sqlite_instance*)storage->instance; | |
62 | int rc=SQLITE_OK; | |
63 | char *errmsg=NULL; | |
64 | -#if SQLITE_API == 2 | |
65 | +#if REDLAND_SQLITE_API == 2 | |
66 | int mode=0; | |
67 | #endif | |
68 | int db_file_exists=0; | |
69 | @@ -804,13 +804,13 @@ | |
70 | if(context->is_new && db_file_exists) | |
71 | unlink(context->name); | |
72 | ||
73 | -#if SQLITE_API == 3 | |
74 | +#if REDLAND_SQLITE_API == 3 | |
75 | context->db=NULL; | |
76 | rc=sqlite3_open(context->name, &context->db); | |
77 | if(rc != SQLITE_OK) | |
78 | errmsg=(char*)sqlite3_errmsg(context->db); | |
79 | #endif | |
80 | -#if SQLITE_API == 2 | |
81 | +#if REDLAND_SQLITE_API == 2 | |
82 | context->db=sqlite_open(context->name, mode, &errmsg); | |
83 | if(context->db == NULL) | |
84 | rc=SQLITE_ERROR; | |
85 | @@ -819,7 +819,7 @@ | |
86 | librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, | |
87 | "SQLite database %s open failed - %s", | |
88 | context->name, errmsg); | |
89 | -#if SQLITE_API == 2 | |
90 | +#if REDLAND_SQLITE_API == 2 | |
91 | sqlite_FREE(errmsg); | |
92 | #endif | |
93 | librdf_storage_sqlite_close(storage); | |
94 | @@ -1279,7 +1279,7 @@ | |
95 | ||
96 | LIBRDF_DEBUG2("SQLite prepare '%s'\n", request); | |
97 | ||
98 | -#if SQLITE_API == 3 | |
99 | +#if REDLAND_SQLITE_API == 3 | |
100 | status=sqlite3_prepare(context->db, | |
101 | (const char*)request, | |
102 | raptor_stringbuffer_length(sb), | |
103 | @@ -1288,7 +1288,7 @@ | |
104 | if(status != SQLITE_OK) | |
105 | errmsg=(char*)sqlite3_errmsg(context->db); | |
106 | #endif | |
107 | -#if SQLITE_API == 2 | |
108 | +#if REDLAND_SQLITE_API == 2 | |
109 | status=sqlite_compile(context->db, | |
110 | (const char*)request, | |
111 | &scontext->zTail, | |
112 | @@ -1328,7 +1328,7 @@ | |
113 | librdf_statement **statement, | |
114 | librdf_node **context_node) { | |
115 | int status=SQLITE_BUSY; | |
116 | -#if SQLITE_API == 2 | |
117 | +#if REDLAND_SQLITE_API == 2 | |
118 | int pN; | |
119 | const char **pazValue; /* Column data */ | |
120 | const char **pazColName; /* Column names and datatypes */ | |
121 | @@ -1342,10 +1342,10 @@ | |
122 | * SQLITE_MISUSE. | |
123 | */ | |
124 | do { | |
125 | -#if SQLITE_API == 3 | |
126 | +#if REDLAND_SQLITE_API == 3 | |
127 | status=sqlite3_step(vm); | |
128 | #endif | |
129 | -#if SQLITE_API == 2 | |
130 | +#if REDLAND_SQLITE_API == 2 | |
131 | status=sqlite_step(vm, &pN, &pazValue, &pazColName); | |
132 | #endif | |
133 | if(status == SQLITE_BUSY) { | |
134 | @@ -1479,12 +1479,12 @@ | |
135 | if(status == SQLITE_ERROR) { | |
136 | char *errmsg=NULL; | |
137 | ||
138 | -#if SQLITE_API == 3 | |
139 | +#if REDLAND_SQLITE_API == 3 | |
140 | status=sqlite3_finalize(vm); | |
141 | if(status != SQLITE_OK) | |
142 | errmsg=(char*)sqlite3_errmsg(scontext->db); | |
143 | #endif | |
144 | -#if SQLITE_API == 2 | |
145 | +#if REDLAND_SQLITE_API == 2 | |
146 | status=sqlite_finalize(vm, &errmsg); | |
147 | #endif | |
148 | if(status != SQLITE_OK) { | |
149 | @@ -1492,7 +1492,7 @@ | |
150 | 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, | |
151 | "SQLite database %s finalize failed - %s (%d)", | |
152 | scontext->name, errmsg, status); | |
153 | -#if SQLITE_API == 2 | |
154 | +#if REDLAND_SQLITE_API == 2 | |
155 | sqlite_FREE(errmsg); | |
156 | #endif | |
157 | } | |
158 | @@ -1583,12 +1583,12 @@ | |
159 | char *errmsg=NULL; | |
160 | int status; | |
161 | ||
162 | -#if SQLITE_API == 3 | |
163 | +#if REDLAND_SQLITE_API == 3 | |
164 | status=sqlite3_finalize(scontext->vm); | |
165 | if(status != SQLITE_OK) | |
166 | errmsg=(char*)sqlite3_errmsg(scontext->sqlite_context->db); | |
167 | #endif | |
168 | -#if SQLITE_API == 2 | |
169 | +#if REDLAND_SQLITE_API == 2 | |
170 | status=sqlite_finalize(scontext->vm, &errmsg); | |
171 | #endif | |
172 | if(status != SQLITE_OK) { | |
173 | @@ -1596,7 +1596,7 @@ | |
174 | 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, | |
175 | "SQLite database %s finalize failed - %s (%d)", | |
176 | scontext->sqlite_context->name, errmsg, status); | |
177 | -#if SQLITE_API == 2 | |
178 | +#if REDLAND_SQLITE_API == 2 | |
179 | sqlite_FREE(errmsg); | |
180 | #endif | |
181 | } | |
182 | @@ -1734,7 +1734,7 @@ | |
183 | ||
184 | LIBRDF_DEBUG2("SQLite prepare '%s'\n", request); | |
185 | ||
186 | -#if SQLITE_API == 3 | |
187 | +#if REDLAND_SQLITE_API == 3 | |
188 | status=sqlite3_prepare(context->db, | |
189 | (const char*)request, | |
190 | raptor_stringbuffer_length(sb), | |
191 | @@ -1743,7 +1743,7 @@ | |
192 | if(status != SQLITE_OK) | |
193 | errmsg=(char*)sqlite3_errmsg(context->db); | |
194 | #endif | |
195 | -#if SQLITE_API == 2 | |
196 | +#if REDLAND_SQLITE_API == 2 | |
197 | status=sqlite_compile(context->db, | |
198 | (const char*)request, | |
199 | &scontext->zTail, | |
200 | @@ -1856,12 +1856,12 @@ | |
201 | char *errmsg=NULL; | |
202 | int status; | |
203 | ||
204 | -#if SQLITE_API == 3 | |
205 | +#if REDLAND_SQLITE_API == 3 | |
206 | status=sqlite3_finalize(scontext->vm); | |
207 | if(status != SQLITE_OK) | |
208 | errmsg=(char*)sqlite3_errmsg(scontext->sqlite_context->db); | |
209 | #endif | |
210 | -#if SQLITE_API == 2 | |
211 | +#if REDLAND_SQLITE_API == 2 | |
212 | status=sqlite_finalize(scontext->vm, &errmsg); | |
213 | #endif | |
214 | if(status != SQLITE_OK) { | |
215 | @@ -1869,7 +1869,7 @@ | |
216 | 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, | |
217 | "SQLite database %s finalize failed - %s (%d)", | |
218 | scontext->sqlite_context->name, errmsg, status); | |
219 | -#if SQLITE_API == 2 | |
220 | +#if REDLAND_SQLITE_API == 2 | |
221 | sqlite_FREE(errmsg); | |
222 | #endif | |
223 | } | |
224 | @@ -2180,7 +2180,7 @@ | |
225 | ||
226 | LIBRDF_DEBUG2("SQLite prepare '%s'\n", request); | |
227 | ||
228 | -#if SQLITE_API == 3 | |
229 | +#if REDLAND_SQLITE_API == 3 | |
230 | status=sqlite3_prepare(context->db, | |
231 | (const char*)request, | |
232 | raptor_stringbuffer_length(sb), | |
233 | @@ -2189,7 +2189,7 @@ | |
234 | if(status != SQLITE_OK) | |
235 | errmsg=(char*)sqlite3_errmsg(context->db); | |
236 | #endif | |
237 | -#if SQLITE_API == 2 | |
238 | +#if REDLAND_SQLITE_API == 2 | |
239 | status=sqlite_compile(context->db, | |
240 | (const char*)request, | |
241 | &scontext->zTail, | |
242 | @@ -2303,12 +2303,12 @@ | |
243 | char *errmsg=NULL; | |
244 | int status; | |
245 | ||
246 | -#if SQLITE_API == 3 | |
247 | +#if REDLAND_SQLITE_API == 3 | |
248 | status=sqlite3_finalize(scontext->vm); | |
249 | if(status != SQLITE_OK) | |
250 | errmsg=(char*)sqlite3_errmsg(scontext->sqlite_context->db); | |
251 | #endif | |
252 | -#if SQLITE_API == 2 | |
253 | +#if REDLAND_SQLITE_API == 2 | |
254 | status=sqlite_finalize(scontext->vm, &errmsg); | |
255 | #endif | |
256 | if(status != SQLITE_OK) { | |
257 | @@ -2316,7 +2316,7 @@ | |
258 | 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, | |
259 | "SQLite database %s finalize failed - %s (%d)", | |
260 | scontext->sqlite_context->name, errmsg, status); | |
261 | -#if SQLITE_API == 2 | |
262 | +#if REDLAND_SQLITE_API == 2 | |
263 | sqlite_FREE(errmsg); | |
264 | #endif | |
265 | } | |
266 | @@ -2360,7 +2360,7 @@ | |
267 | sqlite_STATEMENT *vm, | |
268 | librdf_node **context_node) { | |
269 | int status=SQLITE_BUSY; | |
270 | -#if SQLITE_API == 2 | |
271 | +#if REDLAND_SQLITE_API == 2 | |
272 | int pN; | |
273 | const char **pazValue; /* Column data */ | |
274 | const char **pazColName; /* Column names and datatypes */ | |
275 | @@ -2374,10 +2374,10 @@ | |
276 | * SQLITE_MISUSE. | |
277 | */ | |
278 | do { | |
279 | -#if SQLITE_API == 3 | |
280 | +#if REDLAND_SQLITE_API == 3 | |
281 | status=sqlite3_step(vm); | |
282 | #endif | |
283 | -#if SQLITE_API == 2 | |
284 | +#if REDLAND_SQLITE_API == 2 | |
285 | status=sqlite_step(vm, &pN, &pazValue, &pazColName); | |
286 | #endif | |
287 | if(status == SQLITE_BUSY) { | |
288 | @@ -2429,12 +2429,12 @@ | |
289 | if(status == SQLITE_ERROR) { | |
290 | char *errmsg=NULL; | |
291 | ||
292 | -#if SQLITE_API == 3 | |
293 | +#if REDLAND_SQLITE_API == 3 | |
294 | status=sqlite3_finalize(vm); | |
295 | if(status != SQLITE_OK) | |
296 | errmsg=(char*)sqlite3_errmsg(scontext->db); | |
297 | #endif | |
298 | -#if SQLITE_API == 2 | |
299 | +#if REDLAND_SQLITE_API == 2 | |
300 | status=sqlite_finalize(vm, &errmsg); | |
301 | #endif | |
302 | if(status != SQLITE_OK) { | |
303 | @@ -2442,7 +2442,7 @@ | |
304 | 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, | |
305 | "SQLite database %s finalize failed - %s (%d)", | |
306 | scontext->name, errmsg, status); | |
307 | -#if SQLITE_API == 2 | |
308 | +#if REDLAND_SQLITE_API == 2 | |
309 | sqlite_FREE(errmsg); | |
310 | #endif | |
311 | } | |
312 | @@ -2541,12 +2541,12 @@ | |
313 | char *errmsg=NULL; | |
314 | int status; | |
315 | ||
316 | -#if SQLITE_API == 3 | |
317 | +#if REDLAND_SQLITE_API == 3 | |
318 | status=sqlite3_finalize(icontext->vm); | |
319 | if(status != SQLITE_OK) | |
320 | errmsg=(char*)sqlite3_errmsg(icontext->sqlite_context->db); | |
321 | #endif | |
322 | -#if SQLITE_API == 2 | |
323 | +#if REDLAND_SQLITE_API == 2 | |
324 | status=sqlite_finalize(icontext->vm, &errmsg); | |
325 | #endif | |
326 | if(status != SQLITE_OK) { | |
327 | @@ -2554,7 +2554,7 @@ | |
328 | 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, | |
329 | "SQLite database %s finalize failed - %s (%d)", | |
330 | icontext->sqlite_context->name, errmsg, status); | |
331 | -#if SQLITE_API == 2 | |
332 | +#if REDLAND_SQLITE_API == 2 | |
333 | sqlite_FREE(errmsg); | |
334 | #endif | |
335 | } | |
336 | @@ -2619,7 +2619,7 @@ | |
337 | ||
338 | LIBRDF_DEBUG2("SQLite prepare '%s'\n", request); | |
339 | ||
340 | -#if SQLITE_API == 3 | |
341 | +#if REDLAND_SQLITE_API == 3 | |
342 | status=sqlite3_prepare(context->db, | |
343 | (const char*)request, | |
344 | raptor_stringbuffer_length(sb), | |
345 | @@ -2628,7 +2628,7 @@ | |
346 | if(status != SQLITE_OK) | |
347 | errmsg=(char*)sqlite3_errmsg(context->db); | |
348 | #endif | |
349 | -#if SQLITE_API == 2 | |
350 | +#if REDLAND_SQLITE_API == 2 | |
351 | status=sqlite_compile(context->db, | |
352 | (const char*)request, | |
353 | &icontext->zTail, | |
354 | diff -ur redland-1.0.9.orig/src/win32_rdf_config.h redland-1.0.9/src/win32_rdf_config.h | |
355 | --- redland-1.0.9.orig/src/win32_rdf_config.h 2009-04-08 07:31:14.000000000 +0300 | |
356 | +++ redland-1.0.9/src/win32_rdf_config.h 2009-08-12 20:23:06.000000000 +0300 | |
357 | @@ -249,7 +249,7 @@ | |
358 | #define SIZEOF_UNSIGNED_LONG_LONG 8 | |
359 | ||
360 | /* SQLite API version */ | |
361 | -#define SQLITE_API 3 | |
362 | +#define REDLAND_SQLITE_API 3 | |
363 | ||
364 | /* Define to 1 if you have the ANSI C header files. */ | |
365 | #define STDC_HEADERS 1 |