/ Check-in [bf9c86c7]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:The return type used by the auto-extension entry points is 'int', not 'void'.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | callbackConv
Files: files | file ages | folders
SHA1: bf9c86c74f30136a106f37603a6c7dcc76caf41d
User & Date: mistachkin 2016-07-28 22:46:53
Context
2016-07-28
22:53
More compiler warning fixes for GCC related to the auto-extension mechanism. check-in: b8218129 user: mistachkin tags: callbackConv
22:46
The return type used by the auto-extension entry points is 'int', not 'void'. check-in: bf9c86c7 user: mistachkin tags: callbackConv
22:38
Make sure all the auto-extension mechanism function signatures match up precisely. check-in: 87ba69b5 user: mistachkin tags: callbackConv
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/loadext.c.

   672    672   
   673    673   
   674    674   /*
   675    675   ** Register a statically linked extension that is automatically
   676    676   ** loaded by every new database connection.
   677    677   */
   678    678   int sqlite3_auto_extension(
   679         -  void (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *)
          679  +  int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *)
   680    680   ){
   681    681     int rc = SQLITE_OK;
   682    682   #ifndef SQLITE_OMIT_AUTOINIT
   683    683     rc = sqlite3_initialize();
   684    684     if( rc ){
   685    685       return rc;
   686    686     }else
................................................................................
   719    719   ** is currently on the list.  If xInit is not on the list, then this
   720    720   ** routine is a no-op.
   721    721   **
   722    722   ** Return 1 if xInit was found on the list and removed.  Return 0 if xInit
   723    723   ** was not on the list.
   724    724   */
   725    725   int sqlite3_cancel_auto_extension(
   726         -  void (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *)
          726  +  int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *)
   727    727   ){
   728    728   #if SQLITE_THREADSAFE
   729    729     sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
   730    730   #endif
   731    731     int i;
   732    732     int n = 0;
   733    733     wsdAutoextInit;

Changes to src/sqlite.h.in.

  5705   5705   ** will be called more than once for each database connection that is opened.
  5706   5706   **
  5707   5707   ** See also: [sqlite3_reset_auto_extension()]
  5708   5708   ** and [sqlite3_cancel_auto_extension()]
  5709   5709   */
  5710   5710   typedef struct sqlite3_api_routines sqlite3_api_routines;
  5711   5711   int sqlite3_auto_extension(
  5712         -  void (*xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
         5712  +  int (*xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
  5713   5713   );
  5714   5714   
  5715   5715   /*
  5716   5716   ** CAPI3REF: Cancel Automatic Extension Loading
  5717   5717   **
  5718   5718   ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
  5719   5719   ** initialization routine X that was registered using a prior call to
  5720   5720   ** [sqlite3_auto_extension(X)].  ^The [sqlite3_cancel_auto_extension(X)]
  5721   5721   ** routine returns 1 if initialization routine X was successfully 
  5722   5722   ** unregistered and it returns 0 if X was not on the list of initialization
  5723   5723   ** routines.
  5724   5724   */
  5725   5725   int sqlite3_cancel_auto_extension(
  5726         -  void (*xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
         5726  +  int (*xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
  5727   5727   );
  5728   5728   
  5729   5729   /*
  5730   5730   ** CAPI3REF: Reset Automatic Extension Loading
  5731   5731   **
  5732   5732   ** ^This interface disables all automatic extensions previously
  5733   5733   ** registered using [sqlite3_auto_extension()].

Changes to src/sqlite3ext.h.

   247    247     int (*stricmp)(const char*,const char*);
   248    248     int (*uri_boolean)(const char*,const char*,int);
   249    249     sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
   250    250     const char *(*uri_parameter)(const char*,const char*);
   251    251     char *(*vsnprintf)(int,char*,const char*,va_list);
   252    252     int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
   253    253     /* Version 3.8.7 and later */
   254         -  int (*auto_extension)(void(*)(sqlite3*,char**,const sqlite3_api_routines*));
          254  +  int (*auto_extension)(int(*)(sqlite3*,char**,const sqlite3_api_routines*));
   255    255     int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64,
   256    256                        void(*)(void*));
   257    257     int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
   258    258                         void(*)(void*),unsigned char);
   259         -  int (*cancel_auto_extension)(void(*)(sqlite3*,char**,
          259  +  int (*cancel_auto_extension)(int(*)(sqlite3*,char**,
   260    260                                          const sqlite3_api_routines*));
   261    261     int (*load_extension)(sqlite3*,const char*,const char*,char**);
   262    262     void *(*malloc64)(sqlite3_uint64);
   263    263     sqlite3_uint64 (*msize)(void*);
   264    264     void *(*realloc64)(void*,sqlite3_uint64);
   265    265     void (*reset_auto_extension)(void);
   266    266     void (*result_blob64)(sqlite3_context*,const void*,sqlite3_uint64,