mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 14:19:10 -04:00
Correcting newline style to native
This commit is contained in:
parent
ba52ccbba4
commit
683e627d25
4 changed files with 8592 additions and 8592 deletions
218
SQLite.xs
218
SQLite.xs
|
@ -1,109 +1,109 @@
|
||||||
#define PERL_NO_GET_CONTEXT
|
#define PERL_NO_GET_CONTEXT
|
||||||
|
|
||||||
#include "SQLiteXS.h"
|
#include "SQLiteXS.h"
|
||||||
|
|
||||||
DBISTATE_DECLARE;
|
DBISTATE_DECLARE;
|
||||||
|
|
||||||
MODULE = DBD::SQLite PACKAGE = DBD::SQLite::db
|
MODULE = DBD::SQLite PACKAGE = DBD::SQLite::db
|
||||||
|
|
||||||
PROTOTYPES: DISABLE
|
PROTOTYPES: DISABLE
|
||||||
|
|
||||||
BOOT:
|
BOOT:
|
||||||
sv_setpv(get_sv("DBD::SQLite::sqlite_version", TRUE|GV_ADDMULTI), SQLITE_VERSION);
|
sv_setpv(get_sv("DBD::SQLite::sqlite_version", TRUE|GV_ADDMULTI), SQLITE_VERSION);
|
||||||
|
|
||||||
AV *
|
AV *
|
||||||
list_tables(dbh)
|
list_tables(dbh)
|
||||||
SV *dbh
|
SV *dbh
|
||||||
CODE:
|
CODE:
|
||||||
{
|
{
|
||||||
RETVAL = newAV();
|
RETVAL = newAV();
|
||||||
}
|
}
|
||||||
OUTPUT:
|
OUTPUT:
|
||||||
RETVAL
|
RETVAL
|
||||||
|
|
||||||
IV
|
IV
|
||||||
last_insert_rowid(dbh)
|
last_insert_rowid(dbh)
|
||||||
SV *dbh
|
SV *dbh
|
||||||
CODE:
|
CODE:
|
||||||
{
|
{
|
||||||
D_imp_dbh(dbh);
|
D_imp_dbh(dbh);
|
||||||
RETVAL = sqlite3_last_insert_rowid(imp_dbh->db);
|
RETVAL = sqlite3_last_insert_rowid(imp_dbh->db);
|
||||||
}
|
}
|
||||||
OUTPUT:
|
OUTPUT:
|
||||||
RETVAL
|
RETVAL
|
||||||
|
|
||||||
void
|
void
|
||||||
create_function(dbh, name, argc, func)
|
create_function(dbh, name, argc, func)
|
||||||
SV *dbh
|
SV *dbh
|
||||||
char *name
|
char *name
|
||||||
int argc
|
int argc
|
||||||
SV *func
|
SV *func
|
||||||
CODE:
|
CODE:
|
||||||
{
|
{
|
||||||
sqlite3_db_create_function(aTHX_ dbh, name, argc, func );
|
sqlite3_db_create_function(aTHX_ dbh, name, argc, func );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
enable_load_extension(dbh, onoff)
|
enable_load_extension(dbh, onoff)
|
||||||
SV *dbh
|
SV *dbh
|
||||||
int onoff
|
int onoff
|
||||||
CODE:
|
CODE:
|
||||||
{
|
{
|
||||||
sqlite3_db_enable_load_extension(aTHX_ dbh, onoff );
|
sqlite3_db_enable_load_extension(aTHX_ dbh, onoff );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
create_aggregate(dbh, name, argc, aggr)
|
create_aggregate(dbh, name, argc, aggr)
|
||||||
SV *dbh
|
SV *dbh
|
||||||
char *name
|
char *name
|
||||||
int argc
|
int argc
|
||||||
SV *aggr
|
SV *aggr
|
||||||
CODE:
|
CODE:
|
||||||
{
|
{
|
||||||
sqlite3_db_create_aggregate(aTHX_ dbh, name, argc, aggr );
|
sqlite3_db_create_aggregate(aTHX_ dbh, name, argc, aggr );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
create_collation(dbh, name, func)
|
create_collation(dbh, name, func)
|
||||||
SV *dbh
|
SV *dbh
|
||||||
char *name
|
char *name
|
||||||
SV *func
|
SV *func
|
||||||
CODE:
|
CODE:
|
||||||
{
|
{
|
||||||
sqlite3_db_create_collation(aTHX_ dbh, name, func );
|
sqlite3_db_create_collation(aTHX_ dbh, name, func );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
progress_handler(dbh, n_opcodes, handler)
|
progress_handler(dbh, n_opcodes, handler)
|
||||||
SV *dbh
|
SV *dbh
|
||||||
int n_opcodes
|
int n_opcodes
|
||||||
SV *handler
|
SV *handler
|
||||||
CODE:
|
CODE:
|
||||||
{
|
{
|
||||||
sqlite3_db_progress_handler(aTHX_ dbh, n_opcodes, handler );
|
sqlite3_db_progress_handler(aTHX_ dbh, n_opcodes, handler );
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
busy_timeout(dbh, timeout=0)
|
busy_timeout(dbh, timeout=0)
|
||||||
SV *dbh
|
SV *dbh
|
||||||
int timeout
|
int timeout
|
||||||
CODE:
|
CODE:
|
||||||
RETVAL = dbd_set_sqlite3_busy_timeout(aTHX_ dbh, timeout );
|
RETVAL = dbd_set_sqlite3_busy_timeout(aTHX_ dbh, timeout );
|
||||||
OUTPUT:
|
OUTPUT:
|
||||||
RETVAL
|
RETVAL
|
||||||
|
|
||||||
MODULE = DBD::SQLite PACKAGE = DBD::SQLite::st
|
MODULE = DBD::SQLite PACKAGE = DBD::SQLite::st
|
||||||
|
|
||||||
PROTOTYPES: DISABLE
|
PROTOTYPES: DISABLE
|
||||||
|
|
||||||
void
|
void
|
||||||
reset(sth)
|
reset(sth)
|
||||||
SV *sth
|
SV *sth
|
||||||
CODE:
|
CODE:
|
||||||
{
|
{
|
||||||
sqlite_st_reset(aTHX_ sth);
|
sqlite_st_reset(aTHX_ sth);
|
||||||
}
|
}
|
||||||
|
|
||||||
MODULE = DBD::SQLite PACKAGE = DBD::SQLite
|
MODULE = DBD::SQLite PACKAGE = DBD::SQLite
|
||||||
|
|
||||||
INCLUDE: SQLite.xsi
|
INCLUDE: SQLite.xsi
|
||||||
|
|
232
dbdimp.h
232
dbdimp.h
|
@ -1,116 +1,116 @@
|
||||||
|
|
||||||
#ifndef _DBDIMP_H
|
#ifndef _DBDIMP_H
|
||||||
#define _DBDIMP_H 1
|
#define _DBDIMP_H 1
|
||||||
|
|
||||||
#include "SQLiteXS.h"
|
#include "SQLiteXS.h"
|
||||||
#include "sqlite3.h"
|
#include "sqlite3.h"
|
||||||
|
|
||||||
/* 30 second timeout by default */
|
/* 30 second timeout by default */
|
||||||
#define SQL_TIMEOUT 30000
|
#define SQL_TIMEOUT 30000
|
||||||
|
|
||||||
/* Driver Handle */
|
/* Driver Handle */
|
||||||
struct imp_drh_st {
|
struct imp_drh_st {
|
||||||
dbih_drc_t com;
|
dbih_drc_t com;
|
||||||
/* sqlite specific bits */
|
/* sqlite specific bits */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Database Handle */
|
/* Database Handle */
|
||||||
struct imp_dbh_st {
|
struct imp_dbh_st {
|
||||||
dbih_dbc_t com;
|
dbih_dbc_t com;
|
||||||
/* sqlite specific bits */
|
/* sqlite specific bits */
|
||||||
sqlite3 *db;
|
sqlite3 *db;
|
||||||
bool in_tran;
|
bool in_tran;
|
||||||
bool unicode;
|
bool unicode;
|
||||||
bool handle_binary_nulls;
|
bool handle_binary_nulls;
|
||||||
int timeout;
|
int timeout;
|
||||||
AV *functions;
|
AV *functions;
|
||||||
AV *aggregates;
|
AV *aggregates;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Statement Handle */
|
/* Statement Handle */
|
||||||
struct imp_sth_st {
|
struct imp_sth_st {
|
||||||
dbih_stc_t com;
|
dbih_stc_t com;
|
||||||
/* sqlite specific bits */
|
/* sqlite specific bits */
|
||||||
sqlite3_stmt *stmt;
|
sqlite3_stmt *stmt;
|
||||||
/*
|
/*
|
||||||
char **results;
|
char **results;
|
||||||
char **coldata;
|
char **coldata;
|
||||||
*/
|
*/
|
||||||
int retval;
|
int retval;
|
||||||
int nrow;
|
int nrow;
|
||||||
char *statement;
|
char *statement;
|
||||||
AV *params;
|
AV *params;
|
||||||
AV *col_types;
|
AV *col_types;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define dbd_init sqlite_init
|
#define dbd_init sqlite_init
|
||||||
#define dbd_discon_all sqlite_discon_all
|
#define dbd_discon_all sqlite_discon_all
|
||||||
#define dbd_db_login sqlite_db_login
|
#define dbd_db_login sqlite_db_login
|
||||||
#define dbd_db_do sqlite_db_do
|
#define dbd_db_do sqlite_db_do
|
||||||
#define dbd_db_commit sqlite_db_commit
|
#define dbd_db_commit sqlite_db_commit
|
||||||
#define dbd_db_rollback sqlite_db_rollback
|
#define dbd_db_rollback sqlite_db_rollback
|
||||||
#define dbd_db_disconnect sqlite_db_disconnect
|
#define dbd_db_disconnect sqlite_db_disconnect
|
||||||
#define dbd_db_destroy sqlite_db_destroy
|
#define dbd_db_destroy sqlite_db_destroy
|
||||||
#define dbd_db_STORE_attrib sqlite_db_STORE_attrib
|
#define dbd_db_STORE_attrib sqlite_db_STORE_attrib
|
||||||
#define dbd_db_FETCH_attrib sqlite_db_FETCH_attrib
|
#define dbd_db_FETCH_attrib sqlite_db_FETCH_attrib
|
||||||
#define dbd_db_STORE_attrib_k sqlite_db_STORE_attrib_k
|
#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_FETCH_attrib_k sqlite_db_FETCH_attrib_k
|
||||||
#define dbd_db_last_insert_id sqlite_db_last_insert_id
|
#define dbd_db_last_insert_id sqlite_db_last_insert_id
|
||||||
#define dbd_st_prepare sqlite_st_prepare
|
#define dbd_st_prepare sqlite_st_prepare
|
||||||
#define dbd_st_rows sqlite_st_rows
|
#define dbd_st_rows sqlite_st_rows
|
||||||
#define dbd_st_execute sqlite_st_execute
|
#define dbd_st_execute sqlite_st_execute
|
||||||
#define dbd_st_fetch sqlite_st_fetch
|
#define dbd_st_fetch sqlite_st_fetch
|
||||||
#define dbd_st_finish3 sqlite_st_finish3
|
#define dbd_st_finish3 sqlite_st_finish3
|
||||||
#define dbd_st_finish sqlite_st_finish
|
#define dbd_st_finish sqlite_st_finish
|
||||||
#define dbd_st_destroy sqlite_st_destroy
|
#define dbd_st_destroy sqlite_st_destroy
|
||||||
#define dbd_st_blob_read sqlite_st_blob_read
|
#define dbd_st_blob_read sqlite_st_blob_read
|
||||||
#define dbd_st_STORE_attrib sqlite_st_STORE_attrib
|
#define dbd_st_STORE_attrib sqlite_st_STORE_attrib
|
||||||
#define dbd_st_FETCH_attrib sqlite_st_FETCH_attrib
|
#define dbd_st_FETCH_attrib sqlite_st_FETCH_attrib
|
||||||
#define dbd_st_STORE_attrib_k sqlite_st_STORE_attrib_k
|
#define dbd_st_STORE_attrib_k sqlite_st_STORE_attrib_k
|
||||||
#define dbd_st_FETCH_attrib_k sqlite_st_FETCH_attrib_k
|
#define dbd_st_FETCH_attrib_k sqlite_st_FETCH_attrib_k
|
||||||
#define dbd_bind_ph sqlite_bind_ph
|
#define dbd_bind_ph sqlite_bind_ph
|
||||||
#define dbd_st_bind_col sqlite_bind_col
|
#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_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_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_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_create_collation(pTHX_ SV *dbh, const char *name, SV *func);
|
||||||
void sqlite3_db_progress_handler(pTHX_ SV *dbh, int n_opcodes, SV *handler);
|
void sqlite3_db_progress_handler(pTHX_ SV *dbh, int n_opcodes, SV *handler);
|
||||||
void sqlite_st_reset(pTHX_ SV *sth );
|
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 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 );
|
int dbd_set_sqlite3_busy_timeout (pTHX_ SV *dbh, int timeout );
|
||||||
|
|
||||||
#ifdef SvUTF8_on
|
#ifdef SvUTF8_on
|
||||||
|
|
||||||
static SV *
|
static SV *
|
||||||
newUTF8SVpv(char *s, STRLEN len) {
|
newUTF8SVpv(char *s, STRLEN len) {
|
||||||
dTHX;
|
dTHX;
|
||||||
register SV *sv;
|
register SV *sv;
|
||||||
|
|
||||||
sv = newSVpv(s, len);
|
sv = newSVpv(s, len);
|
||||||
SvUTF8_on(sv);
|
SvUTF8_on(sv);
|
||||||
return sv;
|
return sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static SV *
|
static SV *
|
||||||
newUTF8SVpvn(char *s, STRLEN len) {
|
newUTF8SVpvn(char *s, STRLEN len) {
|
||||||
dTHX;
|
dTHX;
|
||||||
register SV *sv;
|
register SV *sv;
|
||||||
|
|
||||||
sv = newSV(0);
|
sv = newSV(0);
|
||||||
sv_setpvn(sv, s, len);
|
sv_setpvn(sv, s, len);
|
||||||
SvUTF8_on(sv);
|
SvUTF8_on(sv);
|
||||||
return sv;
|
return sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* #ifdef SvUTF8_on */
|
#else /* #ifdef SvUTF8_on */
|
||||||
|
|
||||||
#define newUTF8SVpv newSVpv
|
#define newUTF8SVpv newSVpv
|
||||||
#define newUTF8SVpvn newSVpvn
|
#define newUTF8SVpvn newSVpvn
|
||||||
#define SvUTF8_on(a) (a)
|
#define SvUTF8_on(a) (a)
|
||||||
#define SvUTF8_off(a) (a)
|
#define SvUTF8_off(a) (a)
|
||||||
#define sv_utf8_upgrade(a) (a)
|
#define sv_utf8_upgrade(a) (a)
|
||||||
|
|
||||||
#endif /* #ifdef SvUTF8_on */
|
#endif /* #ifdef SvUTF8_on */
|
||||||
|
|
||||||
#endif /* #ifndef _DBDIMP_H */
|
#endif /* #ifndef _DBDIMP_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue