@crossbind/port-spatialite-wasm 2.0.0-beta.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +12 -0
  3. package/config.guess +1823 -0
  4. package/config.sub +1885 -0
  5. package/crossbind.build.js +1 -0
  6. package/crossbind.config.js +11 -0
  7. package/dist/prebuilt/CMakeLists.txt +57 -0
  8. package/dist/prebuilt/wasm-wasm32-mt-release/crossbind-emccflags.fingerprint +1 -0
  9. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/control_points.h +259 -0
  10. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/debug.h +77 -0
  11. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaia_network.h +627 -0
  12. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaia_topology.h +1221 -0
  13. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaaux.h +540 -0
  14. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaconfig-msvc.h +56 -0
  15. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaconfig-msvc.h.in +55 -0
  16. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaconfig.h +68 -0
  17. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaconfig.h.in +67 -0
  18. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiaexif.h +669 -0
  19. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiageo.h +77 -0
  20. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gaiamatrix.h +277 -0
  21. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/geojson.h +586 -0
  22. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/geopackage.h +198 -0
  23. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_advanced.h +5184 -0
  24. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_const.h +606 -0
  25. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_core.h +2294 -0
  26. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_dxf.h +993 -0
  27. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_dynamic.h +416 -0
  28. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_formats.h +2056 -0
  29. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_mbr.h +606 -0
  30. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_sequence.h +173 -0
  31. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_structs.h +880 -0
  32. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_wfs.h +581 -0
  33. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/gg_xml.h +818 -0
  34. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/spatialite_ext.h +64 -0
  35. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/sqlite.h +70 -0
  36. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite/stored_procedures.h +641 -0
  37. package/dist/prebuilt/wasm-wasm32-mt-release/include/spatialite.h +2098 -0
  38. package/dist/prebuilt/wasm-wasm32-mt-release/lib/libspatialite.a +0 -0
  39. package/dist/prebuilt/wasm-wasm32-mt-release/lib/libspatialite.la +41 -0
  40. package/dist/prebuilt/wasm-wasm32-mt-release/lib/mod_spatialite.a +0 -0
  41. package/dist/prebuilt/wasm-wasm32-mt-release/lib/mod_spatialite.la +41 -0
  42. package/dist/prebuilt/wasm-wasm32-mt-release/lib/pkgconfig/spatialite.pc +12 -0
  43. package/dist/prebuilt/wasm-wasm32-st-release/crossbind-emccflags.fingerprint +1 -0
  44. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/control_points.h +259 -0
  45. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/debug.h +77 -0
  46. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaia_network.h +627 -0
  47. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaia_topology.h +1221 -0
  48. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaaux.h +540 -0
  49. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaconfig-msvc.h +56 -0
  50. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaconfig-msvc.h.in +55 -0
  51. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaconfig.h +68 -0
  52. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaconfig.h.in +67 -0
  53. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiaexif.h +669 -0
  54. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiageo.h +77 -0
  55. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gaiamatrix.h +277 -0
  56. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/geojson.h +586 -0
  57. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/geopackage.h +198 -0
  58. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_advanced.h +5184 -0
  59. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_const.h +606 -0
  60. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_core.h +2294 -0
  61. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_dxf.h +993 -0
  62. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_dynamic.h +416 -0
  63. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_formats.h +2056 -0
  64. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_mbr.h +606 -0
  65. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_sequence.h +173 -0
  66. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_structs.h +880 -0
  67. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_wfs.h +581 -0
  68. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/gg_xml.h +818 -0
  69. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/spatialite_ext.h +64 -0
  70. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/sqlite.h +70 -0
  71. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite/stored_procedures.h +641 -0
  72. package/dist/prebuilt/wasm-wasm32-st-release/include/spatialite.h +2098 -0
  73. package/dist/prebuilt/wasm-wasm32-st-release/lib/libspatialite.a +0 -0
  74. package/dist/prebuilt/wasm-wasm32-st-release/lib/libspatialite.la +41 -0
  75. package/dist/prebuilt/wasm-wasm32-st-release/lib/mod_spatialite.a +0 -0
  76. package/dist/prebuilt/wasm-wasm32-st-release/lib/mod_spatialite.la +41 -0
  77. package/dist/prebuilt/wasm-wasm32-st-release/lib/pkgconfig/spatialite.pc +12 -0
  78. package/package.json +39 -0
@@ -0,0 +1,641 @@
1
+ /*
2
+ stored_procedues.h -- SQL Procedures and Stored Procedures functions
3
+
4
+ version 5.1.0, 2023 August 4
5
+
6
+ Author: Sandro Furieri a.furieri@lqt.it
7
+
8
+ ------------------------------------------------------------------------------
9
+
10
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
11
+
12
+ The contents of this file are subject to the Mozilla Public License Version
13
+ 1.1 (the "License"); you may not use this file except in compliance with
14
+ the License. You may obtain a copy of the License at
15
+ http://www.mozilla.org/MPL/
16
+
17
+ Software distributed under the License is distributed on an "AS IS" basis,
18
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
19
+ for the specific language governing rights and limitations under the
20
+ License.
21
+
22
+ The Original Code is the SpatiaLite library
23
+
24
+ The Initial Developer of the Original Code is Alessandro Furieri
25
+
26
+ Portions created by the Initial Developer are Copyright (C) 2017-2023
27
+ the Initial Developer. All Rights Reserved.
28
+
29
+ Contributor(s):
30
+
31
+ Alternatively, the contents of this file may be used under the terms of
32
+ either the GNU General Public License Version 2 or later (the "GPL"), or
33
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
34
+ in which case the provisions of the GPL or the LGPL are applicable instead
35
+ of those above. If you wish to allow use of your version of this file only
36
+ under the terms of either the GPL or the LGPL, and not to allow others to
37
+ use your version of this file under the terms of the MPL, indicate your
38
+ decision by deleting the provisions above and replace them with the notice
39
+ and other provisions required by the GPL or the LGPL. If you do not delete
40
+ the provisions above, a recipient may use your version of this file under
41
+ the terms of any one of the MPL, the GPL or the LGPL.
42
+
43
+ */
44
+
45
+ /**
46
+ \file stored_procedures.h
47
+
48
+ SQL Procedures and Stored Procedures functions
49
+ */
50
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
51
+ #ifdef DLL_EXPORT
52
+ #define SQLPROC_DECLARE __declspec(dllexport)
53
+ #else
54
+ #define SQLPROC_DECLARE extern
55
+ #endif
56
+ #endif
57
+
58
+ #ifndef _SQLPROC_H
59
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
60
+ #define _SQLPROC_H
61
+ #endif
62
+
63
+ #ifdef __cplusplus
64
+ extern "C"
65
+ {
66
+ #endif
67
+
68
+ /* constants */
69
+ /** SQL Procedure BLOB start marker */
70
+ #define SQLPROC_START 0xcd
71
+ /** SQL Procedure BLOB delimiter marker */
72
+ #define SQLPROC_DELIM 0x87
73
+ /** SQL Procedure BLOB stop marker */
74
+ #define SQLPROC_STOP 0xdc
75
+
76
+ /* data structures */
77
+ /**
78
+ SqlProc: Variable with value
79
+ */
80
+ typedef struct gaiaSqlProc_VariableStruct
81
+ {
82
+ /** Variable Name */
83
+ char *Name;
84
+ /** Variable Value */
85
+ char *Value;
86
+ /** Pointer to next Variable (linked list) */
87
+ struct gaiaSqlProc_VariableStruct *Next;
88
+ } SqlProc_Variable;
89
+ /**
90
+ Typedef for SqlProc Variable structure
91
+
92
+ \sa SqlProc_VarList
93
+ */
94
+ typedef SqlProc_Variable *SqlProc_VariablePtr;
95
+
96
+ /**
97
+ SqlProc: List of Variables with values
98
+ */
99
+ typedef struct gaiaSqlProc_VarListStruct
100
+ {
101
+ /** invalid object */
102
+ int Error;
103
+ /** Error Message (if any) */
104
+ char *ErrMessage;
105
+ /** pointer to first Variable [linked list] */
106
+ SqlProc_VariablePtr First; /* Variables linked list - first */
107
+ /** pointer to last Variable [linked list] */
108
+ SqlProc_VariablePtr Last; /* Variables linked list - last */
109
+ } SqlProc_VarList;
110
+ /**
111
+ Typedef for SqlProc Variables List structure
112
+
113
+ \sa SqlProc_Variable
114
+ */
115
+ typedef SqlProc_VarList *SqlProc_VarListPtr;
116
+
117
+
118
+ /* function prototypes */
119
+
120
+ /**
121
+ Return the most recent SQL Procedure error (if any)
122
+
123
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
124
+
125
+ \return the most recent SQL Procedure error message (if any);
126
+ NULL in any other case.
127
+ */
128
+ SQLPROC_DECLARE char *gaia_sql_proc_get_last_error (const void *p_cache);
129
+
130
+ /**
131
+ Will enable/disable a Logfile supporting Execute methods
132
+
133
+ \param p_cache a memory pointer returned by spatialite_alloc_connection()
134
+ \param filepath the pathname of the Logfile. NULL to disable logging.
135
+ \param append if TRUE the Logfile will be opened in append mode,
136
+ otherwise will be trucated.
137
+
138
+ \return 0 on failure, any other value on success.
139
+
140
+ \sa gaia_sql_proc_execute
141
+ */
142
+ SQLPROC_DECLARE int gaia_sql_proc_logfile (const void *p_cache,
143
+ const char *filepath,
144
+ int append);
145
+
146
+ /**
147
+ Creates an empty list of Variables with Values
148
+
149
+ \return pointer to the Variables List
150
+
151
+ \sa gaia_sql_proc_destroy_variables, gaia_sql_proc_add_variable,
152
+ gaia_sql_proc_cooked_sql, gaia_sql_proc_execute
153
+
154
+ \note you are responsible to destroy (before or after) the Variables List
155
+ Object returned by this function by calling gaia_sql_proc_destroy_variables().
156
+ */
157
+ SQLPROC_DECLARE SqlProc_VarListPtr gaia_sql_proc_create_variables ();
158
+
159
+ /**
160
+ Destroys a list of Variables with Values
161
+
162
+ \param list pointer to the Variables List Object to be destroyed.
163
+
164
+ \sa gaia_sql_proc_create_variables
165
+ */
166
+ SQLPROC_DECLARE void
167
+ gaia_sql_proc_destroy_variables (SqlProc_VarListPtr list);
168
+
169
+ /**
170
+ Add a Variable with Value to the List
171
+
172
+ \param list pointer to the Variables List Object.
173
+ \param str text string expected to contain a Variable with Value
174
+ in the canonical form '@varname@=value'.
175
+
176
+ \return 0 on failure, any other value on success.
177
+
178
+ \sa gaia_sql_proc_create_variables, gaia_sql_proc_destroy_variables
179
+ */
180
+ SQLPROC_DECLARE int
181
+ gaia_sql_proc_add_variable (SqlProc_VarListPtr list, const char *str);
182
+
183
+ /**
184
+ Builds a SQL Procedure BLOB object from Text
185
+
186
+ \param cache the same memory pointer passed to the corresponding call to
187
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
188
+ \param sql body of the SQL-script
189
+ \param charset the GNU ICONV name identifying the sql body charset
190
+ \param blob on succesfull completion this pointer will reference the
191
+ BLOB SQL Procedure Object (NULL on failure).
192
+ \param blob_sz on succesfull completion this pointer will reference
193
+ the size (in bytes) of the BLOB SQL Procedure Object.
194
+
195
+ \return 0 on failure, any other value on success.
196
+
197
+ \sa gaia_sql_proc_import, gaia_sql_proc_get_last_error,
198
+ gaia_sql_proc_is_valid, gaia_sql_proc_count,
199
+ gaia_sql_proc_variable, gaia_sql_proc_all_variables,
200
+ gaia_sql_proc_raw_sql, gaia_sql_proc_cooked_sql
201
+
202
+ \note you are responsible to free (before or after) the BLOB
203
+ SQL Procedure Object returned by this function.
204
+ */
205
+ SQLPROC_DECLARE int gaia_sql_proc_parse (const void *cache,
206
+ const char *sql,
207
+ const char *charset,
208
+ unsigned char **blob,
209
+ int *blob_sz);
210
+
211
+ /**
212
+ Builds a SQL Procedure BLOB object from an external file
213
+
214
+ \param cache the same memory pointer passed to the corresponding call to
215
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
216
+ \param filepath path to the SQL-script to be loaded.
217
+ \param charset the GNU ICONV name identifying the sql body charset
218
+ \param blob on succesfull completion this pointer will reference the
219
+ BLOB SQL Procedure Object (NULL on failure).
220
+ \param blob_sz on succesfull completion this pointer will reference
221
+ the size (in bytes) of the BLOB SQL Procedure Object.
222
+
223
+ \return 0 on failure, any other value on success.
224
+
225
+ \sa gaia_sql_proc_parse, gaia_sql_proc_get_last_error
226
+
227
+ \note you are responsible to free (before or after) the BLOB
228
+ SQL Procedure Object returned by this function.
229
+ */
230
+ SQLPROC_DECLARE int gaia_sql_proc_import (const void *cache,
231
+ const char *filepath,
232
+ const char *charset,
233
+ unsigned char **blob,
234
+ int *blob_sz);
235
+
236
+ /**
237
+ Checks if a BLOB is a valid SQL Procedure Object
238
+
239
+ \param blob pointer to the BLOB Object.
240
+ \param blob_sz size (in bytes) of the BLOB Object.
241
+
242
+ \return 0 on failure: any other different value on success.
243
+
244
+ \sa gaia_sql_proc_parse
245
+ */
246
+ SQLPROC_DECLARE int gaia_sql_proc_is_valid (const unsigned char
247
+ *blob, int blob_sz);
248
+
249
+ /**
250
+ Checks if a TEXT is a valid SQL Variable with Value
251
+
252
+ \param str the text string to be evaluated.
253
+
254
+ \return 0 on failure: any other different value on success.
255
+ */
256
+ SQLPROC_DECLARE int gaia_sql_proc_is_valid_var_value (const char *str);
257
+
258
+ /**
259
+ Return the total count of Variables from a SQL Procedure Object
260
+
261
+ \param blob pointer to the BLOB Object.
262
+ \param blob_sz size (in bytes) of the BLOB Object.
263
+
264
+ \return the total count of Variables or -1 on invalid Object
265
+
266
+ \sa gaia_sql_proc_parse, gaia_sql_proc_variable
267
+ */
268
+ SQLPROC_DECLARE int gaia_sql_proc_var_count (const unsigned char
269
+ *blob, int blob_sz);
270
+
271
+ /**
272
+ Return the Name of the Nth Variable from a SQL Procedure Object
273
+
274
+ \param blob pointer to the BLOB Object.
275
+ \param blob_sz size (in bytes) of the BLOB Object.
276
+ \param index the first Variable has Index=0.
277
+
278
+ \return the name of the Nth Variable or NULL on invalid Object or
279
+ invalid Index.
280
+
281
+ \sa gaia_sql_proc_parse, gaia_sql_proc_var_count,
282
+ gaia_sql_proc_all_variables, gaia_sql_proc_raw_sql
283
+
284
+ \note you are responsible to free (before or after) the Variable Name
285
+ returned by this function.
286
+ */
287
+ SQLPROC_DECLARE char *gaia_sql_proc_variable (const unsigned
288
+ char *blob,
289
+ int blob_sz, int index);
290
+
291
+ /**
292
+ Return the Names of all Variables from a SQL Procedure Object
293
+
294
+ \param blob pointer to the BLOB Object.
295
+ \param blob_sz size (in bytes) of the BLOB Object.
296
+
297
+ \return a list of Variable Names separated by spaces or NULL on
298
+ invalid arguments.
299
+
300
+ \sa gaia_sql_proc_parse, gaia_sql_proc_var_count
301
+
302
+ \note you are responsible to free (before or after) the Variable Names
303
+ returned by this function.
304
+ */
305
+ SQLPROC_DECLARE char *gaia_sql_proc_all_variables (const
306
+ unsigned char
307
+ *blob, int blob_sz);
308
+
309
+ /**
310
+ Return the raw SQL body from a SQL Procedure Object
311
+
312
+ \param blob pointer to the BLOB Object.
313
+ \param blob_sz size (in bytes) of the BLOB Object.
314
+
315
+ \return the raw SQL body or NULL on invalid arguments.
316
+
317
+ \sa gaia_sql_proc_parse, gaia_sql_proc_var_count
318
+
319
+ \note you are responsible to free (before or after) the raw SQL body
320
+ returned by this function.
321
+ */
322
+ SQLPROC_DECLARE char *gaia_sql_proc_raw_sql (const unsigned char
323
+ *blob, int blob_sz);
324
+
325
+ /**
326
+ Return a cooked SQL body from a raw SQL body by replacing Variable Values
327
+
328
+ \param handle pointer to the current DB connection.
329
+ \param cache the same memory pointer passed to the corresponding call to
330
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
331
+ \param blob pointer to the BLOB Object.
332
+ \param blob_sz size (in bytes) of the BLOB Object.
333
+ \param variables list of Variables with Values.
334
+ \param sql on succesfull completions will point to the "cooked" SQL body;
335
+ NULL on failure.
336
+
337
+ \return 0 on failure: any other different value on success.
338
+
339
+ \sa gaia_sql_proc_parse, gaia_sql_proc_var_count,
340
+ gaia_sql_proc_create_variables
341
+
342
+ \note you are responsible to free (before or after) the cooked SQL body
343
+ returned by this function.
344
+ */
345
+ SQLPROC_DECLARE int gaia_sql_proc_cooked_sql (sqlite3 * handle,
346
+ const void *cache,
347
+ const unsigned char *blob,
348
+ int blob_sz,
349
+ SqlProc_VarListPtr variables,
350
+ char **sql);
351
+
352
+ /**
353
+ Will attempt to create the Stored Procedures Tables if not already existing
354
+
355
+ \param handle pointer to the current DB connection.
356
+ \param cache the same memory pointer passed to the corresponding call to
357
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
358
+
359
+ \return 0 on failure: any other different value on success.
360
+
361
+ \sa gaia_stored_proc_store, gaia_stored_proc_fetch,
362
+ gaia_stored_proc_delete, gaia_stored_proc_update_title,
363
+ gaia_stored_proc_update_sql, gaia_stored_var_store,
364
+ gaia_stored_var_fetch, gaia_stored_var_delete,
365
+ gaia_stored_var_update_title, gaia_stored_var_update_value
366
+ */
367
+ SQLPROC_DECLARE int gaia_stored_proc_create_tables (sqlite3 *
368
+ handle,
369
+ const void *cache);
370
+
371
+ /**
372
+ Permanently inserts a Stored Procedure into the DB
373
+
374
+ \param handle pointer to the current DB connection.
375
+ \param cache the same memory pointer passed to the corresponding call to
376
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
377
+ \param name unique identifier of the Stored Procedure.
378
+ \param title short description of the Stored Procedure.
379
+ \param blob pointer to the BLOB Object.
380
+ \param blob_sz size (in bytes) of the BLOB Object.
381
+
382
+ \return 0 on failure: any other different value on success.
383
+
384
+ \sa gaia_stored_proc_create_tables, gaia_stored_proc_fetch,
385
+ gaia_stored_proc_delete, gaia_stored_proc_update_title,
386
+ gaia_stored_proc_update_sql, gaia_stored_var_store,
387
+ gaia_stored_var_fetch, gaia_stored_var_delete,
388
+ gaia_stored_var_update_title, gaia_stored_var_update_value
389
+ */
390
+ SQLPROC_DECLARE int gaia_stored_proc_store (sqlite3 * handle,
391
+ const void *cache,
392
+ const char *name,
393
+ const char *title,
394
+ const unsigned char
395
+ *blob, int blob_sz);
396
+
397
+ /**
398
+ Retrieves a permanent Stored Procedure from the DB
399
+
400
+ \param handle pointer to the current DB connection.
401
+ \param cache the same memory pointer passed to the corresponding call to
402
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
403
+ \param name unique identifier of the Stored Procedure.
404
+ \param blob on succesfull completion this pointer will reference the
405
+ BLOB SQL Procedure Object (NULL on failure).
406
+ \param blob_sz on succesfull completion this pointer will reference
407
+ the size (in bytes) of the BLOB SQL Procedure Object.
408
+
409
+ \return 0 on failure: any other different value on success.
410
+
411
+ \sa gaia_stored_proc_create_tables, gaia_stored_proc_store,
412
+ gaia_stored_proc_delete, gaia_stored_proc_update_title,
413
+ gaia_stored_proc_update_sql, gaia_stored_var_store,
414
+ gaia_stored_var_fetch, gaia_stored_var_delete,
415
+ gaia_stored_var_update_title, gaia_stored_var_update_value
416
+
417
+ \note you are responsible to free (before or after) the BLOB
418
+ SQL Procedure Object returned by this function.
419
+ */
420
+ SQLPROC_DECLARE int gaia_stored_proc_fetch (sqlite3 * handle,
421
+ const void *cache,
422
+ const char *name,
423
+ unsigned char **blob,
424
+ int *blob_sz);
425
+
426
+ /**
427
+ Removes a permanent Stored Procedure from the DB
428
+
429
+ \param handle pointer to the current DB connection.
430
+ \param cache the same memory pointer passed to the corresponding call to
431
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
432
+ \param name unique identifier of the Stored Procedure.
433
+
434
+ \return 0 on failure: any other different value on success.
435
+
436
+ \sa gaia_stored_proc_create_tables, gaia_stored_proc_store,
437
+ gaia_stored_proc_fetche, gaia_stored_proc_update_title,
438
+ gaia_stored_proc_update_sql, gaia_stored_var_store,
439
+ gaia_stored_var_fetch, gaia_stored_var_delete,
440
+ gaia_stored_var_update_title, gaia_stored_var_update_value
441
+ */
442
+ SQLPROC_DECLARE int gaia_stored_proc_delete (sqlite3 * handle,
443
+ const void *cache,
444
+ const char *name);
445
+
446
+ /**
447
+ Updates the Title on a permanent Stored Procedure
448
+
449
+ \param handle pointer to the current DB connection.
450
+ \param cache the same memory pointer passed to the corresponding call to
451
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
452
+ \param name unique identifier of the Stored Procedure.
453
+ \param title short description of the Stored Procedure.
454
+
455
+ \return 0 on failure: any other different value on success.
456
+
457
+ \sa gaia_stored_proc_create_tables, gaia_stored_proc_store,
458
+ gaia_stored_proc_fetch, gaia_stored_proc_delete,
459
+ gaia_stored_proc_update_sql, gaia_stored_var_store,
460
+ gaia_stored_var_fetch, gaia_stored_var_delete,
461
+ gaia_stored_var_update_title, gaia_stored_var_update_value
462
+ */
463
+ SQLPROC_DECLARE int gaia_stored_proc_update_title (sqlite3 *
464
+ handle,
465
+ const void
466
+ *cache,
467
+ const char
468
+ *name,
469
+ const char *title);
470
+
471
+ /**
472
+ Updates the Raw SQL Body on a permanent Stored Procedure
473
+
474
+ \param handle pointer to the current DB connection.
475
+ \param cache the same memory pointer passed to the corresponding call to
476
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
477
+ \param name unique identifier of the Stored Procedure.
478
+ \param blob pointer to the BLOB Object.
479
+ \param blob_sz size (in bytes) of the BLOB Object.
480
+
481
+ \return 0 on failure: any other different value on success.
482
+
483
+ \sa gaia_stored_proc_create_tables, gaia_stored_proc_store,
484
+ gaia_stored_proc_fetch, gaia_stored_proc_delete,
485
+ gaia_stored_proc_update_title, gaia_stored_var_store,
486
+ gaia_stored_var_fetch, gaia_stored_var_delete,
487
+ gaia_stored_var_update_title, gaia_stored_var_update_value
488
+ */
489
+ SQLPROC_DECLARE int gaia_stored_proc_update_sql (sqlite3 *
490
+ handle,
491
+ const void
492
+ *cache,
493
+ const char
494
+ *name,
495
+ const
496
+ unsigned char
497
+ *blob, int blob_sz);
498
+
499
+ /**
500
+ Permanently inserts a Stored Variable into the DB
501
+
502
+ \param handle pointer to the current DB connection.
503
+ \param cache the same memory pointer passed to the corresponding call to
504
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
505
+ \param name unique identifier of the Stored Variable.
506
+ \param title short description of the Stored Variable.
507
+ \param value the Variable Value in its textual representation.
508
+
509
+ \return 0 on failure: any other different value on success.
510
+
511
+ \sa gaia_stored_proc_create_tables, gaia_stored_proc_store,
512
+ gaia_stored_proc_fetch, gaia_stored_proc_delete,
513
+ gaia_stored_proc_update_title, gaia_stored_proc_update_sql,
514
+ gaia_stored_var_fetch, gaia_stored_var_delete,
515
+ gaia_stored_var_update_title, gaia_stored_var_update_value
516
+ */
517
+ SQLPROC_DECLARE int gaia_stored_var_store (sqlite3 * handle,
518
+ const void *cache,
519
+ const char *name,
520
+ const char *title,
521
+ const char *value);
522
+
523
+ /**
524
+ Retrieves a Stored Variable from the DB
525
+
526
+ \param handle pointer to the current DB connection.
527
+ \param cache the same memory pointer passed to the corresponding call to
528
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
529
+ \param name unique identifier of the Stored Variable.
530
+ \param var_with_val if set to TRUE value will point to a Variable with
531
+ Name string, otherwise (FALSE) it will point to a bare textual value.
532
+ \param value on succesfull completion this pointer will reference
533
+ the Stored Variable represented as a Variable with Value or as a bare
534
+ textual value depending on var_with_val setting.
535
+
536
+ \return 0 on failure: any other different value on success.
537
+
538
+ \sa gaia_stored_proc_create_tables, gaia_stored_proc_store,
539
+ gaia_stored_proc_fetch, gaia_stored_proc_delete,
540
+ gaia_stored_proc_update_title, gaia_stored_proc_update_sql,
541
+ gaia_stored_var_store, gaia_stored_var_delete,
542
+ gaia_stored_var_update_title, gaia_stored_var_update_value
543
+
544
+ \note you are responsible to free (before or after) the Text
545
+ String returned by this function.
546
+ */
547
+ SQLPROC_DECLARE int gaia_stored_var_fetch (sqlite3 * handle,
548
+ const void *cache,
549
+ const char *name,
550
+ int var_with_val, char **value);
551
+
552
+ /**
553
+ Removes a Stored Variable from the DB
554
+
555
+ \param handle pointer to the current DB connection.
556
+ \param cache the same memory pointer passed to the corresponding call to
557
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
558
+ \param name unique identifier of the Stored Variable.
559
+
560
+ \return 0 on failure: any other different value on success.
561
+
562
+ \sa gaia_stored_proc_create_tables, gaia_stored_proc_store,
563
+ gaia_stored_proc_fetch, gaia_stored_proc_delete,
564
+ gaia_stored_proc_update_title, gaia_stored_proc_update_sql,
565
+ gaia_stored_var_store, gaia_stored_var_fetch,
566
+ gaia_stored_var_update_title, gaia_stored_var_update_value
567
+ */
568
+ SQLPROC_DECLARE int gaia_stored_var_delete (sqlite3 * handle,
569
+ const void *cache,
570
+ const char *name);
571
+
572
+ /**
573
+ Updates the Title on a Stored Variable
574
+
575
+ \param handle pointer to the current DB connection.
576
+ \param cache the same memory pointer passed to the corresponding call to
577
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
578
+ \param name unique identifier of the Stored Variable.
579
+ \param title short description of the Stored Variable.
580
+
581
+ \return 0 on failure: any other different value on success.
582
+
583
+ \sa gaia_stored_proc_create_tables, gaia_stored_proc_store,
584
+ gaia_stored_proc_fetch, gaia_stored_proc_delete,
585
+ gaia_stored_proc_update_title, gaia_stored_proc_update_sql,
586
+ gaia_stored_var_store, gaia_stored_var_store, gaia_stored_var_fetch,
587
+ gaia_stored_var_delete, gaia_stored_var_update_value
588
+ */
589
+ SQLPROC_DECLARE int gaia_stored_var_update_title (sqlite3 *
590
+ handle,
591
+ const void
592
+ *cache,
593
+ const char
594
+ *name, const char *title);
595
+
596
+ /**
597
+ Updates the Value on a Stored Variable
598
+
599
+ \param handle pointer to the current DB connection.
600
+ \param cache the same memory pointer passed to the corresponding call to
601
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
602
+ \param name unique identifier of the Stored Variable.
603
+ \param value the Variable Value in its textual representation.
604
+
605
+ \return 0 on failure: any other different value on success.
606
+
607
+ \sa gaia_stored_proc_create_tables, gaia_stored_proc_store,
608
+ gaia_stored_proc_fetch, gaia_stored_proc_delete,
609
+ gaia_stored_proc_update_title, gaia_stored_proc_update_sql,
610
+ gaia_stored_var_store, gaia_stored_var_store, gaia_stored_var_fetch,
611
+ gaia_stored_var_delete, gaia_stored_var_update_title
612
+ */
613
+ SQLPROC_DECLARE int gaia_stored_var_update_value (sqlite3 *
614
+ handle,
615
+ const void
616
+ *cache,
617
+ const char
618
+ *name, const char *value);
619
+
620
+ /**
621
+ Executing a cooked SQL Procedure
622
+
623
+ \param handle pointer to the current DB connection.
624
+ \param cache the same memory pointer passed to the corresponding call to
625
+ spatialite_init_ex() and returned by spatialite_alloc_connection()
626
+ \param sql the cooked SQL Body to be executed.
627
+
628
+ \return 0 on failure: any other different value on success.
629
+
630
+ \sa gaia_sql_proc_logfile
631
+ */
632
+ SQLPROC_DECLARE int gaia_sql_proc_execute (sqlite3 *
633
+ handle,
634
+ const void *cache,
635
+ const char *sql);
636
+
637
+ #ifdef __cplusplus
638
+ }
639
+ #endif
640
+
641
+ #endif /* _SQLPROC_H */