/ Check-in [e5a51803]
Login

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

Overview
Comment:Add the three new pointer interfaces to the loadable extension mechanism. Update sqlite3_value_subtype() documentation to remove the statement about it not being used internally.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bind-pointer
Files: files | file ages | folders
SHA3-256: e5a518038fcb23376d2b17d4d70648320bc5540c5bd8b164201044ebe1ce45c5
User & Date: drh 2017-07-13 17:54:12
Context
2017-07-13
17:56
Fix an incorrect type signature for the loadable extension pointer for sqlite3_result_pointer(). Closed-Leaf check-in: 0bd7875b user: drh tags: bind-pointer
17:54
Add the three new pointer interfaces to the loadable extension mechanism. Update sqlite3_value_subtype() documentation to remove the statement about it not being used internally. check-in: e5a51803 user: drh tags: bind-pointer
17:48
Update the FTS3 extension to use sqlite3_result_pointer() and sqlite3_value_pointer() for passing FTS3 cursor objects from the table into functions such as snippet(). check-in: 0fa2e170 user: drh tags: bind-pointer
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/loadext.c.

   423    423     /* Version 3.14.0 and later */
   424    424     sqlite3_trace_v2,
   425    425     sqlite3_expanded_sql,
   426    426     /* Version 3.18.0 and later */
   427    427     sqlite3_set_last_insert_rowid,
   428    428     /* Version 3.20.0 and later */
   429    429     sqlite3_prepare_v3,
   430         -  sqlite3_prepare16_v3
          430  +  sqlite3_prepare16_v3,
          431  +  sqlite3_bind_pointer,
          432  +  sqlite3_result_pointer,
          433  +  sqlite3_value_pointer
   431    434   };
   432    435   
   433    436   /*
   434    437   ** Attempt to load an SQLite extension library contained in the file
   435    438   ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
   436    439   ** default entry point name (sqlite3_extension_init) is used.  Use
   437    440   ** of the default name is recommended.

Changes to src/sqlite.h.in.

  4806   4806   ** METHOD: sqlite3_value
  4807   4807   **
  4808   4808   ** The sqlite3_value_subtype(V) function returns the subtype for
  4809   4809   ** an [application-defined SQL function] argument V.  The subtype
  4810   4810   ** information can be used to pass a limited amount of context from
  4811   4811   ** one SQL function to another.  Use the [sqlite3_result_subtype()]
  4812   4812   ** routine to set the subtype for the return value of an SQL function.
  4813         -**
  4814         -** SQLite makes no use of subtype itself.  It merely passes the subtype
  4815         -** from the result of one [application-defined SQL function] into the
  4816         -** input of another.
  4817   4813   */
  4818   4814   unsigned int sqlite3_value_subtype(sqlite3_value*);
  4819   4815   
  4820   4816   /*
  4821   4817   ** CAPI3REF: Copy And Free SQL Values
  4822   4818   ** METHOD: sqlite3_value
  4823   4819   **

Changes to src/sqlite3ext.h.

   285    285     /* Version 3.18.0 and later */
   286    286     void (*set_last_insert_rowid)(sqlite3*,sqlite3_int64);
   287    287     /* Version 3.20.0 and later */
   288    288     int (*prepare_v3)(sqlite3*,const char*,int,unsigned int,
   289    289                       sqlite3_stmt**,const char**);
   290    290     int (*prepare16_v3)(sqlite3*,const void*,int,unsigned int,
   291    291                         sqlite3_stmt**,const void**);
          292  +  int (*bind_pointer)(sqlite3_stmt*,int,void*);
          293  +  int (*result_pointer)(sqlite3_context*,void*);
          294  +  void *(*value_pointer)(sqlite3_value*);
   292    295   };
   293    296   
   294    297   /*
   295    298   ** This is the function signature used for all extension entry points.  It
   296    299   ** is also defined in the file "loadext.c".
   297    300   */
   298    301   typedef int (*sqlite3_loadext_entry)(
................................................................................
   548    551   #define sqlite3_trace_v2               sqlite3_api->trace_v2
   549    552   #define sqlite3_expanded_sql           sqlite3_api->expanded_sql
   550    553   /* Version 3.18.0 and later */
   551    554   #define sqlite3_set_last_insert_rowid  sqlite3_api->set_last_insert_rowid
   552    555   /* Version 3.20.0 and later */
   553    556   #define sqlite3_prepare_v3             sqlite3_api->prepare_v3
   554    557   #define sqlite3_prepare16_v3           sqlite3_api->prepare16_v3
          558  +#define sqlite3_bind_pointer           sqlite3_api->bind_pointer
          559  +#define sqlite3_result_pointer         sqlite3_api->result_pointer
          560  +#define sqlite3_value_pointer          sqlite3_api->value_pointer
   555    561   #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
   556    562   
   557    563   #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
   558    564     /* This case when the file really is being compiled as a loadable 
   559    565     ** extension */
   560    566   # define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api=0;
   561    567   # define SQLITE_EXTENSION_INIT2(v)  sqlite3_api=v;