Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -12,11 +12,11 @@ ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.201 2004/05/31 23:56:43 danielk1977 Exp $ +** $Id: main.c,v 1.202 2004/06/01 00:03:53 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" #include @@ -1106,92 +1106,10 @@ sqliteFree(zFilename8); return rc; } -/* -** Open a new database handle. -*/ -int sqlite3_open_vararg( - const char *filename, /* Database filename (UTF-8) */ - sqlite3 **ppDb, /* OUT: SQLite db handle */ - ... /* Option strings */ -){ - va_list ap; - const char **aOpts = 0; - int nOpts = 0; - int rc; - - /* Count the arguments */ - va_start(ap, ppDb); - while( va_arg(ap, const char *) ) nOpts++; - va_end(ap); - - /* If there are more than zero arguments, construct an array */ - if( nOpts ){ - aOpts = (const char **)sqliteMalloc(sizeof(const char *)*nOpts+1); - if( !aOpts ){ - *ppDb = 0; - return SQLITE_NOMEM; - } - va_start(ap, ppDb); - nOpts = 0; - while( va_arg(ap, const char *) ){ - aOpts[nOpts] = va_arg(ap, const char *); - nOpts++; - } - aOpts[nOpts] = 0; - va_end(ap); - } - - /* Call the regular sqlite3_open() */ - rc = sqlite3_open(filename, ppDb, aOpts); - if( aOpts ) sqliteFree(aOpts); - return rc; -} - -/* -** Open a new database handle. -*/ -int sqlite3_open16_vararg( - const void *filename, /* Database filename (UTF-16) */ - sqlite3 **ppDb, /* OUT: SQLite db handle */ - ... /* Option strings */ -){ - va_list ap; - const char **aOpts = 0; - int nOpts = 0; - int rc; - - /* Count the arguments */ - va_start(ap, ppDb); - while( va_arg(ap, const char *) ) nOpts++; - va_end(ap); - - /* If there are more than zero arguments, construct an array */ - if( nOpts ){ - aOpts = (const char **)sqliteMalloc(sizeof(const char *)*nOpts+1); - if( !aOpts ){ - *ppDb = 0; - return SQLITE_NOMEM; - } - va_start(ap, ppDb); - nOpts = 0; - while( va_arg(ap, const char *) ){ - aOpts[nOpts] = va_arg(ap, const char *); - nOpts++; - } - aOpts[nOpts] = 0; - va_end(ap); - } - - /* Call the regular sqlite3_open16() */ - rc = sqlite3_open16(filename, ppDb, aOpts); - if( aOpts ) sqliteFree(aOpts); - return rc; -} - /* ** The following routine destroys a virtual machine that is created by ** the sqlite3_compile() routine. The integer returned is an SQLITE_ ** success/failure code that describes the result of executing the virtual ** machine. Index: src/sqlite.h.in ================================================================== --- src/sqlite.h.in +++ src/sqlite.h.in @@ -10,11 +10,11 @@ ** ************************************************************************* ** This header file defines the interface that the SQLite library ** presents to client programs. ** -** @(#) $Id: sqlite.h.in,v 1.88 2004/05/31 23:56:43 danielk1977 Exp $ +** @(#) $Id: sqlite.h.in,v 1.89 2004/06/01 00:03:53 danielk1977 Exp $ */ #ifndef _SQLITE_H_ #define _SQLITE_H_ #include /* Needed for the definition of va_list */ @@ -516,27 +516,10 @@ const void *filename, /* Database filename (UTF-16) */ sqlite3 **ppDb, /* OUT: SQLite db handle */ const char **args /* Null terminated array of option strings */ ); -/* -** The following two functions are identical to sqlite3_open() and -** sqlite3_open16(), except that any option strings are specified as the -** third and subsequent arguments, instead of as an array. The final -** argument to either of the following two functions must be a NULL. -*/ -int sqlite3_open_vararg( - const char *filename, /* Database filename (UTF-8) */ - sqlite3 **ppDb, /* OUT: SQLite db handle */ - ... /* Option strings */ -); -int sqlite3_open16_vararg( - const void *filename, /* Database filename (UTF-16) */ - sqlite3 **ppDb, /* OUT: SQLite db handle */ - ... /* Option strings */ -); - /* ** Return the error code for the most recent sqlite3_* API call associated ** with sqlite3 handle 'db'. SQLITE_OK is returned if the most recent ** API call was successful. **