Index: src/vdbeInt.h ================================================================== --- src/vdbeInt.h +++ src/vdbeInt.h @@ -222,11 +222,11 @@ /* ** An instance of the virtual machine. This structure contains the complete ** state of the virtual machine. ** -** The "sqlite_vm" structure pointer that is returned by sqlite_compile() +** The "sqlite_vm" structure pointer that is returned by sqlite3_compile() ** is really a pointer to an instance of this structure. */ struct Vdbe { sqlite *db; /* The whole database */ Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */ Index: src/vdbeaux.c ================================================================== --- src/vdbeaux.c +++ src/vdbeaux.c @@ -20,15 +20,15 @@ #include "vdbeInt.h" /* ** When debugging the code generator in a symbolic debugger, one can -** set the sqlite_vdbe_addop_trace to 1 and all opcodes will be printed +** set the sqlite3_vdbe_addop_trace to 1 and all opcodes will be printed ** as they are added to the instruction stream. */ #ifndef NDEBUG -int sqlite_vdbe_addop_trace = 0; +int sqlite3_vdbe_addop_trace = 0; #endif /* ** Create a new virtual database engine. @@ -98,11 +98,11 @@ } pOp->p2 = p2; pOp->p3 = 0; pOp->p3type = P3_NOTUSED; #ifndef NDEBUG - if( sqlite_vdbe_addop_trace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]); + if( sqlite3_vdbe_addop_trace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]); #endif return i; } /* @@ -224,11 +224,11 @@ pOut->p1 = pIn->p1; pOut->p2 = p2<0 ? addr + ADDR(p2) : p2; pOut->p3 = pIn->p3; pOut->p3type = pIn->p3 ? P3_STATIC : P3_NOTUSED; #ifndef NDEBUG - if( sqlite_vdbe_addop_trace ){ + if( sqlite3_vdbe_addop_trace ){ sqlite3VdbePrintOp(0, i+addr, &p->aOp[i+addr]); } #endif } p->nOp += nOp; @@ -389,28 +389,28 @@ /* ** The following group or routines are employed by installable functions ** to return their results. ** -** The sqlite_set_result_string() routine can be used to return a string +** The sqlite3_set_result_string() routine can be used to return a string ** value or to return a NULL. To return a NULL, pass in NULL for zResult. ** A copy is made of the string before this routine returns so it is safe ** to pass in an ephemeral string. ** -** sqlite_set_result_error() works like sqlite_set_result_string() except +** sqlite3_set_result_error() works like sqlite3_set_result_string() except ** that it signals a fatal error. The string argument, if any, is the ** error message. If the argument is NULL a generic substitute error message ** is used. ** -** The sqlite_set_result_int() and sqlite_set_result_double() set the return +** The sqlite3_set_result_int() and sqlite3_set_result_double() set the return ** value of the user function to an integer or a double. ** ** These routines are defined here in vdbe.c because they depend on knowing ** the internals of the sqlite_func structure which is only defined in ** this source file. */ -char *sqlite_set_result_string(sqlite_func *p, const char *zResult, int n){ +char *sqlite3_set_result_string(sqlite_func *p, const char *zResult, int n){ assert( !p->isStep ); if( p->s.flags & MEM_Dyn ){ sqliteFree(p->s.z); } if( zResult==0 ){ @@ -435,37 +435,37 @@ } p->s.n = n+1; } return p->s.z; } -void sqlite_set_result_int(sqlite_func *p, int iResult){ +void sqlite3_set_result_int(sqlite_func *p, int iResult){ assert( !p->isStep ); if( p->s.flags & MEM_Dyn ){ sqliteFree(p->s.z); } p->s.i = iResult; p->s.flags = MEM_Int; } -void sqlite_set_result_double(sqlite_func *p, double rResult){ +void sqlite3_set_result_double(sqlite_func *p, double rResult){ assert( !p->isStep ); if( p->s.flags & MEM_Dyn ){ sqliteFree(p->s.z); } p->s.r = rResult; p->s.flags = MEM_Real; } -void sqlite_set_result_error(sqlite_func *p, const char *zMsg, int n){ +void sqlite3_set_result_error(sqlite_func *p, const char *zMsg, int n){ assert( !p->isStep ); - sqlite_set_result_string(p, zMsg, n); + sqlite3_set_result_string(p, zMsg, n); p->isError = 1; } /* ** Extract the user data from a sqlite_func structure and return a ** pointer to it. */ -void *sqlite_user_data(sqlite_func *p){ +void *sqlite3_user_data(sqlite_func *p){ assert( p && p->pFunc ); return p->pFunc->pUserData; } /* @@ -475,11 +475,11 @@ ** ** This routine is defined here in vdbe.c because it depends on knowing ** the internals of the sqlite_func structure which is only defined in ** this source file. */ -void *sqlite_aggregate_context(sqlite_func *p, int nByte){ +void *sqlite3_aggregate_context(sqlite_func *p, int nByte){ assert( p && p->pFunc && p->pFunc->xStep ); if( p->pAgg==0 ){ if( nByte<=NBFS ){ p->pAgg = (void*)p->s.z; memset(p->pAgg, 0, nByte); @@ -496,11 +496,11 @@ ** ** This routine is defined here in vdbe.c because it depends on knowing ** the internals of the sqlite_func structure which is only defined in ** this source file. */ -int sqlite_aggregate_count(sqlite_func *p){ +int sqlite3_aggregate_count(sqlite_func *p){ assert( p && p->pFunc && p->pFunc->xStep ); return p->cnt; } #if !defined(NDEBUG) || defined(VDBE_PROFILE) @@ -557,11 +557,11 @@ p->rc = SQLITE_MISUSE; }else{ p->rc = SQLITE_INTERRUPT; } rc = SQLITE_ERROR; - sqlite3SetString(&p->zErrMsg, sqlite_error_string(p->rc), (char*)0); + sqlite3SetString(&p->zErrMsg, sqlite3_error_string(p->rc), (char*)0); }else{ sprintf(p->zArgv[0],"%d",i); sprintf(p->zArgv[2],"%d", p->aOp[i].p1); sprintf(p->zArgv[3],"%d", p->aOp[i].p2); if( p->aOp[i].p3type==P3_POINTER ){ @@ -834,11 +834,11 @@ int sqlite3VdbeReset(Vdbe *p, char **pzErrMsg){ sqlite *db = p->db; int i; if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){ - sqlite3SetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0); + sqlite3SetString(pzErrMsg, sqlite3_error_string(SQLITE_MISUSE), (char*)0); return SQLITE_MISUSE; } if( p->zErrMsg ){ if( pzErrMsg && *pzErrMsg==0 ){ *pzErrMsg = p->zErrMsg; @@ -845,11 +845,11 @@ }else{ sqliteFree(p->zErrMsg); } p->zErrMsg = 0; }else if( p->rc ){ - sqlite3SetString(pzErrMsg, sqlite_error_string(p->rc), (char*)0); + sqlite3SetString(pzErrMsg, sqlite3_error_string(p->rc), (char*)0); } Cleanup(p); if( p->rc!=SQLITE_OK ){ switch( p->errorAction ){ case OE_Abort: { @@ -884,11 +884,11 @@ if( db->aDb[i].pBt && db->aDb[i].inTrans==2 ){ sqlite3BtreeCommitStmt(db->aDb[i].pBt); db->aDb[i].inTrans = 1; } } - assert( p->pTos<&p->aStack[p->pc] || sqlite_malloc_failed==1 ); + assert( p->pTos<&p->aStack[p->pc] || sqlite3_malloc_failed==1 ); #ifdef VDBE_PROFILE { FILE *out = fopen("vdbe_profile.out", "a"); if( out ){ int i; @@ -920,18 +920,18 @@ int sqlite3VdbeFinalize(Vdbe *p, char **pzErrMsg){ int rc; sqlite *db; if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){ - sqlite3SetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0); + sqlite3SetString(pzErrMsg, sqlite3_error_string(SQLITE_MISUSE), (char*)0); return SQLITE_MISUSE; } db = p->db; rc = sqlite3VdbeReset(p, pzErrMsg); sqlite3VdbeDelete(p); if( db->want_to_close && db->pVdbe==0 ){ - sqlite_close(db); + sqlite3_close(db); } if( rc==SQLITE_SCHEMA ){ sqlite3ResetInternalSchema(db, 0); } return rc; @@ -943,11 +943,11 @@ ** so forth. If a value is out of range (for example $3 when nValue==2) ** then its value will be NULL. ** ** This routine overrides any prior call. */ -int sqlite_bind(sqlite_vm *pVm, int i, const char *zVal, int len, int copy){ +int sqlite3_bind(sqlite_vm *pVm, int i, const char *zVal, int len, int copy){ Vdbe *p = (Vdbe*)pVm; if( p->magic!=VDBE_MAGIC_RUN || p->pc!=0 ){ return SQLITE_MISUSE; } if( i<1 || i>p->nVar ){ @@ -1045,18 +1045,18 @@ ** routine does nothing and returns SQLITE_OK. */ int sqlite3VdbeCursorMoveto(Cursor *p){ if( p->deferredMoveto ){ int res; - extern int sqlite_search_count; + extern int sqlite3_search_count; sqlite3BtreeMoveto(p->pCursor, (char*)&p->movetoTarget, sizeof(int), &res); p->lastRecno = keyToInt(p->movetoTarget); p->recnoIsValid = res==0; if( res<0 ){ sqlite3BtreeNext(p->pCursor, &res); } - sqlite_search_count++; + sqlite3_search_count++; p->deferredMoveto = 0; } return SQLITE_OK; } Index: src/where.c ================================================================== --- src/where.c +++ src/where.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This module contains C code that generates VDBE code used to process ** the WHERE clause of SQL statements. ** -** $Id: where.c,v 1.90 2004/05/08 08:23:47 danielk1977 Exp $ +** $Id: where.c,v 1.91 2004/05/10 10:37:19 danielk1977 Exp $ */ #include "sqliteInt.h" /* ** The query generator uses an array of instances of this structure to @@ -387,11 +387,11 @@ /* Allocate and initialize the WhereInfo structure that will become the ** return value. */ pWInfo = sqliteMalloc( sizeof(WhereInfo) + pTabList->nSrc*sizeof(WhereLevel)); - if( sqlite_malloc_failed ){ + if( sqlite3_malloc_failed ){ sqliteFree(pWInfo); return 0; } pWInfo->pParse = pParse; pWInfo->pTabList = pTabList;