sqlite3-ruby 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sqlite3-ruby might be problematic. Click here for more details.

@@ -1,8 +1,13 @@
1
1
  require 'mkmf'
2
2
 
3
+ SWIG_WRAP = "sqlite3_api_wrap.c"
4
+
3
5
  dir_config( "sqlite3", "/usr/local" )
4
6
 
5
- if have_header( "sqlite3.h" ) and have_library( "sqlite3", "sqlite3_open" )
6
- system "swig -ruby sqlite3_api.i"
7
+ if have_header( "sqlite3.h" ) && have_library( "sqlite3", "sqlite3_open" )
8
+ if !File.exists?( SWIG_WRAP ) || with_config( "swig", false )
9
+ puts "creating #{SWIG_WRAP}"
10
+ system "swig -ruby sqlite3_api.i" or raise "could not build wrapper via swig (perhaps swig is not installed?)"
11
+ end
7
12
  create_makefile( "sqlite3_api" )
8
13
  end
@@ -25,6 +25,16 @@ int Sqlite3_ruby_busy_handler(void* data,int value) {
25
25
  return FIX2INT(result);
26
26
  }
27
27
 
28
+ static void mark_CallbackData(void* ptr) {
29
+ CallbackData* cb = (CallbackData*)ptr;
30
+ if (cb->proc != Qnil)
31
+ rb_gc_mark(cb->proc);
32
+ if (cb->proc2 != Qnil)
33
+ rb_gc_mark(cb->proc2);
34
+ if (cb->data != Qnil)
35
+ rb_gc_mark(cb->data);
36
+ }
37
+
28
38
  int Sqlite3_ruby_authorizer(void* data,int type,
29
39
  const char* a,const char* b,const char* c,const char* d)
30
40
  {
@@ -90,6 +100,8 @@ void Sqlite3_ruby_function_final(sqlite3_context *ctx) {
90
100
  }
91
101
  %}
92
102
 
103
+ %markfunc CallbackData "mark_CallbackData";
104
+
93
105
  struct CallbackData {
94
106
  VALUE proc;
95
107
  VALUE proc2;
@@ -0,0 +1,3095 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 1.3.27
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
+ * coding conventions designed to improve portability and efficiency. Do not make
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
+ * ----------------------------------------------------------------------------- */
10
+
11
+ /***********************************************************************
12
+ *
13
+ * This section contains generic SWIG labels for method/variable
14
+ * declarations/attributes, and other compiler dependent labels.
15
+ *
16
+ ************************************************************************/
17
+
18
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
19
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
20
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21
+ # define SWIGTEMPLATEDISAMBIGUATOR template
22
+ # else
23
+ # define SWIGTEMPLATEDISAMBIGUATOR
24
+ # endif
25
+ #endif
26
+
27
+ /* inline attribute */
28
+ #ifndef SWIGINLINE
29
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
30
+ # define SWIGINLINE inline
31
+ # else
32
+ # define SWIGINLINE
33
+ # endif
34
+ #endif
35
+
36
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
37
+ #ifndef SWIGUNUSED
38
+ # if defined(__GNUC__) || defined(__ICC)
39
+ # define SWIGUNUSED __attribute__ ((unused))
40
+ # else
41
+ # define SWIGUNUSED
42
+ # endif
43
+ #endif
44
+
45
+ /* internal SWIG method */
46
+ #ifndef SWIGINTERN
47
+ # define SWIGINTERN static SWIGUNUSED
48
+ #endif
49
+
50
+ /* internal inline SWIG method */
51
+ #ifndef SWIGINTERNINLINE
52
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
53
+ #endif
54
+
55
+ /* exporting methods for Windows DLLs */
56
+ #ifndef SWIGEXPORT
57
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
58
+ # if defined(STATIC_LINKED)
59
+ # define SWIGEXPORT
60
+ # else
61
+ # define SWIGEXPORT __declspec(dllexport)
62
+ # endif
63
+ # else
64
+ # define SWIGEXPORT
65
+ # endif
66
+ #endif
67
+
68
+ /* calling conventions for Windows */
69
+ #ifndef SWIGSTDCALL
70
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
71
+ # define SWIGSTDCALL __stdcall
72
+ # else
73
+ # define SWIGSTDCALL
74
+ # endif
75
+ #endif
76
+
77
+
78
+ /* ruby.swg */
79
+ /* Implementation : RUBY */
80
+ #define SWIGRUBY 1
81
+
82
+ #include "ruby.h"
83
+
84
+ /* Flags for pointer conversion */
85
+ #define SWIG_POINTER_EXCEPTION 0x1
86
+ #define SWIG_POINTER_OWN 0x1
87
+ #define SWIG_POINTER_DISOWN 0x2
88
+ #define SWIG_TRACK_OBJECTS 0x4
89
+
90
+ #define NUM2USHRT(n) (\
91
+ (0 <= NUM2UINT(n) && NUM2UINT(n) <= USHRT_MAX)\
92
+ ? (unsigned short) NUM2UINT(n) \
93
+ : (rb_raise(rb_eArgError, "integer %d out of range of `unsigned short'",\
94
+ NUM2UINT(n)), (short)0)\
95
+ )
96
+
97
+ #define NUM2SHRT(n) (\
98
+ (SHRT_MIN <= NUM2INT(n) && NUM2INT(n) <= SHRT_MAX)\
99
+ ? (short)NUM2INT(n)\
100
+ : (rb_raise(rb_eArgError, "integer %d out of range of `short'",\
101
+ NUM2INT(n)), (short)0)\
102
+ )
103
+
104
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
105
+ #ifndef NUM2LL
106
+ #define NUM2LL(x) NUM2LONG((x))
107
+ #endif
108
+ #ifndef LL2NUM
109
+ #define LL2NUM(x) INT2NUM((long) (x))
110
+ #endif
111
+ #ifndef ULL2NUM
112
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
113
+ #endif
114
+
115
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
116
+ #ifndef NUM2ULL
117
+ #ifdef HAVE_LONG_LONG
118
+ #define NUM2ULL(x) rb_num2ull((x))
119
+ #else
120
+ #define NUM2ULL(x) NUM2ULONG(x)
121
+ #endif
122
+ #endif
123
+
124
+ /*
125
+ * Need to be very careful about how these macros are defined, especially
126
+ * when compiling C++ code or C code with an ANSI C compiler.
127
+ *
128
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
129
+ * a Ruby method so that it can be passed as an argument to API functions
130
+ * like rb_define_method() and rb_define_singleton_method().
131
+ *
132
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
133
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
134
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
135
+ * and Data_Make_Struct().
136
+ */
137
+
138
+ #ifdef __cplusplus
139
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
140
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
141
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
142
+ # define VOIDFUNC(f) ((void (*)()) f)
143
+ # else
144
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
145
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
146
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
147
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
148
+ # else /* These definitions should work for Ruby 1.7+ */
149
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
150
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
151
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
152
+ # endif
153
+ # endif
154
+ #else
155
+ # define VALUEFUNC(f) (f)
156
+ # define VOIDFUNC(f) (f)
157
+ #endif
158
+
159
+ typedef struct {
160
+ VALUE klass;
161
+ VALUE mImpl;
162
+ void (*mark)(void *);
163
+ void (*destroy)(void *);
164
+ } swig_class;
165
+
166
+ /* Don't use for expressions have side effect */
167
+ #ifndef RB_STRING_VALUE
168
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
169
+ #endif
170
+ #ifndef StringValue
171
+ #define StringValue(s) RB_STRING_VALUE(s)
172
+ #endif
173
+ #ifndef StringValuePtr
174
+ #define StringValuePtr(s) RSTRING(RB_STRING_VALUE(s))->ptr
175
+ #endif
176
+ #ifndef StringValueLen
177
+ #define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
178
+ #endif
179
+ #ifndef SafeStringValue
180
+ #define SafeStringValue(v) do {\
181
+ StringValue(v);\
182
+ rb_check_safe_str(v);\
183
+ } while (0)
184
+ #endif
185
+
186
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
187
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
188
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
189
+ #endif
190
+
191
+ /* Contract support */
192
+
193
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { rb_raise(rb_eRuntimeError, (char *) msg ); } else
194
+
195
+
196
+ /***********************************************************************
197
+ * swigrun.swg
198
+ *
199
+ * This file contains generic CAPI SWIG runtime support for pointer
200
+ * type checking.
201
+ *
202
+ ************************************************************************/
203
+
204
+ /* This should only be incremented when either the layout of swig_type_info changes,
205
+ or for whatever reason, the runtime changes incompatibly */
206
+ #define SWIG_RUNTIME_VERSION "2"
207
+
208
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
209
+ #ifdef SWIG_TYPE_TABLE
210
+ # define SWIG_QUOTE_STRING(x) #x
211
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
212
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
213
+ #else
214
+ # define SWIG_TYPE_TABLE_NAME
215
+ #endif
216
+
217
+ /*
218
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
219
+ creating a static or dynamic library from the swig runtime code.
220
+ In 99.9% of the cases, swig just needs to declare them as 'static'.
221
+
222
+ But only do this if is strictly necessary, ie, if you have problems
223
+ with your compiler or so.
224
+ */
225
+
226
+ #ifndef SWIGRUNTIME
227
+ # define SWIGRUNTIME SWIGINTERN
228
+ #endif
229
+
230
+ #ifndef SWIGRUNTIMEINLINE
231
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
232
+ #endif
233
+
234
+ #include <string.h>
235
+
236
+ #ifdef __cplusplus
237
+ extern "C" {
238
+ #endif
239
+
240
+ typedef void *(*swig_converter_func)(void *);
241
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
242
+
243
+ /* Structure to store inforomation on one type */
244
+ typedef struct swig_type_info {
245
+ const char *name; /* mangled name of this type */
246
+ const char *str; /* human readable name of this type */
247
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
248
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
249
+ void *clientdata; /* language specific type data */
250
+ } swig_type_info;
251
+
252
+ /* Structure to store a type and conversion function used for casting */
253
+ typedef struct swig_cast_info {
254
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
255
+ swig_converter_func converter; /* function to cast the void pointers */
256
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
257
+ struct swig_cast_info *prev; /* pointer to the previous cast */
258
+ } swig_cast_info;
259
+
260
+ /* Structure used to store module information
261
+ * Each module generates one structure like this, and the runtime collects
262
+ * all of these structures and stores them in a circularly linked list.*/
263
+ typedef struct swig_module_info {
264
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
265
+ size_t size; /* Number of types in this module */
266
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
267
+ swig_type_info **type_initial; /* Array of initially generated type structures */
268
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
269
+ void *clientdata; /* Language specific module data */
270
+ } swig_module_info;
271
+
272
+
273
+ /*
274
+ Compare two type names skipping the space characters, therefore
275
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
276
+
277
+ Return 0 when the two name types are equivalent, as in
278
+ strncmp, but skipping ' '.
279
+ */
280
+ SWIGRUNTIME int
281
+ SWIG_TypeNameComp(const char *f1, const char *l1,
282
+ const char *f2, const char *l2) {
283
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
284
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
285
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
286
+ if (*f1 != *f2) return (int)(*f1 - *f2);
287
+ }
288
+ return (l1 - f1) - (l2 - f2);
289
+ }
290
+
291
+ /*
292
+ Check type equivalence in a name list like <name1>|<name2>|...
293
+ Return 0 if not equal, 1 if equal
294
+ */
295
+ SWIGRUNTIME int
296
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
297
+ int equiv = 0;
298
+ const char* te = tb + strlen(tb);
299
+ const char* ne = nb;
300
+ while (!equiv && *ne) {
301
+ for (nb = ne; *ne; ++ne) {
302
+ if (*ne == '|') break;
303
+ }
304
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
305
+ if (*ne) ++ne;
306
+ }
307
+ return equiv;
308
+ }
309
+
310
+ /*
311
+ Check type equivalence in a name list like <name1>|<name2>|...
312
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
313
+ */
314
+ SWIGRUNTIME int
315
+ SWIG_TypeCompare(const char *nb, const char *tb) {
316
+ int equiv = 0;
317
+ const char* te = tb + strlen(tb);
318
+ const char* ne = nb;
319
+ while (!equiv && *ne) {
320
+ for (nb = ne; *ne; ++ne) {
321
+ if (*ne == '|') break;
322
+ }
323
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
324
+ if (*ne) ++ne;
325
+ }
326
+ return equiv;
327
+ }
328
+
329
+
330
+ /* think of this as a c++ template<> or a scheme macro */
331
+ #define SWIG_TypeCheck_Template(comparison, ty) \
332
+ if (ty) { \
333
+ swig_cast_info *iter = ty->cast; \
334
+ while (iter) { \
335
+ if (comparison) { \
336
+ if (iter == ty->cast) return iter; \
337
+ /* Move iter to the top of the linked list */ \
338
+ iter->prev->next = iter->next; \
339
+ if (iter->next) \
340
+ iter->next->prev = iter->prev; \
341
+ iter->next = ty->cast; \
342
+ iter->prev = 0; \
343
+ if (ty->cast) ty->cast->prev = iter; \
344
+ ty->cast = iter; \
345
+ return iter; \
346
+ } \
347
+ iter = iter->next; \
348
+ } \
349
+ } \
350
+ return 0
351
+
352
+ /*
353
+ Check the typename
354
+ */
355
+ SWIGRUNTIME swig_cast_info *
356
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
357
+ SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
358
+ }
359
+
360
+ /* Same as previous function, except strcmp is replaced with a pointer comparison */
361
+ SWIGRUNTIME swig_cast_info *
362
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
363
+ SWIG_TypeCheck_Template(iter->type == from, into);
364
+ }
365
+
366
+ /*
367
+ Cast a pointer up an inheritance hierarchy
368
+ */
369
+ SWIGRUNTIMEINLINE void *
370
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
371
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
372
+ }
373
+
374
+ /*
375
+ Dynamic pointer casting. Down an inheritance hierarchy
376
+ */
377
+ SWIGRUNTIME swig_type_info *
378
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
379
+ swig_type_info *lastty = ty;
380
+ if (!ty || !ty->dcast) return ty;
381
+ while (ty && (ty->dcast)) {
382
+ ty = (*ty->dcast)(ptr);
383
+ if (ty) lastty = ty;
384
+ }
385
+ return lastty;
386
+ }
387
+
388
+ /*
389
+ Return the name associated with this type
390
+ */
391
+ SWIGRUNTIMEINLINE const char *
392
+ SWIG_TypeName(const swig_type_info *ty) {
393
+ return ty->name;
394
+ }
395
+
396
+ /*
397
+ Return the pretty name associated with this type,
398
+ that is an unmangled type name in a form presentable to the user.
399
+ */
400
+ SWIGRUNTIME const char *
401
+ SWIG_TypePrettyName(const swig_type_info *type) {
402
+ /* The "str" field contains the equivalent pretty names of the
403
+ type, separated by vertical-bar characters. We choose
404
+ to print the last name, as it is often (?) the most
405
+ specific. */
406
+ if (type->str != NULL) {
407
+ const char *last_name = type->str;
408
+ const char *s;
409
+ for (s = type->str; *s; s++)
410
+ if (*s == '|') last_name = s+1;
411
+ return last_name;
412
+ }
413
+ else
414
+ return type->name;
415
+ }
416
+
417
+ /*
418
+ Set the clientdata field for a type
419
+ */
420
+ SWIGRUNTIME void
421
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
422
+ swig_cast_info *cast = ti->cast;
423
+ /* if (ti->clientdata == clientdata) return; */
424
+ ti->clientdata = clientdata;
425
+
426
+ while (cast) {
427
+ if (!cast->converter) {
428
+ swig_type_info *tc = cast->type;
429
+ if (!tc->clientdata) {
430
+ SWIG_TypeClientData(tc, clientdata);
431
+ }
432
+ }
433
+ cast = cast->next;
434
+ }
435
+ }
436
+
437
+ /*
438
+ Search for a swig_type_info structure only by mangled name
439
+ Search is a O(log #types)
440
+
441
+ We start searching at module start, and finish searching when start == end.
442
+ Note: if start == end at the beginning of the function, we go all the way around
443
+ the circular list.
444
+ */
445
+ SWIGRUNTIME swig_type_info *
446
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
447
+ swig_module_info *end,
448
+ const char *name) {
449
+ swig_module_info *iter = start;
450
+ do {
451
+ if (iter->size) {
452
+ register size_t l = 0;
453
+ register size_t r = iter->size - 1;
454
+ do {
455
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
456
+ register size_t i = (l + r) >> 1;
457
+ const char *iname = iter->types[i]->name;
458
+ if (iname) {
459
+ register int compare = strcmp(name, iname);
460
+ if (compare == 0) {
461
+ return iter->types[i];
462
+ } else if (compare < 0) {
463
+ if (i) {
464
+ r = i - 1;
465
+ } else {
466
+ break;
467
+ }
468
+ } else if (compare > 0) {
469
+ l = i + 1;
470
+ }
471
+ } else {
472
+ break; /* should never happen */
473
+ }
474
+ } while (l <= r);
475
+ }
476
+ iter = iter->next;
477
+ } while (iter != end);
478
+ return 0;
479
+ }
480
+
481
+ /*
482
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
483
+ It first searches the mangled names of the types, which is a O(log #types)
484
+ If a type is not found it then searches the human readable names, which is O(#types).
485
+
486
+ We start searching at module start, and finish searching when start == end.
487
+ Note: if start == end at the beginning of the function, we go all the way around
488
+ the circular list.
489
+ */
490
+ SWIGRUNTIME swig_type_info *
491
+ SWIG_TypeQueryModule(swig_module_info *start,
492
+ swig_module_info *end,
493
+ const char *name) {
494
+ /* STEP 1: Search the name field using binary search */
495
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
496
+ if (ret) {
497
+ return ret;
498
+ } else {
499
+ /* STEP 2: If the type hasn't been found, do a complete search
500
+ of the str field (the human readable name) */
501
+ swig_module_info *iter = start;
502
+ do {
503
+ register size_t i = 0;
504
+ for (; i < iter->size; ++i) {
505
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
506
+ return iter->types[i];
507
+ }
508
+ iter = iter->next;
509
+ } while (iter != end);
510
+ }
511
+
512
+ /* neither found a match */
513
+ return 0;
514
+ }
515
+
516
+
517
+ /*
518
+ Pack binary data into a string
519
+ */
520
+ SWIGRUNTIME char *
521
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
522
+ static const char hex[17] = "0123456789abcdef";
523
+ register const unsigned char *u = (unsigned char *) ptr;
524
+ register const unsigned char *eu = u + sz;
525
+ for (; u != eu; ++u) {
526
+ register unsigned char uu = *u;
527
+ *(c++) = hex[(uu & 0xf0) >> 4];
528
+ *(c++) = hex[uu & 0xf];
529
+ }
530
+ return c;
531
+ }
532
+
533
+ /*
534
+ Unpack binary data from a string
535
+ */
536
+ SWIGRUNTIME const char *
537
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
538
+ register unsigned char *u = (unsigned char *) ptr;
539
+ register const unsigned char *eu = u + sz;
540
+ for (; u != eu; ++u) {
541
+ register char d = *(c++);
542
+ register unsigned char uu = 0;
543
+ if ((d >= '0') && (d <= '9'))
544
+ uu = ((d - '0') << 4);
545
+ else if ((d >= 'a') && (d <= 'f'))
546
+ uu = ((d - ('a'-10)) << 4);
547
+ else
548
+ return (char *) 0;
549
+ d = *(c++);
550
+ if ((d >= '0') && (d <= '9'))
551
+ uu |= (d - '0');
552
+ else if ((d >= 'a') && (d <= 'f'))
553
+ uu |= (d - ('a'-10));
554
+ else
555
+ return (char *) 0;
556
+ *u = uu;
557
+ }
558
+ return c;
559
+ }
560
+
561
+ /*
562
+ Pack 'void *' into a string buffer.
563
+ */
564
+ SWIGRUNTIME char *
565
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
566
+ char *r = buff;
567
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
568
+ *(r++) = '_';
569
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
570
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
571
+ strcpy(r,name);
572
+ return buff;
573
+ }
574
+
575
+ SWIGRUNTIME const char *
576
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
577
+ if (*c != '_') {
578
+ if (strcmp(c,"NULL") == 0) {
579
+ *ptr = (void *) 0;
580
+ return name;
581
+ } else {
582
+ return 0;
583
+ }
584
+ }
585
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
586
+ }
587
+
588
+ SWIGRUNTIME char *
589
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
590
+ char *r = buff;
591
+ size_t lname = (name ? strlen(name) : 0);
592
+ if ((2*sz + 2 + lname) > bsz) return 0;
593
+ *(r++) = '_';
594
+ r = SWIG_PackData(r,ptr,sz);
595
+ if (lname) {
596
+ strncpy(r,name,lname+1);
597
+ } else {
598
+ *r = 0;
599
+ }
600
+ return buff;
601
+ }
602
+
603
+ SWIGRUNTIME const char *
604
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
605
+ if (*c != '_') {
606
+ if (strcmp(c,"NULL") == 0) {
607
+ memset(ptr,0,sz);
608
+ return name;
609
+ } else {
610
+ return 0;
611
+ }
612
+ }
613
+ return SWIG_UnpackData(++c,ptr,sz);
614
+ }
615
+
616
+ #ifdef __cplusplus
617
+ }
618
+ #endif
619
+
620
+ /***********************************************************************
621
+ * rubytracking.swg
622
+ *
623
+ * This file contains support for tracking mappings from
624
+ * Ruby objects to C++ objects. This functionality is needed
625
+ * to implement mark functions for Ruby's mark and sweep
626
+ * garbage collector.
627
+ ************************************************************************/
628
+
629
+ /* Global Ruby hash table to store Trackings from C/C++
630
+ structs to Ruby Objects. */
631
+ static VALUE swig_ruby_trackings;
632
+
633
+ /* Setup a Ruby hash table to store Trackings */
634
+ static void SWIG_RubyInitializeTrackings() {
635
+ /* Create a ruby hash table to store Trackings from C++
636
+ objects to Ruby objects. Also make sure to tell
637
+ the garabage collector about the hash table. */
638
+ swig_ruby_trackings = rb_hash_new();
639
+ rb_gc_register_address(&swig_ruby_trackings);
640
+ }
641
+
642
+ /* Get a Ruby number to reference a pointer */
643
+ static VALUE SWIG_RubyPtrToReference(void* ptr) {
644
+ /* We cast the pointer to an unsigned long
645
+ and then store a reference to it using
646
+ a Ruby number object. */
647
+
648
+ /* Convert the pointer to a Ruby number */
649
+ unsigned long value = (unsigned long) ptr;
650
+ return LONG2NUM(value);
651
+ }
652
+
653
+ /* Get a Ruby number to reference an object */
654
+ static VALUE SWIG_RubyObjectToReference(VALUE object) {
655
+ /* We cast the object to an unsigned long
656
+ and then store a reference to it using
657
+ a Ruby number object. */
658
+
659
+ /* Convert the Object to a Ruby number */
660
+ unsigned long value = (unsigned long) object;
661
+ return LONG2NUM(value);
662
+ }
663
+
664
+ /* Get a Ruby object from a previously stored reference */
665
+ static VALUE SWIG_RubyReferenceToObject(VALUE reference) {
666
+ /* The provided Ruby number object is a reference
667
+ to the Ruby object we want.*/
668
+
669
+ /* First convert the Ruby number to a C number */
670
+ unsigned long value = NUM2LONG(reference);
671
+ return (VALUE) value;
672
+ }
673
+
674
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
675
+ static void SWIG_RubyAddTracking(void* ptr, VALUE object) {
676
+ /* In a Ruby hash table we store the pointer and
677
+ the associated Ruby object. The trick here is
678
+ that we cannot store the Ruby object directly - if
679
+ we do then it cannot be garbage collected. So
680
+ instead we typecast it as a unsigned long and
681
+ convert it to a Ruby number object.*/
682
+
683
+ /* Get a reference to the pointer as a Ruby number */
684
+ VALUE key = SWIG_RubyPtrToReference(ptr);
685
+
686
+ /* Get a reference to the Ruby object as a Ruby number */
687
+ VALUE value = SWIG_RubyObjectToReference(object);
688
+
689
+ /* Store the mapping to the global hash table. */
690
+ rb_hash_aset(swig_ruby_trackings, key, value);
691
+ }
692
+
693
+ /* Get the Ruby object that owns the specified C/C++ struct */
694
+ static VALUE SWIG_RubyInstanceFor(void* ptr) {
695
+ /* Get a reference to the pointer as a Ruby number */
696
+ VALUE key = SWIG_RubyPtrToReference(ptr);
697
+
698
+ /* Now lookup the value stored in the global hash table */
699
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
700
+
701
+ if (value == Qnil) {
702
+ /* No object exists - return nil. */
703
+ return Qnil;
704
+ }
705
+ else {
706
+ /* Convert this value to Ruby object */
707
+ return SWIG_RubyReferenceToObject(value);
708
+ }
709
+ }
710
+
711
+ /* Remove a Tracking from a C/C++ struct to a Ruby object */
712
+ static void SWIG_RubyRemoveTracking(void* ptr) {
713
+ /* Get a reference to the pointer as a Ruby number */
714
+ VALUE key = SWIG_RubyPtrToReference(ptr);
715
+
716
+ /* Define delete method - in C++ this could be marked as
717
+ static but unfortunately not in C. */
718
+ VALUE delete_function = rb_intern("delete");
719
+
720
+ /* Delete the object from the hash table by calling Ruby's
721
+ do this we need to call the Hash.delete method.*/
722
+ rb_funcall(swig_ruby_trackings, delete_function, 1, key);
723
+ }
724
+
725
+ /* This is a helper method that unlinks a Ruby object from its
726
+ underlying C++ object. This is needed if the lifetime of the
727
+ Ruby object is longer than the C++ object */
728
+ static void SWIG_RubyUnlinkObjects(void* ptr) {
729
+ VALUE object = SWIG_RubyInstanceFor(ptr);
730
+
731
+ if (object != Qnil) {
732
+ DATA_PTR(object) = 0;
733
+ }
734
+ }
735
+
736
+ /* Common SWIG API */
737
+ #define SWIG_ConvertPtr(obj, pp, type, flags) \
738
+ SWIG_Ruby_ConvertPtr(obj, pp, type, flags)
739
+ #define SWIG_NewPointerObj(p, type, flags) \
740
+ SWIG_Ruby_NewPointerObj(p, type, flags)
741
+ #define SWIG_MustGetPtr(p, type, argnum, flags) \
742
+ SWIG_Ruby_MustGetPtr(p, type, argnum, flags)
743
+ #define SWIG_GetModule(clientdata) \
744
+ SWIG_Ruby_GetModule()
745
+ #define SWIG_SetModule(clientdata, pointer) \
746
+ SWIG_Ruby_SetModule(pointer)
747
+
748
+ /* Ruby-specific SWIG API */
749
+
750
+ #define SWIG_InitRuntime() \
751
+ SWIG_Ruby_InitRuntime()
752
+ #define SWIG_define_class(ty) \
753
+ SWIG_Ruby_define_class(ty)
754
+ #define SWIG_NewClassInstance(value, ty) \
755
+ SWIG_Ruby_NewClassInstance(value, ty)
756
+ #define SWIG_MangleStr(value) \
757
+ SWIG_Ruby_MangleStr(value)
758
+ #define SWIG_CheckConvert(value, ty) \
759
+ SWIG_Ruby_CheckConvert(value, ty)
760
+ #define SWIG_NewPackedObj(ptr, sz, ty) \
761
+ SWIG_Ruby_NewPackedObj(ptr, sz, ty)
762
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
763
+ SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
764
+
765
+ /* rubydef.swg */
766
+ #ifdef __cplusplus
767
+ extern "C" {
768
+ #endif
769
+
770
+ static VALUE _mSWIG = Qnil;
771
+ static VALUE _cSWIG_Pointer = Qnil;
772
+ static VALUE swig_runtime_data_type_pointer = Qnil;
773
+
774
+ /* Initialize Ruby runtime support */
775
+ static void
776
+ SWIG_Ruby_InitRuntime(void)
777
+ {
778
+ if (_mSWIG == Qnil) {
779
+ _mSWIG = rb_define_module("SWIG");
780
+ }
781
+ }
782
+
783
+ /* Define Ruby class for C type */
784
+ static void
785
+ SWIG_Ruby_define_class(swig_type_info *type)
786
+ {
787
+ VALUE klass;
788
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
789
+ sprintf(klass_name, "TYPE%s", type->name);
790
+ if (NIL_P(_cSWIG_Pointer)) {
791
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
792
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
793
+ }
794
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
795
+ free((void *) klass_name);
796
+ }
797
+
798
+ /* Create a new pointer object */
799
+ static VALUE
800
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
801
+ {
802
+ int own = flags & SWIG_POINTER_OWN;
803
+ int track = flags & SWIG_TRACK_OBJECTS;
804
+
805
+ char *klass_name;
806
+ swig_class *sklass;
807
+ VALUE klass;
808
+ VALUE obj;
809
+
810
+ if (!ptr)
811
+ return Qnil;
812
+
813
+ /* Have we already wrapped this pointer? */
814
+ if (track) {
815
+ obj = SWIG_RubyInstanceFor(ptr);
816
+ if (obj != Qnil) {
817
+ return obj;
818
+ }
819
+ }
820
+
821
+ if (type->clientdata) {
822
+ sklass = (swig_class *) type->clientdata;
823
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
824
+ } else {
825
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
826
+ sprintf(klass_name, "TYPE%s", type->name);
827
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
828
+ free((void *) klass_name);
829
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
830
+ }
831
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
832
+
833
+ /* Keep track of this object if necessary */
834
+ if (track) {
835
+ SWIG_RubyAddTracking(ptr, obj);
836
+ }
837
+
838
+ return obj;
839
+ }
840
+
841
+ /* Create a new class instance (always owned) */
842
+ static VALUE
843
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
844
+ {
845
+ VALUE obj;
846
+ swig_class *sklass = (swig_class *) type->clientdata;
847
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
848
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
849
+ return obj;
850
+ }
851
+
852
+ /* Get type mangle from class name */
853
+ static SWIGINLINE char *
854
+ SWIG_Ruby_MangleStr(VALUE obj)
855
+ {
856
+ VALUE stype = rb_iv_get(obj, "__swigtype__");
857
+ return StringValuePtr(stype);
858
+ }
859
+
860
+ /* Convert a pointer value */
861
+ static int
862
+ SWIG_Ruby_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
863
+ {
864
+ char *c;
865
+ swig_cast_info *tc;
866
+
867
+ /* Grab the pointer */
868
+ if (NIL_P(obj)) {
869
+ *ptr = 0;
870
+ return 0;
871
+ } else {
872
+ Data_Get_Struct(obj, void, *ptr);
873
+ }
874
+
875
+ /* Check to see if the input object is giving up ownership
876
+ of the underlying C struct or C++ object. If so then we
877
+ need to reset the destructor since the Ruby object no
878
+ longer owns the underlying C++ object.*/
879
+ if (flags & SWIG_POINTER_DISOWN) {
880
+ if (flags & SWIG_TRACK_OBJECTS) {
881
+ /* We are tracking objects. Thus we change the destructor
882
+ * to SWIG_RubyRemoveTracking. This allows us to
883
+ * remove the mapping from the C++ to Ruby object
884
+ * when the Ruby object is garbage collected. If we don't
885
+ * do this, then it is possible we will return a reference
886
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
887
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
888
+ } else {
889
+ RDATA(obj)->dfree = 0;
890
+ }
891
+ }
892
+
893
+ /* Do type-checking if type info was provided */
894
+ if (ty) {
895
+ if (ty->clientdata) {
896
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
897
+ if (*ptr == 0)
898
+ rb_raise(rb_eRuntimeError, "This %s already released", ty->str);
899
+ return 0;
900
+ }
901
+ }
902
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
903
+ if (flags & SWIG_POINTER_EXCEPTION)
904
+ rb_raise(rb_eTypeError, "Expected %s", ty->str);
905
+ else
906
+ return -1;
907
+ }
908
+ tc = SWIG_TypeCheck(c, ty);
909
+ if (!tc) {
910
+ if (flags & SWIG_POINTER_EXCEPTION)
911
+ rb_raise(rb_eTypeError, "Expected %s", ty->str);
912
+ else
913
+ return -1;
914
+ }
915
+ *ptr = SWIG_TypeCast(tc, *ptr);
916
+ }
917
+ return 0;
918
+ }
919
+
920
+ /* Convert a pointer value, signal an exception on a type mismatch */
921
+ static SWIGINLINE void *
922
+ SWIG_Ruby_MustGetPtr(VALUE obj, swig_type_info *ty, int argnum, int flags)
923
+ {
924
+ void *result;
925
+ SWIG_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION);
926
+ return result;
927
+ }
928
+
929
+ /* Check convert */
930
+ static SWIGINLINE int
931
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
932
+ {
933
+ char *c = SWIG_MangleStr(obj);
934
+ if (!c)
935
+ return 0;
936
+ return SWIG_TypeCheck(c,ty) != 0;
937
+ }
938
+
939
+ static VALUE
940
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
941
+ char result[1024];
942
+ char *r = result;
943
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
944
+ *(r++) = '_';
945
+ r = SWIG_PackData(r, ptr, sz);
946
+ strcpy(r, type->name);
947
+ return rb_str_new2(result);
948
+ }
949
+
950
+ /* Convert a packed value value */
951
+ static void
952
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags) {
953
+ swig_cast_info *tc;
954
+ const char *c;
955
+
956
+ if (TYPE(obj) != T_STRING) goto type_error;
957
+ c = StringValuePtr(obj);
958
+ /* Pointer values must start with leading underscore */
959
+ if (*c != '_') goto type_error;
960
+ c++;
961
+ c = SWIG_UnpackData(c, ptr, sz);
962
+ if (ty) {
963
+ tc = SWIG_TypeCheck(c, ty);
964
+ if (!tc) goto type_error;
965
+ }
966
+ return;
967
+
968
+ type_error:
969
+
970
+ if (flags) {
971
+ if (ty) {
972
+ rb_raise(rb_eTypeError, "Type error. Expected %s", ty->name);
973
+ } else {
974
+ rb_raise(rb_eTypeError, "Expected a pointer");
975
+ }
976
+ }
977
+ }
978
+
979
+ static swig_module_info *SWIG_Ruby_GetModule() {
980
+ VALUE pointer;
981
+ swig_module_info *ret = 0;
982
+
983
+ /* first check if pointer already created */
984
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
985
+ if (pointer != Qnil) {
986
+ Data_Get_Struct(pointer, swig_module_info, ret);
987
+ }
988
+ return ret;
989
+ }
990
+
991
+ static void SWIG_Ruby_SetModule(swig_module_info *pointer) {
992
+ /* register a new class */
993
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
994
+ /* create and store the structure pointer to a global variable */
995
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
996
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
997
+ }
998
+
999
+ #ifdef __cplusplus
1000
+ }
1001
+ #endif
1002
+
1003
+
1004
+
1005
+ /* -------- TYPES TABLE (BEGIN) -------- */
1006
+
1007
+ #define SWIGTYPE_p_CallbackData swig_types[0]
1008
+ #define SWIGTYPE_p_f_p_sqlite3_context__void swig_types[1]
1009
+ #define SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void swig_types[2]
1010
+ #define SWIGTYPE_p_f_p_void__void swig_types[3]
1011
+ #define SWIGTYPE_p_f_p_void_int__int swig_types[4]
1012
+ #define SWIGTYPE_p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int swig_types[5]
1013
+ #define SWIGTYPE_p_f_p_void_p_q_const__char__void swig_types[6]
1014
+ #define SWIGTYPE_p_p_char swig_types[7]
1015
+ #define SWIGTYPE_p_p_sqlite3 swig_types[8]
1016
+ #define SWIGTYPE_p_p_sqlite3_stmt swig_types[9]
1017
+ #define SWIGTYPE_p_p_void swig_types[10]
1018
+ #define SWIGTYPE_p_sqlite3 swig_types[11]
1019
+ #define SWIGTYPE_p_sqlite3_context swig_types[12]
1020
+ #define SWIGTYPE_p_sqlite3_stmt swig_types[13]
1021
+ #define SWIGTYPE_p_sqlite3_value swig_types[14]
1022
+ #define SWIGTYPE_p_sqlite_int64 swig_types[15]
1023
+ #define SWIGTYPE_p_unsigned_long swig_types[16]
1024
+ #define SWIGTYPE_p_void swig_types[17]
1025
+ static swig_type_info *swig_types[19];
1026
+ static swig_module_info swig_module = {swig_types, 18, 0, 0, 0, 0};
1027
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1028
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1029
+
1030
+ /* -------- TYPES TABLE (END) -------- */
1031
+
1032
+ #define SWIG_init Init_API
1033
+ #define SWIG_name "SQLite3::Driver::Native::API"
1034
+
1035
+ static VALUE mAPI;
1036
+
1037
+ static void SWIG_AsVal(VALUE obj, int *val)
1038
+ {
1039
+ *val = (int) NUM2INT(obj);
1040
+ }
1041
+
1042
+
1043
+ #ifdef __cplusplus
1044
+ extern "C" {
1045
+ #endif
1046
+ #ifdef HAVE_SYS_TIME_H
1047
+ # include <sys/time.h>
1048
+ struct timeval rb_time_timeval(VALUE);
1049
+ #endif
1050
+ #ifdef __cplusplus
1051
+ }
1052
+ #endif
1053
+
1054
+
1055
+ #ifdef __cplusplus
1056
+ extern "C" {
1057
+ #endif
1058
+ #include "rubyio.h"
1059
+ #ifdef __cplusplus
1060
+ }
1061
+ #endif
1062
+
1063
+
1064
+ #include <sqlite3.h>
1065
+ #include "ruby.h"
1066
+ #include "intern.h"
1067
+
1068
+ #define Init_API Init_sqlite3_api
1069
+
1070
+ struct CallbackData {
1071
+ VALUE proc;
1072
+ VALUE proc2;
1073
+ VALUE data;
1074
+ };
1075
+
1076
+ typedef struct CallbackData CallbackData;
1077
+ typedef void BLOB;
1078
+ typedef void VALBLOB;
1079
+
1080
+ int Sqlite3_ruby_busy_handler(void* data,int value) {
1081
+ VALUE result;
1082
+ CallbackData *cb = (CallbackData*)data;
1083
+ result = rb_funcall(
1084
+ cb->proc, rb_intern("call"), 2, cb->data, INT2FIX(value) );
1085
+ return FIX2INT(result);
1086
+ }
1087
+
1088
+ static void mark_CallbackData(void* ptr) {
1089
+ CallbackData* cb = (CallbackData*)ptr;
1090
+ if (cb->proc != Qnil)
1091
+ rb_gc_mark(cb->proc);
1092
+ if (cb->proc2 != Qnil)
1093
+ rb_gc_mark(cb->proc2);
1094
+ if (cb->data != Qnil)
1095
+ rb_gc_mark(cb->data);
1096
+ }
1097
+
1098
+ int Sqlite3_ruby_authorizer(void* data,int type,
1099
+ const char* a,const char* b,const char* c,const char* d)
1100
+ {
1101
+ VALUE result;
1102
+ CallbackData *cb = (CallbackData*)data;
1103
+ result = rb_funcall(
1104
+ cb->proc, rb_intern("call"), 6, cb->data, INT2FIX(type),
1105
+ ( a ? rb_str_new2(a) : Qnil ), ( b ? rb_str_new2(b) : Qnil ),
1106
+ ( c ? rb_str_new2(c) : Qnil ), ( d ? rb_str_new2(d) : Qnil ) );
1107
+ return FIX2INT(result);
1108
+ }
1109
+
1110
+ void Sqlite3_ruby_trace(void* data, const char *sql) {
1111
+ CallbackData *cb = (CallbackData*)data;
1112
+ rb_funcall( cb->proc, rb_intern("call"), 2, cb->data,
1113
+ sql ? rb_str_new2(sql) : Qnil );
1114
+ }
1115
+
1116
+ void Sqlite3_ruby_function_step(sqlite3_context* ctx,int n,
1117
+ sqlite3_value** args)
1118
+ {
1119
+ CallbackData *data;
1120
+ VALUE rb_args;
1121
+ VALUE *rb_context;
1122
+ int idx;
1123
+
1124
+ data = (CallbackData*)sqlite3_user_data(ctx);
1125
+
1126
+ if( data->proc2 != Qnil ) {
1127
+ rb_context = (VALUE*)sqlite3_aggregate_context(ctx,sizeof(VALUE));
1128
+ if( *rb_context == 0 ) {
1129
+ *rb_context = rb_hash_new();
1130
+ rb_gc_register_address( rb_context );
1131
+ }
1132
+ }
1133
+
1134
+ rb_args = rb_ary_new2(n+1);
1135
+ rb_ary_push( rb_args, SWIG_NewPointerObj(ctx,SWIGTYPE_p_sqlite3_context,0) );
1136
+ for( idx = 0; idx < n; idx++ ) {
1137
+ rb_ary_push( rb_args, SWIG_NewPointerObj(args[idx],
1138
+ SWIGTYPE_p_sqlite3_value,0) );
1139
+ }
1140
+
1141
+ rb_apply( data->proc, rb_intern("call"), rb_args );
1142
+ }
1143
+
1144
+ void Sqlite3_ruby_function_final(sqlite3_context *ctx) {
1145
+ VALUE *rb_context;
1146
+ CallbackData *data;
1147
+
1148
+ rb_context = (VALUE*)sqlite3_aggregate_context(ctx,sizeof(VALUE));
1149
+ if( *rb_context == 0 ) {
1150
+ *rb_context = rb_hash_new();
1151
+ rb_gc_register_address( rb_context );
1152
+ }
1153
+
1154
+ data = (CallbackData*)sqlite3_user_data(ctx);
1155
+
1156
+ rb_funcall( data->proc2, rb_intern("call"), 1,
1157
+ SWIG_NewPointerObj(ctx,SWIGTYPE_p_sqlite3_context,0) );
1158
+
1159
+ rb_gc_unregister_address( rb_context );
1160
+ }
1161
+
1162
+ swig_class cCallbackData;
1163
+
1164
+ static VALUE
1165
+ _wrap_CallbackData_proc_set(int argc, VALUE *argv, VALUE self) {
1166
+ struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1167
+ VALUE arg2 ;
1168
+
1169
+ if ((argc < 1) || (argc > 1))
1170
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1171
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1172
+ arg2 = argv[0];
1173
+ if (arg1) (arg1)->proc = arg2;
1174
+
1175
+ return Qnil;
1176
+ }
1177
+
1178
+
1179
+ static VALUE
1180
+ _wrap_CallbackData_proc_get(int argc, VALUE *argv, VALUE self) {
1181
+ struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1182
+ VALUE result;
1183
+ VALUE vresult = Qnil;
1184
+
1185
+ if ((argc < 0) || (argc > 0))
1186
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1187
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1188
+ result = (VALUE) ((arg1)->proc);
1189
+
1190
+ vresult = result;
1191
+ return vresult;
1192
+ }
1193
+
1194
+
1195
+ static VALUE
1196
+ _wrap_CallbackData_proc2_set(int argc, VALUE *argv, VALUE self) {
1197
+ struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1198
+ VALUE arg2 ;
1199
+
1200
+ if ((argc < 1) || (argc > 1))
1201
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1202
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1203
+ arg2 = argv[0];
1204
+ if (arg1) (arg1)->proc2 = arg2;
1205
+
1206
+ return Qnil;
1207
+ }
1208
+
1209
+
1210
+ static VALUE
1211
+ _wrap_CallbackData_proc2_get(int argc, VALUE *argv, VALUE self) {
1212
+ struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1213
+ VALUE result;
1214
+ VALUE vresult = Qnil;
1215
+
1216
+ if ((argc < 0) || (argc > 0))
1217
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1218
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1219
+ result = (VALUE) ((arg1)->proc2);
1220
+
1221
+ vresult = result;
1222
+ return vresult;
1223
+ }
1224
+
1225
+
1226
+ static VALUE
1227
+ _wrap_CallbackData_data_set(int argc, VALUE *argv, VALUE self) {
1228
+ struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1229
+ VALUE arg2 ;
1230
+
1231
+ if ((argc < 1) || (argc > 1))
1232
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1233
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1234
+ arg2 = argv[0];
1235
+ if (arg1) (arg1)->data = arg2;
1236
+
1237
+ return Qnil;
1238
+ }
1239
+
1240
+
1241
+ static VALUE
1242
+ _wrap_CallbackData_data_get(int argc, VALUE *argv, VALUE self) {
1243
+ struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1244
+ VALUE result;
1245
+ VALUE vresult = Qnil;
1246
+
1247
+ if ((argc < 0) || (argc > 0))
1248
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1249
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1250
+ result = (VALUE) ((arg1)->data);
1251
+
1252
+ vresult = result;
1253
+ return vresult;
1254
+ }
1255
+
1256
+
1257
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
1258
+ static VALUE
1259
+ _wrap_CallbackData_allocate(VALUE self) {
1260
+ #else
1261
+ static VALUE
1262
+ _wrap_CallbackData_allocate(int argc, VALUE *argv, VALUE self) {
1263
+ #endif
1264
+
1265
+
1266
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_CallbackData);
1267
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1268
+ rb_obj_call_init(vresult, argc, argv);
1269
+ #endif
1270
+ return vresult;
1271
+ }
1272
+
1273
+
1274
+ static VALUE
1275
+ _wrap_new_CallbackData(int argc, VALUE *argv, VALUE self) {
1276
+ struct CallbackData *result;
1277
+
1278
+ if ((argc < 0) || (argc > 0))
1279
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1280
+ result = (struct CallbackData *)(struct CallbackData *) calloc(1, sizeof(struct CallbackData));
1281
+ DATA_PTR(self) = result;
1282
+
1283
+ return self;
1284
+ }
1285
+
1286
+
1287
+ static void
1288
+ free_CallbackData(struct CallbackData *arg1) {
1289
+ free((char *) arg1);
1290
+ }
1291
+
1292
+ static VALUE
1293
+ _wrap_sqlite3_libversion(int argc, VALUE *argv, VALUE self) {
1294
+ char *result;
1295
+ VALUE vresult = Qnil;
1296
+
1297
+ if ((argc < 0) || (argc > 0))
1298
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1299
+ result = (char *)sqlite3_libversion();
1300
+
1301
+ {
1302
+ vresult = result ? rb_str_new2(result) : Qnil;
1303
+ }
1304
+ return vresult;
1305
+ }
1306
+
1307
+
1308
+ static VALUE
1309
+ _wrap_sqlite3_close(int argc, VALUE *argv, VALUE self) {
1310
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1311
+ int result;
1312
+ VALUE vresult = Qnil;
1313
+
1314
+ if ((argc < 1) || (argc > 1))
1315
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1316
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1317
+ result = (int)sqlite3_close(arg1);
1318
+
1319
+ vresult = INT2NUM(result);
1320
+ return vresult;
1321
+ }
1322
+
1323
+
1324
+ static VALUE
1325
+ _wrap_sqlite3_last_insert_rowid(int argc, VALUE *argv, VALUE self) {
1326
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1327
+ sqlite_int64 result;
1328
+ VALUE vresult = Qnil;
1329
+
1330
+ if ((argc < 1) || (argc > 1))
1331
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1332
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1333
+ result = sqlite3_last_insert_rowid(arg1);
1334
+
1335
+ {
1336
+ vresult = rb_ll2inum( result );
1337
+ }
1338
+ return vresult;
1339
+ }
1340
+
1341
+
1342
+ static VALUE
1343
+ _wrap_sqlite3_changes(int argc, VALUE *argv, VALUE self) {
1344
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1345
+ int result;
1346
+ VALUE vresult = Qnil;
1347
+
1348
+ if ((argc < 1) || (argc > 1))
1349
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1350
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1351
+ result = (int)sqlite3_changes(arg1);
1352
+
1353
+ vresult = INT2NUM(result);
1354
+ return vresult;
1355
+ }
1356
+
1357
+
1358
+ static VALUE
1359
+ _wrap_sqlite3_total_changes(int argc, VALUE *argv, VALUE self) {
1360
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1361
+ int result;
1362
+ VALUE vresult = Qnil;
1363
+
1364
+ if ((argc < 1) || (argc > 1))
1365
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1366
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1367
+ result = (int)sqlite3_total_changes(arg1);
1368
+
1369
+ vresult = INT2NUM(result);
1370
+ return vresult;
1371
+ }
1372
+
1373
+
1374
+ static VALUE
1375
+ _wrap_sqlite3_interrupt(int argc, VALUE *argv, VALUE self) {
1376
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1377
+
1378
+ if ((argc < 1) || (argc > 1))
1379
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1380
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1381
+ sqlite3_interrupt(arg1);
1382
+
1383
+ return Qnil;
1384
+ }
1385
+
1386
+
1387
+ static VALUE
1388
+ _wrap_sqlite3_complete(int argc, VALUE *argv, VALUE self) {
1389
+ char *arg1 = (char *) 0 ;
1390
+ int result;
1391
+ VALUE vresult = Qnil;
1392
+
1393
+ if ((argc < 1) || (argc > 1))
1394
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1395
+ arg1 = StringValuePtr(argv[0]);
1396
+ result = (int)sqlite3_complete((char const *)arg1);
1397
+
1398
+ vresult = INT2NUM(result);
1399
+ return vresult;
1400
+ }
1401
+
1402
+
1403
+ static VALUE
1404
+ _wrap_sqlite3_complete16(int argc, VALUE *argv, VALUE self) {
1405
+ void *arg1 = (void *) 0 ;
1406
+ int result;
1407
+ VALUE vresult = Qnil;
1408
+
1409
+ if ((argc < 1) || (argc > 1))
1410
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1411
+ {
1412
+ arg1 = (void*)RSTRING(argv[0])->ptr;
1413
+ }
1414
+ result = (int)sqlite3_complete16((void const *)arg1);
1415
+
1416
+ vresult = INT2NUM(result);
1417
+ return vresult;
1418
+ }
1419
+
1420
+
1421
+ static VALUE
1422
+ _wrap_sqlite3_busy_handler(int argc, VALUE *argv, VALUE self) {
1423
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1424
+ int (*arg2)(void *,int) = (int (*)(void *,int)) 0 ;
1425
+ void *arg3 = (void *) 0 ;
1426
+ int result;
1427
+ VALUE vresult = Qnil;
1428
+
1429
+ if ((argc < 3) || (argc > 3))
1430
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1431
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1432
+ SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_f_p_void_int__int, 0);
1433
+ SWIG_ConvertPtr(argv[2], (void **) &arg3, 0, SWIG_POINTER_EXCEPTION|0);
1434
+ result = (int)sqlite3_busy_handler(arg1,arg2,arg3);
1435
+
1436
+ vresult = INT2NUM(result);
1437
+ return vresult;
1438
+ }
1439
+
1440
+
1441
+ static VALUE
1442
+ _wrap_sqlite3_busy_timeout(int argc, VALUE *argv, VALUE self) {
1443
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1444
+ int arg2 ;
1445
+ int result;
1446
+ VALUE vresult = Qnil;
1447
+
1448
+ if ((argc < 2) || (argc > 2))
1449
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1450
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1451
+ arg2 = NUM2INT(argv[1]);
1452
+ result = (int)sqlite3_busy_timeout(arg1,arg2);
1453
+
1454
+ vresult = INT2NUM(result);
1455
+ return vresult;
1456
+ }
1457
+
1458
+
1459
+ static VALUE
1460
+ _wrap_sqlite3_set_authorizer(int argc, VALUE *argv, VALUE self) {
1461
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1462
+ int (*arg2)(void *,int,char const *,char const *,char const *,char const *) = (int (*)(void *,int,char const *,char const *,char const *,char const *)) 0 ;
1463
+ void *arg3 = (void *) 0 ;
1464
+ int result;
1465
+ VALUE vresult = Qnil;
1466
+
1467
+ if ((argc < 3) || (argc > 3))
1468
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1469
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1470
+ SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int, 0);
1471
+ SWIG_ConvertPtr(argv[2], (void **) &arg3, 0, SWIG_POINTER_EXCEPTION|0);
1472
+ result = (int)sqlite3_set_authorizer(arg1,arg2,arg3);
1473
+
1474
+ vresult = INT2NUM(result);
1475
+ return vresult;
1476
+ }
1477
+
1478
+
1479
+ static VALUE
1480
+ _wrap_sqlite3_trace(int argc, VALUE *argv, VALUE self) {
1481
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1482
+ void (*arg2)(void *,char const *) = (void (*)(void *,char const *)) 0 ;
1483
+ void *arg3 = (void *) 0 ;
1484
+ int result;
1485
+ VALUE vresult = Qnil;
1486
+
1487
+ if ((argc < 3) || (argc > 3))
1488
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1489
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1490
+ SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_f_p_void_p_q_const__char__void, 0);
1491
+ SWIG_ConvertPtr(argv[2], (void **) &arg3, 0, SWIG_POINTER_EXCEPTION|0);
1492
+ result = (int)sqlite3_trace(arg1,arg2,arg3);
1493
+
1494
+ vresult = INT2NUM(result);
1495
+ return vresult;
1496
+ }
1497
+
1498
+
1499
+ static VALUE
1500
+ _wrap_sqlite3_open(int argc, VALUE *argv, VALUE self) {
1501
+ char *arg1 = (char *) 0 ;
1502
+ sqlite3 **arg2 = (sqlite3 **) 0 ;
1503
+ int result;
1504
+ VALUE vresult = Qnil;
1505
+
1506
+ if ((argc < 1) || (argc > 1))
1507
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1508
+ {
1509
+ arg1 = STR2CSTR(argv[0]);
1510
+ arg2 = (sqlite3**)malloc( sizeof( sqlite3* ) );
1511
+ }
1512
+ result = (int)sqlite3_open((char const *)arg1,arg2);
1513
+
1514
+ vresult = INT2NUM(result);
1515
+ {
1516
+ VALUE ary;
1517
+ ary = rb_ary_new2(2);
1518
+ rb_ary_push( ary, vresult );
1519
+ rb_ary_push( ary, SWIG_NewPointerObj( *arg2, SWIGTYPE_p_sqlite3, 0 ) );
1520
+ free( arg2 );
1521
+ vresult = ary;
1522
+ }
1523
+ return vresult;
1524
+ }
1525
+
1526
+
1527
+ static VALUE
1528
+ _wrap_sqlite3_open16(int argc, VALUE *argv, VALUE self) {
1529
+ void *arg1 = (void *) 0 ;
1530
+ sqlite3 **arg2 = (sqlite3 **) 0 ;
1531
+ int result;
1532
+ VALUE vresult = Qnil;
1533
+
1534
+ if ((argc < 1) || (argc > 1))
1535
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1536
+ {
1537
+ arg1 = (void*)RSTRING(argv[0])->ptr;
1538
+ arg2 = (sqlite3**)malloc( sizeof( sqlite3* ) );
1539
+ }
1540
+ result = (int)sqlite3_open16((void const *)arg1,arg2);
1541
+
1542
+ vresult = INT2NUM(result);
1543
+ {
1544
+ VALUE ary;
1545
+ ary = rb_ary_new2(2);
1546
+ rb_ary_push( ary, vresult );
1547
+ rb_ary_push( ary, SWIG_NewPointerObj( *arg2, SWIGTYPE_p_sqlite3, 0 ) );
1548
+ free( arg2 );
1549
+ vresult = ary;
1550
+ }
1551
+ return vresult;
1552
+ }
1553
+
1554
+
1555
+ static VALUE
1556
+ _wrap_sqlite3_errcode(int argc, VALUE *argv, VALUE self) {
1557
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1558
+ int result;
1559
+ VALUE vresult = Qnil;
1560
+
1561
+ if ((argc < 1) || (argc > 1))
1562
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1563
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1564
+ result = (int)sqlite3_errcode(arg1);
1565
+
1566
+ vresult = INT2NUM(result);
1567
+ return vresult;
1568
+ }
1569
+
1570
+
1571
+ static VALUE
1572
+ _wrap_sqlite3_errmsg(int argc, VALUE *argv, VALUE self) {
1573
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1574
+ char *result;
1575
+ VALUE vresult = Qnil;
1576
+
1577
+ if ((argc < 1) || (argc > 1))
1578
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1579
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1580
+ result = (char *)sqlite3_errmsg(arg1);
1581
+
1582
+ {
1583
+ vresult = result ? rb_str_new2(result) : Qnil;
1584
+ }
1585
+ return vresult;
1586
+ }
1587
+
1588
+
1589
+ static VALUE
1590
+ _wrap_sqlite3_errmsg16(int argc, VALUE *argv, VALUE self) {
1591
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1592
+ void *result;
1593
+ VALUE vresult = Qnil;
1594
+
1595
+ if ((argc < 1) || (argc > 1))
1596
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1597
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1598
+ result = (void *)sqlite3_errmsg16(arg1);
1599
+
1600
+ {
1601
+ int i;
1602
+ if( result ) {
1603
+ for( i = 0; ((char*)result)[i]; i += 2 );
1604
+ vresult = rb_str_new( (char*)result, i );
1605
+ } else vresult = Qnil;
1606
+ }
1607
+ return vresult;
1608
+ }
1609
+
1610
+
1611
+ static VALUE
1612
+ _wrap_sqlite3_prepare(int argc, VALUE *argv, VALUE self) {
1613
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1614
+ char *arg2 = (char *) 0 ;
1615
+ int arg3 ;
1616
+ sqlite3_stmt **arg4 = (sqlite3_stmt **) 0 ;
1617
+ char **arg5 = (char **) 0 ;
1618
+ int result;
1619
+ sqlite3_stmt *stmt2 ;
1620
+ char *errmsg2 ;
1621
+ VALUE vresult = Qnil;
1622
+
1623
+ if ((argc < 2) || (argc > 2))
1624
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1625
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1626
+ {
1627
+ arg2 = RSTRING(argv[1])->ptr;
1628
+ arg3 = RSTRING(argv[1])->len;
1629
+ arg4 = &stmt2;
1630
+ arg5 = &errmsg2;
1631
+ }
1632
+ result = (int)sqlite3_prepare(arg1,(char const *)arg2,arg3,arg4,(char const **)arg5);
1633
+
1634
+ vresult = INT2NUM(result);
1635
+ {
1636
+ VALUE ary;
1637
+ ary = rb_ary_new2(3);
1638
+ rb_ary_push( ary, vresult );
1639
+ rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
1640
+ rb_ary_push( ary, errmsg2 ? rb_str_new2( errmsg2 ) : Qnil );
1641
+ vresult = ary;
1642
+ }
1643
+ return vresult;
1644
+ }
1645
+
1646
+
1647
+ static VALUE
1648
+ _wrap_sqlite3_prepare16(int argc, VALUE *argv, VALUE self) {
1649
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
1650
+ void *arg2 = (void *) 0 ;
1651
+ int arg3 ;
1652
+ sqlite3_stmt **arg4 = (sqlite3_stmt **) 0 ;
1653
+ void **arg5 = (void **) 0 ;
1654
+ int result;
1655
+ sqlite3_stmt *stmt2 ;
1656
+ void *errmsg2 ;
1657
+ VALUE vresult = Qnil;
1658
+
1659
+ if ((argc < 2) || (argc > 2))
1660
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1661
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1662
+ {
1663
+ arg2 = RSTRING(argv[1])->ptr;
1664
+ arg3 = RSTRING(argv[1])->len;
1665
+ arg4 = &stmt2;
1666
+ arg5 = &errmsg2;
1667
+ }
1668
+ result = (int)sqlite3_prepare16(arg1,(void const *)arg2,arg3,arg4,(void const **)arg5);
1669
+
1670
+ vresult = INT2NUM(result);
1671
+ {
1672
+ VALUE ary;
1673
+ int i;
1674
+
1675
+ for( i = 0; ((char*)errmsg2)[i]; i += 2 );
1676
+
1677
+ ary = rb_ary_new2(3);
1678
+ rb_ary_push( ary, vresult );
1679
+ rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
1680
+ rb_ary_push( ary, errmsg2 ? rb_str_new( (char*)errmsg2, i ) : Qnil );
1681
+ vresult = ary;
1682
+ }
1683
+ return vresult;
1684
+ }
1685
+
1686
+
1687
+ static VALUE
1688
+ _wrap_sqlite3_bind_blob(int argc, VALUE *argv, VALUE self) {
1689
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1690
+ int arg2 ;
1691
+ void *arg3 = (void *) 0 ;
1692
+ int arg4 ;
1693
+ void (*arg5)(void *) = (void (*)(void *)) 0 ;
1694
+ int result;
1695
+ VALUE vresult = Qnil;
1696
+
1697
+ if ((argc < 3) || (argc > 3))
1698
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1699
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1700
+ arg2 = NUM2INT(argv[1]);
1701
+ {
1702
+ arg3 = (void*)RSTRING(argv[2])->ptr;
1703
+ arg4 = RSTRING(argv[2])->len;
1704
+ arg5 = SQLITE_TRANSIENT;
1705
+ }
1706
+ result = (int)sqlite3_bind_blob(arg1,arg2,(void const *)arg3,arg4,arg5);
1707
+
1708
+ vresult = INT2NUM(result);
1709
+ return vresult;
1710
+ }
1711
+
1712
+
1713
+ static VALUE
1714
+ _wrap_sqlite3_bind_double(int argc, VALUE *argv, VALUE self) {
1715
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1716
+ int arg2 ;
1717
+ double arg3 ;
1718
+ int result;
1719
+ VALUE vresult = Qnil;
1720
+
1721
+ if ((argc < 3) || (argc > 3))
1722
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1723
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1724
+ arg2 = NUM2INT(argv[1]);
1725
+ arg3 = (double) NUM2DBL(argv[2]);
1726
+ result = (int)sqlite3_bind_double(arg1,arg2,arg3);
1727
+
1728
+ vresult = INT2NUM(result);
1729
+ return vresult;
1730
+ }
1731
+
1732
+
1733
+ static VALUE
1734
+ _wrap_sqlite3_bind_int(int argc, VALUE *argv, VALUE self) {
1735
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1736
+ int arg2 ;
1737
+ int arg3 ;
1738
+ int result;
1739
+ VALUE vresult = Qnil;
1740
+
1741
+ if ((argc < 3) || (argc > 3))
1742
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1743
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1744
+ arg2 = NUM2INT(argv[1]);
1745
+ arg3 = NUM2INT(argv[2]);
1746
+ result = (int)sqlite3_bind_int(arg1,arg2,arg3);
1747
+
1748
+ vresult = INT2NUM(result);
1749
+ return vresult;
1750
+ }
1751
+
1752
+
1753
+ static VALUE
1754
+ _wrap_sqlite3_bind_int64(int argc, VALUE *argv, VALUE self) {
1755
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1756
+ int arg2 ;
1757
+ sqlite_int64 arg3 ;
1758
+ int result;
1759
+ VALUE vresult = Qnil;
1760
+
1761
+ if ((argc < 3) || (argc > 3))
1762
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1763
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1764
+ arg2 = NUM2INT(argv[1]);
1765
+ {
1766
+ arg3 = rb_big2ll( argv[2] );
1767
+ }
1768
+ result = (int)sqlite3_bind_int64(arg1,arg2,arg3);
1769
+
1770
+ vresult = INT2NUM(result);
1771
+ return vresult;
1772
+ }
1773
+
1774
+
1775
+ static VALUE
1776
+ _wrap_sqlite3_bind_null(int argc, VALUE *argv, VALUE self) {
1777
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1778
+ int arg2 ;
1779
+ int result;
1780
+ VALUE vresult = Qnil;
1781
+
1782
+ if ((argc < 2) || (argc > 2))
1783
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1784
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1785
+ arg2 = NUM2INT(argv[1]);
1786
+ result = (int)sqlite3_bind_null(arg1,arg2);
1787
+
1788
+ vresult = INT2NUM(result);
1789
+ return vresult;
1790
+ }
1791
+
1792
+
1793
+ static VALUE
1794
+ _wrap_sqlite3_bind_text(int argc, VALUE *argv, VALUE self) {
1795
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1796
+ int arg2 ;
1797
+ char *arg3 = (char *) 0 ;
1798
+ int arg4 ;
1799
+ void (*arg5)(void *) = (void (*)(void *)) 0 ;
1800
+ int result;
1801
+ VALUE vresult = Qnil;
1802
+
1803
+ if ((argc < 3) || (argc > 3))
1804
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1805
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1806
+ arg2 = NUM2INT(argv[1]);
1807
+ {
1808
+ arg3 = RSTRING(argv[2])->ptr;
1809
+ arg4 = RSTRING(argv[2])->len;
1810
+ arg5 = SQLITE_TRANSIENT;
1811
+ }
1812
+ result = (int)sqlite3_bind_text(arg1,arg2,(char const *)arg3,arg4,arg5);
1813
+
1814
+ vresult = INT2NUM(result);
1815
+ return vresult;
1816
+ }
1817
+
1818
+
1819
+ static VALUE
1820
+ _wrap_sqlite3_bind_text16(int argc, VALUE *argv, VALUE self) {
1821
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1822
+ int arg2 ;
1823
+ void *arg3 = (void *) 0 ;
1824
+ int arg4 ;
1825
+ void (*arg5)(void *) = (void (*)(void *)) 0 ;
1826
+ int result;
1827
+ VALUE vresult = Qnil;
1828
+
1829
+ if ((argc < 3) || (argc > 3))
1830
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1831
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1832
+ arg2 = NUM2INT(argv[1]);
1833
+ {
1834
+ arg3 = (void*)RSTRING(argv[2])->ptr;
1835
+ arg4 = RSTRING(argv[2])->len;
1836
+ arg5 = SQLITE_TRANSIENT;
1837
+ }
1838
+ result = (int)sqlite3_bind_text16(arg1,arg2,(void const *)arg3,arg4,arg5);
1839
+
1840
+ vresult = INT2NUM(result);
1841
+ return vresult;
1842
+ }
1843
+
1844
+
1845
+ static VALUE
1846
+ _wrap_sqlite3_bind_parameter_count(int argc, VALUE *argv, VALUE self) {
1847
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1848
+ int result;
1849
+ VALUE vresult = Qnil;
1850
+
1851
+ if ((argc < 1) || (argc > 1))
1852
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1853
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1854
+ result = (int)sqlite3_bind_parameter_count(arg1);
1855
+
1856
+ vresult = INT2NUM(result);
1857
+ return vresult;
1858
+ }
1859
+
1860
+
1861
+ static VALUE
1862
+ _wrap_sqlite3_bind_parameter_name(int argc, VALUE *argv, VALUE self) {
1863
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1864
+ int arg2 ;
1865
+ char *result;
1866
+ VALUE vresult = Qnil;
1867
+
1868
+ if ((argc < 2) || (argc > 2))
1869
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1870
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1871
+ arg2 = NUM2INT(argv[1]);
1872
+ result = (char *)sqlite3_bind_parameter_name(arg1,arg2);
1873
+
1874
+ {
1875
+ vresult = result ? rb_str_new2(result) : Qnil;
1876
+ }
1877
+ return vresult;
1878
+ }
1879
+
1880
+
1881
+ static VALUE
1882
+ _wrap_sqlite3_bind_parameter_index(int argc, VALUE *argv, VALUE self) {
1883
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1884
+ char *arg2 = (char *) 0 ;
1885
+ int result;
1886
+ VALUE vresult = Qnil;
1887
+
1888
+ if ((argc < 2) || (argc > 2))
1889
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1890
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1891
+ arg2 = StringValuePtr(argv[1]);
1892
+ result = (int)sqlite3_bind_parameter_index(arg1,(char const *)arg2);
1893
+
1894
+ vresult = INT2NUM(result);
1895
+ return vresult;
1896
+ }
1897
+
1898
+
1899
+ static VALUE
1900
+ _wrap_sqlite3_column_count(int argc, VALUE *argv, VALUE self) {
1901
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1902
+ int result;
1903
+ VALUE vresult = Qnil;
1904
+
1905
+ if ((argc < 1) || (argc > 1))
1906
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1907
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1908
+ result = (int)sqlite3_column_count(arg1);
1909
+
1910
+ vresult = INT2NUM(result);
1911
+ return vresult;
1912
+ }
1913
+
1914
+
1915
+ static VALUE
1916
+ _wrap_sqlite3_column_name(int argc, VALUE *argv, VALUE self) {
1917
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1918
+ int arg2 ;
1919
+ char *result;
1920
+ VALUE vresult = Qnil;
1921
+
1922
+ if ((argc < 2) || (argc > 2))
1923
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1924
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1925
+ arg2 = NUM2INT(argv[1]);
1926
+ result = (char *)sqlite3_column_name(arg1,arg2);
1927
+
1928
+ {
1929
+ vresult = result ? rb_str_new2(result) : Qnil;
1930
+ }
1931
+ return vresult;
1932
+ }
1933
+
1934
+
1935
+ static VALUE
1936
+ _wrap_sqlite3_column_name16(int argc, VALUE *argv, VALUE self) {
1937
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1938
+ int arg2 ;
1939
+ void *result;
1940
+ VALUE vresult = Qnil;
1941
+
1942
+ if ((argc < 2) || (argc > 2))
1943
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1944
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1945
+ arg2 = NUM2INT(argv[1]);
1946
+ result = (void *)sqlite3_column_name16(arg1,arg2);
1947
+
1948
+ {
1949
+ int i;
1950
+ if( result ) {
1951
+ for( i = 0; ((char*)result)[i]; i += 2 );
1952
+ vresult = rb_str_new( (char*)result, i );
1953
+ } else vresult = Qnil;
1954
+ }
1955
+ return vresult;
1956
+ }
1957
+
1958
+
1959
+ static VALUE
1960
+ _wrap_sqlite3_column_decltype(int argc, VALUE *argv, VALUE self) {
1961
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1962
+ int arg2 ;
1963
+ char *result;
1964
+ VALUE vresult = Qnil;
1965
+
1966
+ if ((argc < 2) || (argc > 2))
1967
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1968
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1969
+ arg2 = NUM2INT(argv[1]);
1970
+ result = (char *)sqlite3_column_decltype(arg1,arg2);
1971
+
1972
+ {
1973
+ vresult = result ? rb_str_new2(result) : Qnil;
1974
+ }
1975
+ return vresult;
1976
+ }
1977
+
1978
+
1979
+ static VALUE
1980
+ _wrap_sqlite3_column_decltype16(int argc, VALUE *argv, VALUE self) {
1981
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1982
+ int arg2 ;
1983
+ void *result;
1984
+ VALUE vresult = Qnil;
1985
+
1986
+ if ((argc < 2) || (argc > 2))
1987
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1988
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1989
+ arg2 = NUM2INT(argv[1]);
1990
+ result = (void *)sqlite3_column_decltype16(arg1,arg2);
1991
+
1992
+ {
1993
+ int i;
1994
+ if( result ) {
1995
+ for( i = 0; ((char*)result)[i]; i += 2 );
1996
+ vresult = rb_str_new( (char*)result, i );
1997
+ } else vresult = Qnil;
1998
+ }
1999
+ return vresult;
2000
+ }
2001
+
2002
+
2003
+ static VALUE
2004
+ _wrap_sqlite3_step(int argc, VALUE *argv, VALUE self) {
2005
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2006
+ int result;
2007
+ VALUE vresult = Qnil;
2008
+
2009
+ if ((argc < 1) || (argc > 1))
2010
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2011
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2012
+ result = (int)sqlite3_step(arg1);
2013
+
2014
+ vresult = INT2NUM(result);
2015
+ return vresult;
2016
+ }
2017
+
2018
+
2019
+ static VALUE
2020
+ _wrap_sqlite3_data_count(int argc, VALUE *argv, VALUE self) {
2021
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2022
+ int result;
2023
+ VALUE vresult = Qnil;
2024
+
2025
+ if ((argc < 1) || (argc > 1))
2026
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2027
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2028
+ result = (int)sqlite3_data_count(arg1);
2029
+
2030
+ vresult = INT2NUM(result);
2031
+ return vresult;
2032
+ }
2033
+
2034
+
2035
+ static VALUE
2036
+ _wrap_sqlite3_column_blob(int argc, VALUE *argv, VALUE self) {
2037
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2038
+ int arg2 ;
2039
+ BLOB *result;
2040
+ VALUE vresult = Qnil;
2041
+
2042
+ if ((argc < 2) || (argc > 2))
2043
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2044
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2045
+ arg2 = NUM2INT(argv[1]);
2046
+ result = (BLOB *)sqlite3_column_blob(arg1,arg2);
2047
+
2048
+ {
2049
+ vresult = result ?
2050
+ rb_str_new( (char*)result, sqlite3_column_bytes( arg1, arg2 ) ) : Qnil;
2051
+ }
2052
+ return vresult;
2053
+ }
2054
+
2055
+
2056
+ static VALUE
2057
+ _wrap_sqlite3_column_bytes(int argc, VALUE *argv, VALUE self) {
2058
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2059
+ int arg2 ;
2060
+ int result;
2061
+ VALUE vresult = Qnil;
2062
+
2063
+ if ((argc < 2) || (argc > 2))
2064
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2065
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2066
+ arg2 = NUM2INT(argv[1]);
2067
+ result = (int)sqlite3_column_bytes(arg1,arg2);
2068
+
2069
+ vresult = INT2NUM(result);
2070
+ return vresult;
2071
+ }
2072
+
2073
+
2074
+ static VALUE
2075
+ _wrap_sqlite3_column_bytes16(int argc, VALUE *argv, VALUE self) {
2076
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2077
+ int arg2 ;
2078
+ int result;
2079
+ VALUE vresult = Qnil;
2080
+
2081
+ if ((argc < 2) || (argc > 2))
2082
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2083
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2084
+ arg2 = NUM2INT(argv[1]);
2085
+ result = (int)sqlite3_column_bytes16(arg1,arg2);
2086
+
2087
+ vresult = INT2NUM(result);
2088
+ return vresult;
2089
+ }
2090
+
2091
+
2092
+ static VALUE
2093
+ _wrap_sqlite3_column_double(int argc, VALUE *argv, VALUE self) {
2094
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2095
+ int arg2 ;
2096
+ double result;
2097
+ VALUE vresult = Qnil;
2098
+
2099
+ if ((argc < 2) || (argc > 2))
2100
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2101
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2102
+ arg2 = NUM2INT(argv[1]);
2103
+ result = (double)sqlite3_column_double(arg1,arg2);
2104
+
2105
+ vresult = rb_float_new(result);
2106
+ return vresult;
2107
+ }
2108
+
2109
+
2110
+ static VALUE
2111
+ _wrap_sqlite3_column_int(int argc, VALUE *argv, VALUE self) {
2112
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2113
+ int arg2 ;
2114
+ double result;
2115
+ VALUE vresult = Qnil;
2116
+
2117
+ if ((argc < 2) || (argc > 2))
2118
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2119
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2120
+ arg2 = NUM2INT(argv[1]);
2121
+ result = (double)sqlite3_column_int(arg1,arg2);
2122
+
2123
+ vresult = rb_float_new(result);
2124
+ return vresult;
2125
+ }
2126
+
2127
+
2128
+ static VALUE
2129
+ _wrap_sqlite3_column_int64(int argc, VALUE *argv, VALUE self) {
2130
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2131
+ int arg2 ;
2132
+ sqlite_int64 result;
2133
+ VALUE vresult = Qnil;
2134
+
2135
+ if ((argc < 2) || (argc > 2))
2136
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2137
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2138
+ arg2 = NUM2INT(argv[1]);
2139
+ result = sqlite3_column_int64(arg1,arg2);
2140
+
2141
+ {
2142
+ vresult = rb_ll2inum( result );
2143
+ }
2144
+ return vresult;
2145
+ }
2146
+
2147
+
2148
+ static VALUE
2149
+ _wrap_sqlite3_column_text(int argc, VALUE *argv, VALUE self) {
2150
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2151
+ int arg2 ;
2152
+ char *result;
2153
+ VALUE vresult = Qnil;
2154
+
2155
+ if ((argc < 2) || (argc > 2))
2156
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2157
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2158
+ arg2 = NUM2INT(argv[1]);
2159
+ result = (char *)sqlite3_column_text(arg1,arg2);
2160
+
2161
+ {
2162
+ vresult = result ? rb_str_new2(result) : Qnil;
2163
+ }
2164
+ return vresult;
2165
+ }
2166
+
2167
+
2168
+ static VALUE
2169
+ _wrap_sqlite3_column_text16(int argc, VALUE *argv, VALUE self) {
2170
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2171
+ int arg2 ;
2172
+ void *result;
2173
+ VALUE vresult = Qnil;
2174
+
2175
+ if ((argc < 2) || (argc > 2))
2176
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2177
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2178
+ arg2 = NUM2INT(argv[1]);
2179
+ result = (void *)sqlite3_column_text16(arg1,arg2);
2180
+
2181
+ {
2182
+ int i;
2183
+ if( result ) {
2184
+ for( i = 0; ((char*)result)[i]; i += 2 );
2185
+ vresult = rb_str_new( (char*)result, i );
2186
+ } else vresult = Qnil;
2187
+ }
2188
+ return vresult;
2189
+ }
2190
+
2191
+
2192
+ static VALUE
2193
+ _wrap_sqlite3_column_type(int argc, VALUE *argv, VALUE self) {
2194
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2195
+ int arg2 ;
2196
+ int result;
2197
+ VALUE vresult = Qnil;
2198
+
2199
+ if ((argc < 2) || (argc > 2))
2200
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2201
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2202
+ arg2 = NUM2INT(argv[1]);
2203
+ result = (int)sqlite3_column_type(arg1,arg2);
2204
+
2205
+ vresult = INT2NUM(result);
2206
+ return vresult;
2207
+ }
2208
+
2209
+
2210
+ static VALUE
2211
+ _wrap_sqlite3_finalize(int argc, VALUE *argv, VALUE self) {
2212
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2213
+ int result;
2214
+ VALUE vresult = Qnil;
2215
+
2216
+ if ((argc < 1) || (argc > 1))
2217
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2218
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2219
+ result = (int)sqlite3_finalize(arg1);
2220
+
2221
+ vresult = INT2NUM(result);
2222
+ return vresult;
2223
+ }
2224
+
2225
+
2226
+ static VALUE
2227
+ _wrap_sqlite3_reset(int argc, VALUE *argv, VALUE self) {
2228
+ sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2229
+ int result;
2230
+ VALUE vresult = Qnil;
2231
+
2232
+ if ((argc < 1) || (argc > 1))
2233
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2234
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2235
+ result = (int)sqlite3_reset(arg1);
2236
+
2237
+ vresult = INT2NUM(result);
2238
+ return vresult;
2239
+ }
2240
+
2241
+
2242
+ static VALUE
2243
+ _wrap_sqlite3_create_function(int argc, VALUE *argv, VALUE self) {
2244
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
2245
+ char *arg2 = (char *) 0 ;
2246
+ int arg3 ;
2247
+ int arg4 ;
2248
+ void *arg5 = (void *) 0 ;
2249
+ void (*arg6)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
2250
+ void (*arg7)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
2251
+ void (*arg8)(sqlite3_context *) = (void (*)(sqlite3_context *)) 0 ;
2252
+ int result;
2253
+ VALUE vresult = Qnil;
2254
+
2255
+ if ((argc < 8) || (argc > 8))
2256
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 8)",argc);
2257
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
2258
+ arg2 = StringValuePtr(argv[1]);
2259
+ arg3 = NUM2INT(argv[2]);
2260
+ arg4 = NUM2INT(argv[3]);
2261
+ SWIG_ConvertPtr(argv[4], (void **) &arg5, 0, SWIG_POINTER_EXCEPTION|0);
2262
+ SWIG_ConvertPtr(argv[5], (void **) &arg6, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
2263
+ SWIG_ConvertPtr(argv[6], (void **) &arg7, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
2264
+ SWIG_ConvertPtr(argv[7], (void **) &arg8, SWIGTYPE_p_f_p_sqlite3_context__void, 0);
2265
+ result = (int)sqlite3_create_function(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8);
2266
+
2267
+ vresult = INT2NUM(result);
2268
+ return vresult;
2269
+ }
2270
+
2271
+
2272
+ static VALUE
2273
+ _wrap_sqlite3_create_function16(int argc, VALUE *argv, VALUE self) {
2274
+ sqlite3 *arg1 = (sqlite3 *) 0 ;
2275
+ void *arg2 = (void *) 0 ;
2276
+ int arg3 ;
2277
+ int arg4 ;
2278
+ void *arg5 = (void *) 0 ;
2279
+ void (*arg6)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
2280
+ void (*arg7)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
2281
+ void (*arg8)(sqlite3_context *) = (void (*)(sqlite3_context *)) 0 ;
2282
+ int result;
2283
+ VALUE vresult = Qnil;
2284
+
2285
+ if ((argc < 8) || (argc > 8))
2286
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 8)",argc);
2287
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
2288
+ {
2289
+ arg2 = (void*)RSTRING(argv[1])->ptr;
2290
+ }
2291
+ arg3 = NUM2INT(argv[2]);
2292
+ arg4 = NUM2INT(argv[3]);
2293
+ SWIG_ConvertPtr(argv[4], (void **) &arg5, 0, SWIG_POINTER_EXCEPTION|0);
2294
+ SWIG_ConvertPtr(argv[5], (void **) &arg6, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
2295
+ SWIG_ConvertPtr(argv[6], (void **) &arg7, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
2296
+ SWIG_ConvertPtr(argv[7], (void **) &arg8, SWIGTYPE_p_f_p_sqlite3_context__void, 0);
2297
+ result = (int)sqlite3_create_function16(arg1,(void const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8);
2298
+
2299
+ vresult = INT2NUM(result);
2300
+ return vresult;
2301
+ }
2302
+
2303
+
2304
+ static VALUE
2305
+ _wrap_sqlite3_aggregate_count(int argc, VALUE *argv, VALUE self) {
2306
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2307
+ int result;
2308
+ VALUE vresult = Qnil;
2309
+
2310
+ if ((argc < 1) || (argc > 1))
2311
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2312
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2313
+ result = (int)sqlite3_aggregate_count(arg1);
2314
+
2315
+ vresult = INT2NUM(result);
2316
+ return vresult;
2317
+ }
2318
+
2319
+
2320
+ static VALUE
2321
+ _wrap_sqlite3_value_blob(int argc, VALUE *argv, VALUE self) {
2322
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2323
+ VALBLOB *result;
2324
+ VALUE vresult = Qnil;
2325
+
2326
+ if ((argc < 1) || (argc > 1))
2327
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2328
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2329
+ result = (VALBLOB *)sqlite3_value_blob(arg1);
2330
+
2331
+ {
2332
+ vresult = result ? rb_str_new( (char*)result, sqlite3_value_bytes( arg1 ) ) : Qnil;
2333
+ }
2334
+ return vresult;
2335
+ }
2336
+
2337
+
2338
+ static VALUE
2339
+ _wrap_sqlite3_value_bytes(int argc, VALUE *argv, VALUE self) {
2340
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2341
+ int result;
2342
+ VALUE vresult = Qnil;
2343
+
2344
+ if ((argc < 1) || (argc > 1))
2345
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2346
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2347
+ result = (int)sqlite3_value_bytes(arg1);
2348
+
2349
+ vresult = INT2NUM(result);
2350
+ return vresult;
2351
+ }
2352
+
2353
+
2354
+ static VALUE
2355
+ _wrap_sqlite3_value_bytes16(int argc, VALUE *argv, VALUE self) {
2356
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2357
+ int result;
2358
+ VALUE vresult = Qnil;
2359
+
2360
+ if ((argc < 1) || (argc > 1))
2361
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2362
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2363
+ result = (int)sqlite3_value_bytes16(arg1);
2364
+
2365
+ vresult = INT2NUM(result);
2366
+ return vresult;
2367
+ }
2368
+
2369
+
2370
+ static VALUE
2371
+ _wrap_sqlite3_value_double(int argc, VALUE *argv, VALUE self) {
2372
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2373
+ double result;
2374
+ VALUE vresult = Qnil;
2375
+
2376
+ if ((argc < 1) || (argc > 1))
2377
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2378
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2379
+ result = (double)sqlite3_value_double(arg1);
2380
+
2381
+ vresult = rb_float_new(result);
2382
+ return vresult;
2383
+ }
2384
+
2385
+
2386
+ static VALUE
2387
+ _wrap_sqlite3_value_int(int argc, VALUE *argv, VALUE self) {
2388
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2389
+ int result;
2390
+ VALUE vresult = Qnil;
2391
+
2392
+ if ((argc < 1) || (argc > 1))
2393
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2394
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2395
+ result = (int)sqlite3_value_int(arg1);
2396
+
2397
+ vresult = INT2NUM(result);
2398
+ return vresult;
2399
+ }
2400
+
2401
+
2402
+ static VALUE
2403
+ _wrap_sqlite3_value_int64(int argc, VALUE *argv, VALUE self) {
2404
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2405
+ sqlite_int64 result;
2406
+ VALUE vresult = Qnil;
2407
+
2408
+ if ((argc < 1) || (argc > 1))
2409
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2410
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2411
+ result = sqlite3_value_int64(arg1);
2412
+
2413
+ {
2414
+ vresult = rb_ll2inum( result );
2415
+ }
2416
+ return vresult;
2417
+ }
2418
+
2419
+
2420
+ static VALUE
2421
+ _wrap_sqlite3_value_text(int argc, VALUE *argv, VALUE self) {
2422
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2423
+ char *result;
2424
+ VALUE vresult = Qnil;
2425
+
2426
+ if ((argc < 1) || (argc > 1))
2427
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2428
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2429
+ result = (char *)sqlite3_value_text(arg1);
2430
+
2431
+ {
2432
+ vresult = result ? rb_str_new2(result) : Qnil;
2433
+ }
2434
+ return vresult;
2435
+ }
2436
+
2437
+
2438
+ static VALUE
2439
+ _wrap_sqlite3_value_text16(int argc, VALUE *argv, VALUE self) {
2440
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2441
+ void *result;
2442
+ VALUE vresult = Qnil;
2443
+
2444
+ if ((argc < 1) || (argc > 1))
2445
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2446
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2447
+ result = (void *)sqlite3_value_text16(arg1);
2448
+
2449
+ {
2450
+ int i;
2451
+ if( result ) {
2452
+ for( i = 0; ((char*)result)[i]; i += 2 );
2453
+ vresult = rb_str_new( (char*)result, i );
2454
+ } else vresult = Qnil;
2455
+ }
2456
+ return vresult;
2457
+ }
2458
+
2459
+
2460
+ static VALUE
2461
+ _wrap_sqlite3_value_text16le(int argc, VALUE *argv, VALUE self) {
2462
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2463
+ void *result;
2464
+ VALUE vresult = Qnil;
2465
+
2466
+ if ((argc < 1) || (argc > 1))
2467
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2468
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2469
+ result = (void *)sqlite3_value_text16le(arg1);
2470
+
2471
+ {
2472
+ int i;
2473
+ if( result ) {
2474
+ for( i = 0; ((char*)result)[i]; i += 2 );
2475
+ vresult = rb_str_new( (char*)result, i );
2476
+ } else vresult = Qnil;
2477
+ }
2478
+ return vresult;
2479
+ }
2480
+
2481
+
2482
+ static VALUE
2483
+ _wrap_sqlite3_value_text16be(int argc, VALUE *argv, VALUE self) {
2484
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2485
+ void *result;
2486
+ VALUE vresult = Qnil;
2487
+
2488
+ if ((argc < 1) || (argc > 1))
2489
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2490
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2491
+ result = (void *)sqlite3_value_text16be(arg1);
2492
+
2493
+ {
2494
+ int i;
2495
+ if( result ) {
2496
+ for( i = 0; ((char*)result)[i]; i += 2 );
2497
+ vresult = rb_str_new( (char*)result, i );
2498
+ } else vresult = Qnil;
2499
+ }
2500
+ return vresult;
2501
+ }
2502
+
2503
+
2504
+ static VALUE
2505
+ _wrap_sqlite3_value_type(int argc, VALUE *argv, VALUE self) {
2506
+ sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2507
+ int result;
2508
+ VALUE vresult = Qnil;
2509
+
2510
+ if ((argc < 1) || (argc > 1))
2511
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2512
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2513
+ result = (int)sqlite3_value_type(arg1);
2514
+
2515
+ vresult = INT2NUM(result);
2516
+ return vresult;
2517
+ }
2518
+
2519
+
2520
+ static VALUE
2521
+ _wrap_sqlite3_result_blob(int argc, VALUE *argv, VALUE self) {
2522
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2523
+ void *arg2 = (void *) 0 ;
2524
+ int arg3 ;
2525
+ void (*arg4)(void *) = (void (*)(void *)) 0 ;
2526
+
2527
+ if ((argc < 2) || (argc > 2))
2528
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2529
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2530
+ {
2531
+ arg2 = (void*)RSTRING(argv[1])->ptr;
2532
+ arg3 = RSTRING(argv[1])->len;
2533
+ arg4 = SQLITE_TRANSIENT;
2534
+ }
2535
+ sqlite3_result_blob(arg1,(void const *)arg2,arg3,arg4);
2536
+
2537
+ return Qnil;
2538
+ }
2539
+
2540
+
2541
+ static VALUE
2542
+ _wrap_sqlite3_result_double(int argc, VALUE *argv, VALUE self) {
2543
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2544
+ double arg2 ;
2545
+
2546
+ if ((argc < 2) || (argc > 2))
2547
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2548
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2549
+ arg2 = (double) NUM2DBL(argv[1]);
2550
+ sqlite3_result_double(arg1,arg2);
2551
+
2552
+ return Qnil;
2553
+ }
2554
+
2555
+
2556
+ static VALUE
2557
+ _wrap_sqlite3_result_error(int argc, VALUE *argv, VALUE self) {
2558
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2559
+ char *arg2 = (char *) 0 ;
2560
+ int arg3 ;
2561
+
2562
+ if ((argc < 2) || (argc > 2))
2563
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2564
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2565
+ {
2566
+ arg2 = RSTRING(argv[1])->ptr;
2567
+ arg3 = RSTRING(argv[1])->len;
2568
+ }
2569
+ sqlite3_result_error(arg1,(char const *)arg2,arg3);
2570
+
2571
+ return Qnil;
2572
+ }
2573
+
2574
+
2575
+ static VALUE
2576
+ _wrap_sqlite3_result_error16(int argc, VALUE *argv, VALUE self) {
2577
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2578
+ void *arg2 = (void *) 0 ;
2579
+ int arg3 ;
2580
+
2581
+ if ((argc < 2) || (argc > 2))
2582
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2583
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2584
+ {
2585
+ arg2 = (void*)RSTRING(argv[1])->ptr;
2586
+ arg3 = RSTRING(argv[1])->len;
2587
+ }
2588
+ sqlite3_result_error16(arg1,(void const *)arg2,arg3);
2589
+
2590
+ return Qnil;
2591
+ }
2592
+
2593
+
2594
+ static VALUE
2595
+ _wrap_sqlite3_result_int(int argc, VALUE *argv, VALUE self) {
2596
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2597
+ int arg2 ;
2598
+
2599
+ if ((argc < 2) || (argc > 2))
2600
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2601
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2602
+ arg2 = NUM2INT(argv[1]);
2603
+ sqlite3_result_int(arg1,arg2);
2604
+
2605
+ return Qnil;
2606
+ }
2607
+
2608
+
2609
+ static VALUE
2610
+ _wrap_sqlite3_result_int64(int argc, VALUE *argv, VALUE self) {
2611
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2612
+ sqlite_int64 arg2 ;
2613
+
2614
+ if ((argc < 2) || (argc > 2))
2615
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2616
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2617
+ {
2618
+ arg2 = rb_big2ll( argv[1] );
2619
+ }
2620
+ sqlite3_result_int64(arg1,arg2);
2621
+
2622
+ return Qnil;
2623
+ }
2624
+
2625
+
2626
+ static VALUE
2627
+ _wrap_sqlite3_result_text(int argc, VALUE *argv, VALUE self) {
2628
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2629
+ char *arg2 = (char *) 0 ;
2630
+ int arg3 ;
2631
+ void (*arg4)(void *) = (void (*)(void *)) 0 ;
2632
+
2633
+ if ((argc < 2) || (argc > 2))
2634
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2635
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2636
+ {
2637
+ arg2 = RSTRING(argv[1])->ptr;
2638
+ arg3 = RSTRING(argv[1])->len;
2639
+ arg4 = SQLITE_TRANSIENT;
2640
+ }
2641
+ sqlite3_result_text(arg1,(char const *)arg2,arg3,arg4);
2642
+
2643
+ return Qnil;
2644
+ }
2645
+
2646
+
2647
+ static VALUE
2648
+ _wrap_sqlite3_result_text16(int argc, VALUE *argv, VALUE self) {
2649
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2650
+ void *arg2 = (void *) 0 ;
2651
+ int arg3 ;
2652
+ void (*arg4)(void *) = (void (*)(void *)) 0 ;
2653
+
2654
+ if ((argc < 2) || (argc > 2))
2655
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2656
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2657
+ {
2658
+ arg2 = (void*)RSTRING(argv[1])->ptr;
2659
+ arg3 = RSTRING(argv[1])->len;
2660
+ arg4 = SQLITE_TRANSIENT;
2661
+ }
2662
+ sqlite3_result_text16(arg1,(void const *)arg2,arg3,arg4);
2663
+
2664
+ return Qnil;
2665
+ }
2666
+
2667
+
2668
+ static VALUE
2669
+ _wrap_sqlite3_result_text16le(int argc, VALUE *argv, VALUE self) {
2670
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2671
+ void *arg2 = (void *) 0 ;
2672
+ int arg3 ;
2673
+ void (*arg4)(void *) = (void (*)(void *)) 0 ;
2674
+
2675
+ if ((argc < 2) || (argc > 2))
2676
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2677
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2678
+ {
2679
+ arg2 = (void*)RSTRING(argv[1])->ptr;
2680
+ arg3 = RSTRING(argv[1])->len;
2681
+ arg4 = SQLITE_TRANSIENT;
2682
+ }
2683
+ sqlite3_result_text16le(arg1,(void const *)arg2,arg3,arg4);
2684
+
2685
+ return Qnil;
2686
+ }
2687
+
2688
+
2689
+ static VALUE
2690
+ _wrap_sqlite3_result_text16be(int argc, VALUE *argv, VALUE self) {
2691
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2692
+ void *arg2 = (void *) 0 ;
2693
+ int arg3 ;
2694
+ void (*arg4)(void *) = (void (*)(void *)) 0 ;
2695
+
2696
+ if ((argc < 2) || (argc > 2))
2697
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2698
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2699
+ {
2700
+ arg2 = (void*)RSTRING(argv[1])->ptr;
2701
+ arg3 = RSTRING(argv[1])->len;
2702
+ arg4 = SQLITE_TRANSIENT;
2703
+ }
2704
+ sqlite3_result_text16be(arg1,(void const *)arg2,arg3,arg4);
2705
+
2706
+ return Qnil;
2707
+ }
2708
+
2709
+
2710
+ static VALUE
2711
+ _wrap_sqlite3_result_value(int argc, VALUE *argv, VALUE self) {
2712
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2713
+ sqlite3_value *arg2 = (sqlite3_value *) 0 ;
2714
+
2715
+ if ((argc < 2) || (argc > 2))
2716
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2717
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2718
+ SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_sqlite3_value, 0);
2719
+ sqlite3_result_value(arg1,arg2);
2720
+
2721
+ return Qnil;
2722
+ }
2723
+
2724
+
2725
+ static VALUE
2726
+ _wrap_sqlite3_aggregate_context(int argc, VALUE *argv, VALUE self) {
2727
+ sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2728
+ int arg2 ;
2729
+ VALUE *result;
2730
+ VALUE vresult = Qnil;
2731
+
2732
+ if ((argc < 1) || (argc > 1))
2733
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2734
+ {
2735
+ SWIG_ConvertPtr(argv[0],(void**)&arg1, SWIGTYPE_p_sqlite3_context, 1);
2736
+ arg2 = 4;
2737
+ }
2738
+ result = (VALUE *)sqlite3_aggregate_context(arg1,arg2);
2739
+
2740
+ {
2741
+ vresult = *(VALUE*)result;
2742
+ }
2743
+ return vresult;
2744
+ }
2745
+
2746
+
2747
+
2748
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
2749
+
2750
+ static swig_type_info _swigt__p_CallbackData = {"_p_CallbackData", "struct CallbackData *", 0, 0, 0};
2751
+ static swig_type_info _swigt__p_f_p_sqlite3_context__void = {"_p_f_p_sqlite3_context__void", "void (*)(sqlite3_context *)", 0, 0, 0};
2752
+ static swig_type_info _swigt__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void = {"_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void", "void (*)(sqlite3_context *,int,sqlite3_value **)", 0, 0, 0};
2753
+ static swig_type_info _swigt__p_f_p_void__void = {"_p_f_p_void__void", "void (*)(void *)", 0, 0, 0};
2754
+ static swig_type_info _swigt__p_f_p_void_int__int = {"_p_f_p_void_int__int", "int (*)(void *,int)", 0, 0, 0};
2755
+ static swig_type_info _swigt__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int = {"_p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int", "int (*)(void *,int,char const *,char const *,char const *,char const *)", 0, 0, 0};
2756
+ static swig_type_info _swigt__p_f_p_void_p_q_const__char__void = {"_p_f_p_void_p_q_const__char__void", "void (*)(void *,char const *)", 0, 0, 0};
2757
+ static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, 0};
2758
+ static swig_type_info _swigt__p_p_sqlite3 = {"_p_p_sqlite3", "sqlite3 **", 0, 0, 0};
2759
+ static swig_type_info _swigt__p_p_sqlite3_stmt = {"_p_p_sqlite3_stmt", "sqlite3_stmt **", 0, 0, 0};
2760
+ static swig_type_info _swigt__p_p_void = {"_p_p_void", "void **", 0, 0, 0};
2761
+ static swig_type_info _swigt__p_sqlite3 = {"_p_sqlite3", "sqlite3 *", 0, 0, 0};
2762
+ static swig_type_info _swigt__p_sqlite3_context = {"_p_sqlite3_context", "sqlite3_context *", 0, 0, 0};
2763
+ static swig_type_info _swigt__p_sqlite3_stmt = {"_p_sqlite3_stmt", "sqlite3_stmt *", 0, 0, 0};
2764
+ static swig_type_info _swigt__p_sqlite3_value = {"_p_sqlite3_value", "sqlite3_value *", 0, 0, 0};
2765
+ static swig_type_info _swigt__p_sqlite_int64 = {"_p_sqlite_int64", "sqlite_int64 *", 0, 0, 0};
2766
+ static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "unsigned long *|VALUE *", 0, 0, 0};
2767
+ static swig_type_info _swigt__p_void = {"_p_void", "void *|VALBLOB *", 0, 0, 0};
2768
+
2769
+ static swig_type_info *swig_type_initial[] = {
2770
+ &_swigt__p_CallbackData,
2771
+ &_swigt__p_f_p_sqlite3_context__void,
2772
+ &_swigt__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void,
2773
+ &_swigt__p_f_p_void__void,
2774
+ &_swigt__p_f_p_void_int__int,
2775
+ &_swigt__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int,
2776
+ &_swigt__p_f_p_void_p_q_const__char__void,
2777
+ &_swigt__p_p_char,
2778
+ &_swigt__p_p_sqlite3,
2779
+ &_swigt__p_p_sqlite3_stmt,
2780
+ &_swigt__p_p_void,
2781
+ &_swigt__p_sqlite3,
2782
+ &_swigt__p_sqlite3_context,
2783
+ &_swigt__p_sqlite3_stmt,
2784
+ &_swigt__p_sqlite3_value,
2785
+ &_swigt__p_sqlite_int64,
2786
+ &_swigt__p_unsigned_long,
2787
+ &_swigt__p_void,
2788
+ };
2789
+
2790
+ static swig_cast_info _swigc__p_CallbackData[] = { {&_swigt__p_CallbackData, 0, 0, 0},{0, 0, 0, 0}};
2791
+ static swig_cast_info _swigc__p_f_p_sqlite3_context__void[] = { {&_swigt__p_f_p_sqlite3_context__void, 0, 0, 0},{0, 0, 0, 0}};
2792
+ static swig_cast_info _swigc__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void[] = { {&_swigt__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0, 0, 0},{0, 0, 0, 0}};
2793
+ static swig_cast_info _swigc__p_f_p_void__void[] = { {&_swigt__p_f_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
2794
+ static swig_cast_info _swigc__p_f_p_void_int__int[] = { {&_swigt__p_f_p_void_int__int, 0, 0, 0},{0, 0, 0, 0}};
2795
+ static swig_cast_info _swigc__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int[] = { {&_swigt__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int, 0, 0, 0},{0, 0, 0, 0}};
2796
+ static swig_cast_info _swigc__p_f_p_void_p_q_const__char__void[] = { {&_swigt__p_f_p_void_p_q_const__char__void, 0, 0, 0},{0, 0, 0, 0}};
2797
+ static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
2798
+ static swig_cast_info _swigc__p_p_sqlite3[] = { {&_swigt__p_p_sqlite3, 0, 0, 0},{0, 0, 0, 0}};
2799
+ static swig_cast_info _swigc__p_p_sqlite3_stmt[] = { {&_swigt__p_p_sqlite3_stmt, 0, 0, 0},{0, 0, 0, 0}};
2800
+ static swig_cast_info _swigc__p_p_void[] = { {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}};
2801
+ static swig_cast_info _swigc__p_sqlite3[] = { {&_swigt__p_sqlite3, 0, 0, 0},{0, 0, 0, 0}};
2802
+ static swig_cast_info _swigc__p_sqlite3_context[] = { {&_swigt__p_sqlite3_context, 0, 0, 0},{0, 0, 0, 0}};
2803
+ static swig_cast_info _swigc__p_sqlite3_stmt[] = { {&_swigt__p_sqlite3_stmt, 0, 0, 0},{0, 0, 0, 0}};
2804
+ static swig_cast_info _swigc__p_sqlite3_value[] = { {&_swigt__p_sqlite3_value, 0, 0, 0},{0, 0, 0, 0}};
2805
+ static swig_cast_info _swigc__p_sqlite_int64[] = { {&_swigt__p_sqlite_int64, 0, 0, 0},{0, 0, 0, 0}};
2806
+ static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
2807
+ static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
2808
+
2809
+ static swig_cast_info *swig_cast_initial[] = {
2810
+ _swigc__p_CallbackData,
2811
+ _swigc__p_f_p_sqlite3_context__void,
2812
+ _swigc__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void,
2813
+ _swigc__p_f_p_void__void,
2814
+ _swigc__p_f_p_void_int__int,
2815
+ _swigc__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int,
2816
+ _swigc__p_f_p_void_p_q_const__char__void,
2817
+ _swigc__p_p_char,
2818
+ _swigc__p_p_sqlite3,
2819
+ _swigc__p_p_sqlite3_stmt,
2820
+ _swigc__p_p_void,
2821
+ _swigc__p_sqlite3,
2822
+ _swigc__p_sqlite3_context,
2823
+ _swigc__p_sqlite3_stmt,
2824
+ _swigc__p_sqlite3_value,
2825
+ _swigc__p_sqlite_int64,
2826
+ _swigc__p_unsigned_long,
2827
+ _swigc__p_void,
2828
+ };
2829
+
2830
+
2831
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
2832
+
2833
+ /*************************************************************************
2834
+ * Type initialization:
2835
+ * This problem is tough by the requirement that no dynamic
2836
+ * memory is used. Also, since swig_type_info structures store pointers to
2837
+ * swig_cast_info structures and swig_cast_info structures store pointers back
2838
+ * to swig_type_info structures, we need some lookup code at initialization.
2839
+ * The idea is that swig generates all the structures that are needed.
2840
+ * The runtime then collects these partially filled structures.
2841
+ * The SWIG_InitializeModule function takes these initial arrays out of
2842
+ * swig_module, and does all the lookup, filling in the swig_module.types
2843
+ * array with the correct data and linking the correct swig_cast_info
2844
+ * structures together.
2845
+
2846
+ * The generated swig_type_info structures are assigned staticly to an initial
2847
+ * array. We just loop though that array, and handle each type individually.
2848
+ * First we lookup if this type has been already loaded, and if so, use the
2849
+ * loaded structure instead of the generated one. Then we have to fill in the
2850
+ * cast linked list. The cast data is initially stored in something like a
2851
+ * two-dimensional array. Each row corresponds to a type (there are the same
2852
+ * number of rows as there are in the swig_type_initial array). Each entry in
2853
+ * a column is one of the swig_cast_info structures for that type.
2854
+ * The cast_initial array is actually an array of arrays, because each row has
2855
+ * a variable number of columns. So to actually build the cast linked list,
2856
+ * we find the array of casts associated with the type, and loop through it
2857
+ * adding the casts to the list. The one last trick we need to do is making
2858
+ * sure the type pointer in the swig_cast_info struct is correct.
2859
+
2860
+ * First off, we lookup the cast->type name to see if it is already loaded.
2861
+ * There are three cases to handle:
2862
+ * 1) If the cast->type has already been loaded AND the type we are adding
2863
+ * casting info to has not been loaded (it is in this module), THEN we
2864
+ * replace the cast->type pointer with the type pointer that has already
2865
+ * been loaded.
2866
+ * 2) If BOTH types (the one we are adding casting info to, and the
2867
+ * cast->type) are loaded, THEN the cast info has already been loaded by
2868
+ * the previous module so we just ignore it.
2869
+ * 3) Finally, if cast->type has not already been loaded, then we add that
2870
+ * swig_cast_info to the linked list (because the cast->type) pointer will
2871
+ * be correct.
2872
+ **/
2873
+
2874
+ #ifdef __cplusplus
2875
+ extern "C" {
2876
+ #endif
2877
+
2878
+ SWIGRUNTIME void
2879
+ SWIG_InitializeModule(void *clientdata) {
2880
+ swig_type_info *type, *ret;
2881
+ swig_cast_info *cast;
2882
+ size_t i;
2883
+ swig_module_info *module_head;
2884
+ static int init_run = 0;
2885
+
2886
+ clientdata = clientdata;
2887
+
2888
+ if (init_run) return;
2889
+ init_run = 1;
2890
+
2891
+ /* Initialize the swig_module */
2892
+ swig_module.type_initial = swig_type_initial;
2893
+ swig_module.cast_initial = swig_cast_initial;
2894
+
2895
+ /* Try and load any already created modules */
2896
+ module_head = SWIG_GetModule(clientdata);
2897
+ if (module_head) {
2898
+ swig_module.next = module_head->next;
2899
+ module_head->next = &swig_module;
2900
+ } else {
2901
+ /* This is the first module loaded */
2902
+ swig_module.next = &swig_module;
2903
+ SWIG_SetModule(clientdata, &swig_module);
2904
+ }
2905
+
2906
+ /* Now work on filling in swig_module.types */
2907
+ for (i = 0; i < swig_module.size; ++i) {
2908
+ type = 0;
2909
+
2910
+ /* if there is another module already loaded */
2911
+ if (swig_module.next != &swig_module) {
2912
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
2913
+ }
2914
+ if (type) {
2915
+ /* Overwrite clientdata field */
2916
+ if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
2917
+ } else {
2918
+ type = swig_module.type_initial[i];
2919
+ }
2920
+
2921
+ /* Insert casting types */
2922
+ cast = swig_module.cast_initial[i];
2923
+ while (cast->type) {
2924
+
2925
+ /* Don't need to add information already in the list */
2926
+ ret = 0;
2927
+ if (swig_module.next != &swig_module) {
2928
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
2929
+ }
2930
+ if (ret && type == swig_module.type_initial[i]) {
2931
+ cast->type = ret;
2932
+ ret = 0;
2933
+ }
2934
+
2935
+ if (!ret) {
2936
+ if (type->cast) {
2937
+ type->cast->prev = cast;
2938
+ cast->next = type->cast;
2939
+ }
2940
+ type->cast = cast;
2941
+ }
2942
+
2943
+ cast++;
2944
+ }
2945
+
2946
+ /* Set entry in modules->types array equal to the type */
2947
+ swig_module.types[i] = type;
2948
+ }
2949
+ swig_module.types[i] = 0;
2950
+ }
2951
+
2952
+ /* This function will propagate the clientdata field of type to
2953
+ * any new swig_type_info structures that have been added into the list
2954
+ * of equivalent types. It is like calling
2955
+ * SWIG_TypeClientData(type, clientdata) a second time.
2956
+ */
2957
+ SWIGRUNTIME void
2958
+ SWIG_PropagateClientData(void) {
2959
+ size_t i;
2960
+ swig_cast_info *equiv;
2961
+ static int init_run = 0;
2962
+
2963
+ if (init_run) return;
2964
+ init_run = 1;
2965
+
2966
+ for (i = 0; i < swig_module.size; i++) {
2967
+ if (swig_module.types[i]->clientdata) {
2968
+ equiv = swig_module.types[i]->cast;
2969
+ while (equiv) {
2970
+ if (!equiv->converter) {
2971
+ if (equiv->type && !equiv->type->clientdata)
2972
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
2973
+ }
2974
+ equiv = equiv->next;
2975
+ }
2976
+ }
2977
+ }
2978
+ }
2979
+
2980
+ #ifdef __cplusplus
2981
+ }
2982
+ #endif
2983
+
2984
+
2985
+ #ifdef __cplusplus
2986
+ extern "C"
2987
+ #endif
2988
+ SWIGEXPORT void Init_API(void) {
2989
+ size_t i;
2990
+
2991
+ SWIG_InitRuntime();
2992
+ mAPI = rb_define_module("SQLite3");
2993
+ mAPI = rb_define_module_under(mAPI, "Driver");
2994
+ mAPI = rb_define_module_under(mAPI, "Native");
2995
+ mAPI = rb_define_module_under(mAPI, "API");
2996
+
2997
+ SWIG_InitializeModule(0);
2998
+ for (i = 0; i < swig_module.size; i++) {
2999
+ SWIG_define_class(swig_module.types[i]);
3000
+ }
3001
+
3002
+ SWIG_RubyInitializeTrackings();
3003
+
3004
+ cCallbackData.klass = rb_define_class_under(mAPI, "CallbackData", rb_cObject);
3005
+ SWIG_TypeClientData(SWIGTYPE_p_CallbackData, (void *) &cCallbackData);
3006
+ rb_define_alloc_func(cCallbackData.klass, _wrap_CallbackData_allocate);
3007
+ rb_define_method(cCallbackData.klass, "initialize", _wrap_new_CallbackData, -1);
3008
+ rb_define_method(cCallbackData.klass, "proc=", _wrap_CallbackData_proc_set, -1);
3009
+ rb_define_method(cCallbackData.klass, "proc", _wrap_CallbackData_proc_get, -1);
3010
+ rb_define_method(cCallbackData.klass, "proc2=", _wrap_CallbackData_proc2_set, -1);
3011
+ rb_define_method(cCallbackData.klass, "proc2", _wrap_CallbackData_proc2_get, -1);
3012
+ rb_define_method(cCallbackData.klass, "data=", _wrap_CallbackData_data_set, -1);
3013
+ rb_define_method(cCallbackData.klass, "data", _wrap_CallbackData_data_get, -1);
3014
+ cCallbackData.mark = (void (*)(void *)) mark_CallbackData;
3015
+ cCallbackData.destroy = (void (*)(void *)) free_CallbackData;
3016
+ rb_define_const(mAPI,"Sqlite3_ruby_busy_handler", SWIG_NewPointerObj((void *) Sqlite3_ruby_busy_handler, SWIGTYPE_p_f_p_void_int__int,0));
3017
+ rb_define_const(mAPI,"Sqlite3_ruby_authorizer", SWIG_NewPointerObj((void *) Sqlite3_ruby_authorizer, SWIGTYPE_p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int,0));
3018
+ rb_define_const(mAPI,"Sqlite3_ruby_trace", SWIG_NewPointerObj((void *) Sqlite3_ruby_trace, SWIGTYPE_p_f_p_void_p_q_const__char__void,0));
3019
+ rb_define_const(mAPI,"Sqlite3_ruby_function_step", SWIG_NewPointerObj((void *) Sqlite3_ruby_function_step, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void,0));
3020
+ rb_define_const(mAPI,"Sqlite3_ruby_function_final", SWIG_NewPointerObj((void *) Sqlite3_ruby_function_final, SWIGTYPE_p_f_p_sqlite3_context__void,0));
3021
+ rb_define_module_function(mAPI, "sqlite3_libversion", _wrap_sqlite3_libversion, -1);
3022
+ rb_define_module_function(mAPI, "sqlite3_close", _wrap_sqlite3_close, -1);
3023
+ rb_define_module_function(mAPI, "sqlite3_last_insert_rowid", _wrap_sqlite3_last_insert_rowid, -1);
3024
+ rb_define_module_function(mAPI, "sqlite3_changes", _wrap_sqlite3_changes, -1);
3025
+ rb_define_module_function(mAPI, "sqlite3_total_changes", _wrap_sqlite3_total_changes, -1);
3026
+ rb_define_module_function(mAPI, "sqlite3_interrupt", _wrap_sqlite3_interrupt, -1);
3027
+ rb_define_module_function(mAPI, "sqlite3_complete", _wrap_sqlite3_complete, -1);
3028
+ rb_define_module_function(mAPI, "sqlite3_complete16", _wrap_sqlite3_complete16, -1);
3029
+ rb_define_module_function(mAPI, "sqlite3_busy_handler", _wrap_sqlite3_busy_handler, -1);
3030
+ rb_define_module_function(mAPI, "sqlite3_busy_timeout", _wrap_sqlite3_busy_timeout, -1);
3031
+ rb_define_module_function(mAPI, "sqlite3_set_authorizer", _wrap_sqlite3_set_authorizer, -1);
3032
+ rb_define_module_function(mAPI, "sqlite3_trace", _wrap_sqlite3_trace, -1);
3033
+ rb_define_module_function(mAPI, "sqlite3_open", _wrap_sqlite3_open, -1);
3034
+ rb_define_module_function(mAPI, "sqlite3_open16", _wrap_sqlite3_open16, -1);
3035
+ rb_define_module_function(mAPI, "sqlite3_errcode", _wrap_sqlite3_errcode, -1);
3036
+ rb_define_module_function(mAPI, "sqlite3_errmsg", _wrap_sqlite3_errmsg, -1);
3037
+ rb_define_module_function(mAPI, "sqlite3_errmsg16", _wrap_sqlite3_errmsg16, -1);
3038
+ rb_define_module_function(mAPI, "sqlite3_prepare", _wrap_sqlite3_prepare, -1);
3039
+ rb_define_module_function(mAPI, "sqlite3_prepare16", _wrap_sqlite3_prepare16, -1);
3040
+ rb_define_module_function(mAPI, "sqlite3_bind_blob", _wrap_sqlite3_bind_blob, -1);
3041
+ rb_define_module_function(mAPI, "sqlite3_bind_double", _wrap_sqlite3_bind_double, -1);
3042
+ rb_define_module_function(mAPI, "sqlite3_bind_int", _wrap_sqlite3_bind_int, -1);
3043
+ rb_define_module_function(mAPI, "sqlite3_bind_int64", _wrap_sqlite3_bind_int64, -1);
3044
+ rb_define_module_function(mAPI, "sqlite3_bind_null", _wrap_sqlite3_bind_null, -1);
3045
+ rb_define_module_function(mAPI, "sqlite3_bind_text", _wrap_sqlite3_bind_text, -1);
3046
+ rb_define_module_function(mAPI, "sqlite3_bind_text16", _wrap_sqlite3_bind_text16, -1);
3047
+ rb_define_module_function(mAPI, "sqlite3_bind_parameter_count", _wrap_sqlite3_bind_parameter_count, -1);
3048
+ rb_define_module_function(mAPI, "sqlite3_bind_parameter_name", _wrap_sqlite3_bind_parameter_name, -1);
3049
+ rb_define_module_function(mAPI, "sqlite3_bind_parameter_index", _wrap_sqlite3_bind_parameter_index, -1);
3050
+ rb_define_module_function(mAPI, "sqlite3_column_count", _wrap_sqlite3_column_count, -1);
3051
+ rb_define_module_function(mAPI, "sqlite3_column_name", _wrap_sqlite3_column_name, -1);
3052
+ rb_define_module_function(mAPI, "sqlite3_column_name16", _wrap_sqlite3_column_name16, -1);
3053
+ rb_define_module_function(mAPI, "sqlite3_column_decltype", _wrap_sqlite3_column_decltype, -1);
3054
+ rb_define_module_function(mAPI, "sqlite3_column_decltype16", _wrap_sqlite3_column_decltype16, -1);
3055
+ rb_define_module_function(mAPI, "sqlite3_step", _wrap_sqlite3_step, -1);
3056
+ rb_define_module_function(mAPI, "sqlite3_data_count", _wrap_sqlite3_data_count, -1);
3057
+ rb_define_module_function(mAPI, "sqlite3_column_blob", _wrap_sqlite3_column_blob, -1);
3058
+ rb_define_module_function(mAPI, "sqlite3_column_bytes", _wrap_sqlite3_column_bytes, -1);
3059
+ rb_define_module_function(mAPI, "sqlite3_column_bytes16", _wrap_sqlite3_column_bytes16, -1);
3060
+ rb_define_module_function(mAPI, "sqlite3_column_double", _wrap_sqlite3_column_double, -1);
3061
+ rb_define_module_function(mAPI, "sqlite3_column_int", _wrap_sqlite3_column_int, -1);
3062
+ rb_define_module_function(mAPI, "sqlite3_column_int64", _wrap_sqlite3_column_int64, -1);
3063
+ rb_define_module_function(mAPI, "sqlite3_column_text", _wrap_sqlite3_column_text, -1);
3064
+ rb_define_module_function(mAPI, "sqlite3_column_text16", _wrap_sqlite3_column_text16, -1);
3065
+ rb_define_module_function(mAPI, "sqlite3_column_type", _wrap_sqlite3_column_type, -1);
3066
+ rb_define_module_function(mAPI, "sqlite3_finalize", _wrap_sqlite3_finalize, -1);
3067
+ rb_define_module_function(mAPI, "sqlite3_reset", _wrap_sqlite3_reset, -1);
3068
+ rb_define_module_function(mAPI, "sqlite3_create_function", _wrap_sqlite3_create_function, -1);
3069
+ rb_define_module_function(mAPI, "sqlite3_create_function16", _wrap_sqlite3_create_function16, -1);
3070
+ rb_define_module_function(mAPI, "sqlite3_aggregate_count", _wrap_sqlite3_aggregate_count, -1);
3071
+ rb_define_module_function(mAPI, "sqlite3_value_blob", _wrap_sqlite3_value_blob, -1);
3072
+ rb_define_module_function(mAPI, "sqlite3_value_bytes", _wrap_sqlite3_value_bytes, -1);
3073
+ rb_define_module_function(mAPI, "sqlite3_value_bytes16", _wrap_sqlite3_value_bytes16, -1);
3074
+ rb_define_module_function(mAPI, "sqlite3_value_double", _wrap_sqlite3_value_double, -1);
3075
+ rb_define_module_function(mAPI, "sqlite3_value_int", _wrap_sqlite3_value_int, -1);
3076
+ rb_define_module_function(mAPI, "sqlite3_value_int64", _wrap_sqlite3_value_int64, -1);
3077
+ rb_define_module_function(mAPI, "sqlite3_value_text", _wrap_sqlite3_value_text, -1);
3078
+ rb_define_module_function(mAPI, "sqlite3_value_text16", _wrap_sqlite3_value_text16, -1);
3079
+ rb_define_module_function(mAPI, "sqlite3_value_text16le", _wrap_sqlite3_value_text16le, -1);
3080
+ rb_define_module_function(mAPI, "sqlite3_value_text16be", _wrap_sqlite3_value_text16be, -1);
3081
+ rb_define_module_function(mAPI, "sqlite3_value_type", _wrap_sqlite3_value_type, -1);
3082
+ rb_define_module_function(mAPI, "sqlite3_result_blob", _wrap_sqlite3_result_blob, -1);
3083
+ rb_define_module_function(mAPI, "sqlite3_result_double", _wrap_sqlite3_result_double, -1);
3084
+ rb_define_module_function(mAPI, "sqlite3_result_error", _wrap_sqlite3_result_error, -1);
3085
+ rb_define_module_function(mAPI, "sqlite3_result_error16", _wrap_sqlite3_result_error16, -1);
3086
+ rb_define_module_function(mAPI, "sqlite3_result_int", _wrap_sqlite3_result_int, -1);
3087
+ rb_define_module_function(mAPI, "sqlite3_result_int64", _wrap_sqlite3_result_int64, -1);
3088
+ rb_define_module_function(mAPI, "sqlite3_result_text", _wrap_sqlite3_result_text, -1);
3089
+ rb_define_module_function(mAPI, "sqlite3_result_text16", _wrap_sqlite3_result_text16, -1);
3090
+ rb_define_module_function(mAPI, "sqlite3_result_text16le", _wrap_sqlite3_result_text16le, -1);
3091
+ rb_define_module_function(mAPI, "sqlite3_result_text16be", _wrap_sqlite3_result_text16be, -1);
3092
+ rb_define_module_function(mAPI, "sqlite3_result_value", _wrap_sqlite3_result_value, -1);
3093
+ rb_define_module_function(mAPI, "sqlite3_aggregate_context", _wrap_sqlite3_aggregate_context, -1);
3094
+ }
3095
+