From: drh Date: Thu, 28 Jul 2016 15:09:02 +0000 (+0000) Subject: Change mksqlite3h.tcl to automatically insert the SQLITE_CALLBACK calling X-Git-Tag: version-3.14.0~30^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4194ff65989d436a22699faac29e6f98d1beb414;p=thirdparty%2Fsqlite.git Change mksqlite3h.tcl to automatically insert the SQLITE_CALLBACK calling convention macros. FossilOrigin-Name: 11ab9c9ab562df98c20abf126a8bac178aef77a8 --- diff --git a/manifest b/manifest index 8f0151d5f2..49f48174ea 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Allow\sthe\s'testfixture.exe'\starget\sto\sbe\scompiled\swith\sthe\s__stdcall\scalling\sconvention. -D 2016-07-28T14:37:04.758 +C Change\smksqlite3h.tcl\sto\sautomatically\sinsert\sthe\sSQLITE_CALLBACK\scalling\nconvention\smacros. +D 2016-07-28T15:09:02.696 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc da4c9f5bc46f6f12d7313d12be18a2d2c55e06c0 @@ -385,7 +385,7 @@ F src/resolve.c cca3aa77b95706df5d635a2141a4d1de60ae6598 F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac F src/select.c f3c6e9065fb34f6a23af27ec7f1f717ffbfc2ee4 F src/shell.c 9351fc6de11e1d908648c0a92d85627138e3dee5 -F src/sqlite.h.in a0760a3f7b1939e395a3e74d245e5bb03cd54fb1 +F src/sqlite.h.in a03063e698a43cc5c996cd341f39439a6ce58304 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 46f300b6e300e0fa916d7d58c44b53415b8471a9 F src/sqliteInt.h d25c18c1272a7811e2569c39bfc2fca96156eead @@ -1450,7 +1450,7 @@ F tool/mkpragmatab.tcl f0d5bb266d1d388cf86fce5ba01a891e95d72d41 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c-noext.tcl aa58ea3be311c81821c2cd3209f55e46b07ab656 F tool/mksqlite3c.tcl a52ead27e2ac5d4b616e945a0601f628f4328329 -F tool/mksqlite3h.tcl fab97967314e63384a3ed23fd35f0d8188352400 +F tool/mksqlite3h.tcl abaf6af11e184c0b69f117fc47ecfa351d81c219 F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b F tool/mkvsix.tcl 4abcaf3267171b2faadaf9b82a0dfbaa6e98f8b7 F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 @@ -1508,7 +1508,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 02b8040e1add02734d2dbc6c59737ab74ff8fb18 -R ccdbec6a43a33ea0f78bbd174bf27dd8 -U mistachkin -Z 9a093adb6bae045a3c1e5e0de6859957 +P e8be3dfeabaa31b3490793cf8230faae1204be15 +R 44253432508e9739e51133f1558c85ed +U drh +Z 863aa68feeed694e590c235a245cfae1 diff --git a/manifest.uuid b/manifest.uuid index 8d4ac6e27c..617643d254 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e8be3dfeabaa31b3490793cf8230faae1204be15 \ No newline at end of file +11ab9c9ab562df98c20abf126a8bac178aef77a8 \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 009f080a86..02ae22c346 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -67,7 +67,6 @@ extern "C" { # define SQLITE_SYSAPI #endif - /* ** These no-op macros are used in front of interfaces to mark those ** interfaces as either deprecated or experimental. New applications @@ -328,7 +327,7 @@ int sqlite3_close_v2(sqlite3*); ** This is legacy and deprecated. It is included for historical ** compatibility and is not documented. */ -typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**); +typedef int (*sqlite3_callback)(void*,int,char**, char**); /* ** CAPI3REF: One-Step Query Execution Interface @@ -395,7 +394,7 @@ typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**); int sqlite3_exec( sqlite3*, /* An open database */ const char *sql, /* SQL to be evaluated */ - int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback func */ + int (*callback)(void*,int,char**,char**), /* Callback function */ void *, /* 1st argument to callback */ char **errmsg /* Error msg written here */ ); @@ -743,30 +742,26 @@ struct sqlite3_file { typedef struct sqlite3_io_methods sqlite3_io_methods; struct sqlite3_io_methods { int iVersion; - int (SQLITE_CALLBACK *xClose)(sqlite3_file*); - int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, - sqlite3_int64 iOfst); - int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, - sqlite3_int64 iOfst); - int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size); - int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags); - int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); - int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int); - int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int); - int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut); - int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg); - int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*); - int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*); + int (*xClose)(sqlite3_file*); + int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); + int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); + int (*xTruncate)(sqlite3_file*, sqlite3_int64 size); + int (*xSync)(sqlite3_file*, int flags); + int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); + int (*xLock)(sqlite3_file*, int); + int (*xUnlock)(sqlite3_file*, int); + int (*xCheckReservedLock)(sqlite3_file*, int *pResOut); + int (*xFileControl)(sqlite3_file*, int op, void *pArg); + int (*xSectorSize)(sqlite3_file*); + int (*xDeviceCharacteristics)(sqlite3_file*); /* Methods above are valid for version 1 */ - int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, - void volatile**); - int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags); - void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*); - int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag); + int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); + int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); + void (*xShmBarrier)(sqlite3_file*); + int (*xShmUnmap)(sqlite3_file*, int deleteFlag); /* Methods above are valid for version 2 */ - int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, - void **pp); - int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); + int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); + int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); /* Methods above are valid for version 3 */ /* Additional methods may be added in future releases */ }; @@ -1208,7 +1203,7 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** any of these methods if the iVersion of the VFS is less than 3. */ typedef struct sqlite3_vfs sqlite3_vfs; -typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void); +typedef void (*sqlite3_syscall_ptr)(void); struct sqlite3_vfs { int iVersion; /* Structure version number (currently 3) */ int szOsFile; /* Size of subclassed sqlite3_file */ @@ -1216,37 +1211,31 @@ struct sqlite3_vfs { sqlite3_vfs *pNext; /* Next registered VFS */ const char *zName; /* Name of this virtual file system */ void *pAppData; /* Pointer to application-specific data */ - int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, + int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, int flags, int *pOutFlags); - int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir); - int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, - int *pResOut); - int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, - int nOut, char *zOut); - void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename); - void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); - void (*(SQLITE_CALLBACK *xDlSym)(sqlite3_vfs*,void*, - const char *zSymbol))(void); - void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*); - int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut); - int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds); - int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*); - int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *); + int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); + int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); + int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); + void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); + void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); + void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); + void (*xDlClose)(sqlite3_vfs*, void*); + int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); + int (*xSleep)(sqlite3_vfs*, int microseconds); + int (*xCurrentTime)(sqlite3_vfs*, double*); + int (*xGetLastError)(sqlite3_vfs*, int, char *); /* ** The methods above are in version 1 of the sqlite_vfs object ** definition. Those that follow are added in version 2 or later */ - int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); + int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); /* ** The methods above are in versions 1 and 2 of the sqlite_vfs object. ** Those below are for version 3 and greater. */ - int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, - sqlite3_syscall_ptr); - sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, - const char *zName); - const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, - const char *zName); + int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); + sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName); + const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName); /* ** The methods above are in versions 1 through 3 of the sqlite_vfs object. ** New fields may be appended in future versions. The iVersion @@ -1513,13 +1502,13 @@ int sqlite3_db_config(sqlite3*, int op, ...); */ typedef struct sqlite3_mem_methods sqlite3_mem_methods; struct sqlite3_mem_methods { - void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */ - void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */ - void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */ - int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */ - int (SQLITE_CALLBACK *xRoundup)(int); /* Round up size to allocation size */ - int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */ - void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize memory allocator */ + void *(*xMalloc)(int); /* Memory allocation function */ + void (*xFree)(void*); /* Free a prior allocation */ + void *(*xRealloc)(void*,int); /* Resize an allocation */ + int (*xSize)(void*); /* Return the size of an allocation */ + int (*xRoundup)(int); /* Round up request size to allocation size */ + int (*xInit)(void*); /* Initialize the memory allocator */ + void (*xShutdown)(void*); /* Deinitialize the memory allocator */ void *pAppData; /* Argument to xInit() and xShutdown() */ }; @@ -2253,7 +2242,7 @@ int sqlite3_complete16(const void *sql); ** A busy handler must not close the database connection ** or [prepared statement] that invoked the busy handler. */ -int sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*); +int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); /* ** CAPI3REF: Set A Busy Timeout @@ -2697,8 +2686,7 @@ void sqlite3_randomness(int N, void *P); */ int sqlite3_set_authorizer( sqlite3*, - int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*, - const char*), + int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), void *pUserData ); @@ -2805,9 +2793,9 @@ int sqlite3_set_authorizer( ** subject to change in future versions of SQLite. */ SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*, - void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*); + void(*xTrace)(void*,const char*), void*); SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, - void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*); + void(*xProfile)(void*,const char*,sqlite3_uint64), void*); /* ** CAPI3REF: SQL Trace Event Codes @@ -2898,7 +2886,7 @@ SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, int sqlite3_trace_v2( sqlite3*, unsigned uMask, - int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*), + int(*xCallback)(unsigned,void*,void*,void*), void *pCtx ); @@ -2934,7 +2922,7 @@ int sqlite3_trace_v2( ** database connections for the meaning of "modify" in this paragraph. ** */ -void sqlite3_progress_handler(sqlite3*,int,int(SQLITE_CALLBACK *)(void*),void*); +void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); /* ** CAPI3REF: Opening A New Database Connection @@ -3765,20 +3753,17 @@ typedef struct sqlite3_context sqlite3_context; ** See also: [sqlite3_bind_parameter_count()], ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. */ -int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, - void(SQLITE_CALLBACK *)(void*)); +int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, - void(SQLITE_CALLBACK *)(void*)); + void(*)(void*)); int sqlite3_bind_double(sqlite3_stmt*, int, double); int sqlite3_bind_int(sqlite3_stmt*, int, int); int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); int sqlite3_bind_null(sqlite3_stmt*, int); -int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int, - void(SQLITE_CALLBACK *)(void*)); -int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, - void(SQLITE_CALLBACK *)(void*)); +int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); +int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, - void(SQLITE_CALLBACK *)(void*), unsigned char encoding); + void(*)(void*), unsigned char encoding); int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); @@ -4446,9 +4431,9 @@ int sqlite3_create_function( int nArg, int eTextRep, void *pApp, - void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), - void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), - void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*) ); int sqlite3_create_function16( sqlite3 *db, @@ -4456,9 +4441,9 @@ int sqlite3_create_function16( int nArg, int eTextRep, void *pApp, - void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), - void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), - void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*) ); int sqlite3_create_function_v2( sqlite3 *db, @@ -4466,10 +4451,10 @@ int sqlite3_create_function_v2( int nArg, int eTextRep, void *pApp, - void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), - void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), - void (SQLITE_CALLBACK *xFinal)(sqlite3_context*), - void (SQLITE_CALLBACK *xDestroy)(void*) + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*), + void(*xDestroy)(void*) ); /* @@ -4511,9 +4496,8 @@ SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*); SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); SQLITE_DEPRECATED int sqlite3_global_recover(void); SQLITE_DEPRECATED void sqlite3_thread_cleanup(void); -SQLITE_DEPRECATED int sqlite3_memory_alarm( - void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int), - void*,sqlite3_int64); +SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), + void*,sqlite3_int64); #endif /* @@ -4732,8 +4716,7 @@ sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** the SQL function is running. */ void *sqlite3_get_auxdata(sqlite3_context*, int N); -void sqlite3_set_auxdata(sqlite3_context*, int N, void*, - void (SQLITE_CALLBACK *)(void*)); +void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); /* @@ -4750,7 +4733,7 @@ void sqlite3_set_auxdata(sqlite3_context*, int N, void*, ** The typedef is necessary to work around problems in certain ** C++ compilers. */ -typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*); +typedef void (*sqlite3_destructor_type)(void*); #define SQLITE_STATIC ((sqlite3_destructor_type)0) #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) @@ -4869,10 +4852,9 @@ typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*); ** than the one containing the application-defined function that received ** the [sqlite3_context] pointer, the results are undefined. */ -void sqlite3_result_blob(sqlite3_context*, const void*, int, - void(SQLITE_CALLBACK *)(void*)); +void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); void sqlite3_result_blob64(sqlite3_context*,const void*, - sqlite3_uint64,void(SQLITE_CALLBACK *)(void*)); + sqlite3_uint64,void(*)(void*)); void sqlite3_result_double(sqlite3_context*, double); void sqlite3_result_error(sqlite3_context*, const char*, int); void sqlite3_result_error16(sqlite3_context*, const void*, int); @@ -4882,17 +4864,12 @@ void sqlite3_result_error_code(sqlite3_context*, int); void sqlite3_result_int(sqlite3_context*, int); void sqlite3_result_int64(sqlite3_context*, sqlite3_int64); void sqlite3_result_null(sqlite3_context*); -void sqlite3_result_text(sqlite3_context*, const char*, int, - void(SQLITE_CALLBACK *)(void*)); +void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, - void(SQLITE_CALLBACK *)(void*), - unsigned char encoding); -void sqlite3_result_text16(sqlite3_context*, const void*, int, - void(SQLITE_CALLBACK *)(void*)); -void sqlite3_result_text16le(sqlite3_context*, const void*, int, - void(SQLITE_CALLBACK *)(void*)); -void sqlite3_result_text16be(sqlite3_context*, const void*, int, - void(SQLITE_CALLBACK *)(void*)); + void(*)(void*), unsigned char encoding); +void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); +void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); +void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); void sqlite3_result_value(sqlite3_context*, sqlite3_value*); void sqlite3_result_zeroblob(sqlite3_context*, int n); int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); @@ -4997,22 +4974,22 @@ int sqlite3_create_collation( const char *zName, int eTextRep, void *pArg, - int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) + int(*xCompare)(void*,int,const void*,int,const void*) ); int sqlite3_create_collation_v2( sqlite3*, const char *zName, int eTextRep, void *pArg, - int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*), - void(SQLITE_CALLBACK *xDestroy)(void*) + int(*xCompare)(void*,int,const void*,int,const void*), + void(*xDestroy)(void*) ); int sqlite3_create_collation16( sqlite3*, const void *zName, int eTextRep, void *pArg, - int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) + int(*xCompare)(void*,int,const void*,int,const void*) ); /* @@ -5045,12 +5022,12 @@ int sqlite3_create_collation16( int sqlite3_collation_needed( sqlite3*, void*, - void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*) + void(*)(void*,sqlite3*,int eTextRep,const char*) ); int sqlite3_collation_needed16( sqlite3*, void*, - void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*) + void(*)(void*,sqlite3*,int eTextRep,const void*) ); #ifdef SQLITE_HAS_CODEC @@ -5349,8 +5326,8 @@ sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); ** ** See also the [sqlite3_update_hook()] interface. */ -void *sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*); -void *sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*); +void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); +void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); /* ** CAPI3REF: Data Change Notification Callbacks @@ -5403,7 +5380,7 @@ void *sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*); */ void *sqlite3_update_hook( sqlite3*, - void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64), + void(*)(void *,int ,char const *,char const *,sqlite3_int64), void* ); @@ -5730,7 +5707,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff); ** See also: [sqlite3_reset_auto_extension()] ** and [sqlite3_cancel_auto_extension()] */ -int sqlite3_auto_extension(void (SQLITE_CALLBACK *xEntryPoint)(void)); +int sqlite3_auto_extension(void (*xEntryPoint)(void)); /* ** CAPI3REF: Cancel Automatic Extension Loading @@ -5742,7 +5719,7 @@ int sqlite3_auto_extension(void (SQLITE_CALLBACK *xEntryPoint)(void)); ** unregistered and it returns 0 if X was not on the list of initialization ** routines. */ -int sqlite3_cancel_auto_extension(void (SQLITE_CALLBACK *xEntryPoint)(void)); +int sqlite3_cancel_auto_extension(void (*xEntryPoint)(void)); /* ** CAPI3REF: Reset Automatic Extension Loading @@ -5787,41 +5764,37 @@ typedef struct sqlite3_module sqlite3_module; */ struct sqlite3_module { int iVersion; - int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux, + int (*xCreate)(sqlite3*, void *pAux, int argc, const char *const*argv, sqlite3_vtab **ppVTab, char**); - int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux, + int (*xConnect)(sqlite3*, void *pAux, int argc, const char *const*argv, sqlite3_vtab **ppVTab, char**); - int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); - int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab); - int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab); - int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, - sqlite3_vtab_cursor **ppCursor); - int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*); - int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, - int idxNum, const char *idxStr, - int argc, sqlite3_value **argv); - int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*); - int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*); - int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); - int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); - int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, - sqlite3_int64 *); - int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab); - int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab); - int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab); - int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab); - int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, - int nArg, const char *zName, - void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**), - void **ppArg); - int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew); + int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); + int (*xDisconnect)(sqlite3_vtab *pVTab); + int (*xDestroy)(sqlite3_vtab *pVTab); + int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); + int (*xClose)(sqlite3_vtab_cursor*); + int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, + int argc, sqlite3_value **argv); + int (*xNext)(sqlite3_vtab_cursor*); + int (*xEof)(sqlite3_vtab_cursor*); + int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); + int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); + int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); + int (*xBegin)(sqlite3_vtab *pVTab); + int (*xSync)(sqlite3_vtab *pVTab); + int (*xCommit)(sqlite3_vtab *pVTab); + int (*xRollback)(sqlite3_vtab *pVTab); + int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, + void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), + void **ppArg); + int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); /* The methods above are in version 1 of the sqlite_module object. Those ** below are for version 2 and greater. */ - int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int); - int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int); - int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int); + int (*xSavepoint)(sqlite3_vtab *pVTab, int); + int (*xRelease)(sqlite3_vtab *pVTab, int); + int (*xRollbackTo)(sqlite3_vtab *pVTab, int); }; /* @@ -6010,7 +5983,7 @@ int sqlite3_create_module_v2( const char *zName, /* Name of the module */ const sqlite3_module *p, /* Methods for the module */ void *pClientData, /* Client data for xCreate/xConnect */ - void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */ + void(*xDestroy)(void*) /* Module destructor function */ ); /* @@ -6551,15 +6524,15 @@ void sqlite3_mutex_leave(sqlite3_mutex*); */ typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; struct sqlite3_mutex_methods { - int (SQLITE_CALLBACK *xMutexInit)(void); - int (SQLITE_CALLBACK *xMutexEnd)(void); - sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int); - void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *); - void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *); - int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *); - void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *); - int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *); - int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *); + int (*xMutexInit)(void); + int (*xMutexEnd)(void); + sqlite3_mutex *(*xMutexAlloc)(int); + void (*xMutexFree)(sqlite3_mutex *); + void (*xMutexEnter)(sqlite3_mutex *); + int (*xMutexTry)(sqlite3_mutex *); + void (*xMutexLeave)(sqlite3_mutex *); + int (*xMutexHeld)(sqlite3_mutex *); + int (*xMutexNotheld)(sqlite3_mutex *); }; /* @@ -7255,21 +7228,18 @@ typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; struct sqlite3_pcache_methods2 { int iVersion; void *pArg; - int (SQLITE_CALLBACK *xInit)(void*); - void (SQLITE_CALLBACK *xShutdown)(void*); - sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, - int bPurgeable); - void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); - int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); - sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, - int createFlag); - void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, - int discard); - void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, - unsigned oldKey, unsigned newKey); - void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); - void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); - void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*); + int (*xInit)(void*); + void (*xShutdown)(void*); + sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable); + void (*xCachesize)(sqlite3_pcache*, int nCachesize); + int (*xPagecount)(sqlite3_pcache*); + sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); + void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); + void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, + unsigned oldKey, unsigned newKey); + void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); + void (*xDestroy)(sqlite3_pcache*); + void (*xShrink)(sqlite3_pcache*); }; /* @@ -7280,18 +7250,16 @@ struct sqlite3_pcache_methods2 { typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; struct sqlite3_pcache_methods { void *pArg; - int (SQLITE_CALLBACK *xInit)(void*); - void (SQLITE_CALLBACK *xShutdown)(void*); - sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable); - void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); - int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); - void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, - int createFlag); - void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard); - void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, - unsigned newKey); - void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); - void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); + int (*xInit)(void*); + void (*xShutdown)(void*); + sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable); + void (*xCachesize)(sqlite3_pcache*, int nCachesize); + int (*xPagecount)(sqlite3_pcache*); + void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); + void (*xUnpin)(sqlite3_pcache*, void*, int discard); + void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); + void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); + void (*xDestroy)(sqlite3_pcache*); }; @@ -7621,7 +7589,7 @@ int sqlite3_backup_pagecount(sqlite3_backup *p); */ int sqlite3_unlock_notify( sqlite3 *pBlocked, /* Waiting connection */ - void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback func */ + void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */ void *pNotifyArg /* Argument to pass to xNotify */ ); @@ -7736,7 +7704,7 @@ void sqlite3_log(int iErrCode, const char *zFormat, ...); */ void *sqlite3_wal_hook( sqlite3*, - int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int), + int(*)(void *,sqlite3*,const char*,int), void* ); @@ -8209,7 +8177,7 @@ int sqlite3_db_cacheflush(sqlite3*); */ SQLITE_EXPERIMENTAL void *sqlite3_preupdate_hook( sqlite3 *db, - void(SQLITE_CALLBACK *xPreUpdate)( + void(*xPreUpdate)( void *pCtx, /* Copy of third arg to preupdate_hook() */ sqlite3 *db, /* Database handle */ int op, /* SQLITE_UPDATE, DELETE or INSERT */ diff --git a/tool/mksqlite3h.tcl b/tool/mksqlite3h.tcl index d0ddba9cfa..4b7d10b69f 100644 --- a/tool/mksqlite3h.tcl +++ b/tool/mksqlite3h.tcl @@ -21,6 +21,8 @@ # formatted as an integer (e.g. "3006017"). # 5) Replaces the string --SOURCE-ID-- with the date and time and sha1 # hash of the fossil-scm manifest for the source tree. +# 6) Adds the SQLITE_CALLBACK calling convention macro in front of all +# callback declarations. # # This script outputs to stdout. # @@ -125,6 +127,7 @@ foreach file $filelist { append line " " $funcname $rest } } + regsub {\(\*} $line {(SQLITE_CALLBACK *} line puts $line } close $in