mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-08 06:38:12 -04:00
DBD-SQLite: switched from dTHX to pTHX_/aTHX_ where I could. I think #44884 is almost done except for the ones related to other tickets like #44871 (so we shouldn't close #44884 yet)
This commit is contained in:
parent
30599f51bc
commit
3d9bf5c1e2
3 changed files with 247 additions and 256 deletions
217
SQLite.xs
217
SQLite.xs
|
@ -1,108 +1,109 @@
|
|||
|
||||
#include "SQLiteXS.h"
|
||||
|
||||
DBISTATE_DECLARE;
|
||||
|
||||
MODULE = DBD::SQLite PACKAGE = DBD::SQLite::db
|
||||
|
||||
PROTOTYPES: DISABLE
|
||||
|
||||
BOOT:
|
||||
sv_setpv(get_sv("DBD::SQLite::sqlite_version", TRUE|GV_ADDMULTI), SQLITE_VERSION);
|
||||
|
||||
AV *
|
||||
list_tables(dbh)
|
||||
SV *dbh
|
||||
CODE:
|
||||
{
|
||||
RETVAL = newAV();
|
||||
}
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
IV
|
||||
last_insert_rowid(dbh)
|
||||
SV *dbh
|
||||
CODE:
|
||||
{
|
||||
D_imp_dbh(dbh);
|
||||
RETVAL = sqlite3_last_insert_rowid(imp_dbh->db);
|
||||
}
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
void
|
||||
create_function(dbh, name, argc, func)
|
||||
SV *dbh
|
||||
char *name
|
||||
int argc
|
||||
SV *func
|
||||
CODE:
|
||||
{
|
||||
sqlite3_db_create_function( dbh, name, argc, func );
|
||||
}
|
||||
|
||||
void
|
||||
enable_load_extension(dbh, onoff)
|
||||
SV *dbh
|
||||
int onoff
|
||||
CODE:
|
||||
{
|
||||
sqlite3_db_enable_load_extension( dbh, onoff );
|
||||
}
|
||||
|
||||
void
|
||||
create_aggregate(dbh, name, argc, aggr)
|
||||
SV *dbh
|
||||
char *name
|
||||
int argc
|
||||
SV *aggr
|
||||
CODE:
|
||||
{
|
||||
sqlite3_db_create_aggregate( dbh, name, argc, aggr );
|
||||
}
|
||||
|
||||
void
|
||||
create_collation(dbh, name, func)
|
||||
SV *dbh
|
||||
char *name
|
||||
SV *func
|
||||
CODE:
|
||||
{
|
||||
sqlite3_db_create_collation( dbh, name, func );
|
||||
}
|
||||
|
||||
void
|
||||
progress_handler(dbh, n_opcodes, handler)
|
||||
SV *dbh
|
||||
int n_opcodes
|
||||
SV *handler
|
||||
CODE:
|
||||
{
|
||||
sqlite3_db_progress_handler( dbh, n_opcodes, handler );
|
||||
}
|
||||
|
||||
int
|
||||
busy_timeout(dbh, timeout=0)
|
||||
SV *dbh
|
||||
int timeout
|
||||
CODE:
|
||||
RETVAL = dbd_set_sqlite3_busy_timeout( dbh, timeout );
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
MODULE = DBD::SQLite PACKAGE = DBD::SQLite::st
|
||||
|
||||
PROTOTYPES: DISABLE
|
||||
|
||||
void
|
||||
reset(sth)
|
||||
SV *sth
|
||||
CODE:
|
||||
{
|
||||
sqlite_st_reset(sth);
|
||||
}
|
||||
|
||||
MODULE = DBD::SQLite PACKAGE = DBD::SQLite
|
||||
|
||||
INCLUDE: SQLite.xsi
|
||||
#define PERL_NO_GET_CONTEXT
|
||||
|
||||
#include "SQLiteXS.h"
|
||||
|
||||
DBISTATE_DECLARE;
|
||||
|
||||
MODULE = DBD::SQLite PACKAGE = DBD::SQLite::db
|
||||
|
||||
PROTOTYPES: DISABLE
|
||||
|
||||
BOOT:
|
||||
sv_setpv(get_sv("DBD::SQLite::sqlite_version", TRUE|GV_ADDMULTI), SQLITE_VERSION);
|
||||
|
||||
AV *
|
||||
list_tables(dbh)
|
||||
SV *dbh
|
||||
CODE:
|
||||
{
|
||||
RETVAL = newAV();
|
||||
}
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
IV
|
||||
last_insert_rowid(dbh)
|
||||
SV *dbh
|
||||
CODE:
|
||||
{
|
||||
D_imp_dbh(dbh);
|
||||
RETVAL = sqlite3_last_insert_rowid(imp_dbh->db);
|
||||
}
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
void
|
||||
create_function(dbh, name, argc, func)
|
||||
SV *dbh
|
||||
char *name
|
||||
int argc
|
||||
SV *func
|
||||
CODE:
|
||||
{
|
||||
sqlite3_db_create_function(aTHX_ dbh, name, argc, func );
|
||||
}
|
||||
|
||||
void
|
||||
enable_load_extension(dbh, onoff)
|
||||
SV *dbh
|
||||
int onoff
|
||||
CODE:
|
||||
{
|
||||
sqlite3_db_enable_load_extension(aTHX_ dbh, onoff );
|
||||
}
|
||||
|
||||
void
|
||||
create_aggregate(dbh, name, argc, aggr)
|
||||
SV *dbh
|
||||
char *name
|
||||
int argc
|
||||
SV *aggr
|
||||
CODE:
|
||||
{
|
||||
sqlite3_db_create_aggregate(aTHX_ dbh, name, argc, aggr );
|
||||
}
|
||||
|
||||
void
|
||||
create_collation(dbh, name, func)
|
||||
SV *dbh
|
||||
char *name
|
||||
SV *func
|
||||
CODE:
|
||||
{
|
||||
sqlite3_db_create_collation(aTHX_ dbh, name, func );
|
||||
}
|
||||
|
||||
void
|
||||
progress_handler(dbh, n_opcodes, handler)
|
||||
SV *dbh
|
||||
int n_opcodes
|
||||
SV *handler
|
||||
CODE:
|
||||
{
|
||||
sqlite3_db_progress_handler(aTHX_ dbh, n_opcodes, handler );
|
||||
}
|
||||
|
||||
int
|
||||
busy_timeout(dbh, timeout=0)
|
||||
SV *dbh
|
||||
int timeout
|
||||
CODE:
|
||||
RETVAL = dbd_set_sqlite3_busy_timeout(aTHX_ dbh, timeout );
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
MODULE = DBD::SQLite PACKAGE = DBD::SQLite::st
|
||||
|
||||
PROTOTYPES: DISABLE
|
||||
|
||||
void
|
||||
reset(sth)
|
||||
SV *sth
|
||||
CODE:
|
||||
{
|
||||
sqlite_st_reset(aTHX_ sth);
|
||||
}
|
||||
|
||||
MODULE = DBD::SQLite PACKAGE = DBD::SQLite
|
||||
|
||||
INCLUDE: SQLite.xsi
|
||||
|
|
54
dbdimp.c
54
dbdimp.c
|
@ -18,7 +18,9 @@ DBISTATE_DECLARE;
|
|||
#define call_sv(x,y) perl_call_sv(x,y)
|
||||
#endif
|
||||
|
||||
#define sqlite_error(h,xxh,rc,what) _sqlite_error(__FILE__, __LINE__, h, xxh, rc, what)
|
||||
#define sqlite_error(h,xxh,rc,what) _sqlite_error(aTHX_ __FILE__, __LINE__, h, xxh, rc, what)
|
||||
|
||||
/* XXX: is there any good way to use pTHX_/aTHX_ here like above? */
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2)
|
||||
# define sqlite_trace(h,xxh,level,fmt...) _sqlite_tracef(__FILE__, __LINE__, h, xxh, level, fmt)
|
||||
#else
|
||||
|
@ -32,10 +34,8 @@ sqlite_init(dbistate_t *dbistate)
|
|||
}
|
||||
|
||||
static void
|
||||
_sqlite_error(char *file, int line, SV *h, imp_xxh_t *imp_xxh, int rc, char *what)
|
||||
_sqlite_error(pTHX_ char *file, int line, SV *h, imp_xxh_t *imp_xxh, int rc, char *what)
|
||||
{
|
||||
dTHX;
|
||||
|
||||
DBIh_SET_ERR_CHAR(h, imp_xxh, Nullch, rc, what, Nullch, Nullch);
|
||||
|
||||
/* #7753: DBD::SQLite error shouldn't include extraneous info */
|
||||
|
@ -51,7 +51,7 @@ static void
|
|||
_sqlite_tracef(char *file, int line, SV *h, imp_xxh_t *imp_xxh, int level, const char *fmt, ...)
|
||||
{
|
||||
dTHX;
|
||||
|
||||
|
||||
va_list ap;
|
||||
if ( DBIc_TRACE_LEVEL(imp_xxh) >= level ) {
|
||||
char format[8192];
|
||||
|
@ -66,7 +66,7 @@ static void
|
|||
_sqlite_tracef_noline(SV *h, imp_xxh_t *imp_xxh, int level, const char *fmt, ...)
|
||||
{
|
||||
dTHX;
|
||||
|
||||
|
||||
va_list ap;
|
||||
if ( DBIc_TRACE_LEVEL(imp_xxh) >= level ) {
|
||||
char format[8192];
|
||||
|
@ -140,10 +140,8 @@ sqlite_db_login(SV *dbh, imp_dbh_t *imp_dbh, char *dbname, char *user, char *pas
|
|||
}
|
||||
|
||||
int
|
||||
dbd_set_sqlite3_busy_timeout ( SV *dbh, int timeout )
|
||||
dbd_set_sqlite3_busy_timeout (pTHX_ SV *dbh, int timeout )
|
||||
{
|
||||
dTHX;
|
||||
|
||||
D_imp_dbh(dbh);
|
||||
if (timeout) {
|
||||
imp_dbh->timeout = timeout;
|
||||
|
@ -330,9 +328,8 @@ sqlite_quote(imp_dbh_t *imp_dbh, SV *val)
|
|||
}
|
||||
|
||||
void
|
||||
sqlite_st_reset (SV *sth)
|
||||
sqlite_st_reset (pTHX_ SV *sth)
|
||||
{
|
||||
dTHX;
|
||||
D_imp_sth(sth);
|
||||
if (DBIc_IMPSET(imp_sth))
|
||||
sqlite3_reset(imp_sth->stmt);
|
||||
|
@ -848,9 +845,8 @@ sqlite_st_FETCH_attrib (SV *sth, imp_sth_t *imp_sth, SV *keysv)
|
|||
}
|
||||
|
||||
static void
|
||||
sqlite_db_set_result(sqlite3_context *context, SV *result, int is_error )
|
||||
sqlite_db_set_result(pTHX_ sqlite3_context *context, SV *result, int is_error )
|
||||
{
|
||||
dTHX;
|
||||
STRLEN len;
|
||||
char *s;
|
||||
|
||||
|
@ -929,19 +925,19 @@ sqlite_db_func_dispatcher(int is_unicode, sqlite3_context *context, int argc, sq
|
|||
|
||||
/* Check for an error */
|
||||
if (SvTRUE(ERRSV) ) {
|
||||
sqlite_db_set_result( context, ERRSV, 1);
|
||||
sqlite_db_set_result(aTHX_ context, ERRSV, 1);
|
||||
POPs;
|
||||
} else if ( count != 1 ) {
|
||||
SV *err = sv_2mortal(newSVpvf( "function should return 1 argument, got %d",
|
||||
count ));
|
||||
|
||||
sqlite_db_set_result( context, err, 1);
|
||||
sqlite_db_set_result(aTHX_ context, err, 1);
|
||||
/* Clear the stack */
|
||||
for ( i=0; i < count; i++ ) {
|
||||
POPs;
|
||||
}
|
||||
} else {
|
||||
sqlite_db_set_result( context, POPs, 0 );
|
||||
sqlite_db_set_result(aTHX_ context, POPs, 0 );
|
||||
}
|
||||
|
||||
PUTBACK;
|
||||
|
@ -964,9 +960,8 @@ sqlite_db_func_dispatcher_no_unicode(sqlite3_context *context, int argc, sqlite3
|
|||
}
|
||||
|
||||
void
|
||||
sqlite3_db_create_function( SV *dbh, const char *name, int argc, SV *func )
|
||||
sqlite3_db_create_function(pTHX_ SV *dbh, const char *name, int argc, SV *func )
|
||||
{
|
||||
dTHX;
|
||||
D_imp_dbh(dbh);
|
||||
int retval;
|
||||
|
||||
|
@ -989,9 +984,8 @@ sqlite3_db_create_function( SV *dbh, const char *name, int argc, SV *func )
|
|||
}
|
||||
|
||||
void
|
||||
sqlite3_db_enable_load_extension( SV *dbh, int onoff )
|
||||
sqlite3_db_enable_load_extension(pTHX_ SV *dbh, int onoff )
|
||||
{
|
||||
dTHX;
|
||||
D_imp_dbh(dbh);
|
||||
int retval;
|
||||
|
||||
|
@ -1012,9 +1006,8 @@ struct aggrInfo {
|
|||
};
|
||||
|
||||
static void
|
||||
sqlite_db_aggr_new_dispatcher( sqlite3_context *context, aggrInfo *aggr_info )
|
||||
sqlite_db_aggr_new_dispatcher(pTHX_ sqlite3_context *context, aggrInfo *aggr_info )
|
||||
{
|
||||
dTHX;
|
||||
dSP;
|
||||
SV *pkg = NULL;
|
||||
int count = 0;
|
||||
|
@ -1086,7 +1079,7 @@ sqlite_db_aggr_step_dispatcher (sqlite3_context *context,
|
|||
|
||||
/* initialize on first step */
|
||||
if ( !aggr->inited ) {
|
||||
sqlite_db_aggr_new_dispatcher( context, aggr );
|
||||
sqlite_db_aggr_new_dispatcher(aTHX_ context, aggr );
|
||||
}
|
||||
|
||||
if ( aggr->err || !aggr->aggr_inst )
|
||||
|
@ -1153,7 +1146,7 @@ sqlite_db_aggr_finalize_dispatcher( sqlite3_context *context )
|
|||
aggr = &myAggr;
|
||||
aggr->aggr_inst = NULL;
|
||||
aggr->err = NULL;
|
||||
sqlite_db_aggr_new_dispatcher (context, aggr);
|
||||
sqlite_db_aggr_new_dispatcher(aTHX_ context, aggr);
|
||||
}
|
||||
|
||||
if ( ! aggr->err && aggr->aggr_inst ) {
|
||||
|
@ -1177,7 +1170,7 @@ sqlite_db_aggr_finalize_dispatcher( sqlite3_context *context )
|
|||
POPs;
|
||||
}
|
||||
} else {
|
||||
sqlite_db_set_result( context, POPs, 0 );
|
||||
sqlite_db_set_result(aTHX_ context, POPs, 0 );
|
||||
}
|
||||
PUTBACK;
|
||||
}
|
||||
|
@ -1186,7 +1179,7 @@ sqlite_db_aggr_finalize_dispatcher( sqlite3_context *context )
|
|||
warn( "DBD::SQLite: error in aggregator cannot be reported to SQLite: %s",
|
||||
SvPV_nolen( aggr->err ) );
|
||||
|
||||
/* sqlite_db_set_result( context, aggr->err, 1 ); */
|
||||
/* sqlite_db_set_result(aTHX_ context, aggr->err, 1 ); */
|
||||
SvREFCNT_dec( aggr->err );
|
||||
aggr->err = NULL;
|
||||
}
|
||||
|
@ -1201,9 +1194,8 @@ sqlite_db_aggr_finalize_dispatcher( sqlite3_context *context )
|
|||
}
|
||||
|
||||
void
|
||||
sqlite3_db_create_aggregate( SV *dbh, const char *name, int argc, SV *aggr_pkg )
|
||||
sqlite3_db_create_aggregate(pTHX_ SV *dbh, const char *name, int argc, SV *aggr_pkg )
|
||||
{
|
||||
dTHX;
|
||||
D_imp_dbh(dbh);
|
||||
int retval;
|
||||
|
||||
|
@ -1289,9 +1281,8 @@ int sqlite_db_collation_dispatcher_utf8(
|
|||
|
||||
|
||||
void
|
||||
sqlite3_db_create_collation( SV *dbh, const char *name, SV *func )
|
||||
sqlite3_db_create_collation(pTHX_ SV *dbh, const char *name, SV *func )
|
||||
{
|
||||
dTHX;
|
||||
D_imp_dbh(dbh);
|
||||
int rv, rv2;
|
||||
void *aa = "aa";
|
||||
|
@ -1351,9 +1342,8 @@ int sqlite_db_progress_handler_dispatcher( void *handler )
|
|||
|
||||
|
||||
void
|
||||
sqlite3_db_progress_handler( SV *dbh, int n_opcodes, SV *handler )
|
||||
sqlite3_db_progress_handler(pTHX_ SV *dbh, int n_opcodes, SV *handler )
|
||||
{
|
||||
dTHX;
|
||||
D_imp_dbh(dbh);
|
||||
|
||||
if (handler == &PL_sv_undef) {
|
||||
|
|
232
dbdimp.h
232
dbdimp.h
|
@ -1,116 +1,116 @@
|
|||
|
||||
#ifndef _DBDIMP_H
|
||||
#define _DBDIMP_H 1
|
||||
|
||||
#include "SQLiteXS.h"
|
||||
#include "sqlite3.h"
|
||||
|
||||
/* 30 second timeout by default */
|
||||
#define SQL_TIMEOUT 30000
|
||||
|
||||
/* Driver Handle */
|
||||
struct imp_drh_st {
|
||||
dbih_drc_t com;
|
||||
/* sqlite specific bits */
|
||||
};
|
||||
|
||||
/* Database Handle */
|
||||
struct imp_dbh_st {
|
||||
dbih_dbc_t com;
|
||||
/* sqlite specific bits */
|
||||
sqlite3 *db;
|
||||
bool in_tran;
|
||||
bool unicode;
|
||||
bool handle_binary_nulls;
|
||||
int timeout;
|
||||
AV *functions;
|
||||
AV *aggregates;
|
||||
};
|
||||
|
||||
/* Statement Handle */
|
||||
struct imp_sth_st {
|
||||
dbih_stc_t com;
|
||||
/* sqlite specific bits */
|
||||
sqlite3_stmt *stmt;
|
||||
/*
|
||||
char **results;
|
||||
char **coldata;
|
||||
*/
|
||||
int retval;
|
||||
int nrow;
|
||||
char *statement;
|
||||
AV *params;
|
||||
AV *col_types;
|
||||
};
|
||||
|
||||
#define dbd_init sqlite_init
|
||||
#define dbd_discon_all sqlite_discon_all
|
||||
#define dbd_db_login sqlite_db_login
|
||||
#define dbd_db_do sqlite_db_do
|
||||
#define dbd_db_commit sqlite_db_commit
|
||||
#define dbd_db_rollback sqlite_db_rollback
|
||||
#define dbd_db_disconnect sqlite_db_disconnect
|
||||
#define dbd_db_destroy sqlite_db_destroy
|
||||
#define dbd_db_STORE_attrib sqlite_db_STORE_attrib
|
||||
#define dbd_db_FETCH_attrib sqlite_db_FETCH_attrib
|
||||
#define dbd_db_STORE_attrib_k sqlite_db_STORE_attrib_k
|
||||
#define dbd_db_FETCH_attrib_k sqlite_db_FETCH_attrib_k
|
||||
#define dbd_db_last_insert_id sqlite_db_last_insert_id
|
||||
#define dbd_st_prepare sqlite_st_prepare
|
||||
#define dbd_st_rows sqlite_st_rows
|
||||
#define dbd_st_execute sqlite_st_execute
|
||||
#define dbd_st_fetch sqlite_st_fetch
|
||||
#define dbd_st_finish3 sqlite_st_finish3
|
||||
#define dbd_st_finish sqlite_st_finish
|
||||
#define dbd_st_destroy sqlite_st_destroy
|
||||
#define dbd_st_blob_read sqlite_st_blob_read
|
||||
#define dbd_st_STORE_attrib sqlite_st_STORE_attrib
|
||||
#define dbd_st_FETCH_attrib sqlite_st_FETCH_attrib
|
||||
#define dbd_st_STORE_attrib_k sqlite_st_STORE_attrib_k
|
||||
#define dbd_st_FETCH_attrib_k sqlite_st_FETCH_attrib_k
|
||||
#define dbd_bind_ph sqlite_bind_ph
|
||||
#define dbd_st_bind_col sqlite_bind_col
|
||||
|
||||
void sqlite3_db_create_function(SV *dbh, const char *name, int argc, SV *func);
|
||||
void sqlite3_db_enable_load_extension(SV *dbh, int onoff);
|
||||
void sqlite3_db_create_aggregate( SV *dbh, const char *name, int argc, SV *aggr );
|
||||
void sqlite3_db_create_collation(SV *dbh, const char *name, SV *func);
|
||||
void sqlite3_db_progress_handler(SV *dbh, int n_opcodes, SV *handler);
|
||||
void sqlite_st_reset( SV *sth );
|
||||
int sqlite_bind_col( SV *sth, imp_sth_t *imp_sth, SV *col, SV *ref, IV sql_type, SV *attribs );
|
||||
int dbd_set_sqlite3_busy_timeout ( SV *dbh, int timeout );
|
||||
|
||||
#ifdef SvUTF8_on
|
||||
|
||||
static SV *
|
||||
newUTF8SVpv(char *s, STRLEN len) {
|
||||
dTHX;
|
||||
register SV *sv;
|
||||
|
||||
sv = newSVpv(s, len);
|
||||
SvUTF8_on(sv);
|
||||
return sv;
|
||||
}
|
||||
|
||||
static SV *
|
||||
newUTF8SVpvn(char *s, STRLEN len) {
|
||||
dTHX;
|
||||
register SV *sv;
|
||||
|
||||
sv = newSV(0);
|
||||
sv_setpvn(sv, s, len);
|
||||
SvUTF8_on(sv);
|
||||
return sv;
|
||||
}
|
||||
|
||||
#else /* #ifdef SvUTF8_on */
|
||||
|
||||
#define newUTF8SVpv newSVpv
|
||||
#define newUTF8SVpvn newSVpvn
|
||||
#define SvUTF8_on(a) (a)
|
||||
#define SvUTF8_off(a) (a)
|
||||
#define sv_utf8_upgrade(a) (a)
|
||||
|
||||
#endif /* #ifdef SvUTF8_on */
|
||||
|
||||
#endif /* #ifndef _DBDIMP_H */
|
||||
|
||||
#ifndef _DBDIMP_H
|
||||
#define _DBDIMP_H 1
|
||||
|
||||
#include "SQLiteXS.h"
|
||||
#include "sqlite3.h"
|
||||
|
||||
/* 30 second timeout by default */
|
||||
#define SQL_TIMEOUT 30000
|
||||
|
||||
/* Driver Handle */
|
||||
struct imp_drh_st {
|
||||
dbih_drc_t com;
|
||||
/* sqlite specific bits */
|
||||
};
|
||||
|
||||
/* Database Handle */
|
||||
struct imp_dbh_st {
|
||||
dbih_dbc_t com;
|
||||
/* sqlite specific bits */
|
||||
sqlite3 *db;
|
||||
bool in_tran;
|
||||
bool unicode;
|
||||
bool handle_binary_nulls;
|
||||
int timeout;
|
||||
AV *functions;
|
||||
AV *aggregates;
|
||||
};
|
||||
|
||||
/* Statement Handle */
|
||||
struct imp_sth_st {
|
||||
dbih_stc_t com;
|
||||
/* sqlite specific bits */
|
||||
sqlite3_stmt *stmt;
|
||||
/*
|
||||
char **results;
|
||||
char **coldata;
|
||||
*/
|
||||
int retval;
|
||||
int nrow;
|
||||
char *statement;
|
||||
AV *params;
|
||||
AV *col_types;
|
||||
};
|
||||
|
||||
#define dbd_init sqlite_init
|
||||
#define dbd_discon_all sqlite_discon_all
|
||||
#define dbd_db_login sqlite_db_login
|
||||
#define dbd_db_do sqlite_db_do
|
||||
#define dbd_db_commit sqlite_db_commit
|
||||
#define dbd_db_rollback sqlite_db_rollback
|
||||
#define dbd_db_disconnect sqlite_db_disconnect
|
||||
#define dbd_db_destroy sqlite_db_destroy
|
||||
#define dbd_db_STORE_attrib sqlite_db_STORE_attrib
|
||||
#define dbd_db_FETCH_attrib sqlite_db_FETCH_attrib
|
||||
#define dbd_db_STORE_attrib_k sqlite_db_STORE_attrib_k
|
||||
#define dbd_db_FETCH_attrib_k sqlite_db_FETCH_attrib_k
|
||||
#define dbd_db_last_insert_id sqlite_db_last_insert_id
|
||||
#define dbd_st_prepare sqlite_st_prepare
|
||||
#define dbd_st_rows sqlite_st_rows
|
||||
#define dbd_st_execute sqlite_st_execute
|
||||
#define dbd_st_fetch sqlite_st_fetch
|
||||
#define dbd_st_finish3 sqlite_st_finish3
|
||||
#define dbd_st_finish sqlite_st_finish
|
||||
#define dbd_st_destroy sqlite_st_destroy
|
||||
#define dbd_st_blob_read sqlite_st_blob_read
|
||||
#define dbd_st_STORE_attrib sqlite_st_STORE_attrib
|
||||
#define dbd_st_FETCH_attrib sqlite_st_FETCH_attrib
|
||||
#define dbd_st_STORE_attrib_k sqlite_st_STORE_attrib_k
|
||||
#define dbd_st_FETCH_attrib_k sqlite_st_FETCH_attrib_k
|
||||
#define dbd_bind_ph sqlite_bind_ph
|
||||
#define dbd_st_bind_col sqlite_bind_col
|
||||
|
||||
void sqlite3_db_create_function(pTHX_ SV *dbh, const char *name, int argc, SV *func);
|
||||
void sqlite3_db_enable_load_extension(pTHX_ SV *dbh, int onoff);
|
||||
void sqlite3_db_create_aggregate(pTHX_ SV *dbh, const char *name, int argc, SV *aggr );
|
||||
void sqlite3_db_create_collation(pTHX_ SV *dbh, const char *name, SV *func);
|
||||
void sqlite3_db_progress_handler(pTHX_ SV *dbh, int n_opcodes, SV *handler);
|
||||
void sqlite_st_reset(pTHX_ SV *sth );
|
||||
int sqlite_bind_col( SV *sth, imp_sth_t *imp_sth, SV *col, SV *ref, IV sql_type, SV *attribs );
|
||||
int dbd_set_sqlite3_busy_timeout (pTHX_ SV *dbh, int timeout );
|
||||
|
||||
#ifdef SvUTF8_on
|
||||
|
||||
static SV *
|
||||
newUTF8SVpv(char *s, STRLEN len) {
|
||||
dTHX;
|
||||
register SV *sv;
|
||||
|
||||
sv = newSVpv(s, len);
|
||||
SvUTF8_on(sv);
|
||||
return sv;
|
||||
}
|
||||
|
||||
static SV *
|
||||
newUTF8SVpvn(char *s, STRLEN len) {
|
||||
dTHX;
|
||||
register SV *sv;
|
||||
|
||||
sv = newSV(0);
|
||||
sv_setpvn(sv, s, len);
|
||||
SvUTF8_on(sv);
|
||||
return sv;
|
||||
}
|
||||
|
||||
#else /* #ifdef SvUTF8_on */
|
||||
|
||||
#define newUTF8SVpv newSVpv
|
||||
#define newUTF8SVpvn newSVpvn
|
||||
#define SvUTF8_on(a) (a)
|
||||
#define SvUTF8_off(a) (a)
|
||||
#define sv_utf8_upgrade(a) (a)
|
||||
|
||||
#endif /* #ifdef SvUTF8_on */
|
||||
|
||||
#endif /* #ifndef _DBDIMP_H */
|
||||
|
|
Loading…
Add table
Reference in a new issue