qoobaa-sqlite3-ruby 1.2.5

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