Go to the source code of this file.
Classes | |
struct | SqlFunc |
struct | SqlCollate |
struct | SqlPreparedStmt |
struct | SqliteDb |
struct | IncrblobChannel |
Defines | |
#define | NUM_PREPARED_STMTS 10 |
#define | MAX_PREPARED_STMTS 100 |
#define | Tcl_InitStubs(a, b, c) |
#define | PACKAGE_VERSION SQLITE_VERSION |
Typedefs | |
typedef struct SqlFunc | SqlFunc |
typedef struct SqlCollate | SqlCollate |
typedef struct SqlPreparedStmt | SqlPreparedStmt |
typedef struct IncrblobChannel | IncrblobChannel |
typedef struct SqliteDb | SqliteDb |
Functions | |
static void | closeIncrblobChannels (SqliteDb *pDb) |
static int | incrblobClose (ClientData instanceData, Tcl_Interp *interp) |
static int | incrblobInput (ClientData instanceData, char *buf, int bufSize, int *errorCodePtr) |
static int | incrblobOutput (ClientData instanceData, CONST char *buf, int toWrite, int *errorCodePtr) |
static int | incrblobSeek (ClientData instanceData, long offset, int seekMode, int *errorCodePtr) |
static void | incrblobWatch (ClientData instanceData, int mode) |
static int | incrblobHandle (ClientData instanceData, int dir, ClientData *hPtr) |
static int | createIncrblobChannel (Tcl_Interp *interp, SqliteDb *pDb, const char *zDb, const char *zTable, const char *zColumn, sqlite_int64 iRow, int isReadonly) |
static int | safeToUseEvalObjv (Tcl_Interp *interp, Tcl_Obj *pCmd) |
static SqlFunc * | findSqlFunc (SqliteDb *pDb, const char *zName) |
static void | flushStmtCache (SqliteDb *pDb) |
static void | DbDeleteCmd (void *db) |
static int | DbBusyHandler (void *cd, int nTries) |
static int | DbProgressHandler (void *cd) |
static void | DbTraceHandler (void *cd, const char *zSql) |
static void | DbProfileHandler (void *cd, const char *zSql, sqlite_uint64 tm) |
static int | DbCommitHandler (void *cd) |
static void | DbRollbackHandler (void *clientData) |
static void | DbUpdateHandler (void *p, int op, const char *zDb, const char *zTbl, sqlite_int64 rowid) |
static void | tclCollateNeeded (void *pCtx, sqlite3 *db, int enc, const char *zName) |
static int | tclSqlCollate (void *pCtx, int nA, const void *zA, int nB, const void *zB) |
static void | tclSqlFunc (sqlite3_context *context, int argc, sqlite3_value **argv) |
static int | auth_callback (void *pArg, int code, const char *zArg1, const char *zArg2, const char *zArg3, const char *zArg4) |
static Tcl_Obj * | dbTextToObj (char const *zText) |
static char * | local_getline (char *zPrompt, FILE *in) |
static int | computeColumnNames (Tcl_Interp *interp, sqlite3_stmt *pStmt, Tcl_Obj ***papColName, Tcl_Obj *pArray) |
static int | DbObjCmd (void *cd, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) |
static int | DbMain (void *cd, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) |
EXTERN int | Sqlite3_Init (Tcl_Interp *interp) |
EXTERN int | Tclsqlite3_Init (Tcl_Interp *interp) |
EXTERN int | Sqlite3_SafeInit (Tcl_Interp *interp) |
EXTERN int | Tclsqlite3_SafeInit (Tcl_Interp *interp) |
EXTERN int | Sqlite3_Unload (Tcl_Interp *interp, int flags) |
EXTERN int | Tclsqlite3_Unload (Tcl_Interp *interp, int flags) |
EXTERN int | Sqlite3_SafeUnload (Tcl_Interp *interp, int flags) |
EXTERN int | Tclsqlite3_SafeUnload (Tcl_Interp *interp, int flags) |
EXTERN int | Sqlite_Init (Tcl_Interp *interp) |
EXTERN int | Tclsqlite_Init (Tcl_Interp *interp) |
EXTERN int | Sqlite_SafeInit (Tcl_Interp *interp) |
EXTERN int | Tclsqlite_SafeInit (Tcl_Interp *interp) |
EXTERN int | Sqlite_Unload (Tcl_Interp *interp, int flags) |
EXTERN int | Tclsqlite_Unload (Tcl_Interp *interp, int flags) |
EXTERN int | Sqlite_SafeUnload (Tcl_Interp *interp, int flags) |
EXTERN int | Tclsqlite_SafeUnload (Tcl_Interp *interp, int flags) |
Variables | |
static Tcl_ChannelType | IncrblobChannelType |
#define MAX_PREPARED_STMTS 100 |
Definition at line 42 of file tclsqlite.c.
Referenced by DbObjCmd().
#define NUM_PREPARED_STMTS 10 |
Definition at line 41 of file tclsqlite.c.
Referenced by DbMain().
#define PACKAGE_VERSION SQLITE_VERSION |
Definition at line 2505 of file tclsqlite.c.
Referenced by Sqlite3_Init().
#define Tcl_InitStubs | ( | a, | |||
b, | |||||
c | ) |
Definition at line 2496 of file tclsqlite.c.
Referenced by Sqlite3_Init().
typedef struct IncrblobChannel IncrblobChannel |
Definition at line 91 of file tclsqlite.c.
typedef struct SqlCollate SqlCollate |
Definition at line 71 of file tclsqlite.c.
Definition at line 58 of file tclsqlite.c.
Definition at line 97 of file tclsqlite.c.
typedef struct SqlPreparedStmt SqlPreparedStmt |
Definition at line 82 of file tclsqlite.c.
static int auth_callback | ( | void * | pArg, | |
int | code, | |||
const char * | zArg1, | |||
const char * | zArg2, | |||
const char * | zArg3, | |||
const char * | zArg4 | |||
) | [static] |
Definition at line 753 of file tclsqlite.c.
References SqliteDb::disableAuth, SqliteDb::interp, SQLITE_ALTER_TABLE, SQLITE_ANALYZE, SQLITE_ATTACH, SQLITE_COPY, SQLITE_CREATE_INDEX, SQLITE_CREATE_TABLE, SQLITE_CREATE_TEMP_INDEX, SQLITE_CREATE_TEMP_TABLE, SQLITE_CREATE_TEMP_TRIGGER, SQLITE_CREATE_TEMP_VIEW, SQLITE_CREATE_TRIGGER, SQLITE_CREATE_VIEW, SQLITE_CREATE_VTABLE, SQLITE_DELETE, SQLITE_DENY, SQLITE_DETACH, SQLITE_DROP_INDEX, SQLITE_DROP_TABLE, SQLITE_DROP_TEMP_INDEX, SQLITE_DROP_TEMP_TABLE, SQLITE_DROP_TEMP_TRIGGER, SQLITE_DROP_TEMP_VIEW, SQLITE_DROP_TRIGGER, SQLITE_DROP_VIEW, SQLITE_DROP_VTABLE, SQLITE_FUNCTION, SQLITE_IGNORE, SQLITE_INSERT, SQLITE_OK, SQLITE_PRAGMA, SQLITE_READ, SQLITE_REINDEX, SQLITE_SELECT, SQLITE_TRANSACTION, SQLITE_UPDATE, and SqliteDb::zAuth.
Referenced by DbObjCmd().
static void closeIncrblobChannels | ( | SqliteDb * | pDb | ) | [static] |
Definition at line 137 of file tclsqlite.c.
References IncrblobChannel::channel, SqliteDb::interp, SqliteDb::pIncrblob, and IncrblobChannel::pNext.
Referenced by DbDeleteCmd().
static int computeColumnNames | ( | Tcl_Interp * | interp, | |
sqlite3_stmt * | pStmt, | |||
Tcl_Obj *** | papColName, | |||
Tcl_Obj * | pArray | |||
) | [static] |
Definition at line 916 of file tclsqlite.c.
References dbTextToObj(), sqlite3_column_count(), and sqlite3_column_name().
Referenced by DbObjCmd().
static int createIncrblobChannel | ( | Tcl_Interp * | interp, | |
SqliteDb * | pDb, | |||
const char * | zDb, | |||
const char * | zTable, | |||
const char * | zColumn, | |||
sqlite_int64 | iRow, | |||
int | isReadonly | |||
) | [static] |
Definition at line 303 of file tclsqlite.c.
References IncrblobChannel::channel, SqliteDb::db, db, IncrblobChannelType, IncrblobChannel::iSeek, IncrblobChannel::pBlob, IncrblobChannel::pDb, SqliteDb::pIncrblob, IncrblobChannel::pNext, IncrblobChannel::pPrev, sqlite3_blob_open(), sqlite3_errmsg(), sqlite3_snprintf(), and SQLITE_OK.
Referenced by DbObjCmd().
static int DbBusyHandler | ( | void * | cd, | |
int | nTries | |||
) | [static] |
Definition at line 471 of file tclsqlite.c.
References SqliteDb::interp, sqlite3_snprintf(), and SqliteDb::zBusy.
Referenced by DbObjCmd().
static int DbCommitHandler | ( | void * | cd | ) | [static] |
Definition at line 546 of file tclsqlite.c.
References SqliteDb::interp, and SqliteDb::zCommit.
Referenced by DbObjCmd().
static void DbDeleteCmd | ( | void * | db | ) | [static] |
Definition at line 424 of file tclsqlite.c.
References closeIncrblobChannels(), SqliteDb::db, flushStmtCache(), SqliteDb::pCollate, SqliteDb::pCollateNeeded, SqliteDb::pFunc, SqlCollate::pNext, SqlFunc::pNext, SqliteDb::pRollbackHook, SqlFunc::pScript, SqliteDb::pUpdateHook, sqlite3_close(), SqliteDb::zAuth, SqliteDb::zBusy, SqliteDb::zNull, SqliteDb::zProfile, and SqliteDb::zTrace.
Referenced by DbMain().
static int DbMain | ( | void * | cd, | |
Tcl_Interp * | interp, | |||
int | objc, | |||
Tcl_Obj *const * | objv | |||
) | [static] |
Definition at line 2372 of file tclsqlite.c.
References SqliteDb::db, DbDeleteCmd(), DbObjCmd(), SqliteDb::interp, SqliteDb::maxStmt, NUM_PREPARED_STMTS, sqlite3_close(), sqlite3_errcode(), sqlite3_errmsg(), sqlite3_free(), sqlite3_key(), sqlite3_mprintf(), sqlite3_open_v2(), sqlite3_version, SQLITE_OK, SQLITE_OPEN_CREATE, SQLITE_OPEN_FULLMUTEX, SQLITE_OPEN_NOMUTEX, SQLITE_OPEN_READONLY, and SQLITE_OPEN_READWRITE.
Referenced by Sqlite3_Init().
static int DbObjCmd | ( | void * | cd, | |
Tcl_Interp * | interp, | |||
int | objc, | |||
Tcl_Obj *const * | objv | |||
) | [static] |
Definition at line 968 of file tclsqlite.c.
References auth_callback(), computeColumnNames(), createIncrblobChannel(), SqliteDb::db, DbBusyHandler(), DbCommitHandler(), DbProfileHandler(), DbProgressHandler(), DbRollbackHandler(), dbTextToObj(), DbTraceHandler(), DbUpdateHandler(), SqliteDb::disableAuth, findSqlFunc(), flushStmtCache(), SqlCollate::interp, SqliteDb::interp, local_getline(), MAX_PREPARED_STMTS, SqliteDb::maxStmt, SqliteDb::nSort, SqlPreparedStmt::nSql, SqliteDb::nStep, SqliteDb::nStmt, SqliteDb::pCollate, SqliteDb::pCollateNeeded, SqlPreparedStmt::pNext, SqlCollate::pNext, SqlPreparedStmt::pPrev, SqliteDb::pRollbackHook, SqlFunc::pScript, SqlPreparedStmt::pStmt, SqliteDb::pUpdateHook, safeToUseEvalObjv(), sqlite3_bind_blob(), sqlite3_bind_double(), sqlite3_bind_int(), sqlite3_bind_int64(), sqlite3_bind_null(), sqlite3_bind_parameter_count(), sqlite3_bind_parameter_name(), sqlite3_bind_text(), sqlite3_busy_handler(), sqlite3_busy_timeout(), sqlite3_changes(), sqlite3_collation_needed(), sqlite3_column_blob(), sqlite3_column_bytes(), sqlite3_column_count(), sqlite3_column_double(), sqlite3_column_int64(), sqlite3_column_text(), sqlite3_column_type(), sqlite3_commit_hook(), sqlite3_complete(), sqlite3_create_collation(), sqlite3_create_function(), sqlite3_enable_load_extension(), sqlite3_errcode(), sqlite3_errmsg(), sqlite3_exec(), sqlite3_finalize(), sqlite3_free(), sqlite3_get_autocommit(), sqlite3_interrupt(), sqlite3_last_insert_rowid(), sqlite3_libversion(), sqlite3_mprintf(), sqlite3_prepare(), sqlite3_prepare_v2(), sqlite3_profile(), sqlite3_progress_handler(), sqlite3_rekey(), sqlite3_reset(), sqlite3_rollback_hook(), sqlite3_set_authorizer(), sqlite3_snprintf(), sqlite3_sql(), sqlite3_step(), sqlite3_stmt_status(), sqlite3_total_changes(), sqlite3_trace(), sqlite3_update_hook(), sqlite3ErrStr(), SQLITE_BLOB, SQLITE_FLOAT, SQLITE_INTEGER, SQLITE_NULL, SQLITE_OK, SQLITE_ROW, SQLITE_STATIC, SQLITE_STMTSTATUS_FULLSCAN_STEP, SQLITE_STMTSTATUS_SORT, SQLITE_UTF8, SqliteDb::stmtLast, SqliteDb::stmtList, tclCollateNeeded(), tclSqlCollate(), tclSqlFunc(), ttype, SqlFunc::useEvalObjv, SqliteDb::zAuth, SqliteDb::zBusy, SqliteDb::zCommit, SqliteDb::zNull, SqliteDb::zProfile, SqliteDb::zProgress, SqlCollate::zScript, SqlPreparedStmt::zSql, and SqliteDb::zTrace.
Referenced by DbMain().
static void DbProfileHandler | ( | void * | cd, | |
const char * | zSql, | |||
sqlite_uint64 | tm | |||
) | [static] |
Definition at line 524 of file tclsqlite.c.
References SqliteDb::interp, sqlite3_snprintf(), and SqliteDb::zProfile.
Referenced by DbObjCmd().
static int DbProgressHandler | ( | void * | cd | ) | [static] |
Definition at line 488 of file tclsqlite.c.
References SqliteDb::interp, and SqliteDb::zProgress.
Referenced by DbObjCmd().
static void DbRollbackHandler | ( | void * | clientData | ) | [static] |
Definition at line 557 of file tclsqlite.c.
References SqliteDb::interp, and SqliteDb::pRollbackHook.
Referenced by DbObjCmd().
static Tcl_Obj* dbTextToObj | ( | char const * | zText | ) | [static] |
Definition at line 832 of file tclsqlite.c.
Referenced by computeColumnNames(), and DbObjCmd().
static void DbTraceHandler | ( | void * | cd, | |
const char * | zSql | |||
) | [static] |
Definition at line 506 of file tclsqlite.c.
References SqliteDb::interp, and SqliteDb::zTrace.
Referenced by DbObjCmd().
static void DbUpdateHandler | ( | void * | p, | |
int | op, | |||
const char * | zDb, | |||
const char * | zTbl, | |||
sqlite_int64 | rowid | |||
) | [static] |
Definition at line 565 of file tclsqlite.c.
References SqliteDb::interp, SqliteDb::pUpdateHook, SQLITE_DELETE, SQLITE_INSERT, and SQLITE_UPDATE.
Referenced by DbObjCmd().
Definition at line 384 of file tclsqlite.c.
References SqliteDb::interp, SqlFunc::interp, SqliteDb::pFunc, SqlFunc::pNext, SqlFunc::pScript, and SqlFunc::zName.
Referenced by DbObjCmd().
static void flushStmtCache | ( | SqliteDb * | pDb | ) | [static] |
Definition at line 407 of file tclsqlite.c.
References SqliteDb::nStmt, SqlPreparedStmt::pNext, SqlPreparedStmt::pStmt, sqlite3_finalize(), SqliteDb::stmtLast, and SqliteDb::stmtList.
Referenced by DbDeleteCmd(), and DbObjCmd().
static int incrblobClose | ( | ClientData | instanceData, | |
Tcl_Interp * | interp | |||
) | [static] |
Definition at line 155 of file tclsqlite.c.
References SqliteDb::db, db, IncrblobChannel::pBlob, IncrblobChannel::pDb, SqliteDb::pIncrblob, IncrblobChannel::pNext, IncrblobChannel::pPrev, sqlite3_blob_close(), sqlite3_errmsg(), and SQLITE_OK.
static int incrblobHandle | ( | ClientData | instanceData, | |
int | dir, | |||
ClientData * | hPtr | |||
) | [static] |
Definition at line 278 of file tclsqlite.c.
static int incrblobInput | ( | ClientData | instanceData, | |
char * | buf, | |||
int | bufSize, | |||
int * | errorCodePtr | |||
) | [static] |
Definition at line 184 of file tclsqlite.c.
References IncrblobChannel::iSeek, IncrblobChannel::pBlob, sqlite3_blob_bytes(), sqlite3_blob_read(), and SQLITE_OK.
static int incrblobOutput | ( | ClientData | instanceData, | |
CONST char * | buf, | |||
int | toWrite, | |||
int * | errorCodePtr | |||
) | [static] |
Definition at line 216 of file tclsqlite.c.
References IncrblobChannel::iSeek, IncrblobChannel::pBlob, sqlite3_blob_bytes(), sqlite3_blob_write(), and SQLITE_OK.
static int incrblobSeek | ( | ClientData | instanceData, | |
long | offset, | |||
int | seekMode, | |||
int * | errorCodePtr | |||
) | [static] |
Definition at line 249 of file tclsqlite.c.
References IncrblobChannel::iSeek, IncrblobChannel::pBlob, and sqlite3_blob_bytes().
static void incrblobWatch | ( | ClientData | instanceData, | |
int | mode | |||
) | [static] |
Definition at line 275 of file tclsqlite.c.
static char* local_getline | ( | char * | zPrompt, | |
FILE * | in | |||
) | [static] |
Definition at line 857 of file tclsqlite.c.
Referenced by DbObjCmd().
static int safeToUseEvalObjv | ( | Tcl_Interp * | interp, | |
Tcl_Obj * | pCmd | |||
) | [static] |
Definition at line 364 of file tclsqlite.c.
Referenced by DbObjCmd().
EXTERN int Sqlite3_Init | ( | Tcl_Interp * | interp | ) |
Definition at line 2517 of file tclsqlite.c.
References DbMain(), PACKAGE_VERSION, and Tcl_InitStubs.
Referenced by Sqlite_Init(), Tclsqlite3_Init(), and Tclsqlite_Init().
EXTERN int Sqlite3_SafeInit | ( | Tcl_Interp * | interp | ) |
Definition at line 2526 of file tclsqlite.c.
EXTERN int Sqlite3_SafeUnload | ( | Tcl_Interp * | interp, | |
int | flags | |||
) |
Definition at line 2530 of file tclsqlite.c.
EXTERN int Sqlite3_Unload | ( | Tcl_Interp * | interp, | |
int | flags | |||
) |
Definition at line 2528 of file tclsqlite.c.
EXTERN int Sqlite_Init | ( | Tcl_Interp * | interp | ) |
Definition at line 2535 of file tclsqlite.c.
References Sqlite3_Init().
EXTERN int Sqlite_SafeInit | ( | Tcl_Interp * | interp | ) |
Definition at line 2537 of file tclsqlite.c.
EXTERN int Sqlite_SafeUnload | ( | Tcl_Interp * | interp, | |
int | flags | |||
) |
Definition at line 2541 of file tclsqlite.c.
EXTERN int Sqlite_Unload | ( | Tcl_Interp * | interp, | |
int | flags | |||
) |
Definition at line 2539 of file tclsqlite.c.
static void tclCollateNeeded | ( | void * | pCtx, | |
sqlite3 * | db, | |||
int | enc, | |||
const char * | zName | |||
) | [static] |
Definition at line 588 of file tclsqlite.c.
References SqliteDb::interp, and SqliteDb::pCollateNeeded.
Referenced by DbObjCmd().
static int tclSqlCollate | ( | void * | pCtx, | |
int | nA, | |||
const void * | zA, | |||
int | nB, | |||
const void * | zB | |||
) | [static] |
Definition at line 606 of file tclsqlite.c.
References SqlCollate::interp, and SqlCollate::zScript.
Referenced by DbObjCmd().
static void tclSqlFunc | ( | sqlite3_context * | context, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 629 of file tclsqlite.c.
References SqlFunc::interp, SqlFunc::pScript, sqlite3_result_blob(), sqlite3_result_double(), sqlite3_result_error(), sqlite3_result_int(), sqlite3_result_int64(), sqlite3_result_text(), sqlite3_user_data(), sqlite3_value_blob(), sqlite3_value_bytes(), sqlite3_value_double(), sqlite3_value_int64(), sqlite3_value_text(), sqlite3_value_type(), SQLITE_BLOB, SQLITE_FLOAT, SQLITE_INTEGER, SQLITE_NULL, SQLITE_TRANSIENT, and SqlFunc::useEvalObjv.
Referenced by DbObjCmd().
EXTERN int Tclsqlite3_Init | ( | Tcl_Interp * | interp | ) |
Definition at line 2525 of file tclsqlite.c.
References Sqlite3_Init().
EXTERN int Tclsqlite3_SafeInit | ( | Tcl_Interp * | interp | ) |
Definition at line 2527 of file tclsqlite.c.
EXTERN int Tclsqlite3_SafeUnload | ( | Tcl_Interp * | interp, | |
int | flags | |||
) |
Definition at line 2531 of file tclsqlite.c.
EXTERN int Tclsqlite3_Unload | ( | Tcl_Interp * | interp, | |
int | flags | |||
) |
Definition at line 2529 of file tclsqlite.c.
EXTERN int Tclsqlite_Init | ( | Tcl_Interp * | interp | ) |
Definition at line 2536 of file tclsqlite.c.
References Sqlite3_Init().
EXTERN int Tclsqlite_SafeInit | ( | Tcl_Interp * | interp | ) |
Definition at line 2538 of file tclsqlite.c.
EXTERN int Tclsqlite_SafeUnload | ( | Tcl_Interp * | interp, | |
int | flags | |||
) |
Definition at line 2542 of file tclsqlite.c.
EXTERN int Tclsqlite_Unload | ( | Tcl_Interp * | interp, | |
int | flags | |||
) |
Definition at line 2540 of file tclsqlite.c.
Tcl_ChannelType IncrblobChannelType [static] |
{ "incrblob", TCL_CHANNEL_VERSION_2, incrblobClose, incrblobInput, incrblobOutput, incrblobSeek, 0, 0, incrblobWatch, incrblobHandle, 0, 0, 0, 0, 0, }
Definition at line 282 of file tclsqlite.c.
Referenced by createIncrblobChannel().
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:50:02 2011 by Doxygen 1.6.1