/ Check-in [23e5bed1]
Login

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

Overview
Comment:Fix more name collisions. Allow sqlite.h and sqlite3.h to both be included in the same C/C++ source file. (CVS 1942)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 23e5bed1c5062f0f639751f89873bf1a277547bd
User & Date: drh 2004-09-06 17:34:13
Context
2004-09-07
11:28
Lemon escapes backslashes in filenames in #line directives it generates. Ticket #892. (CVS 1943) check-in: d53047cb user: drh tags: trunk
2004-09-06
17:34
Fix more name collisions. Allow sqlite.h and sqlite3.h to both be included in the same C/C++ source file. (CVS 1942) check-in: 23e5bed1 user: drh tags: trunk
17:24
Fix a naming conflict between sqlite versions 2 and 3. An open sqlite3 connection now *must* be called "sqlite3". You cannot call it "sqlite". This might break existing code. (CVS 1941) check-in: 3ddf5a9d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/legacy.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: legacy.c,v 1.6 2004/09/06 17:24:13 drh Exp $
           17  +** $Id: legacy.c,v 1.7 2004/09/06 17:34:13 drh Exp $
    18     18   */
    19     19   
    20     20   #include "sqliteInt.h"
    21     21   #include "os.h"
    22     22   #include <ctype.h>
    23     23   
    24     24   /*
................................................................................
    30     30   ** the xCallback() function is called.  pArg becomes the first
    31     31   ** argument to xCallback().  If xCallback=NULL then no callback
    32     32   ** is invoked, even for queries.
    33     33   */
    34     34   int sqlite3_exec(
    35     35     sqlite3 *db,                /* The database on which the SQL executes */
    36     36     const char *zSql,           /* The SQL to be executed */
    37         -  sqlite_callback xCallback,  /* Invoke this callback routine */
           37  +  sqlite3_callback xCallback, /* Invoke this callback routine */
    38     38     void *pArg,                 /* First argument to xCallback() */
    39     39     char **pzErrMsg             /* Write error messages here */
    40     40   ){
    41     41     int rc = SQLITE_OK;
    42     42     const char *zLeftover;
    43     43     sqlite3_stmt *pStmt = 0;
    44     44     char **azCols = 0;

Changes to src/sqlite.h.in.

     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 header file defines the interface that the SQLite library
    13     13   ** presents to client programs.
    14     14   **
    15         -** @(#) $Id: sqlite.h.in,v 1.117 2004/09/06 17:24:13 drh Exp $
           15  +** @(#) $Id: sqlite.h.in,v 1.118 2004/09/06 17:34:13 drh Exp $
    16     16   */
    17         -#ifndef _SQLITE_H_
    18         -#define _SQLITE_H_
           17  +#ifndef _SQLITE3_H_
           18  +#define _SQLITE3_H_
    19     19   #include <stdarg.h>     /* Needed for the definition of va_list */
    20     20   
    21     21   /*
    22     22   ** Make sure we can call this stuff from C++.
    23     23   */
    24     24   #ifdef __cplusplus
    25     25   extern "C" {
................................................................................
    73     73   ** database connection remains open.
    74     74   */
    75     75   int sqlite3_close(sqlite3 *);
    76     76   
    77     77   /*
    78     78   ** The type for a callback function.
    79     79   */
    80         -typedef int (*sqlite_callback)(void*,int,char**, char**);
           80  +typedef int (*sqlite3_callback)(void*,int,char**, char**);
    81     81   
    82     82   /*
    83     83   ** A function to executes one or more statements of SQL.
    84     84   **
    85     85   ** If one or more of the SQL statements are queries, then
    86     86   ** the callback function specified by the 3rd parameter is
    87     87   ** invoked once for each row of the query result.  This callback
................................................................................
   116    116   **
   117    117   ** If the query could not be executed because a database file is
   118    118   ** locked or busy, then this function returns SQLITE_BUSY.  (This
   119    119   ** behavior can be modified somewhat using the sqlite3_busy_handler()
   120    120   ** and sqlite3_busy_timeout() functions below.)
   121    121   */
   122    122   int sqlite3_exec(
   123         -  sqlite3*,                      /* An open database */
          123  +  sqlite3*,                     /* An open database */
   124    124     const char *sql,              /* SQL to be executed */
   125         -  sqlite_callback,              /* Callback function */
          125  +  sqlite3_callback,             /* Callback function */
   126    126     void *,                       /* 1st argument to callback function */
   127    127     char **errmsg                 /* Error msg written here */
   128    128   );
   129    129   
   130    130   /*
   131    131   ** Return values for sqlite3_exec() and sqlite3_step()
   132    132   */