OLD | NEW |
1 /* | 1 /* |
2 ** 2006 June 7 | 2 ** 2006 June 7 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
11 ************************************************************************* | 11 ************************************************************************* |
12 ** This header file defines the SQLite interface for use by | 12 ** This header file defines the SQLite interface for use by |
13 ** shared libraries that want to be imported as extensions into | 13 ** shared libraries that want to be imported as extensions into |
14 ** an SQLite instance. Shared libraries that intend to be loaded | 14 ** an SQLite instance. Shared libraries that intend to be loaded |
15 ** as extensions by SQLite should #include this file instead of | 15 ** as extensions by SQLite should #include this file instead of |
16 ** sqlite3.h. | 16 ** sqlite3.h. |
17 */ | 17 */ |
18 #ifndef _SQLITE3EXT_H_ | 18 #ifndef SQLITE3EXT_H |
19 #define _SQLITE3EXT_H_ | 19 #define SQLITE3EXT_H |
20 #include "sqlite3.h" | 20 #include "sqlite3.h" |
21 | 21 |
22 typedef struct sqlite3_api_routines sqlite3_api_routines; | |
23 | |
24 /* | 22 /* |
25 ** The following structure holds pointers to all of the SQLite API | 23 ** The following structure holds pointers to all of the SQLite API |
26 ** routines. | 24 ** routines. |
27 ** | 25 ** |
28 ** WARNING: In order to maintain backwards compatibility, add new | 26 ** WARNING: In order to maintain backwards compatibility, add new |
29 ** interfaces to the end of this structure only. If you insert new | 27 ** interfaces to the end of this structure only. If you insert new |
30 ** interfaces in the middle of this structure, then older different | 28 ** interfaces in the middle of this structure, then older different |
31 ** versions of SQLite will not be able to load each other's shared | 29 ** versions of SQLite will not be able to load each other's shared |
32 ** libraries! | 30 ** libraries! |
33 */ | 31 */ |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 void (*value_free)(sqlite3_value*); | 270 void (*value_free)(sqlite3_value*); |
273 int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64); | 271 int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64); |
274 int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64); | 272 int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64); |
275 /* Version 3.9.0 and later */ | 273 /* Version 3.9.0 and later */ |
276 unsigned int (*value_subtype)(sqlite3_value*); | 274 unsigned int (*value_subtype)(sqlite3_value*); |
277 void (*result_subtype)(sqlite3_context*,unsigned int); | 275 void (*result_subtype)(sqlite3_context*,unsigned int); |
278 /* Version 3.10.0 and later */ | 276 /* Version 3.10.0 and later */ |
279 int (*status64)(int,sqlite3_int64*,sqlite3_int64*,int); | 277 int (*status64)(int,sqlite3_int64*,sqlite3_int64*,int); |
280 int (*strlike)(const char*,const char*,unsigned int); | 278 int (*strlike)(const char*,const char*,unsigned int); |
281 int (*db_cacheflush)(sqlite3*); | 279 int (*db_cacheflush)(sqlite3*); |
| 280 /* Version 3.12.0 and later */ |
| 281 int (*system_errno)(sqlite3*); |
| 282 /* Version 3.14.0 and later */ |
| 283 int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*); |
| 284 char *(*expanded_sql)(sqlite3_stmt*); |
282 }; | 285 }; |
283 | 286 |
284 /* | 287 /* |
| 288 ** This is the function signature used for all extension entry points. It |
| 289 ** is also defined in the file "loadext.c". |
| 290 */ |
| 291 typedef int (*sqlite3_loadext_entry)( |
| 292 sqlite3 *db, /* Handle to the database. */ |
| 293 char **pzErrMsg, /* Used to set error string on failure. */ |
| 294 const sqlite3_api_routines *pThunk /* Extension API function pointers. */ |
| 295 ); |
| 296 |
| 297 /* |
285 ** The following macros redefine the API routines so that they are | 298 ** The following macros redefine the API routines so that they are |
286 ** redirected through the global sqlite3_api structure. | 299 ** redirected through the global sqlite3_api structure. |
287 ** | 300 ** |
288 ** This header file is also used by the loadext.c source file | 301 ** This header file is also used by the loadext.c source file |
289 ** (part of the main SQLite library - not an extension) so that | 302 ** (part of the main SQLite library - not an extension) so that |
290 ** it can get access to the sqlite3_api_routines structure | 303 ** it can get access to the sqlite3_api_routines structure |
291 ** definition. But the main library does not want to redefine | 304 ** definition. But the main library does not want to redefine |
292 ** the API. So the redefinition macros are only valid if the | 305 ** the API. So the redefinition macros are only valid if the |
293 ** SQLITE_CORE macros is undefined. | 306 ** SQLITE_CORE macros is undefined. |
294 */ | 307 */ |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 #define sqlite3_value_free sqlite3_api->value_free | 528 #define sqlite3_value_free sqlite3_api->value_free |
516 #define sqlite3_result_zeroblob64 sqlite3_api->result_zeroblob64 | 529 #define sqlite3_result_zeroblob64 sqlite3_api->result_zeroblob64 |
517 #define sqlite3_bind_zeroblob64 sqlite3_api->bind_zeroblob64 | 530 #define sqlite3_bind_zeroblob64 sqlite3_api->bind_zeroblob64 |
518 /* Version 3.9.0 and later */ | 531 /* Version 3.9.0 and later */ |
519 #define sqlite3_value_subtype sqlite3_api->value_subtype | 532 #define sqlite3_value_subtype sqlite3_api->value_subtype |
520 #define sqlite3_result_subtype sqlite3_api->result_subtype | 533 #define sqlite3_result_subtype sqlite3_api->result_subtype |
521 /* Version 3.10.0 and later */ | 534 /* Version 3.10.0 and later */ |
522 #define sqlite3_status64 sqlite3_api->status64 | 535 #define sqlite3_status64 sqlite3_api->status64 |
523 #define sqlite3_strlike sqlite3_api->strlike | 536 #define sqlite3_strlike sqlite3_api->strlike |
524 #define sqlite3_db_cacheflush sqlite3_api->db_cacheflush | 537 #define sqlite3_db_cacheflush sqlite3_api->db_cacheflush |
| 538 /* Version 3.12.0 and later */ |
| 539 #define sqlite3_system_errno sqlite3_api->system_errno |
| 540 /* Version 3.14.0 and later */ |
| 541 #define sqlite3_trace_v2 sqlite3_api->trace_v2 |
| 542 #define sqlite3_expanded_sql sqlite3_api->expanded_sql |
525 #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ | 543 #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ |
526 | 544 |
527 #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) | 545 #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) |
528 /* This case when the file really is being compiled as a loadable | 546 /* This case when the file really is being compiled as a loadable |
529 ** extension */ | 547 ** extension */ |
530 # define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0; | 548 # define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0; |
531 # define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v; | 549 # define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v; |
532 # define SQLITE_EXTENSION_INIT3 \ | 550 # define SQLITE_EXTENSION_INIT3 \ |
533 extern const sqlite3_api_routines *sqlite3_api; | 551 extern const sqlite3_api_routines *sqlite3_api; |
534 #else | 552 #else |
535 /* This case when the file is being statically linked into the | 553 /* This case when the file is being statically linked into the |
536 ** application */ | 554 ** application */ |
537 # define SQLITE_EXTENSION_INIT1 /*no-op*/ | 555 # define SQLITE_EXTENSION_INIT1 /*no-op*/ |
538 # define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */ | 556 # define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */ |
539 # define SQLITE_EXTENSION_INIT3 /*no-op*/ | 557 # define SQLITE_EXTENSION_INIT3 /*no-op*/ |
540 #endif | 558 #endif |
541 | 559 |
542 #endif /* _SQLITE3EXT_H_ */ | 560 #endif /* SQLITE3EXT_H */ |
OLD | NEW |