Add initialization functions for internal usage in libsqlite3.so. SQLite revision: acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b --- /ext/misc/amatch.c +++ /ext/misc/amatch.c @@ -1480,9 +1480,18 @@ #endif /* SQLITE_OMIT_VIRTUALTABLE */ +int sqlite3AmatchInit(sqlite3 *db){ + int rc = SQLITE_OK; +#ifndef SQLITE_OMIT_VIRTUALTABLE + rc = sqlite3_create_module(db, "approximate_match", &amatchModule, 0); +#endif /* SQLITE_OMIT_VIRTUALTABLE */ + return rc; +} + /* ** Register the amatch virtual table */ +#if !defined(SQLITE_CORE) || defined(SQLITE_TEST) #ifdef _WIN32 __declspec(dllexport) #endif @@ -1491,11 +1500,8 @@ char **pzErrMsg, const sqlite3_api_routines *pApi ){ - int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Not used */ -#ifndef SQLITE_OMIT_VIRTUALTABLE - rc = sqlite3_create_module(db, "approximate_match", &amatchModule, 0); -#endif /* SQLITE_OMIT_VIRTUALTABLE */ - return rc; + return sqlite3AmatchInit(db); } +#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */ --- /ext/misc/carray.c +++ /ext/misc/carray.c @@ -498,16 +498,8 @@ #endif /* SQLITE_OMIT_VIRTUALTABLE */ -#ifdef _WIN32 -__declspec(dllexport) -#endif -int sqlite3_carray_init( - sqlite3 *db, - char **pzErrMsg, - const sqlite3_api_routines *pApi -){ +int sqlite3CarrayInit(sqlite3 *db){ int rc = SQLITE_OK; - SQLITE_EXTENSION_INIT2(pApi); #ifndef SQLITE_OMIT_VIRTUALTABLE rc = sqlite3_create_module(db, "carray", &carrayModule, 0); #ifdef SQLITE_TEST @@ -519,3 +511,18 @@ #endif /* SQLITE_OMIT_VIRTUALTABLE */ return rc; } + +#if !defined(SQLITE_CORE) || defined(SQLITE_TEST) +#ifdef _WIN32 +__declspec(dllexport) +#endif +int sqlite3_carray_init( + sqlite3 *db, + char **pzErrMsg, + const sqlite3_api_routines *pApi +){ + SQLITE_EXTENSION_INIT2(pApi); + (void)pzErrMsg; /* Unused parameter */ + return sqlite3CarrayInit(db); +} +#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */ --- /ext/misc/completion.c +++ /ext/misc/completion.c @@ -483,12 +483,13 @@ return rc; } +#if !defined(SQLITE_CORE) || defined(SQLITE_TEST) #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_completion_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; @@ -499,3 +500,4 @@ #endif return rc; } +#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */ --- /ext/misc/csv.c +++ /ext/misc/csv.c @@ -928,6 +928,22 @@ #endif /* !defined(SQLITE_OMIT_VIRTUALTABLE) */ +int sqlite3CsvInit(sqlite3 *db){ +#ifndef SQLITE_OMIT_VIRTUALTABLE + int rc; + rc = sqlite3_create_module(db, "csv", &CsvModule, 0); +#ifdef SQLITE_TEST + if( rc==SQLITE_OK ){ + rc = sqlite3_create_module(db, "csv_wr", &CsvModuleFauxWrite, 0); + } +#endif + return rc; +#else + return SQLITE_OK; +#endif +} + +#if !defined(SQLITE_CORE) || defined(SQLITE_TEST) #ifdef _WIN32 __declspec(dllexport) #endif @@ -941,17 +957,8 @@ char **pzErrMsg, const sqlite3_api_routines *pApi ){ -#ifndef SQLITE_OMIT_VIRTUALTABLE - int rc; SQLITE_EXTENSION_INIT2(pApi); - rc = sqlite3_create_module(db, "csv", &CsvModule, 0); -#ifdef SQLITE_TEST - if( rc==SQLITE_OK ){ - rc = sqlite3_create_module(db, "csv_wr", &CsvModuleFauxWrite, 0); - } -#endif - return rc; -#else - return SQLITE_OK; -#endif + (void)pzErrMsg; /* Unused parameter */ + return sqlite3CsvInit(db); } +#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */ --- /ext/misc/dbdata.c +++ /ext/misc/dbdata.c @@ -803,7 +803,7 @@ /* ** Invoke this routine to register the "sqlite_dbdata" virtual table module */ -static int sqlite3DbdataRegister(sqlite3 *db){ +int sqlite3DbdataRegister(sqlite3 *db){ static sqlite3_module dbdata_module = { 0, /* iVersion */ 0, /* xCreate */ @@ -838,6 +838,7 @@ return rc; } +#if !defined(SQLITE_CORE) || defined(SQLITE_TEST) #ifdef _WIN32 __declspec(dllexport) #endif @@ -849,3 +850,4 @@ SQLITE_EXTENSION_INIT2(pApi); return sqlite3DbdataRegister(db); } +#endif /* !defined(SQLITE_CORE) || defined(SQLITE_TEST) */ --- /ext/misc/decimal.c +++ /ext/misc/decimal.c @@ -590,14 +590,7 @@ decimal_free(pB); } -#ifdef _WIN32 -__declspec(dllexport) -#endif -int sqlite3_decimal_init( - sqlite3 *db, - char **pzErrMsg, - const sqlite3_api_routines *pApi -){ +int sqlite3DecimalInit(sqlite3 *db){ int rc = SQLITE_OK; static const struct { const char *zFuncName; @@ -611,10 +604,6 @@ { "decimal_mul", 2, decimalMulFunc }, }; unsigned int i; - (void)pzErrMsg; /* Unused parameter */ - - SQLITE_EXTENSION_INIT2(pApi); - for(i=0; i