/ Check-in [cd74495f]
Login

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

Overview
Comment:Expose an additional internal API routine (sqliteInitCallback()) for use by private code. (CVS 624)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cd74495f995803eeb5c2b900d536deb52e5584eb
User & Date: drh 2002-06-16 18:21:44
Context
2002-06-17
17:07
Add preliminary logic for the eventual move to having separate TEXT and NUMTEXT datatypes. Also change the version number to 2.5.0 in preparation for an interim release. (CVS 625) check-in: 05783a9d user: drh tags: trunk
2002-06-16
18:21
Expose an additional internal API routine (sqliteInitCallback()) for use by private code. (CVS 624) check-in: cd74495f user: drh tags: trunk
04:57
Added explanation and examples for %Q format specifier. (CVS 623) check-in: 633ce4dd user: chw tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.79 2002/06/14 20:54:15 drh Exp $
           17  +** $Id: main.c,v 1.80 2002/06/16 18:21:44 drh Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include "os.h"
    21     21   #include <ctype.h>
    22     22   
    23     23   /*
    24     24   ** This is the callback routine for the code that initializes the
................................................................................
    28     28   **
    29     29   **     argv[0] = "file-format" or "schema-cookie" or "table" or "index"
    30     30   **     argv[1] = table or index name or meta statement type.
    31     31   **     argv[2] = root page number for table or index.  NULL for meta.
    32     32   **     argv[3] = SQL create statement for the table or index
    33     33   **
    34     34   */
    35         -static int sqliteOpenCb(void *pDb, int argc, char **argv, char **azColName){
           35  +int sqliteInitCallback(void *pDb, int argc, char **argv, char **azColName){
    36     36     sqlite *db = (sqlite*)pDb;
    37     37     Parse sParse;
    38     38     int nErr = 0;
    39     39   
    40     40     /* TODO: Do some validity checks on all fields.  In particular,
    41     41     ** make sure fields do not contain NULLs. Otherwise we might core
    42     42     ** when attempting to initialize from a corrupt database file. */
................................................................................
   255    255     */
   256    256     vdbe = sqliteVdbeCreate(db);
   257    257     if( vdbe==0 ){
   258    258       sqliteSetString(pzErrMsg, "out of memory", 0);
   259    259       return SQLITE_NOMEM;
   260    260     }
   261    261     sqliteVdbeAddOpList(vdbe, sizeof(initProg)/sizeof(initProg[0]), initProg);
   262         -  rc = sqliteVdbeExec(vdbe, sqliteOpenCb, db, pzErrMsg, 
          262  +  rc = sqliteVdbeExec(vdbe, sqliteInitCallback, db, pzErrMsg, 
   263    263                         db->pBusyArg, db->xBusyCallback);
   264    264     sqliteVdbeDelete(vdbe);
   265    265     if( rc==SQLITE_OK && db->nTable==0 ){
   266    266       db->file_format = 2;
   267    267     }
   268    268     if( rc==SQLITE_OK && db->file_format>2 ){
   269    269       sqliteSetString(pzErrMsg, "unsupported file format", 0);
................................................................................
   278    278       Table *pTab;
   279    279       char *azArg[6];
   280    280       azArg[0] = "table";
   281    281       azArg[1] = MASTER_NAME;
   282    282       azArg[2] = "2";
   283    283       azArg[3] = master_schema;
   284    284       azArg[4] = 0;
   285         -    sqliteOpenCb(db, 4, azArg, 0);
          285  +    sqliteInitCallback(db, 4, azArg, 0);
   286    286       pTab = sqliteFindTable(db, MASTER_NAME);
   287    287       if( pTab ){
   288    288         pTab->readOnly = 1;
   289    289       }
   290    290       db->flags |= SQLITE_Initialized;
   291    291       sqliteCommitInternalChanges(db);
   292    292     }

Changes to src/sqliteInt.h.

     7      7   **    May you do good and not evil.
     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   ** Internal interface definitions for SQLite.
    13     13   **
    14         -** @(#) $Id: sqliteInt.h,v 1.123 2002/06/11 02:25:42 danielk1977 Exp $
           14  +** @(#) $Id: sqliteInt.h,v 1.124 2002/06/16 18:21:44 drh Exp $
    15     15   */
    16     16   #include "sqlite.h"
    17     17   #include "hash.h"
    18     18   #include "vdbe.h"
    19     19   #include "parse.h"
    20     20   #include "btree.h"
    21     21   #include <stdio.h>
................................................................................
   901    901   void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*);
   902    902   TriggerStep *sqliteTriggerSelectStep(Select*);
   903    903   TriggerStep *sqliteTriggerInsertStep(Token*, IdList*, ExprList*, Select*, int);
   904    904   TriggerStep *sqliteTriggerUpdateStep(Token*, ExprList*, Expr*, int);
   905    905   TriggerStep *sqliteTriggerDeleteStep(Token*, Expr*);
   906    906   void sqliteDeleteTrigger(Trigger*);
   907    907   int sqliteJoinType(Parse*, Token*, Token*, Token*);
          908  +int sqliteInitCallback(void*,int,char**,char**);