sqlite3-ruby 1.2.3-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sqlite3-ruby might be problematic. Click here for more details.
- data/README.rdoc +51 -0
- data/doc/faq/faq.html +408 -0
- data/doc/faq/faq.rb +145 -0
- data/doc/faq/faq.yml +426 -0
- data/ext/sqlite3_api/MANIFEST +4 -0
- data/ext/sqlite3_api/Makefile +142 -0
- data/ext/sqlite3_api/extconf.rb +16 -0
- data/ext/sqlite3_api/mkmf.log +66 -0
- data/ext/sqlite3_api/sqlite3_api.i +358 -0
- data/ext/sqlite3_api/sqlite3_api.so +0 -0
- data/ext/sqlite3_api/sqlite3_api_wrap.c +3094 -0
- data/ext/sqlite3_api/sqlite3_api_wrap.o +0 -0
- data/ext/sqlite3_api/win32/build.bat +7 -0
- data/lib/sqlite3.rb +1 -0
- data/lib/sqlite3/constants.rb +49 -0
- data/lib/sqlite3/database.rb +715 -0
- data/lib/sqlite3/driver/dl/api.rb +152 -0
- data/lib/sqlite3/driver/dl/driver.rb +307 -0
- data/lib/sqlite3/driver/native/driver.rb +211 -0
- data/lib/sqlite3/errors.rb +68 -0
- data/lib/sqlite3/pragmas.rb +271 -0
- data/lib/sqlite3/resultset.rb +176 -0
- data/lib/sqlite3/statement.rb +230 -0
- data/lib/sqlite3/translator.rb +109 -0
- data/lib/sqlite3/value.rb +57 -0
- data/lib/sqlite3/version.rb +14 -0
- data/test/bm.rb +140 -0
- data/test/driver/dl/tc_driver.rb +292 -0
- data/test/mocks.rb +45 -0
- data/test/native-vs-dl.rb +126 -0
- data/test/tc_database.rb +198 -0
- data/test/tc_errors.rb +21 -0
- data/test/tc_integration.rb +1044 -0
- data/test/tests.rb +6 -0
- metadata +96 -0
Binary file
|
@@ -0,0 +1,3094 @@
|
|
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
|
+
|
1067
|
+
#define Init_API Init_sqlite3_api
|
1068
|
+
|
1069
|
+
struct CallbackData {
|
1070
|
+
VALUE proc;
|
1071
|
+
VALUE proc2;
|
1072
|
+
VALUE data;
|
1073
|
+
};
|
1074
|
+
|
1075
|
+
typedef struct CallbackData CallbackData;
|
1076
|
+
typedef void RUBY_BLOB;
|
1077
|
+
typedef void RUBY_VALBLOB;
|
1078
|
+
|
1079
|
+
int Sqlite3_ruby_busy_handler(void* data,int value) {
|
1080
|
+
VALUE result;
|
1081
|
+
CallbackData *cb = (CallbackData*)data;
|
1082
|
+
result = rb_funcall(
|
1083
|
+
cb->proc, rb_intern("call"), 2, cb->data, INT2FIX(value) );
|
1084
|
+
return FIX2INT(result);
|
1085
|
+
}
|
1086
|
+
|
1087
|
+
static void mark_CallbackData(void* ptr) {
|
1088
|
+
CallbackData* cb = (CallbackData*)ptr;
|
1089
|
+
if (cb->proc != Qnil)
|
1090
|
+
rb_gc_mark(cb->proc);
|
1091
|
+
if (cb->proc2 != Qnil)
|
1092
|
+
rb_gc_mark(cb->proc2);
|
1093
|
+
if (cb->data != Qnil)
|
1094
|
+
rb_gc_mark(cb->data);
|
1095
|
+
}
|
1096
|
+
|
1097
|
+
int Sqlite3_ruby_authorizer(void* data,int type,
|
1098
|
+
const char* a,const char* b,const char* c,const char* d)
|
1099
|
+
{
|
1100
|
+
VALUE result;
|
1101
|
+
CallbackData *cb = (CallbackData*)data;
|
1102
|
+
result = rb_funcall(
|
1103
|
+
cb->proc, rb_intern("call"), 6, cb->data, INT2FIX(type),
|
1104
|
+
( a ? rb_str_new2(a) : Qnil ), ( b ? rb_str_new2(b) : Qnil ),
|
1105
|
+
( c ? rb_str_new2(c) : Qnil ), ( d ? rb_str_new2(d) : Qnil ) );
|
1106
|
+
return FIX2INT(result);
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
void Sqlite3_ruby_trace(void* data, const char *sql) {
|
1110
|
+
CallbackData *cb = (CallbackData*)data;
|
1111
|
+
rb_funcall( cb->proc, rb_intern("call"), 2, cb->data,
|
1112
|
+
sql ? rb_str_new2(sql) : Qnil );
|
1113
|
+
}
|
1114
|
+
|
1115
|
+
void Sqlite3_ruby_function_step(sqlite3_context* ctx,int n,
|
1116
|
+
sqlite3_value** args)
|
1117
|
+
{
|
1118
|
+
CallbackData *data;
|
1119
|
+
VALUE rb_args;
|
1120
|
+
VALUE *rb_context;
|
1121
|
+
int idx;
|
1122
|
+
|
1123
|
+
data = (CallbackData*)sqlite3_user_data(ctx);
|
1124
|
+
|
1125
|
+
if( data->proc2 != Qnil ) {
|
1126
|
+
rb_context = (VALUE*)sqlite3_aggregate_context(ctx,sizeof(VALUE));
|
1127
|
+
if( *rb_context == 0 ) {
|
1128
|
+
*rb_context = rb_hash_new();
|
1129
|
+
rb_gc_register_address( rb_context );
|
1130
|
+
}
|
1131
|
+
}
|
1132
|
+
|
1133
|
+
rb_args = rb_ary_new2(n+1);
|
1134
|
+
rb_ary_push( rb_args, SWIG_NewPointerObj(ctx,SWIGTYPE_p_sqlite3_context,0) );
|
1135
|
+
for( idx = 0; idx < n; idx++ ) {
|
1136
|
+
rb_ary_push( rb_args, SWIG_NewPointerObj(args[idx],
|
1137
|
+
SWIGTYPE_p_sqlite3_value,0) );
|
1138
|
+
}
|
1139
|
+
|
1140
|
+
rb_apply( data->proc, rb_intern("call"), rb_args );
|
1141
|
+
}
|
1142
|
+
|
1143
|
+
void Sqlite3_ruby_function_final(sqlite3_context *ctx) {
|
1144
|
+
VALUE *rb_context;
|
1145
|
+
CallbackData *data;
|
1146
|
+
|
1147
|
+
rb_context = (VALUE*)sqlite3_aggregate_context(ctx,sizeof(VALUE));
|
1148
|
+
if( *rb_context == 0 ) {
|
1149
|
+
*rb_context = rb_hash_new();
|
1150
|
+
rb_gc_register_address( rb_context );
|
1151
|
+
}
|
1152
|
+
|
1153
|
+
data = (CallbackData*)sqlite3_user_data(ctx);
|
1154
|
+
|
1155
|
+
rb_funcall( data->proc2, rb_intern("call"), 1,
|
1156
|
+
SWIG_NewPointerObj(ctx,SWIGTYPE_p_sqlite3_context,0) );
|
1157
|
+
|
1158
|
+
rb_gc_unregister_address( rb_context );
|
1159
|
+
}
|
1160
|
+
|
1161
|
+
swig_class cCallbackData;
|
1162
|
+
|
1163
|
+
static VALUE
|
1164
|
+
_wrap_CallbackData_proc_set(int argc, VALUE *argv, VALUE self) {
|
1165
|
+
struct CallbackData *arg1 = (struct CallbackData *) 0 ;
|
1166
|
+
VALUE arg2 ;
|
1167
|
+
|
1168
|
+
if ((argc < 1) || (argc > 1))
|
1169
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1170
|
+
SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
|
1171
|
+
arg2 = argv[0];
|
1172
|
+
if (arg1) (arg1)->proc = arg2;
|
1173
|
+
|
1174
|
+
return Qnil;
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
|
1178
|
+
static VALUE
|
1179
|
+
_wrap_CallbackData_proc_get(int argc, VALUE *argv, VALUE self) {
|
1180
|
+
struct CallbackData *arg1 = (struct CallbackData *) 0 ;
|
1181
|
+
VALUE result;
|
1182
|
+
VALUE vresult = Qnil;
|
1183
|
+
|
1184
|
+
if ((argc < 0) || (argc > 0))
|
1185
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
|
1186
|
+
SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
|
1187
|
+
result = (VALUE) ((arg1)->proc);
|
1188
|
+
|
1189
|
+
vresult = result;
|
1190
|
+
return vresult;
|
1191
|
+
}
|
1192
|
+
|
1193
|
+
|
1194
|
+
static VALUE
|
1195
|
+
_wrap_CallbackData_proc2_set(int argc, VALUE *argv, VALUE self) {
|
1196
|
+
struct CallbackData *arg1 = (struct CallbackData *) 0 ;
|
1197
|
+
VALUE arg2 ;
|
1198
|
+
|
1199
|
+
if ((argc < 1) || (argc > 1))
|
1200
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1201
|
+
SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
|
1202
|
+
arg2 = argv[0];
|
1203
|
+
if (arg1) (arg1)->proc2 = arg2;
|
1204
|
+
|
1205
|
+
return Qnil;
|
1206
|
+
}
|
1207
|
+
|
1208
|
+
|
1209
|
+
static VALUE
|
1210
|
+
_wrap_CallbackData_proc2_get(int argc, VALUE *argv, VALUE self) {
|
1211
|
+
struct CallbackData *arg1 = (struct CallbackData *) 0 ;
|
1212
|
+
VALUE result;
|
1213
|
+
VALUE vresult = Qnil;
|
1214
|
+
|
1215
|
+
if ((argc < 0) || (argc > 0))
|
1216
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
|
1217
|
+
SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
|
1218
|
+
result = (VALUE) ((arg1)->proc2);
|
1219
|
+
|
1220
|
+
vresult = result;
|
1221
|
+
return vresult;
|
1222
|
+
}
|
1223
|
+
|
1224
|
+
|
1225
|
+
static VALUE
|
1226
|
+
_wrap_CallbackData_data_set(int argc, VALUE *argv, VALUE self) {
|
1227
|
+
struct CallbackData *arg1 = (struct CallbackData *) 0 ;
|
1228
|
+
VALUE arg2 ;
|
1229
|
+
|
1230
|
+
if ((argc < 1) || (argc > 1))
|
1231
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1232
|
+
SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
|
1233
|
+
arg2 = argv[0];
|
1234
|
+
if (arg1) (arg1)->data = arg2;
|
1235
|
+
|
1236
|
+
return Qnil;
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
|
1240
|
+
static VALUE
|
1241
|
+
_wrap_CallbackData_data_get(int argc, VALUE *argv, VALUE self) {
|
1242
|
+
struct CallbackData *arg1 = (struct CallbackData *) 0 ;
|
1243
|
+
VALUE result;
|
1244
|
+
VALUE vresult = Qnil;
|
1245
|
+
|
1246
|
+
if ((argc < 0) || (argc > 0))
|
1247
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
|
1248
|
+
SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
|
1249
|
+
result = (VALUE) ((arg1)->data);
|
1250
|
+
|
1251
|
+
vresult = result;
|
1252
|
+
return vresult;
|
1253
|
+
}
|
1254
|
+
|
1255
|
+
|
1256
|
+
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
|
1257
|
+
static VALUE
|
1258
|
+
_wrap_CallbackData_allocate(VALUE self) {
|
1259
|
+
#else
|
1260
|
+
static VALUE
|
1261
|
+
_wrap_CallbackData_allocate(int argc, VALUE *argv, VALUE self) {
|
1262
|
+
#endif
|
1263
|
+
|
1264
|
+
|
1265
|
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_CallbackData);
|
1266
|
+
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
|
1267
|
+
rb_obj_call_init(vresult, argc, argv);
|
1268
|
+
#endif
|
1269
|
+
return vresult;
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
|
1273
|
+
static VALUE
|
1274
|
+
_wrap_new_CallbackData(int argc, VALUE *argv, VALUE self) {
|
1275
|
+
struct CallbackData *result;
|
1276
|
+
|
1277
|
+
if ((argc < 0) || (argc > 0))
|
1278
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
|
1279
|
+
result = (struct CallbackData *)(struct CallbackData *) calloc(1, sizeof(struct CallbackData));
|
1280
|
+
DATA_PTR(self) = result;
|
1281
|
+
|
1282
|
+
return self;
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
|
1286
|
+
static void
|
1287
|
+
free_CallbackData(struct CallbackData *arg1) {
|
1288
|
+
free((char *) arg1);
|
1289
|
+
}
|
1290
|
+
|
1291
|
+
static VALUE
|
1292
|
+
_wrap_sqlite3_libversion(int argc, VALUE *argv, VALUE self) {
|
1293
|
+
char *result;
|
1294
|
+
VALUE vresult = Qnil;
|
1295
|
+
|
1296
|
+
if ((argc < 0) || (argc > 0))
|
1297
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
|
1298
|
+
result = (char *)sqlite3_libversion();
|
1299
|
+
|
1300
|
+
{
|
1301
|
+
vresult = result ? rb_str_new2(result) : Qnil;
|
1302
|
+
}
|
1303
|
+
return vresult;
|
1304
|
+
}
|
1305
|
+
|
1306
|
+
|
1307
|
+
static VALUE
|
1308
|
+
_wrap_sqlite3_close(int argc, VALUE *argv, VALUE self) {
|
1309
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1310
|
+
int result;
|
1311
|
+
VALUE vresult = Qnil;
|
1312
|
+
|
1313
|
+
if ((argc < 1) || (argc > 1))
|
1314
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1315
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1316
|
+
result = (int)sqlite3_close(arg1);
|
1317
|
+
|
1318
|
+
vresult = INT2NUM(result);
|
1319
|
+
return vresult;
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
|
1323
|
+
static VALUE
|
1324
|
+
_wrap_sqlite3_last_insert_rowid(int argc, VALUE *argv, VALUE self) {
|
1325
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1326
|
+
sqlite_int64 result;
|
1327
|
+
VALUE vresult = Qnil;
|
1328
|
+
|
1329
|
+
if ((argc < 1) || (argc > 1))
|
1330
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1331
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1332
|
+
result = sqlite3_last_insert_rowid(arg1);
|
1333
|
+
|
1334
|
+
{
|
1335
|
+
vresult = rb_ll2inum( result );
|
1336
|
+
}
|
1337
|
+
return vresult;
|
1338
|
+
}
|
1339
|
+
|
1340
|
+
|
1341
|
+
static VALUE
|
1342
|
+
_wrap_sqlite3_changes(int argc, VALUE *argv, VALUE self) {
|
1343
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1344
|
+
int result;
|
1345
|
+
VALUE vresult = Qnil;
|
1346
|
+
|
1347
|
+
if ((argc < 1) || (argc > 1))
|
1348
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1349
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1350
|
+
result = (int)sqlite3_changes(arg1);
|
1351
|
+
|
1352
|
+
vresult = INT2NUM(result);
|
1353
|
+
return vresult;
|
1354
|
+
}
|
1355
|
+
|
1356
|
+
|
1357
|
+
static VALUE
|
1358
|
+
_wrap_sqlite3_total_changes(int argc, VALUE *argv, VALUE self) {
|
1359
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1360
|
+
int result;
|
1361
|
+
VALUE vresult = Qnil;
|
1362
|
+
|
1363
|
+
if ((argc < 1) || (argc > 1))
|
1364
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1365
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1366
|
+
result = (int)sqlite3_total_changes(arg1);
|
1367
|
+
|
1368
|
+
vresult = INT2NUM(result);
|
1369
|
+
return vresult;
|
1370
|
+
}
|
1371
|
+
|
1372
|
+
|
1373
|
+
static VALUE
|
1374
|
+
_wrap_sqlite3_interrupt(int argc, VALUE *argv, VALUE self) {
|
1375
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1376
|
+
|
1377
|
+
if ((argc < 1) || (argc > 1))
|
1378
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1379
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1380
|
+
sqlite3_interrupt(arg1);
|
1381
|
+
|
1382
|
+
return Qnil;
|
1383
|
+
}
|
1384
|
+
|
1385
|
+
|
1386
|
+
static VALUE
|
1387
|
+
_wrap_sqlite3_complete(int argc, VALUE *argv, VALUE self) {
|
1388
|
+
char *arg1 = (char *) 0 ;
|
1389
|
+
int result;
|
1390
|
+
VALUE vresult = Qnil;
|
1391
|
+
|
1392
|
+
if ((argc < 1) || (argc > 1))
|
1393
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1394
|
+
arg1 = StringValuePtr(argv[0]);
|
1395
|
+
result = (int)sqlite3_complete((char const *)arg1);
|
1396
|
+
|
1397
|
+
vresult = INT2NUM(result);
|
1398
|
+
return vresult;
|
1399
|
+
}
|
1400
|
+
|
1401
|
+
|
1402
|
+
static VALUE
|
1403
|
+
_wrap_sqlite3_complete16(int argc, VALUE *argv, VALUE self) {
|
1404
|
+
void *arg1 = (void *) 0 ;
|
1405
|
+
int result;
|
1406
|
+
VALUE vresult = Qnil;
|
1407
|
+
|
1408
|
+
if ((argc < 1) || (argc > 1))
|
1409
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1410
|
+
{
|
1411
|
+
arg1 = (void*)RSTRING_PTR(argv[0]);
|
1412
|
+
}
|
1413
|
+
result = (int)sqlite3_complete16((void const *)arg1);
|
1414
|
+
|
1415
|
+
vresult = INT2NUM(result);
|
1416
|
+
return vresult;
|
1417
|
+
}
|
1418
|
+
|
1419
|
+
|
1420
|
+
static VALUE
|
1421
|
+
_wrap_sqlite3_busy_handler(int argc, VALUE *argv, VALUE self) {
|
1422
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1423
|
+
int (*arg2)(void *,int) = (int (*)(void *,int)) 0 ;
|
1424
|
+
void *arg3 = (void *) 0 ;
|
1425
|
+
int result;
|
1426
|
+
VALUE vresult = Qnil;
|
1427
|
+
|
1428
|
+
if ((argc < 3) || (argc > 3))
|
1429
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
|
1430
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1431
|
+
SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_f_p_void_int__int, 0);
|
1432
|
+
SWIG_ConvertPtr(argv[2], (void **) &arg3, 0, SWIG_POINTER_EXCEPTION|0);
|
1433
|
+
result = (int)sqlite3_busy_handler(arg1,arg2,arg3);
|
1434
|
+
|
1435
|
+
vresult = INT2NUM(result);
|
1436
|
+
return vresult;
|
1437
|
+
}
|
1438
|
+
|
1439
|
+
|
1440
|
+
static VALUE
|
1441
|
+
_wrap_sqlite3_busy_timeout(int argc, VALUE *argv, VALUE self) {
|
1442
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1443
|
+
int arg2 ;
|
1444
|
+
int result;
|
1445
|
+
VALUE vresult = Qnil;
|
1446
|
+
|
1447
|
+
if ((argc < 2) || (argc > 2))
|
1448
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
1449
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1450
|
+
arg2 = NUM2INT(argv[1]);
|
1451
|
+
result = (int)sqlite3_busy_timeout(arg1,arg2);
|
1452
|
+
|
1453
|
+
vresult = INT2NUM(result);
|
1454
|
+
return vresult;
|
1455
|
+
}
|
1456
|
+
|
1457
|
+
|
1458
|
+
static VALUE
|
1459
|
+
_wrap_sqlite3_set_authorizer(int argc, VALUE *argv, VALUE self) {
|
1460
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1461
|
+
int (*arg2)(void *,int,char const *,char const *,char const *,char const *) = (int (*)(void *,int,char const *,char const *,char const *,char const *)) 0 ;
|
1462
|
+
void *arg3 = (void *) 0 ;
|
1463
|
+
int result;
|
1464
|
+
VALUE vresult = Qnil;
|
1465
|
+
|
1466
|
+
if ((argc < 3) || (argc > 3))
|
1467
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
|
1468
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1469
|
+
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);
|
1470
|
+
SWIG_ConvertPtr(argv[2], (void **) &arg3, 0, SWIG_POINTER_EXCEPTION|0);
|
1471
|
+
result = (int)sqlite3_set_authorizer(arg1,arg2,arg3);
|
1472
|
+
|
1473
|
+
vresult = INT2NUM(result);
|
1474
|
+
return vresult;
|
1475
|
+
}
|
1476
|
+
|
1477
|
+
|
1478
|
+
static VALUE
|
1479
|
+
_wrap_sqlite3_trace(int argc, VALUE *argv, VALUE self) {
|
1480
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1481
|
+
void (*arg2)(void *,char const *) = (void (*)(void *,char const *)) 0 ;
|
1482
|
+
void *arg3 = (void *) 0 ;
|
1483
|
+
int result;
|
1484
|
+
VALUE vresult = Qnil;
|
1485
|
+
|
1486
|
+
if ((argc < 3) || (argc > 3))
|
1487
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
|
1488
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1489
|
+
SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_f_p_void_p_q_const__char__void, 0);
|
1490
|
+
SWIG_ConvertPtr(argv[2], (void **) &arg3, 0, SWIG_POINTER_EXCEPTION|0);
|
1491
|
+
result = (int)sqlite3_trace(arg1,arg2,arg3);
|
1492
|
+
|
1493
|
+
vresult = INT2NUM(result);
|
1494
|
+
return vresult;
|
1495
|
+
}
|
1496
|
+
|
1497
|
+
|
1498
|
+
static VALUE
|
1499
|
+
_wrap_sqlite3_open(int argc, VALUE *argv, VALUE self) {
|
1500
|
+
char *arg1 = (char *) 0 ;
|
1501
|
+
sqlite3 **arg2 = (sqlite3 **) 0 ;
|
1502
|
+
int result;
|
1503
|
+
VALUE vresult = Qnil;
|
1504
|
+
|
1505
|
+
if ((argc < 1) || (argc > 1))
|
1506
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1507
|
+
{
|
1508
|
+
arg1 = STR2CSTR(argv[0]);
|
1509
|
+
arg2 = (sqlite3**)malloc( sizeof( sqlite3* ) );
|
1510
|
+
}
|
1511
|
+
result = (int)sqlite3_open((char const *)arg1,arg2);
|
1512
|
+
|
1513
|
+
vresult = INT2NUM(result);
|
1514
|
+
{
|
1515
|
+
VALUE ary;
|
1516
|
+
ary = rb_ary_new2(2);
|
1517
|
+
rb_ary_push( ary, vresult );
|
1518
|
+
rb_ary_push( ary, SWIG_NewPointerObj( *arg2, SWIGTYPE_p_sqlite3, 0 ) );
|
1519
|
+
free( arg2 );
|
1520
|
+
vresult = ary;
|
1521
|
+
}
|
1522
|
+
return vresult;
|
1523
|
+
}
|
1524
|
+
|
1525
|
+
|
1526
|
+
static VALUE
|
1527
|
+
_wrap_sqlite3_open16(int argc, VALUE *argv, VALUE self) {
|
1528
|
+
void *arg1 = (void *) 0 ;
|
1529
|
+
sqlite3 **arg2 = (sqlite3 **) 0 ;
|
1530
|
+
int result;
|
1531
|
+
VALUE vresult = Qnil;
|
1532
|
+
|
1533
|
+
if ((argc < 1) || (argc > 1))
|
1534
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1535
|
+
{
|
1536
|
+
arg1 = (void*)RSTRING_PTR(argv[0]);
|
1537
|
+
arg2 = (sqlite3**)malloc( sizeof( sqlite3* ) );
|
1538
|
+
}
|
1539
|
+
result = (int)sqlite3_open16((void const *)arg1,arg2);
|
1540
|
+
|
1541
|
+
vresult = INT2NUM(result);
|
1542
|
+
{
|
1543
|
+
VALUE ary;
|
1544
|
+
ary = rb_ary_new2(2);
|
1545
|
+
rb_ary_push( ary, vresult );
|
1546
|
+
rb_ary_push( ary, SWIG_NewPointerObj( *arg2, SWIGTYPE_p_sqlite3, 0 ) );
|
1547
|
+
free( arg2 );
|
1548
|
+
vresult = ary;
|
1549
|
+
}
|
1550
|
+
return vresult;
|
1551
|
+
}
|
1552
|
+
|
1553
|
+
|
1554
|
+
static VALUE
|
1555
|
+
_wrap_sqlite3_errcode(int argc, VALUE *argv, VALUE self) {
|
1556
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1557
|
+
int result;
|
1558
|
+
VALUE vresult = Qnil;
|
1559
|
+
|
1560
|
+
if ((argc < 1) || (argc > 1))
|
1561
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1562
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1563
|
+
result = (int)sqlite3_errcode(arg1);
|
1564
|
+
|
1565
|
+
vresult = INT2NUM(result);
|
1566
|
+
return vresult;
|
1567
|
+
}
|
1568
|
+
|
1569
|
+
|
1570
|
+
static VALUE
|
1571
|
+
_wrap_sqlite3_errmsg(int argc, VALUE *argv, VALUE self) {
|
1572
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1573
|
+
char *result;
|
1574
|
+
VALUE vresult = Qnil;
|
1575
|
+
|
1576
|
+
if ((argc < 1) || (argc > 1))
|
1577
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1578
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1579
|
+
result = (char *)sqlite3_errmsg(arg1);
|
1580
|
+
|
1581
|
+
{
|
1582
|
+
vresult = result ? rb_str_new2(result) : Qnil;
|
1583
|
+
}
|
1584
|
+
return vresult;
|
1585
|
+
}
|
1586
|
+
|
1587
|
+
|
1588
|
+
static VALUE
|
1589
|
+
_wrap_sqlite3_errmsg16(int argc, VALUE *argv, VALUE self) {
|
1590
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1591
|
+
void *result;
|
1592
|
+
VALUE vresult = Qnil;
|
1593
|
+
|
1594
|
+
if ((argc < 1) || (argc > 1))
|
1595
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1596
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1597
|
+
result = (void *)sqlite3_errmsg16(arg1);
|
1598
|
+
|
1599
|
+
{
|
1600
|
+
int i;
|
1601
|
+
if( result ) {
|
1602
|
+
for( i = 0; ((char*)result)[i]; i += 2 );
|
1603
|
+
vresult = rb_str_new( (char*)result, i );
|
1604
|
+
} else vresult = Qnil;
|
1605
|
+
}
|
1606
|
+
return vresult;
|
1607
|
+
}
|
1608
|
+
|
1609
|
+
|
1610
|
+
static VALUE
|
1611
|
+
_wrap_sqlite3_prepare(int argc, VALUE *argv, VALUE self) {
|
1612
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1613
|
+
char *arg2 = (char *) 0 ;
|
1614
|
+
int arg3 ;
|
1615
|
+
sqlite3_stmt **arg4 = (sqlite3_stmt **) 0 ;
|
1616
|
+
char **arg5 = (char **) 0 ;
|
1617
|
+
int result;
|
1618
|
+
sqlite3_stmt *stmt2 ;
|
1619
|
+
char *errmsg2 ;
|
1620
|
+
VALUE vresult = Qnil;
|
1621
|
+
|
1622
|
+
if ((argc < 2) || (argc > 2))
|
1623
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
1624
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1625
|
+
{
|
1626
|
+
arg2 = RSTRING_PTR(argv[1]);
|
1627
|
+
arg3 = RSTRING_LEN(argv[1]);
|
1628
|
+
arg4 = &stmt2;
|
1629
|
+
arg5 = &errmsg2;
|
1630
|
+
}
|
1631
|
+
result = (int)sqlite3_prepare(arg1,(char const *)arg2,arg3,arg4,(char const **)arg5);
|
1632
|
+
|
1633
|
+
vresult = INT2NUM(result);
|
1634
|
+
{
|
1635
|
+
VALUE ary;
|
1636
|
+
ary = rb_ary_new2(3);
|
1637
|
+
rb_ary_push( ary, vresult );
|
1638
|
+
rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
|
1639
|
+
rb_ary_push( ary, errmsg2 ? rb_str_new2( errmsg2 ) : Qnil );
|
1640
|
+
vresult = ary;
|
1641
|
+
}
|
1642
|
+
return vresult;
|
1643
|
+
}
|
1644
|
+
|
1645
|
+
|
1646
|
+
static VALUE
|
1647
|
+
_wrap_sqlite3_prepare16(int argc, VALUE *argv, VALUE self) {
|
1648
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
1649
|
+
void *arg2 = (void *) 0 ;
|
1650
|
+
int arg3 ;
|
1651
|
+
sqlite3_stmt **arg4 = (sqlite3_stmt **) 0 ;
|
1652
|
+
void **arg5 = (void **) 0 ;
|
1653
|
+
int result;
|
1654
|
+
sqlite3_stmt *stmt2 ;
|
1655
|
+
void *errmsg2 ;
|
1656
|
+
VALUE vresult = Qnil;
|
1657
|
+
|
1658
|
+
if ((argc < 2) || (argc > 2))
|
1659
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
1660
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
1661
|
+
{
|
1662
|
+
arg2 = RSTRING_PTR(argv[1]);
|
1663
|
+
arg3 = RSTRING_LEN(argv[1]);
|
1664
|
+
arg4 = &stmt2;
|
1665
|
+
arg5 = &errmsg2;
|
1666
|
+
}
|
1667
|
+
result = (int)sqlite3_prepare16(arg1,(void const *)arg2,arg3,arg4,(void const **)arg5);
|
1668
|
+
|
1669
|
+
vresult = INT2NUM(result);
|
1670
|
+
{
|
1671
|
+
VALUE ary;
|
1672
|
+
int i;
|
1673
|
+
|
1674
|
+
for( i = 0; ((char*)errmsg2)[i]; i += 2 );
|
1675
|
+
|
1676
|
+
ary = rb_ary_new2(3);
|
1677
|
+
rb_ary_push( ary, vresult );
|
1678
|
+
rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
|
1679
|
+
rb_ary_push( ary, errmsg2 ? rb_str_new( (char*)errmsg2, i ) : Qnil );
|
1680
|
+
vresult = ary;
|
1681
|
+
}
|
1682
|
+
return vresult;
|
1683
|
+
}
|
1684
|
+
|
1685
|
+
|
1686
|
+
static VALUE
|
1687
|
+
_wrap_sqlite3_bind_blob(int argc, VALUE *argv, VALUE self) {
|
1688
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1689
|
+
int arg2 ;
|
1690
|
+
void *arg3 = (void *) 0 ;
|
1691
|
+
int arg4 ;
|
1692
|
+
void (*arg5)(void *) = (void (*)(void *)) 0 ;
|
1693
|
+
int result;
|
1694
|
+
VALUE vresult = Qnil;
|
1695
|
+
|
1696
|
+
if ((argc < 3) || (argc > 3))
|
1697
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
|
1698
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1699
|
+
arg2 = NUM2INT(argv[1]);
|
1700
|
+
{
|
1701
|
+
arg3 = (void*)RSTRING_PTR(argv[2]);
|
1702
|
+
arg4 = RSTRING_LEN(argv[2]);
|
1703
|
+
arg5 = SQLITE_TRANSIENT;
|
1704
|
+
}
|
1705
|
+
result = (int)sqlite3_bind_blob(arg1,arg2,(void const *)arg3,arg4,arg5);
|
1706
|
+
|
1707
|
+
vresult = INT2NUM(result);
|
1708
|
+
return vresult;
|
1709
|
+
}
|
1710
|
+
|
1711
|
+
|
1712
|
+
static VALUE
|
1713
|
+
_wrap_sqlite3_bind_double(int argc, VALUE *argv, VALUE self) {
|
1714
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1715
|
+
int arg2 ;
|
1716
|
+
double arg3 ;
|
1717
|
+
int result;
|
1718
|
+
VALUE vresult = Qnil;
|
1719
|
+
|
1720
|
+
if ((argc < 3) || (argc > 3))
|
1721
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
|
1722
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1723
|
+
arg2 = NUM2INT(argv[1]);
|
1724
|
+
arg3 = (double) NUM2DBL(argv[2]);
|
1725
|
+
result = (int)sqlite3_bind_double(arg1,arg2,arg3);
|
1726
|
+
|
1727
|
+
vresult = INT2NUM(result);
|
1728
|
+
return vresult;
|
1729
|
+
}
|
1730
|
+
|
1731
|
+
|
1732
|
+
static VALUE
|
1733
|
+
_wrap_sqlite3_bind_int(int argc, VALUE *argv, VALUE self) {
|
1734
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1735
|
+
int arg2 ;
|
1736
|
+
int arg3 ;
|
1737
|
+
int result;
|
1738
|
+
VALUE vresult = Qnil;
|
1739
|
+
|
1740
|
+
if ((argc < 3) || (argc > 3))
|
1741
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
|
1742
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1743
|
+
arg2 = NUM2INT(argv[1]);
|
1744
|
+
arg3 = NUM2INT(argv[2]);
|
1745
|
+
result = (int)sqlite3_bind_int(arg1,arg2,arg3);
|
1746
|
+
|
1747
|
+
vresult = INT2NUM(result);
|
1748
|
+
return vresult;
|
1749
|
+
}
|
1750
|
+
|
1751
|
+
|
1752
|
+
static VALUE
|
1753
|
+
_wrap_sqlite3_bind_int64(int argc, VALUE *argv, VALUE self) {
|
1754
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1755
|
+
int arg2 ;
|
1756
|
+
sqlite_int64 arg3 ;
|
1757
|
+
int result;
|
1758
|
+
VALUE vresult = Qnil;
|
1759
|
+
|
1760
|
+
if ((argc < 3) || (argc > 3))
|
1761
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
|
1762
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1763
|
+
arg2 = NUM2INT(argv[1]);
|
1764
|
+
{
|
1765
|
+
arg3 = rb_num2ll( argv[2] );
|
1766
|
+
}
|
1767
|
+
result = (int)sqlite3_bind_int64(arg1,arg2,arg3);
|
1768
|
+
|
1769
|
+
vresult = INT2NUM(result);
|
1770
|
+
return vresult;
|
1771
|
+
}
|
1772
|
+
|
1773
|
+
|
1774
|
+
static VALUE
|
1775
|
+
_wrap_sqlite3_bind_null(int argc, VALUE *argv, VALUE self) {
|
1776
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1777
|
+
int arg2 ;
|
1778
|
+
int result;
|
1779
|
+
VALUE vresult = Qnil;
|
1780
|
+
|
1781
|
+
if ((argc < 2) || (argc > 2))
|
1782
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
1783
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1784
|
+
arg2 = NUM2INT(argv[1]);
|
1785
|
+
result = (int)sqlite3_bind_null(arg1,arg2);
|
1786
|
+
|
1787
|
+
vresult = INT2NUM(result);
|
1788
|
+
return vresult;
|
1789
|
+
}
|
1790
|
+
|
1791
|
+
|
1792
|
+
static VALUE
|
1793
|
+
_wrap_sqlite3_bind_text(int argc, VALUE *argv, VALUE self) {
|
1794
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1795
|
+
int arg2 ;
|
1796
|
+
char *arg3 = (char *) 0 ;
|
1797
|
+
int arg4 ;
|
1798
|
+
void (*arg5)(void *) = (void (*)(void *)) 0 ;
|
1799
|
+
int result;
|
1800
|
+
VALUE vresult = Qnil;
|
1801
|
+
|
1802
|
+
if ((argc < 3) || (argc > 3))
|
1803
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
|
1804
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1805
|
+
arg2 = NUM2INT(argv[1]);
|
1806
|
+
{
|
1807
|
+
arg3 = RSTRING_PTR(argv[2]);
|
1808
|
+
arg4 = RSTRING_LEN(argv[2]);
|
1809
|
+
arg5 = SQLITE_TRANSIENT;
|
1810
|
+
}
|
1811
|
+
result = (int)sqlite3_bind_text(arg1,arg2,(char const *)arg3,arg4,arg5);
|
1812
|
+
|
1813
|
+
vresult = INT2NUM(result);
|
1814
|
+
return vresult;
|
1815
|
+
}
|
1816
|
+
|
1817
|
+
|
1818
|
+
static VALUE
|
1819
|
+
_wrap_sqlite3_bind_text16(int argc, VALUE *argv, VALUE self) {
|
1820
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1821
|
+
int arg2 ;
|
1822
|
+
void *arg3 = (void *) 0 ;
|
1823
|
+
int arg4 ;
|
1824
|
+
void (*arg5)(void *) = (void (*)(void *)) 0 ;
|
1825
|
+
int result;
|
1826
|
+
VALUE vresult = Qnil;
|
1827
|
+
|
1828
|
+
if ((argc < 3) || (argc > 3))
|
1829
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
|
1830
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1831
|
+
arg2 = NUM2INT(argv[1]);
|
1832
|
+
{
|
1833
|
+
arg3 = (void*)RSTRING_PTR(argv[2]);
|
1834
|
+
arg4 = RSTRING_LEN(argv[2]);
|
1835
|
+
arg5 = SQLITE_TRANSIENT;
|
1836
|
+
}
|
1837
|
+
result = (int)sqlite3_bind_text16(arg1,arg2,(void const *)arg3,arg4,arg5);
|
1838
|
+
|
1839
|
+
vresult = INT2NUM(result);
|
1840
|
+
return vresult;
|
1841
|
+
}
|
1842
|
+
|
1843
|
+
|
1844
|
+
static VALUE
|
1845
|
+
_wrap_sqlite3_bind_parameter_count(int argc, VALUE *argv, VALUE self) {
|
1846
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1847
|
+
int result;
|
1848
|
+
VALUE vresult = Qnil;
|
1849
|
+
|
1850
|
+
if ((argc < 1) || (argc > 1))
|
1851
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1852
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1853
|
+
result = (int)sqlite3_bind_parameter_count(arg1);
|
1854
|
+
|
1855
|
+
vresult = INT2NUM(result);
|
1856
|
+
return vresult;
|
1857
|
+
}
|
1858
|
+
|
1859
|
+
|
1860
|
+
static VALUE
|
1861
|
+
_wrap_sqlite3_bind_parameter_name(int argc, VALUE *argv, VALUE self) {
|
1862
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1863
|
+
int arg2 ;
|
1864
|
+
char *result;
|
1865
|
+
VALUE vresult = Qnil;
|
1866
|
+
|
1867
|
+
if ((argc < 2) || (argc > 2))
|
1868
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
1869
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1870
|
+
arg2 = NUM2INT(argv[1]);
|
1871
|
+
result = (char *)sqlite3_bind_parameter_name(arg1,arg2);
|
1872
|
+
|
1873
|
+
{
|
1874
|
+
vresult = result ? rb_str_new2(result) : Qnil;
|
1875
|
+
}
|
1876
|
+
return vresult;
|
1877
|
+
}
|
1878
|
+
|
1879
|
+
|
1880
|
+
static VALUE
|
1881
|
+
_wrap_sqlite3_bind_parameter_index(int argc, VALUE *argv, VALUE self) {
|
1882
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1883
|
+
char *arg2 = (char *) 0 ;
|
1884
|
+
int result;
|
1885
|
+
VALUE vresult = Qnil;
|
1886
|
+
|
1887
|
+
if ((argc < 2) || (argc > 2))
|
1888
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
1889
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1890
|
+
arg2 = StringValuePtr(argv[1]);
|
1891
|
+
result = (int)sqlite3_bind_parameter_index(arg1,(char const *)arg2);
|
1892
|
+
|
1893
|
+
vresult = INT2NUM(result);
|
1894
|
+
return vresult;
|
1895
|
+
}
|
1896
|
+
|
1897
|
+
|
1898
|
+
static VALUE
|
1899
|
+
_wrap_sqlite3_column_count(int argc, VALUE *argv, VALUE self) {
|
1900
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1901
|
+
int result;
|
1902
|
+
VALUE vresult = Qnil;
|
1903
|
+
|
1904
|
+
if ((argc < 1) || (argc > 1))
|
1905
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
1906
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1907
|
+
result = (int)sqlite3_column_count(arg1);
|
1908
|
+
|
1909
|
+
vresult = INT2NUM(result);
|
1910
|
+
return vresult;
|
1911
|
+
}
|
1912
|
+
|
1913
|
+
|
1914
|
+
static VALUE
|
1915
|
+
_wrap_sqlite3_column_name(int argc, VALUE *argv, VALUE self) {
|
1916
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1917
|
+
int arg2 ;
|
1918
|
+
char *result;
|
1919
|
+
VALUE vresult = Qnil;
|
1920
|
+
|
1921
|
+
if ((argc < 2) || (argc > 2))
|
1922
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
1923
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1924
|
+
arg2 = NUM2INT(argv[1]);
|
1925
|
+
result = (char *)sqlite3_column_name(arg1,arg2);
|
1926
|
+
|
1927
|
+
{
|
1928
|
+
vresult = result ? rb_str_new2(result) : Qnil;
|
1929
|
+
}
|
1930
|
+
return vresult;
|
1931
|
+
}
|
1932
|
+
|
1933
|
+
|
1934
|
+
static VALUE
|
1935
|
+
_wrap_sqlite3_column_name16(int argc, VALUE *argv, VALUE self) {
|
1936
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1937
|
+
int arg2 ;
|
1938
|
+
void *result;
|
1939
|
+
VALUE vresult = Qnil;
|
1940
|
+
|
1941
|
+
if ((argc < 2) || (argc > 2))
|
1942
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
1943
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1944
|
+
arg2 = NUM2INT(argv[1]);
|
1945
|
+
result = (void *)sqlite3_column_name16(arg1,arg2);
|
1946
|
+
|
1947
|
+
{
|
1948
|
+
int i;
|
1949
|
+
if( result ) {
|
1950
|
+
for( i = 0; ((char*)result)[i]; i += 2 );
|
1951
|
+
vresult = rb_str_new( (char*)result, i );
|
1952
|
+
} else vresult = Qnil;
|
1953
|
+
}
|
1954
|
+
return vresult;
|
1955
|
+
}
|
1956
|
+
|
1957
|
+
|
1958
|
+
static VALUE
|
1959
|
+
_wrap_sqlite3_column_decltype(int argc, VALUE *argv, VALUE self) {
|
1960
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1961
|
+
int arg2 ;
|
1962
|
+
char *result;
|
1963
|
+
VALUE vresult = Qnil;
|
1964
|
+
|
1965
|
+
if ((argc < 2) || (argc > 2))
|
1966
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
1967
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1968
|
+
arg2 = NUM2INT(argv[1]);
|
1969
|
+
result = (char *)sqlite3_column_decltype(arg1,arg2);
|
1970
|
+
|
1971
|
+
{
|
1972
|
+
vresult = result ? rb_str_new2(result) : Qnil;
|
1973
|
+
}
|
1974
|
+
return vresult;
|
1975
|
+
}
|
1976
|
+
|
1977
|
+
|
1978
|
+
static VALUE
|
1979
|
+
_wrap_sqlite3_column_decltype16(int argc, VALUE *argv, VALUE self) {
|
1980
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
1981
|
+
int arg2 ;
|
1982
|
+
void *result;
|
1983
|
+
VALUE vresult = Qnil;
|
1984
|
+
|
1985
|
+
if ((argc < 2) || (argc > 2))
|
1986
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
1987
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
1988
|
+
arg2 = NUM2INT(argv[1]);
|
1989
|
+
result = (void *)sqlite3_column_decltype16(arg1,arg2);
|
1990
|
+
|
1991
|
+
{
|
1992
|
+
int i;
|
1993
|
+
if( result ) {
|
1994
|
+
for( i = 0; ((char*)result)[i]; i += 2 );
|
1995
|
+
vresult = rb_str_new( (char*)result, i );
|
1996
|
+
} else vresult = Qnil;
|
1997
|
+
}
|
1998
|
+
return vresult;
|
1999
|
+
}
|
2000
|
+
|
2001
|
+
|
2002
|
+
static VALUE
|
2003
|
+
_wrap_sqlite3_step(int argc, VALUE *argv, VALUE self) {
|
2004
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2005
|
+
int result;
|
2006
|
+
VALUE vresult = Qnil;
|
2007
|
+
|
2008
|
+
if ((argc < 1) || (argc > 1))
|
2009
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2010
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2011
|
+
result = (int)sqlite3_step(arg1);
|
2012
|
+
|
2013
|
+
vresult = INT2NUM(result);
|
2014
|
+
return vresult;
|
2015
|
+
}
|
2016
|
+
|
2017
|
+
|
2018
|
+
static VALUE
|
2019
|
+
_wrap_sqlite3_data_count(int argc, VALUE *argv, VALUE self) {
|
2020
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2021
|
+
int result;
|
2022
|
+
VALUE vresult = Qnil;
|
2023
|
+
|
2024
|
+
if ((argc < 1) || (argc > 1))
|
2025
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2026
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2027
|
+
result = (int)sqlite3_data_count(arg1);
|
2028
|
+
|
2029
|
+
vresult = INT2NUM(result);
|
2030
|
+
return vresult;
|
2031
|
+
}
|
2032
|
+
|
2033
|
+
|
2034
|
+
static VALUE
|
2035
|
+
_wrap_sqlite3_column_blob(int argc, VALUE *argv, VALUE self) {
|
2036
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2037
|
+
int arg2 ;
|
2038
|
+
RUBY_BLOB *result;
|
2039
|
+
VALUE vresult = Qnil;
|
2040
|
+
|
2041
|
+
if ((argc < 2) || (argc > 2))
|
2042
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2043
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2044
|
+
arg2 = NUM2INT(argv[1]);
|
2045
|
+
result = (RUBY_BLOB *)sqlite3_column_blob(arg1,arg2);
|
2046
|
+
|
2047
|
+
{
|
2048
|
+
vresult = result ?
|
2049
|
+
rb_str_new( (char*)result, sqlite3_column_bytes( arg1, arg2 ) ) : Qnil;
|
2050
|
+
}
|
2051
|
+
return vresult;
|
2052
|
+
}
|
2053
|
+
|
2054
|
+
|
2055
|
+
static VALUE
|
2056
|
+
_wrap_sqlite3_column_bytes(int argc, VALUE *argv, VALUE self) {
|
2057
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2058
|
+
int arg2 ;
|
2059
|
+
int result;
|
2060
|
+
VALUE vresult = Qnil;
|
2061
|
+
|
2062
|
+
if ((argc < 2) || (argc > 2))
|
2063
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2064
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2065
|
+
arg2 = NUM2INT(argv[1]);
|
2066
|
+
result = (int)sqlite3_column_bytes(arg1,arg2);
|
2067
|
+
|
2068
|
+
vresult = INT2NUM(result);
|
2069
|
+
return vresult;
|
2070
|
+
}
|
2071
|
+
|
2072
|
+
|
2073
|
+
static VALUE
|
2074
|
+
_wrap_sqlite3_column_bytes16(int argc, VALUE *argv, VALUE self) {
|
2075
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2076
|
+
int arg2 ;
|
2077
|
+
int result;
|
2078
|
+
VALUE vresult = Qnil;
|
2079
|
+
|
2080
|
+
if ((argc < 2) || (argc > 2))
|
2081
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2082
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2083
|
+
arg2 = NUM2INT(argv[1]);
|
2084
|
+
result = (int)sqlite3_column_bytes16(arg1,arg2);
|
2085
|
+
|
2086
|
+
vresult = INT2NUM(result);
|
2087
|
+
return vresult;
|
2088
|
+
}
|
2089
|
+
|
2090
|
+
|
2091
|
+
static VALUE
|
2092
|
+
_wrap_sqlite3_column_double(int argc, VALUE *argv, VALUE self) {
|
2093
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2094
|
+
int arg2 ;
|
2095
|
+
double result;
|
2096
|
+
VALUE vresult = Qnil;
|
2097
|
+
|
2098
|
+
if ((argc < 2) || (argc > 2))
|
2099
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2100
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2101
|
+
arg2 = NUM2INT(argv[1]);
|
2102
|
+
result = (double)sqlite3_column_double(arg1,arg2);
|
2103
|
+
|
2104
|
+
vresult = rb_float_new(result);
|
2105
|
+
return vresult;
|
2106
|
+
}
|
2107
|
+
|
2108
|
+
|
2109
|
+
static VALUE
|
2110
|
+
_wrap_sqlite3_column_int(int argc, VALUE *argv, VALUE self) {
|
2111
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2112
|
+
int arg2 ;
|
2113
|
+
double result;
|
2114
|
+
VALUE vresult = Qnil;
|
2115
|
+
|
2116
|
+
if ((argc < 2) || (argc > 2))
|
2117
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2118
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2119
|
+
arg2 = NUM2INT(argv[1]);
|
2120
|
+
result = (double)sqlite3_column_int(arg1,arg2);
|
2121
|
+
|
2122
|
+
vresult = rb_float_new(result);
|
2123
|
+
return vresult;
|
2124
|
+
}
|
2125
|
+
|
2126
|
+
|
2127
|
+
static VALUE
|
2128
|
+
_wrap_sqlite3_column_int64(int argc, VALUE *argv, VALUE self) {
|
2129
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2130
|
+
int arg2 ;
|
2131
|
+
sqlite_int64 result;
|
2132
|
+
VALUE vresult = Qnil;
|
2133
|
+
|
2134
|
+
if ((argc < 2) || (argc > 2))
|
2135
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2136
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2137
|
+
arg2 = NUM2INT(argv[1]);
|
2138
|
+
result = sqlite3_column_int64(arg1,arg2);
|
2139
|
+
|
2140
|
+
{
|
2141
|
+
vresult = rb_ll2inum( result );
|
2142
|
+
}
|
2143
|
+
return vresult;
|
2144
|
+
}
|
2145
|
+
|
2146
|
+
|
2147
|
+
static VALUE
|
2148
|
+
_wrap_sqlite3_column_text(int argc, VALUE *argv, VALUE self) {
|
2149
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2150
|
+
int arg2 ;
|
2151
|
+
char *result;
|
2152
|
+
VALUE vresult = Qnil;
|
2153
|
+
|
2154
|
+
if ((argc < 2) || (argc > 2))
|
2155
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2156
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2157
|
+
arg2 = NUM2INT(argv[1]);
|
2158
|
+
result = (char *)sqlite3_column_text(arg1,arg2);
|
2159
|
+
|
2160
|
+
{
|
2161
|
+
vresult = result ? rb_str_new2(result) : Qnil;
|
2162
|
+
}
|
2163
|
+
return vresult;
|
2164
|
+
}
|
2165
|
+
|
2166
|
+
|
2167
|
+
static VALUE
|
2168
|
+
_wrap_sqlite3_column_text16(int argc, VALUE *argv, VALUE self) {
|
2169
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2170
|
+
int arg2 ;
|
2171
|
+
void *result;
|
2172
|
+
VALUE vresult = Qnil;
|
2173
|
+
|
2174
|
+
if ((argc < 2) || (argc > 2))
|
2175
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2176
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2177
|
+
arg2 = NUM2INT(argv[1]);
|
2178
|
+
result = (void *)sqlite3_column_text16(arg1,arg2);
|
2179
|
+
|
2180
|
+
{
|
2181
|
+
int i;
|
2182
|
+
if( result ) {
|
2183
|
+
for( i = 0; ((char*)result)[i]; i += 2 );
|
2184
|
+
vresult = rb_str_new( (char*)result, i );
|
2185
|
+
} else vresult = Qnil;
|
2186
|
+
}
|
2187
|
+
return vresult;
|
2188
|
+
}
|
2189
|
+
|
2190
|
+
|
2191
|
+
static VALUE
|
2192
|
+
_wrap_sqlite3_column_type(int argc, VALUE *argv, VALUE self) {
|
2193
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2194
|
+
int arg2 ;
|
2195
|
+
int result;
|
2196
|
+
VALUE vresult = Qnil;
|
2197
|
+
|
2198
|
+
if ((argc < 2) || (argc > 2))
|
2199
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2200
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2201
|
+
arg2 = NUM2INT(argv[1]);
|
2202
|
+
result = (int)sqlite3_column_type(arg1,arg2);
|
2203
|
+
|
2204
|
+
vresult = INT2NUM(result);
|
2205
|
+
return vresult;
|
2206
|
+
}
|
2207
|
+
|
2208
|
+
|
2209
|
+
static VALUE
|
2210
|
+
_wrap_sqlite3_finalize(int argc, VALUE *argv, VALUE self) {
|
2211
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2212
|
+
int result;
|
2213
|
+
VALUE vresult = Qnil;
|
2214
|
+
|
2215
|
+
if ((argc < 1) || (argc > 1))
|
2216
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2217
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2218
|
+
result = (int)sqlite3_finalize(arg1);
|
2219
|
+
|
2220
|
+
vresult = INT2NUM(result);
|
2221
|
+
return vresult;
|
2222
|
+
}
|
2223
|
+
|
2224
|
+
|
2225
|
+
static VALUE
|
2226
|
+
_wrap_sqlite3_reset(int argc, VALUE *argv, VALUE self) {
|
2227
|
+
sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
|
2228
|
+
int result;
|
2229
|
+
VALUE vresult = Qnil;
|
2230
|
+
|
2231
|
+
if ((argc < 1) || (argc > 1))
|
2232
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2233
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
|
2234
|
+
result = (int)sqlite3_reset(arg1);
|
2235
|
+
|
2236
|
+
vresult = INT2NUM(result);
|
2237
|
+
return vresult;
|
2238
|
+
}
|
2239
|
+
|
2240
|
+
|
2241
|
+
static VALUE
|
2242
|
+
_wrap_sqlite3_create_function(int argc, VALUE *argv, VALUE self) {
|
2243
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
2244
|
+
char *arg2 = (char *) 0 ;
|
2245
|
+
int arg3 ;
|
2246
|
+
int arg4 ;
|
2247
|
+
void *arg5 = (void *) 0 ;
|
2248
|
+
void (*arg6)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
|
2249
|
+
void (*arg7)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
|
2250
|
+
void (*arg8)(sqlite3_context *) = (void (*)(sqlite3_context *)) 0 ;
|
2251
|
+
int result;
|
2252
|
+
VALUE vresult = Qnil;
|
2253
|
+
|
2254
|
+
if ((argc < 8) || (argc > 8))
|
2255
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 8)",argc);
|
2256
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
2257
|
+
arg2 = StringValuePtr(argv[1]);
|
2258
|
+
arg3 = NUM2INT(argv[2]);
|
2259
|
+
arg4 = NUM2INT(argv[3]);
|
2260
|
+
SWIG_ConvertPtr(argv[4], (void **) &arg5, 0, SWIG_POINTER_EXCEPTION|0);
|
2261
|
+
SWIG_ConvertPtr(argv[5], (void **) &arg6, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
|
2262
|
+
SWIG_ConvertPtr(argv[6], (void **) &arg7, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
|
2263
|
+
SWIG_ConvertPtr(argv[7], (void **) &arg8, SWIGTYPE_p_f_p_sqlite3_context__void, 0);
|
2264
|
+
result = (int)sqlite3_create_function(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8);
|
2265
|
+
|
2266
|
+
vresult = INT2NUM(result);
|
2267
|
+
return vresult;
|
2268
|
+
}
|
2269
|
+
|
2270
|
+
|
2271
|
+
static VALUE
|
2272
|
+
_wrap_sqlite3_create_function16(int argc, VALUE *argv, VALUE self) {
|
2273
|
+
sqlite3 *arg1 = (sqlite3 *) 0 ;
|
2274
|
+
void *arg2 = (void *) 0 ;
|
2275
|
+
int arg3 ;
|
2276
|
+
int arg4 ;
|
2277
|
+
void *arg5 = (void *) 0 ;
|
2278
|
+
void (*arg6)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
|
2279
|
+
void (*arg7)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
|
2280
|
+
void (*arg8)(sqlite3_context *) = (void (*)(sqlite3_context *)) 0 ;
|
2281
|
+
int result;
|
2282
|
+
VALUE vresult = Qnil;
|
2283
|
+
|
2284
|
+
if ((argc < 8) || (argc > 8))
|
2285
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 8)",argc);
|
2286
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
|
2287
|
+
{
|
2288
|
+
arg2 = (void*)RSTRING_PTR(argv[1]);
|
2289
|
+
}
|
2290
|
+
arg3 = NUM2INT(argv[2]);
|
2291
|
+
arg4 = NUM2INT(argv[3]);
|
2292
|
+
SWIG_ConvertPtr(argv[4], (void **) &arg5, 0, SWIG_POINTER_EXCEPTION|0);
|
2293
|
+
SWIG_ConvertPtr(argv[5], (void **) &arg6, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
|
2294
|
+
SWIG_ConvertPtr(argv[6], (void **) &arg7, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
|
2295
|
+
SWIG_ConvertPtr(argv[7], (void **) &arg8, SWIGTYPE_p_f_p_sqlite3_context__void, 0);
|
2296
|
+
result = (int)sqlite3_create_function16(arg1,(void const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8);
|
2297
|
+
|
2298
|
+
vresult = INT2NUM(result);
|
2299
|
+
return vresult;
|
2300
|
+
}
|
2301
|
+
|
2302
|
+
|
2303
|
+
static VALUE
|
2304
|
+
_wrap_sqlite3_aggregate_count(int argc, VALUE *argv, VALUE self) {
|
2305
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2306
|
+
int result;
|
2307
|
+
VALUE vresult = Qnil;
|
2308
|
+
|
2309
|
+
if ((argc < 1) || (argc > 1))
|
2310
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2311
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2312
|
+
result = (int)sqlite3_aggregate_count(arg1);
|
2313
|
+
|
2314
|
+
vresult = INT2NUM(result);
|
2315
|
+
return vresult;
|
2316
|
+
}
|
2317
|
+
|
2318
|
+
|
2319
|
+
static VALUE
|
2320
|
+
_wrap_sqlite3_value_blob(int argc, VALUE *argv, VALUE self) {
|
2321
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2322
|
+
RUBY_VALBLOB *result;
|
2323
|
+
VALUE vresult = Qnil;
|
2324
|
+
|
2325
|
+
if ((argc < 1) || (argc > 1))
|
2326
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2327
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2328
|
+
result = (RUBY_VALBLOB *)sqlite3_value_blob(arg1);
|
2329
|
+
|
2330
|
+
{
|
2331
|
+
vresult = result ? rb_str_new( (char*)result, sqlite3_value_bytes( arg1 ) ) : Qnil;
|
2332
|
+
}
|
2333
|
+
return vresult;
|
2334
|
+
}
|
2335
|
+
|
2336
|
+
|
2337
|
+
static VALUE
|
2338
|
+
_wrap_sqlite3_value_bytes(int argc, VALUE *argv, VALUE self) {
|
2339
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2340
|
+
int result;
|
2341
|
+
VALUE vresult = Qnil;
|
2342
|
+
|
2343
|
+
if ((argc < 1) || (argc > 1))
|
2344
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2345
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2346
|
+
result = (int)sqlite3_value_bytes(arg1);
|
2347
|
+
|
2348
|
+
vresult = INT2NUM(result);
|
2349
|
+
return vresult;
|
2350
|
+
}
|
2351
|
+
|
2352
|
+
|
2353
|
+
static VALUE
|
2354
|
+
_wrap_sqlite3_value_bytes16(int argc, VALUE *argv, VALUE self) {
|
2355
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2356
|
+
int result;
|
2357
|
+
VALUE vresult = Qnil;
|
2358
|
+
|
2359
|
+
if ((argc < 1) || (argc > 1))
|
2360
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2361
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2362
|
+
result = (int)sqlite3_value_bytes16(arg1);
|
2363
|
+
|
2364
|
+
vresult = INT2NUM(result);
|
2365
|
+
return vresult;
|
2366
|
+
}
|
2367
|
+
|
2368
|
+
|
2369
|
+
static VALUE
|
2370
|
+
_wrap_sqlite3_value_double(int argc, VALUE *argv, VALUE self) {
|
2371
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2372
|
+
double result;
|
2373
|
+
VALUE vresult = Qnil;
|
2374
|
+
|
2375
|
+
if ((argc < 1) || (argc > 1))
|
2376
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2377
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2378
|
+
result = (double)sqlite3_value_double(arg1);
|
2379
|
+
|
2380
|
+
vresult = rb_float_new(result);
|
2381
|
+
return vresult;
|
2382
|
+
}
|
2383
|
+
|
2384
|
+
|
2385
|
+
static VALUE
|
2386
|
+
_wrap_sqlite3_value_int(int argc, VALUE *argv, VALUE self) {
|
2387
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2388
|
+
int result;
|
2389
|
+
VALUE vresult = Qnil;
|
2390
|
+
|
2391
|
+
if ((argc < 1) || (argc > 1))
|
2392
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2393
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2394
|
+
result = (int)sqlite3_value_int(arg1);
|
2395
|
+
|
2396
|
+
vresult = INT2NUM(result);
|
2397
|
+
return vresult;
|
2398
|
+
}
|
2399
|
+
|
2400
|
+
|
2401
|
+
static VALUE
|
2402
|
+
_wrap_sqlite3_value_int64(int argc, VALUE *argv, VALUE self) {
|
2403
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2404
|
+
sqlite_int64 result;
|
2405
|
+
VALUE vresult = Qnil;
|
2406
|
+
|
2407
|
+
if ((argc < 1) || (argc > 1))
|
2408
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2409
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2410
|
+
result = sqlite3_value_int64(arg1);
|
2411
|
+
|
2412
|
+
{
|
2413
|
+
vresult = rb_ll2inum( result );
|
2414
|
+
}
|
2415
|
+
return vresult;
|
2416
|
+
}
|
2417
|
+
|
2418
|
+
|
2419
|
+
static VALUE
|
2420
|
+
_wrap_sqlite3_value_text(int argc, VALUE *argv, VALUE self) {
|
2421
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2422
|
+
char *result;
|
2423
|
+
VALUE vresult = Qnil;
|
2424
|
+
|
2425
|
+
if ((argc < 1) || (argc > 1))
|
2426
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2427
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2428
|
+
result = (char *)sqlite3_value_text(arg1);
|
2429
|
+
|
2430
|
+
{
|
2431
|
+
vresult = result ? rb_str_new2(result) : Qnil;
|
2432
|
+
}
|
2433
|
+
return vresult;
|
2434
|
+
}
|
2435
|
+
|
2436
|
+
|
2437
|
+
static VALUE
|
2438
|
+
_wrap_sqlite3_value_text16(int argc, VALUE *argv, VALUE self) {
|
2439
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2440
|
+
void *result;
|
2441
|
+
VALUE vresult = Qnil;
|
2442
|
+
|
2443
|
+
if ((argc < 1) || (argc > 1))
|
2444
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2445
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2446
|
+
result = (void *)sqlite3_value_text16(arg1);
|
2447
|
+
|
2448
|
+
{
|
2449
|
+
int i;
|
2450
|
+
if( result ) {
|
2451
|
+
for( i = 0; ((char*)result)[i]; i += 2 );
|
2452
|
+
vresult = rb_str_new( (char*)result, i );
|
2453
|
+
} else vresult = Qnil;
|
2454
|
+
}
|
2455
|
+
return vresult;
|
2456
|
+
}
|
2457
|
+
|
2458
|
+
|
2459
|
+
static VALUE
|
2460
|
+
_wrap_sqlite3_value_text16le(int argc, VALUE *argv, VALUE self) {
|
2461
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2462
|
+
void *result;
|
2463
|
+
VALUE vresult = Qnil;
|
2464
|
+
|
2465
|
+
if ((argc < 1) || (argc > 1))
|
2466
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2467
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2468
|
+
result = (void *)sqlite3_value_text16le(arg1);
|
2469
|
+
|
2470
|
+
{
|
2471
|
+
int i;
|
2472
|
+
if( result ) {
|
2473
|
+
for( i = 0; ((char*)result)[i]; i += 2 );
|
2474
|
+
vresult = rb_str_new( (char*)result, i );
|
2475
|
+
} else vresult = Qnil;
|
2476
|
+
}
|
2477
|
+
return vresult;
|
2478
|
+
}
|
2479
|
+
|
2480
|
+
|
2481
|
+
static VALUE
|
2482
|
+
_wrap_sqlite3_value_text16be(int argc, VALUE *argv, VALUE self) {
|
2483
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2484
|
+
void *result;
|
2485
|
+
VALUE vresult = Qnil;
|
2486
|
+
|
2487
|
+
if ((argc < 1) || (argc > 1))
|
2488
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2489
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2490
|
+
result = (void *)sqlite3_value_text16be(arg1);
|
2491
|
+
|
2492
|
+
{
|
2493
|
+
int i;
|
2494
|
+
if( result ) {
|
2495
|
+
for( i = 0; ((char*)result)[i]; i += 2 );
|
2496
|
+
vresult = rb_str_new( (char*)result, i );
|
2497
|
+
} else vresult = Qnil;
|
2498
|
+
}
|
2499
|
+
return vresult;
|
2500
|
+
}
|
2501
|
+
|
2502
|
+
|
2503
|
+
static VALUE
|
2504
|
+
_wrap_sqlite3_value_type(int argc, VALUE *argv, VALUE self) {
|
2505
|
+
sqlite3_value *arg1 = (sqlite3_value *) 0 ;
|
2506
|
+
int result;
|
2507
|
+
VALUE vresult = Qnil;
|
2508
|
+
|
2509
|
+
if ((argc < 1) || (argc > 1))
|
2510
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2511
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
|
2512
|
+
result = (int)sqlite3_value_type(arg1);
|
2513
|
+
|
2514
|
+
vresult = INT2NUM(result);
|
2515
|
+
return vresult;
|
2516
|
+
}
|
2517
|
+
|
2518
|
+
|
2519
|
+
static VALUE
|
2520
|
+
_wrap_sqlite3_result_blob(int argc, VALUE *argv, VALUE self) {
|
2521
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2522
|
+
void *arg2 = (void *) 0 ;
|
2523
|
+
int arg3 ;
|
2524
|
+
void (*arg4)(void *) = (void (*)(void *)) 0 ;
|
2525
|
+
|
2526
|
+
if ((argc < 2) || (argc > 2))
|
2527
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2528
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2529
|
+
{
|
2530
|
+
arg2 = (void*)RSTRING_PTR(argv[1]);
|
2531
|
+
arg3 = RSTRING_LEN(argv[1]);
|
2532
|
+
arg4 = SQLITE_TRANSIENT;
|
2533
|
+
}
|
2534
|
+
sqlite3_result_blob(arg1,(void const *)arg2,arg3,arg4);
|
2535
|
+
|
2536
|
+
return Qnil;
|
2537
|
+
}
|
2538
|
+
|
2539
|
+
|
2540
|
+
static VALUE
|
2541
|
+
_wrap_sqlite3_result_double(int argc, VALUE *argv, VALUE self) {
|
2542
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2543
|
+
double arg2 ;
|
2544
|
+
|
2545
|
+
if ((argc < 2) || (argc > 2))
|
2546
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2547
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2548
|
+
arg2 = (double) NUM2DBL(argv[1]);
|
2549
|
+
sqlite3_result_double(arg1,arg2);
|
2550
|
+
|
2551
|
+
return Qnil;
|
2552
|
+
}
|
2553
|
+
|
2554
|
+
|
2555
|
+
static VALUE
|
2556
|
+
_wrap_sqlite3_result_error(int argc, VALUE *argv, VALUE self) {
|
2557
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2558
|
+
char *arg2 = (char *) 0 ;
|
2559
|
+
int arg3 ;
|
2560
|
+
|
2561
|
+
if ((argc < 2) || (argc > 2))
|
2562
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2563
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2564
|
+
{
|
2565
|
+
arg2 = RSTRING_PTR(argv[1]);
|
2566
|
+
arg3 = RSTRING_LEN(argv[1]);
|
2567
|
+
}
|
2568
|
+
sqlite3_result_error(arg1,(char const *)arg2,arg3);
|
2569
|
+
|
2570
|
+
return Qnil;
|
2571
|
+
}
|
2572
|
+
|
2573
|
+
|
2574
|
+
static VALUE
|
2575
|
+
_wrap_sqlite3_result_error16(int argc, VALUE *argv, VALUE self) {
|
2576
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2577
|
+
void *arg2 = (void *) 0 ;
|
2578
|
+
int arg3 ;
|
2579
|
+
|
2580
|
+
if ((argc < 2) || (argc > 2))
|
2581
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2582
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2583
|
+
{
|
2584
|
+
arg2 = (void*)RSTRING_PTR(argv[1]);
|
2585
|
+
arg3 = RSTRING_LEN(argv[1]);
|
2586
|
+
}
|
2587
|
+
sqlite3_result_error16(arg1,(void const *)arg2,arg3);
|
2588
|
+
|
2589
|
+
return Qnil;
|
2590
|
+
}
|
2591
|
+
|
2592
|
+
|
2593
|
+
static VALUE
|
2594
|
+
_wrap_sqlite3_result_int(int argc, VALUE *argv, VALUE self) {
|
2595
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2596
|
+
int arg2 ;
|
2597
|
+
|
2598
|
+
if ((argc < 2) || (argc > 2))
|
2599
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2600
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2601
|
+
arg2 = NUM2INT(argv[1]);
|
2602
|
+
sqlite3_result_int(arg1,arg2);
|
2603
|
+
|
2604
|
+
return Qnil;
|
2605
|
+
}
|
2606
|
+
|
2607
|
+
|
2608
|
+
static VALUE
|
2609
|
+
_wrap_sqlite3_result_int64(int argc, VALUE *argv, VALUE self) {
|
2610
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2611
|
+
sqlite_int64 arg2 ;
|
2612
|
+
|
2613
|
+
if ((argc < 2) || (argc > 2))
|
2614
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2615
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2616
|
+
{
|
2617
|
+
arg2 = rb_num2ll( argv[1] );
|
2618
|
+
}
|
2619
|
+
sqlite3_result_int64(arg1,arg2);
|
2620
|
+
|
2621
|
+
return Qnil;
|
2622
|
+
}
|
2623
|
+
|
2624
|
+
|
2625
|
+
static VALUE
|
2626
|
+
_wrap_sqlite3_result_text(int argc, VALUE *argv, VALUE self) {
|
2627
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2628
|
+
char *arg2 = (char *) 0 ;
|
2629
|
+
int arg3 ;
|
2630
|
+
void (*arg4)(void *) = (void (*)(void *)) 0 ;
|
2631
|
+
|
2632
|
+
if ((argc < 2) || (argc > 2))
|
2633
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2634
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2635
|
+
{
|
2636
|
+
arg2 = RSTRING_PTR(argv[1]);
|
2637
|
+
arg3 = RSTRING_LEN(argv[1]);
|
2638
|
+
arg4 = SQLITE_TRANSIENT;
|
2639
|
+
}
|
2640
|
+
sqlite3_result_text(arg1,(char const *)arg2,arg3,arg4);
|
2641
|
+
|
2642
|
+
return Qnil;
|
2643
|
+
}
|
2644
|
+
|
2645
|
+
|
2646
|
+
static VALUE
|
2647
|
+
_wrap_sqlite3_result_text16(int argc, VALUE *argv, VALUE self) {
|
2648
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2649
|
+
void *arg2 = (void *) 0 ;
|
2650
|
+
int arg3 ;
|
2651
|
+
void (*arg4)(void *) = (void (*)(void *)) 0 ;
|
2652
|
+
|
2653
|
+
if ((argc < 2) || (argc > 2))
|
2654
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2655
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2656
|
+
{
|
2657
|
+
arg2 = (void*)RSTRING_PTR(argv[1]);
|
2658
|
+
arg3 = RSTRING_LEN(argv[1]);
|
2659
|
+
arg4 = SQLITE_TRANSIENT;
|
2660
|
+
}
|
2661
|
+
sqlite3_result_text16(arg1,(void const *)arg2,arg3,arg4);
|
2662
|
+
|
2663
|
+
return Qnil;
|
2664
|
+
}
|
2665
|
+
|
2666
|
+
|
2667
|
+
static VALUE
|
2668
|
+
_wrap_sqlite3_result_text16le(int argc, VALUE *argv, VALUE self) {
|
2669
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2670
|
+
void *arg2 = (void *) 0 ;
|
2671
|
+
int arg3 ;
|
2672
|
+
void (*arg4)(void *) = (void (*)(void *)) 0 ;
|
2673
|
+
|
2674
|
+
if ((argc < 2) || (argc > 2))
|
2675
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2676
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2677
|
+
{
|
2678
|
+
arg2 = (void*)RSTRING_PTR(argv[1]);
|
2679
|
+
arg3 = RSTRING_LEN(argv[1]);
|
2680
|
+
arg4 = SQLITE_TRANSIENT;
|
2681
|
+
}
|
2682
|
+
sqlite3_result_text16le(arg1,(void const *)arg2,arg3,arg4);
|
2683
|
+
|
2684
|
+
return Qnil;
|
2685
|
+
}
|
2686
|
+
|
2687
|
+
|
2688
|
+
static VALUE
|
2689
|
+
_wrap_sqlite3_result_text16be(int argc, VALUE *argv, VALUE self) {
|
2690
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2691
|
+
void *arg2 = (void *) 0 ;
|
2692
|
+
int arg3 ;
|
2693
|
+
void (*arg4)(void *) = (void (*)(void *)) 0 ;
|
2694
|
+
|
2695
|
+
if ((argc < 2) || (argc > 2))
|
2696
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2697
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2698
|
+
{
|
2699
|
+
arg2 = (void*)RSTRING_PTR(argv[1]);
|
2700
|
+
arg3 = RSTRING_LEN(argv[1]);
|
2701
|
+
arg4 = SQLITE_TRANSIENT;
|
2702
|
+
}
|
2703
|
+
sqlite3_result_text16be(arg1,(void const *)arg2,arg3,arg4);
|
2704
|
+
|
2705
|
+
return Qnil;
|
2706
|
+
}
|
2707
|
+
|
2708
|
+
|
2709
|
+
static VALUE
|
2710
|
+
_wrap_sqlite3_result_value(int argc, VALUE *argv, VALUE self) {
|
2711
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2712
|
+
sqlite3_value *arg2 = (sqlite3_value *) 0 ;
|
2713
|
+
|
2714
|
+
if ((argc < 2) || (argc > 2))
|
2715
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
|
2716
|
+
SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
|
2717
|
+
SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_sqlite3_value, 0);
|
2718
|
+
sqlite3_result_value(arg1,arg2);
|
2719
|
+
|
2720
|
+
return Qnil;
|
2721
|
+
}
|
2722
|
+
|
2723
|
+
|
2724
|
+
static VALUE
|
2725
|
+
_wrap_sqlite3_aggregate_context(int argc, VALUE *argv, VALUE self) {
|
2726
|
+
sqlite3_context *arg1 = (sqlite3_context *) 0 ;
|
2727
|
+
int arg2 ;
|
2728
|
+
VALUE *result;
|
2729
|
+
VALUE vresult = Qnil;
|
2730
|
+
|
2731
|
+
if ((argc < 1) || (argc > 1))
|
2732
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
|
2733
|
+
{
|
2734
|
+
SWIG_ConvertPtr(argv[0],(void**)&arg1, SWIGTYPE_p_sqlite3_context, 1);
|
2735
|
+
arg2 = 4;
|
2736
|
+
}
|
2737
|
+
result = (VALUE *)sqlite3_aggregate_context(arg1,arg2);
|
2738
|
+
|
2739
|
+
{
|
2740
|
+
vresult = *(VALUE*)result;
|
2741
|
+
}
|
2742
|
+
return vresult;
|
2743
|
+
}
|
2744
|
+
|
2745
|
+
|
2746
|
+
|
2747
|
+
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
|
2748
|
+
|
2749
|
+
static swig_type_info _swigt__p_CallbackData = {"_p_CallbackData", "struct CallbackData *", 0, 0, 0};
|
2750
|
+
static swig_type_info _swigt__p_f_p_sqlite3_context__void = {"_p_f_p_sqlite3_context__void", "void (*)(sqlite3_context *)", 0, 0, 0};
|
2751
|
+
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};
|
2752
|
+
static swig_type_info _swigt__p_f_p_void__void = {"_p_f_p_void__void", "void (*)(void *)", 0, 0, 0};
|
2753
|
+
static swig_type_info _swigt__p_f_p_void_int__int = {"_p_f_p_void_int__int", "int (*)(void *,int)", 0, 0, 0};
|
2754
|
+
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};
|
2755
|
+
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};
|
2756
|
+
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, 0};
|
2757
|
+
static swig_type_info _swigt__p_p_sqlite3 = {"_p_p_sqlite3", "sqlite3 **", 0, 0, 0};
|
2758
|
+
static swig_type_info _swigt__p_p_sqlite3_stmt = {"_p_p_sqlite3_stmt", "sqlite3_stmt **", 0, 0, 0};
|
2759
|
+
static swig_type_info _swigt__p_p_void = {"_p_p_void", "void **", 0, 0, 0};
|
2760
|
+
static swig_type_info _swigt__p_sqlite3 = {"_p_sqlite3", "sqlite3 *", 0, 0, 0};
|
2761
|
+
static swig_type_info _swigt__p_sqlite3_context = {"_p_sqlite3_context", "sqlite3_context *", 0, 0, 0};
|
2762
|
+
static swig_type_info _swigt__p_sqlite3_stmt = {"_p_sqlite3_stmt", "sqlite3_stmt *", 0, 0, 0};
|
2763
|
+
static swig_type_info _swigt__p_sqlite3_value = {"_p_sqlite3_value", "sqlite3_value *", 0, 0, 0};
|
2764
|
+
static swig_type_info _swigt__p_sqlite_int64 = {"_p_sqlite_int64", "sqlite_int64 *", 0, 0, 0};
|
2765
|
+
static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "unsigned long *|VALUE *", 0, 0, 0};
|
2766
|
+
static swig_type_info _swigt__p_void = {"_p_void", "void *|RUBY_VALBLOB *", 0, 0, 0};
|
2767
|
+
|
2768
|
+
static swig_type_info *swig_type_initial[] = {
|
2769
|
+
&_swigt__p_CallbackData,
|
2770
|
+
&_swigt__p_f_p_sqlite3_context__void,
|
2771
|
+
&_swigt__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void,
|
2772
|
+
&_swigt__p_f_p_void__void,
|
2773
|
+
&_swigt__p_f_p_void_int__int,
|
2774
|
+
&_swigt__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int,
|
2775
|
+
&_swigt__p_f_p_void_p_q_const__char__void,
|
2776
|
+
&_swigt__p_p_char,
|
2777
|
+
&_swigt__p_p_sqlite3,
|
2778
|
+
&_swigt__p_p_sqlite3_stmt,
|
2779
|
+
&_swigt__p_p_void,
|
2780
|
+
&_swigt__p_sqlite3,
|
2781
|
+
&_swigt__p_sqlite3_context,
|
2782
|
+
&_swigt__p_sqlite3_stmt,
|
2783
|
+
&_swigt__p_sqlite3_value,
|
2784
|
+
&_swigt__p_sqlite_int64,
|
2785
|
+
&_swigt__p_unsigned_long,
|
2786
|
+
&_swigt__p_void,
|
2787
|
+
};
|
2788
|
+
|
2789
|
+
static swig_cast_info _swigc__p_CallbackData[] = { {&_swigt__p_CallbackData, 0, 0, 0},{0, 0, 0, 0}};
|
2790
|
+
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}};
|
2791
|
+
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}};
|
2792
|
+
static swig_cast_info _swigc__p_f_p_void__void[] = { {&_swigt__p_f_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
|
2793
|
+
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}};
|
2794
|
+
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}};
|
2795
|
+
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}};
|
2796
|
+
static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
|
2797
|
+
static swig_cast_info _swigc__p_p_sqlite3[] = { {&_swigt__p_p_sqlite3, 0, 0, 0},{0, 0, 0, 0}};
|
2798
|
+
static swig_cast_info _swigc__p_p_sqlite3_stmt[] = { {&_swigt__p_p_sqlite3_stmt, 0, 0, 0},{0, 0, 0, 0}};
|
2799
|
+
static swig_cast_info _swigc__p_p_void[] = { {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}};
|
2800
|
+
static swig_cast_info _swigc__p_sqlite3[] = { {&_swigt__p_sqlite3, 0, 0, 0},{0, 0, 0, 0}};
|
2801
|
+
static swig_cast_info _swigc__p_sqlite3_context[] = { {&_swigt__p_sqlite3_context, 0, 0, 0},{0, 0, 0, 0}};
|
2802
|
+
static swig_cast_info _swigc__p_sqlite3_stmt[] = { {&_swigt__p_sqlite3_stmt, 0, 0, 0},{0, 0, 0, 0}};
|
2803
|
+
static swig_cast_info _swigc__p_sqlite3_value[] = { {&_swigt__p_sqlite3_value, 0, 0, 0},{0, 0, 0, 0}};
|
2804
|
+
static swig_cast_info _swigc__p_sqlite_int64[] = { {&_swigt__p_sqlite_int64, 0, 0, 0},{0, 0, 0, 0}};
|
2805
|
+
static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
|
2806
|
+
static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
|
2807
|
+
|
2808
|
+
static swig_cast_info *swig_cast_initial[] = {
|
2809
|
+
_swigc__p_CallbackData,
|
2810
|
+
_swigc__p_f_p_sqlite3_context__void,
|
2811
|
+
_swigc__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void,
|
2812
|
+
_swigc__p_f_p_void__void,
|
2813
|
+
_swigc__p_f_p_void_int__int,
|
2814
|
+
_swigc__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int,
|
2815
|
+
_swigc__p_f_p_void_p_q_const__char__void,
|
2816
|
+
_swigc__p_p_char,
|
2817
|
+
_swigc__p_p_sqlite3,
|
2818
|
+
_swigc__p_p_sqlite3_stmt,
|
2819
|
+
_swigc__p_p_void,
|
2820
|
+
_swigc__p_sqlite3,
|
2821
|
+
_swigc__p_sqlite3_context,
|
2822
|
+
_swigc__p_sqlite3_stmt,
|
2823
|
+
_swigc__p_sqlite3_value,
|
2824
|
+
_swigc__p_sqlite_int64,
|
2825
|
+
_swigc__p_unsigned_long,
|
2826
|
+
_swigc__p_void,
|
2827
|
+
};
|
2828
|
+
|
2829
|
+
|
2830
|
+
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
|
2831
|
+
|
2832
|
+
/*************************************************************************
|
2833
|
+
* Type initialization:
|
2834
|
+
* This problem is tough by the requirement that no dynamic
|
2835
|
+
* memory is used. Also, since swig_type_info structures store pointers to
|
2836
|
+
* swig_cast_info structures and swig_cast_info structures store pointers back
|
2837
|
+
* to swig_type_info structures, we need some lookup code at initialization.
|
2838
|
+
* The idea is that swig generates all the structures that are needed.
|
2839
|
+
* The runtime then collects these partially filled structures.
|
2840
|
+
* The SWIG_InitializeModule function takes these initial arrays out of
|
2841
|
+
* swig_module, and does all the lookup, filling in the swig_module.types
|
2842
|
+
* array with the correct data and linking the correct swig_cast_info
|
2843
|
+
* structures together.
|
2844
|
+
|
2845
|
+
* The generated swig_type_info structures are assigned staticly to an initial
|
2846
|
+
* array. We just loop though that array, and handle each type individually.
|
2847
|
+
* First we lookup if this type has been already loaded, and if so, use the
|
2848
|
+
* loaded structure instead of the generated one. Then we have to fill in the
|
2849
|
+
* cast linked list. The cast data is initially stored in something like a
|
2850
|
+
* two-dimensional array. Each row corresponds to a type (there are the same
|
2851
|
+
* number of rows as there are in the swig_type_initial array). Each entry in
|
2852
|
+
* a column is one of the swig_cast_info structures for that type.
|
2853
|
+
* The cast_initial array is actually an array of arrays, because each row has
|
2854
|
+
* a variable number of columns. So to actually build the cast linked list,
|
2855
|
+
* we find the array of casts associated with the type, and loop through it
|
2856
|
+
* adding the casts to the list. The one last trick we need to do is making
|
2857
|
+
* sure the type pointer in the swig_cast_info struct is correct.
|
2858
|
+
|
2859
|
+
* First off, we lookup the cast->type name to see if it is already loaded.
|
2860
|
+
* There are three cases to handle:
|
2861
|
+
* 1) If the cast->type has already been loaded AND the type we are adding
|
2862
|
+
* casting info to has not been loaded (it is in this module), THEN we
|
2863
|
+
* replace the cast->type pointer with the type pointer that has already
|
2864
|
+
* been loaded.
|
2865
|
+
* 2) If BOTH types (the one we are adding casting info to, and the
|
2866
|
+
* cast->type) are loaded, THEN the cast info has already been loaded by
|
2867
|
+
* the previous module so we just ignore it.
|
2868
|
+
* 3) Finally, if cast->type has not already been loaded, then we add that
|
2869
|
+
* swig_cast_info to the linked list (because the cast->type) pointer will
|
2870
|
+
* be correct.
|
2871
|
+
**/
|
2872
|
+
|
2873
|
+
#ifdef __cplusplus
|
2874
|
+
extern "C" {
|
2875
|
+
#endif
|
2876
|
+
|
2877
|
+
SWIGRUNTIME void
|
2878
|
+
SWIG_InitializeModule(void *clientdata) {
|
2879
|
+
swig_type_info *type, *ret;
|
2880
|
+
swig_cast_info *cast;
|
2881
|
+
size_t i;
|
2882
|
+
swig_module_info *module_head;
|
2883
|
+
static int init_run = 0;
|
2884
|
+
|
2885
|
+
clientdata = clientdata;
|
2886
|
+
|
2887
|
+
if (init_run) return;
|
2888
|
+
init_run = 1;
|
2889
|
+
|
2890
|
+
/* Initialize the swig_module */
|
2891
|
+
swig_module.type_initial = swig_type_initial;
|
2892
|
+
swig_module.cast_initial = swig_cast_initial;
|
2893
|
+
|
2894
|
+
/* Try and load any already created modules */
|
2895
|
+
module_head = SWIG_GetModule(clientdata);
|
2896
|
+
if (module_head) {
|
2897
|
+
swig_module.next = module_head->next;
|
2898
|
+
module_head->next = &swig_module;
|
2899
|
+
} else {
|
2900
|
+
/* This is the first module loaded */
|
2901
|
+
swig_module.next = &swig_module;
|
2902
|
+
SWIG_SetModule(clientdata, &swig_module);
|
2903
|
+
}
|
2904
|
+
|
2905
|
+
/* Now work on filling in swig_module.types */
|
2906
|
+
for (i = 0; i < swig_module.size; ++i) {
|
2907
|
+
type = 0;
|
2908
|
+
|
2909
|
+
/* if there is another module already loaded */
|
2910
|
+
if (swig_module.next != &swig_module) {
|
2911
|
+
type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
|
2912
|
+
}
|
2913
|
+
if (type) {
|
2914
|
+
/* Overwrite clientdata field */
|
2915
|
+
if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
|
2916
|
+
} else {
|
2917
|
+
type = swig_module.type_initial[i];
|
2918
|
+
}
|
2919
|
+
|
2920
|
+
/* Insert casting types */
|
2921
|
+
cast = swig_module.cast_initial[i];
|
2922
|
+
while (cast->type) {
|
2923
|
+
|
2924
|
+
/* Don't need to add information already in the list */
|
2925
|
+
ret = 0;
|
2926
|
+
if (swig_module.next != &swig_module) {
|
2927
|
+
ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
|
2928
|
+
}
|
2929
|
+
if (ret && type == swig_module.type_initial[i]) {
|
2930
|
+
cast->type = ret;
|
2931
|
+
ret = 0;
|
2932
|
+
}
|
2933
|
+
|
2934
|
+
if (!ret) {
|
2935
|
+
if (type->cast) {
|
2936
|
+
type->cast->prev = cast;
|
2937
|
+
cast->next = type->cast;
|
2938
|
+
}
|
2939
|
+
type->cast = cast;
|
2940
|
+
}
|
2941
|
+
|
2942
|
+
cast++;
|
2943
|
+
}
|
2944
|
+
|
2945
|
+
/* Set entry in modules->types array equal to the type */
|
2946
|
+
swig_module.types[i] = type;
|
2947
|
+
}
|
2948
|
+
swig_module.types[i] = 0;
|
2949
|
+
}
|
2950
|
+
|
2951
|
+
/* This function will propagate the clientdata field of type to
|
2952
|
+
* any new swig_type_info structures that have been added into the list
|
2953
|
+
* of equivalent types. It is like calling
|
2954
|
+
* SWIG_TypeClientData(type, clientdata) a second time.
|
2955
|
+
*/
|
2956
|
+
SWIGRUNTIME void
|
2957
|
+
SWIG_PropagateClientData(void) {
|
2958
|
+
size_t i;
|
2959
|
+
swig_cast_info *equiv;
|
2960
|
+
static int init_run = 0;
|
2961
|
+
|
2962
|
+
if (init_run) return;
|
2963
|
+
init_run = 1;
|
2964
|
+
|
2965
|
+
for (i = 0; i < swig_module.size; i++) {
|
2966
|
+
if (swig_module.types[i]->clientdata) {
|
2967
|
+
equiv = swig_module.types[i]->cast;
|
2968
|
+
while (equiv) {
|
2969
|
+
if (!equiv->converter) {
|
2970
|
+
if (equiv->type && !equiv->type->clientdata)
|
2971
|
+
SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
|
2972
|
+
}
|
2973
|
+
equiv = equiv->next;
|
2974
|
+
}
|
2975
|
+
}
|
2976
|
+
}
|
2977
|
+
}
|
2978
|
+
|
2979
|
+
#ifdef __cplusplus
|
2980
|
+
}
|
2981
|
+
#endif
|
2982
|
+
|
2983
|
+
|
2984
|
+
#ifdef __cplusplus
|
2985
|
+
extern "C"
|
2986
|
+
#endif
|
2987
|
+
SWIGEXPORT void Init_API(void) {
|
2988
|
+
size_t i;
|
2989
|
+
|
2990
|
+
SWIG_InitRuntime();
|
2991
|
+
mAPI = rb_define_module("SQLite3");
|
2992
|
+
mAPI = rb_define_module_under(mAPI, "Driver");
|
2993
|
+
mAPI = rb_define_module_under(mAPI, "Native");
|
2994
|
+
mAPI = rb_define_module_under(mAPI, "API");
|
2995
|
+
|
2996
|
+
SWIG_InitializeModule(0);
|
2997
|
+
for (i = 0; i < swig_module.size; i++) {
|
2998
|
+
SWIG_define_class(swig_module.types[i]);
|
2999
|
+
}
|
3000
|
+
|
3001
|
+
SWIG_RubyInitializeTrackings();
|
3002
|
+
|
3003
|
+
cCallbackData.klass = rb_define_class_under(mAPI, "CallbackData", rb_cObject);
|
3004
|
+
SWIG_TypeClientData(SWIGTYPE_p_CallbackData, (void *) &cCallbackData);
|
3005
|
+
rb_define_alloc_func(cCallbackData.klass, _wrap_CallbackData_allocate);
|
3006
|
+
rb_define_method(cCallbackData.klass, "initialize", _wrap_new_CallbackData, -1);
|
3007
|
+
rb_define_method(cCallbackData.klass, "proc=", _wrap_CallbackData_proc_set, -1);
|
3008
|
+
rb_define_method(cCallbackData.klass, "proc", _wrap_CallbackData_proc_get, -1);
|
3009
|
+
rb_define_method(cCallbackData.klass, "proc2=", _wrap_CallbackData_proc2_set, -1);
|
3010
|
+
rb_define_method(cCallbackData.klass, "proc2", _wrap_CallbackData_proc2_get, -1);
|
3011
|
+
rb_define_method(cCallbackData.klass, "data=", _wrap_CallbackData_data_set, -1);
|
3012
|
+
rb_define_method(cCallbackData.klass, "data", _wrap_CallbackData_data_get, -1);
|
3013
|
+
cCallbackData.mark = (void (*)(void *)) mark_CallbackData;
|
3014
|
+
cCallbackData.destroy = (void (*)(void *)) free_CallbackData;
|
3015
|
+
rb_define_const(mAPI,"Sqlite3_ruby_busy_handler", SWIG_NewPointerObj((void *) Sqlite3_ruby_busy_handler, SWIGTYPE_p_f_p_void_int__int,0));
|
3016
|
+
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));
|
3017
|
+
rb_define_const(mAPI,"Sqlite3_ruby_trace", SWIG_NewPointerObj((void *) Sqlite3_ruby_trace, SWIGTYPE_p_f_p_void_p_q_const__char__void,0));
|
3018
|
+
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));
|
3019
|
+
rb_define_const(mAPI,"Sqlite3_ruby_function_final", SWIG_NewPointerObj((void *) Sqlite3_ruby_function_final, SWIGTYPE_p_f_p_sqlite3_context__void,0));
|
3020
|
+
rb_define_module_function(mAPI, "sqlite3_libversion", _wrap_sqlite3_libversion, -1);
|
3021
|
+
rb_define_module_function(mAPI, "sqlite3_close", _wrap_sqlite3_close, -1);
|
3022
|
+
rb_define_module_function(mAPI, "sqlite3_last_insert_rowid", _wrap_sqlite3_last_insert_rowid, -1);
|
3023
|
+
rb_define_module_function(mAPI, "sqlite3_changes", _wrap_sqlite3_changes, -1);
|
3024
|
+
rb_define_module_function(mAPI, "sqlite3_total_changes", _wrap_sqlite3_total_changes, -1);
|
3025
|
+
rb_define_module_function(mAPI, "sqlite3_interrupt", _wrap_sqlite3_interrupt, -1);
|
3026
|
+
rb_define_module_function(mAPI, "sqlite3_complete", _wrap_sqlite3_complete, -1);
|
3027
|
+
rb_define_module_function(mAPI, "sqlite3_complete16", _wrap_sqlite3_complete16, -1);
|
3028
|
+
rb_define_module_function(mAPI, "sqlite3_busy_handler", _wrap_sqlite3_busy_handler, -1);
|
3029
|
+
rb_define_module_function(mAPI, "sqlite3_busy_timeout", _wrap_sqlite3_busy_timeout, -1);
|
3030
|
+
rb_define_module_function(mAPI, "sqlite3_set_authorizer", _wrap_sqlite3_set_authorizer, -1);
|
3031
|
+
rb_define_module_function(mAPI, "sqlite3_trace", _wrap_sqlite3_trace, -1);
|
3032
|
+
rb_define_module_function(mAPI, "sqlite3_open", _wrap_sqlite3_open, -1);
|
3033
|
+
rb_define_module_function(mAPI, "sqlite3_open16", _wrap_sqlite3_open16, -1);
|
3034
|
+
rb_define_module_function(mAPI, "sqlite3_errcode", _wrap_sqlite3_errcode, -1);
|
3035
|
+
rb_define_module_function(mAPI, "sqlite3_errmsg", _wrap_sqlite3_errmsg, -1);
|
3036
|
+
rb_define_module_function(mAPI, "sqlite3_errmsg16", _wrap_sqlite3_errmsg16, -1);
|
3037
|
+
rb_define_module_function(mAPI, "sqlite3_prepare", _wrap_sqlite3_prepare, -1);
|
3038
|
+
rb_define_module_function(mAPI, "sqlite3_prepare16", _wrap_sqlite3_prepare16, -1);
|
3039
|
+
rb_define_module_function(mAPI, "sqlite3_bind_blob", _wrap_sqlite3_bind_blob, -1);
|
3040
|
+
rb_define_module_function(mAPI, "sqlite3_bind_double", _wrap_sqlite3_bind_double, -1);
|
3041
|
+
rb_define_module_function(mAPI, "sqlite3_bind_int", _wrap_sqlite3_bind_int, -1);
|
3042
|
+
rb_define_module_function(mAPI, "sqlite3_bind_int64", _wrap_sqlite3_bind_int64, -1);
|
3043
|
+
rb_define_module_function(mAPI, "sqlite3_bind_null", _wrap_sqlite3_bind_null, -1);
|
3044
|
+
rb_define_module_function(mAPI, "sqlite3_bind_text", _wrap_sqlite3_bind_text, -1);
|
3045
|
+
rb_define_module_function(mAPI, "sqlite3_bind_text16", _wrap_sqlite3_bind_text16, -1);
|
3046
|
+
rb_define_module_function(mAPI, "sqlite3_bind_parameter_count", _wrap_sqlite3_bind_parameter_count, -1);
|
3047
|
+
rb_define_module_function(mAPI, "sqlite3_bind_parameter_name", _wrap_sqlite3_bind_parameter_name, -1);
|
3048
|
+
rb_define_module_function(mAPI, "sqlite3_bind_parameter_index", _wrap_sqlite3_bind_parameter_index, -1);
|
3049
|
+
rb_define_module_function(mAPI, "sqlite3_column_count", _wrap_sqlite3_column_count, -1);
|
3050
|
+
rb_define_module_function(mAPI, "sqlite3_column_name", _wrap_sqlite3_column_name, -1);
|
3051
|
+
rb_define_module_function(mAPI, "sqlite3_column_name16", _wrap_sqlite3_column_name16, -1);
|
3052
|
+
rb_define_module_function(mAPI, "sqlite3_column_decltype", _wrap_sqlite3_column_decltype, -1);
|
3053
|
+
rb_define_module_function(mAPI, "sqlite3_column_decltype16", _wrap_sqlite3_column_decltype16, -1);
|
3054
|
+
rb_define_module_function(mAPI, "sqlite3_step", _wrap_sqlite3_step, -1);
|
3055
|
+
rb_define_module_function(mAPI, "sqlite3_data_count", _wrap_sqlite3_data_count, -1);
|
3056
|
+
rb_define_module_function(mAPI, "sqlite3_column_blob", _wrap_sqlite3_column_blob, -1);
|
3057
|
+
rb_define_module_function(mAPI, "sqlite3_column_bytes", _wrap_sqlite3_column_bytes, -1);
|
3058
|
+
rb_define_module_function(mAPI, "sqlite3_column_bytes16", _wrap_sqlite3_column_bytes16, -1);
|
3059
|
+
rb_define_module_function(mAPI, "sqlite3_column_double", _wrap_sqlite3_column_double, -1);
|
3060
|
+
rb_define_module_function(mAPI, "sqlite3_column_int", _wrap_sqlite3_column_int, -1);
|
3061
|
+
rb_define_module_function(mAPI, "sqlite3_column_int64", _wrap_sqlite3_column_int64, -1);
|
3062
|
+
rb_define_module_function(mAPI, "sqlite3_column_text", _wrap_sqlite3_column_text, -1);
|
3063
|
+
rb_define_module_function(mAPI, "sqlite3_column_text16", _wrap_sqlite3_column_text16, -1);
|
3064
|
+
rb_define_module_function(mAPI, "sqlite3_column_type", _wrap_sqlite3_column_type, -1);
|
3065
|
+
rb_define_module_function(mAPI, "sqlite3_finalize", _wrap_sqlite3_finalize, -1);
|
3066
|
+
rb_define_module_function(mAPI, "sqlite3_reset", _wrap_sqlite3_reset, -1);
|
3067
|
+
rb_define_module_function(mAPI, "sqlite3_create_function", _wrap_sqlite3_create_function, -1);
|
3068
|
+
rb_define_module_function(mAPI, "sqlite3_create_function16", _wrap_sqlite3_create_function16, -1);
|
3069
|
+
rb_define_module_function(mAPI, "sqlite3_aggregate_count", _wrap_sqlite3_aggregate_count, -1);
|
3070
|
+
rb_define_module_function(mAPI, "sqlite3_value_blob", _wrap_sqlite3_value_blob, -1);
|
3071
|
+
rb_define_module_function(mAPI, "sqlite3_value_bytes", _wrap_sqlite3_value_bytes, -1);
|
3072
|
+
rb_define_module_function(mAPI, "sqlite3_value_bytes16", _wrap_sqlite3_value_bytes16, -1);
|
3073
|
+
rb_define_module_function(mAPI, "sqlite3_value_double", _wrap_sqlite3_value_double, -1);
|
3074
|
+
rb_define_module_function(mAPI, "sqlite3_value_int", _wrap_sqlite3_value_int, -1);
|
3075
|
+
rb_define_module_function(mAPI, "sqlite3_value_int64", _wrap_sqlite3_value_int64, -1);
|
3076
|
+
rb_define_module_function(mAPI, "sqlite3_value_text", _wrap_sqlite3_value_text, -1);
|
3077
|
+
rb_define_module_function(mAPI, "sqlite3_value_text16", _wrap_sqlite3_value_text16, -1);
|
3078
|
+
rb_define_module_function(mAPI, "sqlite3_value_text16le", _wrap_sqlite3_value_text16le, -1);
|
3079
|
+
rb_define_module_function(mAPI, "sqlite3_value_text16be", _wrap_sqlite3_value_text16be, -1);
|
3080
|
+
rb_define_module_function(mAPI, "sqlite3_value_type", _wrap_sqlite3_value_type, -1);
|
3081
|
+
rb_define_module_function(mAPI, "sqlite3_result_blob", _wrap_sqlite3_result_blob, -1);
|
3082
|
+
rb_define_module_function(mAPI, "sqlite3_result_double", _wrap_sqlite3_result_double, -1);
|
3083
|
+
rb_define_module_function(mAPI, "sqlite3_result_error", _wrap_sqlite3_result_error, -1);
|
3084
|
+
rb_define_module_function(mAPI, "sqlite3_result_error16", _wrap_sqlite3_result_error16, -1);
|
3085
|
+
rb_define_module_function(mAPI, "sqlite3_result_int", _wrap_sqlite3_result_int, -1);
|
3086
|
+
rb_define_module_function(mAPI, "sqlite3_result_int64", _wrap_sqlite3_result_int64, -1);
|
3087
|
+
rb_define_module_function(mAPI, "sqlite3_result_text", _wrap_sqlite3_result_text, -1);
|
3088
|
+
rb_define_module_function(mAPI, "sqlite3_result_text16", _wrap_sqlite3_result_text16, -1);
|
3089
|
+
rb_define_module_function(mAPI, "sqlite3_result_text16le", _wrap_sqlite3_result_text16le, -1);
|
3090
|
+
rb_define_module_function(mAPI, "sqlite3_result_text16be", _wrap_sqlite3_result_text16be, -1);
|
3091
|
+
rb_define_module_function(mAPI, "sqlite3_result_value", _wrap_sqlite3_result_value, -1);
|
3092
|
+
rb_define_module_function(mAPI, "sqlite3_aggregate_context", _wrap_sqlite3_aggregate_context, -1);
|
3093
|
+
}
|
3094
|
+
|