/ Check-in [19b100ec]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change the names of external symbols from sqlite_XXX to sqlite3_XXX. (CVS 1339)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 19b100ec0d088b2cca147c967a80d18403b7ee86
User & Date: danielk1977 2004-05-10 10:37:18
Original User & Date: danielk1977 2004-05-10 10:37:19
Context
2004-05-10
10:37
Change the names of external symbols from sqlite_XXX to sqlite3_XXX. (CVS 1340) check-in: ac46bd68 user: danielk1977 tags: trunk
10:37
Change the names of external symbols from sqlite_XXX to sqlite3_XXX. (CVS 1339) check-in: 19b100ec user: danielk1977 tags: trunk
10:34
Change the names of external symbols from sqlite_XXX to sqlite3_XXX. (CVS 1338) check-in: 2242423e user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeInt.h.

   220    220     int csChange;     /* Current statement change count (from db->csChange) */
   221    221   };
   222    222   
   223    223   /*
   224    224   ** An instance of the virtual machine.  This structure contains the complete
   225    225   ** state of the virtual machine.
   226    226   **
   227         -** The "sqlite_vm" structure pointer that is returned by sqlite_compile()
          227  +** The "sqlite_vm" structure pointer that is returned by sqlite3_compile()
   228    228   ** is really a pointer to an instance of this structure.
   229    229   */
   230    230   struct Vdbe {
   231    231     sqlite *db;         /* The whole database */
   232    232     Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
   233    233     FILE *trace;        /* Write an execution trace here, if not NULL */
   234    234     int nOp;            /* Number of instructions in the program */

Changes to src/vdbeaux.c.

    18     18   #include "os.h"
    19     19   #include <ctype.h>
    20     20   #include "vdbeInt.h"
    21     21   
    22     22   
    23     23   /*
    24     24   ** When debugging the code generator in a symbolic debugger, one can
    25         -** set the sqlite_vdbe_addop_trace to 1 and all opcodes will be printed
           25  +** set the sqlite3_vdbe_addop_trace to 1 and all opcodes will be printed
    26     26   ** as they are added to the instruction stream.
    27     27   */
    28     28   #ifndef NDEBUG
    29         -int sqlite_vdbe_addop_trace = 0;
           29  +int sqlite3_vdbe_addop_trace = 0;
    30     30   #endif
    31     31   
    32     32   
    33     33   /*
    34     34   ** Create a new virtual database engine.
    35     35   */
    36     36   Vdbe *sqlite3VdbeCreate(sqlite *db){
................................................................................
    96     96     if( p2<0 && (-1-p2)<p->nLabel && p->aLabel[-1-p2]>=0 ){
    97     97       p2 = p->aLabel[-1-p2];
    98     98     }
    99     99     pOp->p2 = p2;
   100    100     pOp->p3 = 0;
   101    101     pOp->p3type = P3_NOTUSED;
   102    102   #ifndef NDEBUG
   103         -  if( sqlite_vdbe_addop_trace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]);
          103  +  if( sqlite3_vdbe_addop_trace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]);
   104    104   #endif
   105    105     return i;
   106    106   }
   107    107   
   108    108   /*
   109    109   ** Add an opcode that includes the p3 value.
   110    110   */
................................................................................
   222    222         VdbeOp *pOut = &p->aOp[i+addr];
   223    223         pOut->opcode = pIn->opcode;
   224    224         pOut->p1 = pIn->p1;
   225    225         pOut->p2 = p2<0 ? addr + ADDR(p2) : p2;
   226    226         pOut->p3 = pIn->p3;
   227    227         pOut->p3type = pIn->p3 ? P3_STATIC : P3_NOTUSED;
   228    228   #ifndef NDEBUG
   229         -      if( sqlite_vdbe_addop_trace ){
          229  +      if( sqlite3_vdbe_addop_trace ){
   230    230           sqlite3VdbePrintOp(0, i+addr, &p->aOp[i+addr]);
   231    231         }
   232    232   #endif
   233    233       }
   234    234       p->nOp += nOp;
   235    235     }
   236    236     return addr;
................................................................................
   387    387     return &p->aOp[addr];
   388    388   }
   389    389   
   390    390   /*
   391    391   ** The following group or routines are employed by installable functions
   392    392   ** to return their results.
   393    393   **
   394         -** The sqlite_set_result_string() routine can be used to return a string
          394  +** The sqlite3_set_result_string() routine can be used to return a string
   395    395   ** value or to return a NULL.  To return a NULL, pass in NULL for zResult.
   396    396   ** A copy is made of the string before this routine returns so it is safe
   397    397   ** to pass in an ephemeral string.
   398    398   **
   399         -** sqlite_set_result_error() works like sqlite_set_result_string() except
          399  +** sqlite3_set_result_error() works like sqlite3_set_result_string() except
   400    400   ** that it signals a fatal error.  The string argument, if any, is the
   401    401   ** error message.  If the argument is NULL a generic substitute error message
   402    402   ** is used.
   403    403   **
   404         -** The sqlite_set_result_int() and sqlite_set_result_double() set the return
          404  +** The sqlite3_set_result_int() and sqlite3_set_result_double() set the return
   405    405   ** value of the user function to an integer or a double.
   406    406   **
   407    407   ** These routines are defined here in vdbe.c because they depend on knowing
   408    408   ** the internals of the sqlite_func structure which is only defined in 
   409    409   ** this source file.
   410    410   */
   411         -char *sqlite_set_result_string(sqlite_func *p, const char *zResult, int n){
          411  +char *sqlite3_set_result_string(sqlite_func *p, const char *zResult, int n){
   412    412     assert( !p->isStep );
   413    413     if( p->s.flags & MEM_Dyn ){
   414    414       sqliteFree(p->s.z);
   415    415     }
   416    416     if( zResult==0 ){
   417    417       p->s.flags = MEM_Null;
   418    418       n = 0;
................................................................................
   433    433         }
   434    434         p->s.flags = MEM_Str | MEM_Dyn;
   435    435       }
   436    436       p->s.n = n+1;
   437    437     }
   438    438     return p->s.z;
   439    439   }
   440         -void sqlite_set_result_int(sqlite_func *p, int iResult){
          440  +void sqlite3_set_result_int(sqlite_func *p, int iResult){
   441    441     assert( !p->isStep );
   442    442     if( p->s.flags & MEM_Dyn ){
   443    443       sqliteFree(p->s.z);
   444    444     }
   445    445     p->s.i = iResult;
   446    446     p->s.flags = MEM_Int;
   447    447   }
   448         -void sqlite_set_result_double(sqlite_func *p, double rResult){
          448  +void sqlite3_set_result_double(sqlite_func *p, double rResult){
   449    449     assert( !p->isStep );
   450    450     if( p->s.flags & MEM_Dyn ){
   451    451       sqliteFree(p->s.z);
   452    452     }
   453    453     p->s.r = rResult;
   454    454     p->s.flags = MEM_Real;
   455    455   }
   456         -void sqlite_set_result_error(sqlite_func *p, const char *zMsg, int n){
          456  +void sqlite3_set_result_error(sqlite_func *p, const char *zMsg, int n){
   457    457     assert( !p->isStep );
   458         -  sqlite_set_result_string(p, zMsg, n);
          458  +  sqlite3_set_result_string(p, zMsg, n);
   459    459     p->isError = 1;
   460    460   }
   461    461   
   462    462   /*
   463    463   ** Extract the user data from a sqlite_func structure and return a
   464    464   ** pointer to it.
   465    465   */
   466         -void *sqlite_user_data(sqlite_func *p){
          466  +void *sqlite3_user_data(sqlite_func *p){
   467    467     assert( p && p->pFunc );
   468    468     return p->pFunc->pUserData;
   469    469   }
   470    470   
   471    471   /*
   472    472   ** Allocate or return the aggregate context for a user function.  A new
   473    473   ** context is allocated on the first call.  Subsequent calls return the
   474    474   ** same context that was returned on prior calls.
   475    475   **
   476    476   ** This routine is defined here in vdbe.c because it depends on knowing
   477    477   ** the internals of the sqlite_func structure which is only defined in
   478    478   ** this source file.
   479    479   */
   480         -void *sqlite_aggregate_context(sqlite_func *p, int nByte){
          480  +void *sqlite3_aggregate_context(sqlite_func *p, int nByte){
   481    481     assert( p && p->pFunc && p->pFunc->xStep );
   482    482     if( p->pAgg==0 ){
   483    483       if( nByte<=NBFS ){
   484    484         p->pAgg = (void*)p->s.z;
   485    485         memset(p->pAgg, 0, nByte);
   486    486       }else{
   487    487         p->pAgg = sqliteMalloc( nByte );
................................................................................
   494    494   ** Return the number of times the Step function of a aggregate has been 
   495    495   ** called.
   496    496   **
   497    497   ** This routine is defined here in vdbe.c because it depends on knowing
   498    498   ** the internals of the sqlite_func structure which is only defined in
   499    499   ** this source file.
   500    500   */
   501         -int sqlite_aggregate_count(sqlite_func *p){
          501  +int sqlite3_aggregate_count(sqlite_func *p){
   502    502     assert( p && p->pFunc && p->pFunc->xStep );
   503    503     return p->cnt;
   504    504   }
   505    505   
   506    506   #if !defined(NDEBUG) || defined(VDBE_PROFILE)
   507    507   /*
   508    508   ** Print a single opcode.  This routine is used for debugging only.
................................................................................
   555    555       db->flags &= ~SQLITE_Interrupt;
   556    556       if( db->magic!=SQLITE_MAGIC_BUSY ){
   557    557         p->rc = SQLITE_MISUSE;
   558    558       }else{
   559    559         p->rc = SQLITE_INTERRUPT;
   560    560       }
   561    561       rc = SQLITE_ERROR;
   562         -    sqlite3SetString(&p->zErrMsg, sqlite_error_string(p->rc), (char*)0);
          562  +    sqlite3SetString(&p->zErrMsg, sqlite3_error_string(p->rc), (char*)0);
   563    563     }else{
   564    564       sprintf(p->zArgv[0],"%d",i);
   565    565       sprintf(p->zArgv[2],"%d", p->aOp[i].p1);
   566    566       sprintf(p->zArgv[3],"%d", p->aOp[i].p2);
   567    567       if( p->aOp[i].p3type==P3_POINTER ){
   568    568         sprintf(p->aStack[4].zShort, "ptr(%#x)", (int)p->aOp[i].p3);
   569    569         p->zArgv[4] = p->aStack[4].zShort;
................................................................................
   832    832   ** again.
   833    833   */
   834    834   int sqlite3VdbeReset(Vdbe *p, char **pzErrMsg){
   835    835     sqlite *db = p->db;
   836    836     int i;
   837    837   
   838    838     if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){
   839         -    sqlite3SetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0);
          839  +    sqlite3SetString(pzErrMsg, sqlite3_error_string(SQLITE_MISUSE), (char*)0);
   840    840       return SQLITE_MISUSE;
   841    841     }
   842    842     if( p->zErrMsg ){
   843    843       if( pzErrMsg && *pzErrMsg==0 ){
   844    844         *pzErrMsg = p->zErrMsg;
   845    845       }else{
   846    846         sqliteFree(p->zErrMsg);
   847    847       }
   848    848       p->zErrMsg = 0;
   849    849     }else if( p->rc ){
   850         -    sqlite3SetString(pzErrMsg, sqlite_error_string(p->rc), (char*)0);
          850  +    sqlite3SetString(pzErrMsg, sqlite3_error_string(p->rc), (char*)0);
   851    851     }
   852    852     Cleanup(p);
   853    853     if( p->rc!=SQLITE_OK ){
   854    854       switch( p->errorAction ){
   855    855         case OE_Abort: {
   856    856           if( !p->undoTransOnError ){
   857    857             for(i=0; i<db->nDb; i++){
................................................................................
   882    882     }
   883    883     for(i=0; i<db->nDb; i++){
   884    884       if( db->aDb[i].pBt && db->aDb[i].inTrans==2 ){
   885    885         sqlite3BtreeCommitStmt(db->aDb[i].pBt);
   886    886         db->aDb[i].inTrans = 1;
   887    887       }
   888    888     }
   889         -  assert( p->pTos<&p->aStack[p->pc] || sqlite_malloc_failed==1 );
          889  +  assert( p->pTos<&p->aStack[p->pc] || sqlite3_malloc_failed==1 );
   890    890   #ifdef VDBE_PROFILE
   891    891     {
   892    892       FILE *out = fopen("vdbe_profile.out", "a");
   893    893       if( out ){
   894    894         int i;
   895    895         fprintf(out, "---- ");
   896    896         for(i=0; i<p->nOp; i++){
................................................................................
   918    918   ** the result code.  Write any error message text into *pzErrMsg.
   919    919   */
   920    920   int sqlite3VdbeFinalize(Vdbe *p, char **pzErrMsg){
   921    921     int rc;
   922    922     sqlite *db;
   923    923   
   924    924     if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){
   925         -    sqlite3SetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0);
          925  +    sqlite3SetString(pzErrMsg, sqlite3_error_string(SQLITE_MISUSE), (char*)0);
   926    926       return SQLITE_MISUSE;
   927    927     }
   928    928     db = p->db;
   929    929     rc = sqlite3VdbeReset(p, pzErrMsg);
   930    930     sqlite3VdbeDelete(p);
   931    931     if( db->want_to_close && db->pVdbe==0 ){
   932         -    sqlite_close(db);
          932  +    sqlite3_close(db);
   933    933     }
   934    934     if( rc==SQLITE_SCHEMA ){
   935    935       sqlite3ResetInternalSchema(db, 0);
   936    936     }
   937    937     return rc;
   938    938   }
   939    939   
................................................................................
   941    941   ** Set the values of all variables.  Variable $1 in the original SQL will
   942    942   ** be the string azValue[0].  $2 will have the value azValue[1].  And
   943    943   ** so forth.  If a value is out of range (for example $3 when nValue==2)
   944    944   ** then its value will be NULL.
   945    945   **
   946    946   ** This routine overrides any prior call.
   947    947   */
   948         -int sqlite_bind(sqlite_vm *pVm, int i, const char *zVal, int len, int copy){
          948  +int sqlite3_bind(sqlite_vm *pVm, int i, const char *zVal, int len, int copy){
   949    949     Vdbe *p = (Vdbe*)pVm;
   950    950     if( p->magic!=VDBE_MAGIC_RUN || p->pc!=0 ){
   951    951       return SQLITE_MISUSE;
   952    952     }
   953    953     if( i<1 || i>p->nVar ){
   954    954       return SQLITE_RANGE;
   955    955     }
................................................................................
  1043   1043   ** If a MoveTo operation is pending on the given cursor, then do that
  1044   1044   ** MoveTo now.  Return an error code.  If no MoveTo is pending, this
  1045   1045   ** routine does nothing and returns SQLITE_OK.
  1046   1046   */
  1047   1047   int sqlite3VdbeCursorMoveto(Cursor *p){
  1048   1048     if( p->deferredMoveto ){
  1049   1049       int res;
  1050         -    extern int sqlite_search_count;
         1050  +    extern int sqlite3_search_count;
  1051   1051       sqlite3BtreeMoveto(p->pCursor, (char*)&p->movetoTarget, sizeof(int), &res);
  1052   1052       p->lastRecno = keyToInt(p->movetoTarget);
  1053   1053       p->recnoIsValid = res==0;
  1054   1054       if( res<0 ){
  1055   1055         sqlite3BtreeNext(p->pCursor, &res);
  1056   1056       }
  1057         -    sqlite_search_count++;
         1057  +    sqlite3_search_count++;
  1058   1058       p->deferredMoveto = 0;
  1059   1059     }
  1060   1060     return SQLITE_OK;
  1061   1061   }
  1062   1062   
  1063   1063   /*
  1064   1064   ** FIX ME

Changes to src/where.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This module contains C code that generates VDBE code used to process
    13     13   ** the WHERE clause of SQL statements.
    14     14   **
    15         -** $Id: where.c,v 1.90 2004/05/08 08:23:47 danielk1977 Exp $
           15  +** $Id: where.c,v 1.91 2004/05/10 10:37:19 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** The query generator uses an array of instances of this structure to
    21     21   ** help it analyze the subexpressions of the WHERE clause.  Each WHERE
    22     22   ** clause subexpression is separated from the others by an AND operator.
................................................................................
   385    385       return 0;
   386    386     }
   387    387     
   388    388     /* Allocate and initialize the WhereInfo structure that will become the
   389    389     ** return value.
   390    390     */
   391    391     pWInfo = sqliteMalloc( sizeof(WhereInfo) + pTabList->nSrc*sizeof(WhereLevel));
   392         -  if( sqlite_malloc_failed ){
          392  +  if( sqlite3_malloc_failed ){
   393    393       sqliteFree(pWInfo);
   394    394       return 0;
   395    395     }
   396    396     pWInfo->pParse = pParse;
   397    397     pWInfo->pTabList = pTabList;
   398    398     pWInfo->peakNTab = pWInfo->savedNTab = pParse->nTab;
   399    399     pWInfo->iBreak = sqlite3VdbeMakeLabel(v);