/ Check-in [3def6d8ef1]
Login

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

Overview
Comment:Add the ability for loadable extensions to access the new sqlite3_create_window_function() interface.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3def6d8ef11702eb03ad56aeb01763ec8e4ca8ed3b570ffb680164c5c3679e4f
User & Date: drh 2018-09-10 17:21:17
Context
2018-09-10
19:27
Fix a minor problem causing an incorrect cursor-hint to be generated in some cases. check-in: d879c47d7d user: dan tags: trunk
17:21
Add the ability for loadable extensions to access the new sqlite3_create_window_function() interface. check-in: 3def6d8ef1 user: drh tags: trunk
16:38
Fix a broken assert() in fts3.c. check-in: 564fa75195 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/loadext.c.

   445    445     sqlite3_str_vappendf,
   446    446     sqlite3_str_append,
   447    447     sqlite3_str_appendall,
   448    448     sqlite3_str_appendchar,
   449    449     sqlite3_str_reset,
   450    450     sqlite3_str_errcode,
   451    451     sqlite3_str_length,
   452         -  sqlite3_str_value
          452  +  sqlite3_str_value,
          453  +  /* Version 3.25.0 and later */
          454  +  sqlite3_create_window_function
   453    455   };
   454    456   
   455    457   /*
   456    458   ** Attempt to load an SQLite extension library contained in the file
   457    459   ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
   458    460   ** default entry point name (sqlite3_extension_init) is used.  Use
   459    461   ** of the default name is recommended.

Changes to src/sqlite3ext.h.

   306    306     void (*str_append)(sqlite3_str*, const char *zIn, int N);
   307    307     void (*str_appendall)(sqlite3_str*, const char *zIn);
   308    308     void (*str_appendchar)(sqlite3_str*, int N, char C);
   309    309     void (*str_reset)(sqlite3_str*);
   310    310     int (*str_errcode)(sqlite3_str*);
   311    311     int (*str_length)(sqlite3_str*);
   312    312     char *(*str_value)(sqlite3_str*);
          313  +  int (*create_window_function)(sqlite3*,const char*,int,int,void*,
          314  +                            void (*xStep)(sqlite3_context*,int,sqlite3_value**),
          315  +                            void (*xFinal)(sqlite3_context*),
          316  +                            void (*xValue)(sqlite3_context*),
          317  +                            void (*xInv)(sqlite3_context*,int,sqlite3_value**),
          318  +                            void(*xDestroy)(void*));
   313    319   };
   314    320   
   315    321   /*
   316    322   ** This is the function signature used for all extension entry points.  It
   317    323   ** is also defined in the file "loadext.c".
   318    324   */
   319    325   typedef int (*sqlite3_loadext_entry)(
................................................................................
   591    597   #define sqlite3_str_append             sqlite3_api->str_append
   592    598   #define sqlite3_str_appendall          sqlite3_api->str_appendall
   593    599   #define sqlite3_str_appendchar         sqlite3_api->str_appendchar
   594    600   #define sqlite3_str_reset              sqlite3_api->str_reset
   595    601   #define sqlite3_str_errcode            sqlite3_api->str_errcode
   596    602   #define sqlite3_str_length             sqlite3_api->str_length
   597    603   #define sqlite3_str_value              sqlite3_api->str_value
          604  +/* Version 3.25.0 and later */
          605  +#define sqlite3_create_window_function sqlite3_api->create_window_function
   598    606   #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
   599    607   
   600    608   #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
   601    609     /* This case when the file really is being compiled as a loadable 
   602    610     ** extension */
   603    611   # define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api=0;
   604    612   # define SQLITE_EXTENSION_INIT2(v)  sqlite3_api=v;