Update SQLite3 Drivers
Update bundled drivers to version 1.2.4.
This commit is contained in:
parent
14561d998d
commit
65c08e1090
37 changed files with 7364 additions and 521 deletions
4
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/MANIFEST
vendored
Normal file
4
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/MANIFEST
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
extconf.rb
|
||||
post-clean.rb
|
||||
post-distclean.rb
|
||||
sqlite3_api.i
|
146
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/Makefile
vendored
Normal file
146
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/Makefile
vendored
Normal file
|
@ -0,0 +1,146 @@
|
|||
|
||||
SHELL = /bin/sh
|
||||
|
||||
#### Start of system configuration section. ####
|
||||
|
||||
srcdir = .
|
||||
topdir = /opt/local/lib/ruby/1.8/i686-darwin9.2.2
|
||||
hdrdir = $(topdir)
|
||||
VPATH = $(srcdir):$(topdir):$(hdrdir)
|
||||
prefix = $(DESTDIR)/opt/local
|
||||
exec_prefix = $(prefix)
|
||||
sitedir = $(prefix)/lib/ruby/site_ruby
|
||||
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
||||
archdir = $(rubylibdir)/$(arch)
|
||||
sbindir = $(exec_prefix)/sbin
|
||||
vendordir = $(prefix)/lib/ruby/vendor_ruby
|
||||
datadir = $(prefix)/share
|
||||
includedir = $(prefix)/include
|
||||
infodir = $(prefix)/info
|
||||
sysconfdir = $(prefix)/etc
|
||||
mandir = $(DESTDIR)/opt/local/share/man
|
||||
libdir = $(exec_prefix)/lib
|
||||
sharedstatedir = $(prefix)/com
|
||||
oldincludedir = $(DESTDIR)/usr/include
|
||||
sitearchdir = $(sitelibdir)/$(sitearch)
|
||||
vendorarchdir = $(vendorlibdir)/$(vendorarch)
|
||||
bindir = $(exec_prefix)/bin
|
||||
localstatedir = $(prefix)/var
|
||||
vendorlibdir = $(vendordir)/$(ruby_version)
|
||||
sitelibdir = $(sitedir)/$(ruby_version)
|
||||
libexecdir = $(exec_prefix)/libexec
|
||||
|
||||
CC = gcc
|
||||
LIBRUBY = $(LIBRUBY_SO)
|
||||
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
||||
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
||||
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
||||
|
||||
RUBY_EXTCONF_H =
|
||||
CFLAGS = -fno-common -O2 -fno-common -pipe -fno-common
|
||||
INCFLAGS = -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.2.2 -I.
|
||||
CPPFLAGS = -DHAVE_SQLITE3_H -I/usr/local/include -I/opt/local/include
|
||||
CXXFLAGS = $(CFLAGS)
|
||||
DLDFLAGS = -L. -L/opt/local/lib
|
||||
LDSHARED = cc -dynamic -bundle -undefined suppress -flat_namespace
|
||||
AR = ar
|
||||
EXEEXT =
|
||||
|
||||
RUBY_INSTALL_NAME = ruby
|
||||
RUBY_SO_NAME = ruby
|
||||
arch = i686-darwin9.2.2
|
||||
sitearch = i686-darwin9.2.2
|
||||
vendorarch = i686-darwin9.2.2
|
||||
ruby_version = 1.8
|
||||
ruby = /opt/local/bin/ruby
|
||||
RUBY = $(ruby)
|
||||
RM = rm -f
|
||||
MAKEDIRS = mkdir -p
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_PROG = $(INSTALL) -m 0755
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
COPY = cp
|
||||
|
||||
#### End of system configuration section. ####
|
||||
|
||||
preload =
|
||||
|
||||
libpath = . $(libdir) /usr/local/lib
|
||||
LIBPATH = -L"." -L"$(libdir)" -L"/usr/local/lib"
|
||||
DEFFILE =
|
||||
|
||||
CLEANFILES = mkmf.log
|
||||
DISTCLEANFILES =
|
||||
|
||||
extout =
|
||||
extout_prefix =
|
||||
target_prefix =
|
||||
LOCAL_LIBS =
|
||||
LIBS = $(LIBRUBYARG_SHARED) -lsqlite3 -lpthread -ldl -lobjc
|
||||
SRCS = sqlite3_api_wrap.c
|
||||
OBJS = sqlite3_api_wrap.o
|
||||
TARGET = sqlite3_api
|
||||
DLLIB = $(TARGET).bundle
|
||||
EXTSTATIC =
|
||||
STATIC_LIB =
|
||||
|
||||
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
||||
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
||||
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
||||
|
||||
TARGET_SO = $(DLLIB)
|
||||
CLEANLIBS = $(TARGET).bundle $(TARGET).il? $(TARGET).tds $(TARGET).map
|
||||
CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
|
||||
|
||||
all: $(DLLIB)
|
||||
static: $(STATIC_LIB)
|
||||
|
||||
clean:
|
||||
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
||||
|
||||
distclean: clean
|
||||
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
||||
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
||||
|
||||
realclean: distclean
|
||||
install: install-so install-rb
|
||||
|
||||
install-so: $(RUBYARCHDIR)
|
||||
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
||||
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
||||
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
||||
install-rb: pre-install-rb install-rb-default
|
||||
install-rb-default: pre-install-rb-default
|
||||
pre-install-rb: Makefile
|
||||
pre-install-rb-default: Makefile
|
||||
$(RUBYARCHDIR):
|
||||
$(MAKEDIRS) $@
|
||||
|
||||
site-install: site-install-so site-install-rb
|
||||
site-install-so: install-so
|
||||
site-install-rb: install-rb
|
||||
|
||||
.SUFFIXES: .c .m .cc .cxx .cpp .C .o
|
||||
|
||||
.cc.o:
|
||||
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
||||
|
||||
.cxx.o:
|
||||
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
||||
|
||||
.C.o:
|
||||
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
||||
|
||||
.c.o:
|
||||
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
|
||||
|
||||
$(DLLIB): $(OBJS)
|
||||
@-$(RM) $@
|
||||
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
||||
|
||||
|
||||
|
||||
$(OBJS): ruby.h defines.h
|
16
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/extconf.rb
vendored
Normal file
16
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/extconf.rb
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'mkmf'
|
||||
|
||||
SWIG_WRAP = "sqlite3_api_wrap.c"
|
||||
|
||||
dir_config( "sqlite3", "/usr/local" )
|
||||
|
||||
have_library( "rt", "fdatasync" )
|
||||
|
||||
if have_header( "sqlite3.h" ) && have_library( "sqlite3", "sqlite3_open" )
|
||||
if !File.exists?( SWIG_WRAP ) || with_config( "swig", false )
|
||||
puts "creating #{SWIG_WRAP}"
|
||||
system "swig -ruby sqlite3_api.i" or raise "could not build wrapper via swig (perhaps swig is not installed?)"
|
||||
end
|
||||
|
||||
create_makefile( "sqlite3_api" )
|
||||
end
|
71
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/mkmf.log
vendored
Normal file
71
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/mkmf.log
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
have_library: checking for fdatasync() in -lrt... -------------------- no
|
||||
|
||||
"gcc -o conftest -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.2.2 -I. -I/usr/local/include -I/opt/local/include -O2 -fno-common -pipe -fno-common conftest.c -L"." -L"/opt/local/lib" -L"/usr/local/lib" -L. -L/opt/local/lib -lruby-static -lrt -lpthread -ldl -lobjc "
|
||||
conftest.c: In function ‘t’:
|
||||
conftest.c:3: error: ‘fdatasync’ undeclared (first use in this function)
|
||||
conftest.c:3: error: (Each undeclared identifier is reported only once
|
||||
conftest.c:3: error: for each function it appears in.)
|
||||
checked program was:
|
||||
/* begin */
|
||||
1: /*top*/
|
||||
2: int main() { return 0; }
|
||||
3: int t() { void ((*volatile p)()); p = (void ((*)()))fdatasync; return 0; }
|
||||
/* end */
|
||||
|
||||
"gcc -o conftest -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.2.2 -I. -I/usr/local/include -I/opt/local/include -O2 -fno-common -pipe -fno-common conftest.c -L"." -L"/opt/local/lib" -L"/usr/local/lib" -L. -L/opt/local/lib -lruby-static -lrt -lpthread -ldl -lobjc "
|
||||
ld: library not found for -lrt
|
||||
collect2: ld returned 1 exit status
|
||||
checked program was:
|
||||
/* begin */
|
||||
1: /*top*/
|
||||
2: int main() { return 0; }
|
||||
3: int t() { fdatasync(); return 0; }
|
||||
/* end */
|
||||
|
||||
"gcc -o conftest -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.2.2 -I. -I/usr/local/include -I/opt/local/include -O2 -fno-common -pipe -fno-common conftest.c -L"." -L"/opt/local/lib" -L"/usr/local/lib" -L. -L/opt/local/lib -lruby-static -lrt -lpthread -ldl -lobjc "
|
||||
ld: library not found for -lrt
|
||||
collect2: ld returned 1 exit status
|
||||
checked program was:
|
||||
/* begin */
|
||||
1: int fdatasync();
|
||||
2: /*top*/
|
||||
3: int main() { return 0; }
|
||||
4: int t() { fdatasync(); return 0; }
|
||||
/* end */
|
||||
|
||||
--------------------
|
||||
|
||||
have_header: checking for sqlite3.h... -------------------- yes
|
||||
|
||||
"gcc -E -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.2.2 -I. -I/usr/local/include -I/opt/local/include -O2 -fno-common -pipe -fno-common conftest.c -o conftest.i"
|
||||
checked program was:
|
||||
/* begin */
|
||||
1: #include <sqlite3.h>
|
||||
/* end */
|
||||
|
||||
--------------------
|
||||
|
||||
have_library: checking for sqlite3_open() in -lsqlite3... -------------------- yes
|
||||
|
||||
"gcc -o conftest -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.2.2 -I. -I/usr/local/include -I/opt/local/include -O2 -fno-common -pipe -fno-common conftest.c -L"." -L"/opt/local/lib" -L"/usr/local/lib" -L. -L/opt/local/lib -lruby-static -lsqlite3 -lpthread -ldl -lobjc "
|
||||
conftest.c: In function ‘t’:
|
||||
conftest.c:3: error: ‘sqlite3_open’ undeclared (first use in this function)
|
||||
conftest.c:3: error: (Each undeclared identifier is reported only once
|
||||
conftest.c:3: error: for each function it appears in.)
|
||||
checked program was:
|
||||
/* begin */
|
||||
1: /*top*/
|
||||
2: int main() { return 0; }
|
||||
3: int t() { void ((*volatile p)()); p = (void ((*)()))sqlite3_open; return 0; }
|
||||
/* end */
|
||||
|
||||
"gcc -o conftest -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.2.2 -I. -I/usr/local/include -I/opt/local/include -O2 -fno-common -pipe -fno-common conftest.c -L"." -L"/opt/local/lib" -L"/usr/local/lib" -L. -L/opt/local/lib -lruby-static -lsqlite3 -lpthread -ldl -lobjc "
|
||||
checked program was:
|
||||
/* begin */
|
||||
1: /*top*/
|
||||
2: int main() { return 0; }
|
||||
3: int t() { sqlite3_open(); return 0; }
|
||||
/* end */
|
||||
|
||||
--------------------
|
||||
|
358
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/sqlite3_api.i
vendored
Normal file
358
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/sqlite3_api.i
vendored
Normal file
|
@ -0,0 +1,358 @@
|
|||
%module "SQLite3::driver::native::API"
|
||||
%include "typemaps.i"
|
||||
%{
|
||||
#include <sqlite3.h>
|
||||
#include "ruby.h"
|
||||
|
||||
#ifndef RSTRING_PTR
|
||||
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
|
||||
#endif
|
||||
|
||||
#ifndef RSTRING_LEN
|
||||
#define RSTRING_LEN(s) (RSTRING(s)->len)
|
||||
#endif
|
||||
|
||||
#define Init_API Init_sqlite3_api
|
||||
|
||||
struct CallbackData {
|
||||
VALUE proc;
|
||||
VALUE proc2;
|
||||
VALUE data;
|
||||
};
|
||||
|
||||
typedef struct CallbackData CallbackData;
|
||||
typedef void RUBY_BLOB;
|
||||
typedef void RUBY_VALBLOB;
|
||||
|
||||
int Sqlite3_ruby_busy_handler(void* data,int value) {
|
||||
VALUE result;
|
||||
CallbackData *cb = (CallbackData*)data;
|
||||
result = rb_funcall(
|
||||
cb->proc, rb_intern("call"), 2, cb->data, INT2FIX(value) );
|
||||
return FIX2INT(result);
|
||||
}
|
||||
|
||||
static void mark_CallbackData(void* ptr) {
|
||||
CallbackData* cb = (CallbackData*)ptr;
|
||||
if (cb->proc != Qnil)
|
||||
rb_gc_mark(cb->proc);
|
||||
if (cb->proc2 != Qnil)
|
||||
rb_gc_mark(cb->proc2);
|
||||
if (cb->data != Qnil)
|
||||
rb_gc_mark(cb->data);
|
||||
}
|
||||
|
||||
int Sqlite3_ruby_authorizer(void* data,int type,
|
||||
const char* a,const char* b,const char* c,const char* d)
|
||||
{
|
||||
VALUE result;
|
||||
CallbackData *cb = (CallbackData*)data;
|
||||
result = rb_funcall(
|
||||
cb->proc, rb_intern("call"), 6, cb->data, INT2FIX(type),
|
||||
( a ? rb_str_new2(a) : Qnil ), ( b ? rb_str_new2(b) : Qnil ),
|
||||
( c ? rb_str_new2(c) : Qnil ), ( d ? rb_str_new2(d) : Qnil ) );
|
||||
return FIX2INT(result);
|
||||
}
|
||||
|
||||
void Sqlite3_ruby_trace(void* data, const char *sql) {
|
||||
CallbackData *cb = (CallbackData*)data;
|
||||
rb_funcall( cb->proc, rb_intern("call"), 2, cb->data,
|
||||
sql ? rb_str_new2(sql) : Qnil );
|
||||
}
|
||||
|
||||
void Sqlite3_ruby_function_step(sqlite3_context* ctx,int n,
|
||||
sqlite3_value** args)
|
||||
{
|
||||
CallbackData *data;
|
||||
VALUE rb_args;
|
||||
VALUE *rb_context;
|
||||
int idx;
|
||||
|
||||
data = (CallbackData*)sqlite3_user_data(ctx);
|
||||
|
||||
if( data->proc2 != Qnil ) {
|
||||
rb_context = (VALUE*)sqlite3_aggregate_context(ctx,sizeof(VALUE));
|
||||
if( *rb_context == 0 ) {
|
||||
*rb_context = rb_hash_new();
|
||||
rb_gc_register_address( rb_context );
|
||||
}
|
||||
}
|
||||
|
||||
rb_args = rb_ary_new2(n+1);
|
||||
rb_ary_push( rb_args, SWIG_NewPointerObj(ctx,SWIGTYPE_p_sqlite3_context,0) );
|
||||
for( idx = 0; idx < n; idx++ ) {
|
||||
rb_ary_push( rb_args, SWIG_NewPointerObj(args[idx],
|
||||
SWIGTYPE_p_sqlite3_value,0) );
|
||||
}
|
||||
|
||||
rb_apply( data->proc, rb_intern("call"), rb_args );
|
||||
}
|
||||
|
||||
void Sqlite3_ruby_function_final(sqlite3_context *ctx) {
|
||||
VALUE *rb_context;
|
||||
CallbackData *data;
|
||||
|
||||
rb_context = (VALUE*)sqlite3_aggregate_context(ctx,sizeof(VALUE));
|
||||
if( *rb_context == 0 ) {
|
||||
*rb_context = rb_hash_new();
|
||||
rb_gc_register_address( rb_context );
|
||||
}
|
||||
|
||||
data = (CallbackData*)sqlite3_user_data(ctx);
|
||||
|
||||
rb_funcall( data->proc2, rb_intern("call"), 1,
|
||||
SWIG_NewPointerObj(ctx,SWIGTYPE_p_sqlite3_context,0) );
|
||||
|
||||
rb_gc_unregister_address( rb_context );
|
||||
}
|
||||
%}
|
||||
|
||||
%markfunc CallbackData "mark_CallbackData";
|
||||
|
||||
struct CallbackData {
|
||||
VALUE proc;
|
||||
VALUE proc2;
|
||||
VALUE data;
|
||||
};
|
||||
|
||||
%typemap(in) const void *str {
|
||||
$1 = (void*)RSTRING_PTR($input);
|
||||
}
|
||||
|
||||
%typemap(in) (const char *filename, sqlite3**) {
|
||||
$1 = STR2CSTR($input);
|
||||
$2 = (sqlite3**)malloc( sizeof( sqlite3* ) );
|
||||
}
|
||||
|
||||
%typemap(argout) (const char *filename, sqlite3**) {
|
||||
VALUE ary;
|
||||
ary = rb_ary_new2(2);
|
||||
rb_ary_push( ary, $result );
|
||||
rb_ary_push( ary, SWIG_NewPointerObj( *$2, SWIGTYPE_p_sqlite3, 0 ) );
|
||||
free( $2 );
|
||||
$result = ary;
|
||||
}
|
||||
|
||||
%typemap(in) (const void *filename, sqlite3**) {
|
||||
$1 = (void*)RSTRING_PTR($input);
|
||||
$2 = (sqlite3**)malloc( sizeof( sqlite3* ) );
|
||||
}
|
||||
|
||||
%typemap(argout) (const void *filename, sqlite3**) {
|
||||
VALUE ary;
|
||||
ary = rb_ary_new2(2);
|
||||
rb_ary_push( ary, $result );
|
||||
rb_ary_push( ary, SWIG_NewPointerObj( *$2, SWIGTYPE_p_sqlite3, 0 ) );
|
||||
free( $2 );
|
||||
$result = ary;
|
||||
}
|
||||
|
||||
typedef void RUBY_BLOB;
|
||||
%typemap(out) const RUBY_BLOB * {
|
||||
$result = $1 ?
|
||||
rb_str_new( (char*)$1, sqlite3_column_bytes( arg1, arg2 ) ) : Qnil;
|
||||
}
|
||||
|
||||
typedef void RUBY_VALBLOB;
|
||||
%typemap(out) const RUBY_VALBLOB * {
|
||||
$result = $1 ? rb_str_new( (char*)$1, sqlite3_value_bytes( arg1 ) ) : Qnil;
|
||||
}
|
||||
|
||||
%typemap(out) const void * {
|
||||
int i;
|
||||
if( $1 ) {
|
||||
for( i = 0; ((char*)$1)[i]; i += 2 );
|
||||
$result = rb_str_new( (char*)$1, i );
|
||||
} else $result = Qnil;
|
||||
}
|
||||
|
||||
%typemap(in) (const char * sql,int,sqlite3_stmt**,const char**) (sqlite3_stmt *stmt, char *errmsg) {
|
||||
$1 = RSTRING_PTR($input);
|
||||
$2 = RSTRING_LEN($input);
|
||||
$3 = &stmt2;
|
||||
$4 = &errmsg2;
|
||||
}
|
||||
|
||||
%typemap(argout) (const char* sql,int,sqlite3_stmt**,const char**) {
|
||||
VALUE ary;
|
||||
ary = rb_ary_new2(3);
|
||||
rb_ary_push( ary, $result );
|
||||
rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
|
||||
rb_ary_push( ary, errmsg2 ? rb_str_new2( errmsg2 ) : Qnil );
|
||||
$result = ary;
|
||||
}
|
||||
|
||||
%typemap(in) (const void* sql,int,sqlite3_stmt**,const void**) (sqlite3_stmt *stmt, void *errmsg) {
|
||||
$1 = RSTRING_PTR($input);
|
||||
$2 = RSTRING_LEN($input);
|
||||
$3 = &stmt2;
|
||||
$4 = &errmsg2;
|
||||
}
|
||||
|
||||
%typemap(argout) (const void* sql,int,sqlite3_stmt**,const void**) {
|
||||
VALUE ary;
|
||||
int i;
|
||||
|
||||
for( i = 0; ((char*)errmsg2)[i]; i += 2 );
|
||||
|
||||
ary = rb_ary_new2(3);
|
||||
rb_ary_push( ary, $result );
|
||||
rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
|
||||
rb_ary_push( ary, errmsg2 ? rb_str_new( (char*)errmsg2, i ) : Qnil );
|
||||
$result = ary;
|
||||
}
|
||||
|
||||
%typemap(in) (const void *blob,int) {
|
||||
$1 = (void*)RSTRING_PTR($input);
|
||||
$2 = RSTRING_LEN($input);
|
||||
}
|
||||
|
||||
%typemap(in) (const void *blob,int,void(*free)(void*)) {
|
||||
$1 = (void*)RSTRING_PTR($input);
|
||||
$2 = RSTRING_LEN($input);
|
||||
$3 = SQLITE_TRANSIENT;
|
||||
}
|
||||
|
||||
%typemap(in) (const char *text,int) {
|
||||
$1 = RSTRING_PTR($input);
|
||||
$2 = RSTRING_LEN($input);
|
||||
}
|
||||
|
||||
%typemap(in) (const char *text,int,void(*free)(void*)) {
|
||||
$1 = RSTRING_PTR($input);
|
||||
$2 = RSTRING_LEN($input);
|
||||
$3 = SQLITE_TRANSIENT;
|
||||
}
|
||||
|
||||
%typemap(in) (const void *utf16,int) {
|
||||
$1 = (void*)RSTRING_PTR($input);
|
||||
$2 = RSTRING_LEN($input);
|
||||
}
|
||||
|
||||
%typemap(in) (const void *utf16,int,void(*free)(void*)) {
|
||||
$1 = (void*)RSTRING_PTR($input);
|
||||
$2 = RSTRING_LEN($input);
|
||||
$3 = SQLITE_TRANSIENT;
|
||||
}
|
||||
|
||||
%typemap(out) sqlite_int64 {
|
||||
$result = rb_ll2inum( $1 );
|
||||
}
|
||||
|
||||
%typemap(out) const char * {
|
||||
$result = $1 ? rb_str_new2($1) : Qnil;
|
||||
}
|
||||
|
||||
%typemap(in) sqlite_int64 {
|
||||
$1 = rb_num2ll( $input );
|
||||
}
|
||||
|
||||
%typemap(in) (sqlite3_context*,int data_size) {
|
||||
SWIG_ConvertPtr($input,(void**)&$1, SWIGTYPE_p_sqlite3_context, 1);
|
||||
$2 = 4;
|
||||
}
|
||||
|
||||
%typemap(out) VALUE* {
|
||||
$result = *(VALUE*)$1;
|
||||
}
|
||||
|
||||
%constant int Sqlite3_ruby_busy_handler(void*,int);
|
||||
%constant int Sqlite3_ruby_authorizer(void*,int,const char*,const char*,const char*,const char*);
|
||||
%constant void Sqlite3_ruby_trace(void*,const char*);
|
||||
%constant void Sqlite3_ruby_function_step(sqlite3_context* ctx,int n,
|
||||
sqlite3_value** args);
|
||||
%constant void Sqlite3_ruby_function_final(sqlite3_context* ctx);
|
||||
|
||||
const char *sqlite3_libversion(void);
|
||||
int sqlite3_close(sqlite3*);
|
||||
|
||||
sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
|
||||
|
||||
int sqlite3_changes(sqlite3*);
|
||||
int sqlite3_total_changes(sqlite3*);
|
||||
void sqlite3_interrupt(sqlite3*);
|
||||
|
||||
int sqlite3_complete(const char*);
|
||||
int sqlite3_complete16(const void *str);
|
||||
|
||||
int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
|
||||
int sqlite3_busy_timeout(sqlite3*,int);
|
||||
int sqlite3_set_authorizer(sqlite3*, int(*)(void*,int,const char*,const char*,const char*,const char*), void*);
|
||||
int sqlite3_trace(sqlite3*, void(*)(void*,const char*), void*);
|
||||
|
||||
int sqlite3_open(const char *filename, sqlite3 **);
|
||||
int sqlite3_open16(const void *filename, sqlite3 **);
|
||||
|
||||
int sqlite3_errcode(sqlite3*);
|
||||
const char *sqlite3_errmsg(sqlite3*);
|
||||
const void *sqlite3_errmsg16(sqlite3*);
|
||||
|
||||
int sqlite3_prepare(sqlite3*,const char* sql,int,sqlite3_stmt**,const char**);
|
||||
int sqlite3_prepare16(sqlite3*,const void* sql,int,sqlite3_stmt**,const void**);
|
||||
|
||||
int sqlite3_bind_blob(sqlite3_stmt*,int,const void *blob,int,void(*free)(void*));
|
||||
int sqlite3_bind_double(sqlite3_stmt*,int,double);
|
||||
int sqlite3_bind_int(sqlite3_stmt*,int,int);
|
||||
int sqlite3_bind_int64(sqlite3_stmt*,int,sqlite_int64);
|
||||
int sqlite3_bind_null(sqlite3_stmt*,int);
|
||||
int sqlite3_bind_text(sqlite3_stmt*,int,const char*text,int,void(*free)(void*));
|
||||
int sqlite3_bind_text16(sqlite3_stmt*,int,const void*utf16,int,void(*free)(void*));
|
||||
|
||||
int sqlite3_bind_parameter_count(sqlite3_stmt*);
|
||||
const char *sqlite3_bind_parameter_name(sqlite3_stmt*,int);
|
||||
int sqlite3_bind_parameter_index(sqlite3_stmt*,const char*);
|
||||
|
||||
int sqlite3_column_count(sqlite3_stmt*);
|
||||
const char *sqlite3_column_name(sqlite3_stmt*,int);
|
||||
const void *sqlite3_column_name16(sqlite3_stmt*,int);
|
||||
const char *sqlite3_column_decltype(sqlite3_stmt*,int);
|
||||
const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
|
||||
|
||||
int sqlite3_step(sqlite3_stmt*);
|
||||
|
||||
int sqlite3_data_count(sqlite3_stmt*);
|
||||
|
||||
const RUBY_BLOB *sqlite3_column_blob(sqlite3_stmt*,int);
|
||||
int sqlite3_column_bytes(sqlite3_stmt*,int);
|
||||
int sqlite3_column_bytes16(sqlite3_stmt*,int);
|
||||
double sqlite3_column_double(sqlite3_stmt*,int);
|
||||
double sqlite3_column_int(sqlite3_stmt*,int);
|
||||
sqlite_int64 sqlite3_column_int64(sqlite3_stmt*,int);
|
||||
const char *sqlite3_column_text(sqlite3_stmt*,int);
|
||||
const void *sqlite3_column_text16(sqlite3_stmt*,int);
|
||||
int sqlite3_column_type(sqlite3_stmt*,int);
|
||||
|
||||
int sqlite3_finalize(sqlite3_stmt*);
|
||||
int sqlite3_reset(sqlite3_stmt*);
|
||||
|
||||
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*));
|
||||
|
||||
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*));
|
||||
|
||||
int sqlite3_aggregate_count(sqlite3_context*);
|
||||
|
||||
const RUBY_VALBLOB *sqlite3_value_blob(sqlite3_value*);
|
||||
int sqlite3_value_bytes(sqlite3_value*);
|
||||
int sqlite3_value_bytes16(sqlite3_value*);
|
||||
double sqlite3_value_double(sqlite3_value*);
|
||||
int sqlite3_value_int(sqlite3_value*);
|
||||
sqlite_int64 sqlite3_value_int64(sqlite3_value*);
|
||||
const char *sqlite3_value_text(sqlite3_value*);
|
||||
const void *sqlite3_value_text16(sqlite3_value*);
|
||||
const void *sqlite3_value_text16le(sqlite3_value*);
|
||||
const void *sqlite3_value_text16be(sqlite3_value*);
|
||||
int sqlite3_value_type(sqlite3_value*);
|
||||
|
||||
void sqlite3_result_blob(sqlite3_context*,const void *blob,int,void(*free)(void*));
|
||||
void sqlite3_result_double(sqlite3_context*,double);
|
||||
void sqlite3_result_error(sqlite3_context*,const char *text,int);
|
||||
void sqlite3_result_error16(sqlite3_context*,const void *blob,int);
|
||||
void sqlite3_result_int(sqlite3_context*,int);
|
||||
void sqlite3_result_int64(sqlite3_context*,sqlite_int64);
|
||||
void sqlite3_result_text(sqlite3_context*,const char* text,int,void(*free)(void*));
|
||||
void sqlite3_result_text16(sqlite3_context*,const void* utf16,int,void(*free)(void*));
|
||||
void sqlite3_result_text16le(sqlite3_context*,const void* utf16,int,void(*free)(void*));
|
||||
void sqlite3_result_text16be(sqlite3_context*,const void* utf16,int,void(*free)(void*));
|
||||
void sqlite3_result_value(sqlite3_context*,sqlite3_value*);
|
||||
|
||||
VALUE *sqlite3_aggregate_context(sqlite3_context*,int data_size);
|
3102
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/sqlite3_api_wrap.c
vendored
Normal file
3102
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/sqlite3_api_wrap.c
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/win32/build.bat
vendored
Executable file
7
vendor/plugins/sqlite3-ruby/ext/sqlite3_api/win32/build.bat
vendored
Executable file
|
@ -0,0 +1,7 @@
|
|||
REM This is not guaranteed to work, ever. It's just a little helper
|
||||
REM script that I threw together to help me build the win32 version of
|
||||
REM the library. If someone with more win32-fu than I wants to make
|
||||
REM something more robust, please feel free! I'd love to include it.
|
||||
REM -- Jamis Buck
|
||||
|
||||
cl /LD /Ie:\WinSDK\Include /Ic:\ruby\lib\ruby\1.8\i386-mswin32 /Ic:\ruby\sqlite3 /Ic:\ruby\src\ruby-1.8.4_2006-04-14 sqlite3_api_wrap.c /link /LIBPATH:c:\ruby\sqlite3 /LIBPATH:e:\WinSDK\Lib /LIBPATH:c:\ruby\lib sqlite3.lib msvcrt-ruby18.lib
|
Loading…
Add table
Add a link
Reference in a new issue