📄 loadext.c
字号:
/*** 2006 June 7**** The author disclaims copyright to this source code. In place of** a legal notice, here is a blessing:**** May you do good and not evil.** May you find forgiveness for yourself and forgive others.** May you share freely, never taking more than you give.***************************************************************************** This file contains code used to dynamically load extensions into** the SQLite library.**** $Id: loadext.c,v 1.53 2008/08/02 03:50:39 drh Exp $*/#ifndef SQLITE_CORE #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */#endif#include "sqlite3ext.h"#include "sqliteInt.h"#include <string.h>#include <ctype.h>#ifndef SQLITE_OMIT_LOAD_EXTENSION/*** Some API routines are omitted when various features are** excluded from a build of SQLite. Substitute a NULL pointer** for any missing APIs.*/#ifndef SQLITE_ENABLE_COLUMN_METADATA# define sqlite3_column_database_name 0# define sqlite3_column_database_name16 0# define sqlite3_column_table_name 0# define sqlite3_column_table_name16 0# define sqlite3_column_origin_name 0# define sqlite3_column_origin_name16 0# define sqlite3_table_column_metadata 0#endif#ifdef SQLITE_OMIT_AUTHORIZATION# define sqlite3_set_authorizer 0#endif#ifdef SQLITE_OMIT_UTF16# define sqlite3_bind_text16 0# define sqlite3_collation_needed16 0# define sqlite3_column_decltype16 0# define sqlite3_column_name16 0# define sqlite3_column_text16 0# define sqlite3_complete16 0# define sqlite3_create_collation16 0# define sqlite3_create_function16 0# define sqlite3_errmsg16 0# define sqlite3_open16 0# define sqlite3_prepare16 0# define sqlite3_prepare16_v2 0# define sqlite3_result_error16 0# define sqlite3_result_text16 0# define sqlite3_result_text16be 0# define sqlite3_result_text16le 0# define sqlite3_value_text16 0# define sqlite3_value_text16be 0# define sqlite3_value_text16le 0# define sqlite3_column_database_name16 0# define sqlite3_column_table_name16 0# define sqlite3_column_origin_name16 0#endif#ifdef SQLITE_OMIT_COMPLETE# define sqlite3_complete 0# define sqlite3_complete16 0#endif#ifdef SQLITE_OMIT_PROGRESS_CALLBACK# define sqlite3_progress_handler 0#endif#ifdef SQLITE_OMIT_VIRTUALTABLE# define sqlite3_create_module 0# define sqlite3_create_module_v2 0# define sqlite3_declare_vtab 0#endif#ifdef SQLITE_OMIT_SHARED_CACHE# define sqlite3_enable_shared_cache 0#endif#ifdef SQLITE_OMIT_TRACE# define sqlite3_profile 0# define sqlite3_trace 0#endif#ifdef SQLITE_OMIT_GET_TABLE# define sqlite3_free_table 0# define sqlite3_get_table 0#endif#ifdef SQLITE_OMIT_INCRBLOB#define sqlite3_bind_zeroblob 0#define sqlite3_blob_bytes 0#define sqlite3_blob_close 0#define sqlite3_blob_open 0#define sqlite3_blob_read 0#define sqlite3_blob_write 0#endif/*** The following structure contains pointers to all SQLite API routines.** A pointer to this structure is passed into extensions when they are** loaded so that the extension can make calls back into the SQLite** library.**** When adding new APIs, add them to the bottom of this structure** in order to preserve backwards compatibility.**** Extensions that use newer APIs should first call the** sqlite3_libversion_number() to make sure that the API they** intend to use is supported by the library. Extensions should** also check to make sure that the pointer to the function is** not NULL before calling it.*/static const sqlite3_api_routines sqlite3Apis = { sqlite3_aggregate_context, sqlite3_aggregate_count, sqlite3_bind_blob, sqlite3_bind_double, sqlite3_bind_int, sqlite3_bind_int64, sqlite3_bind_null, sqlite3_bind_parameter_count, sqlite3_bind_parameter_index, sqlite3_bind_parameter_name, sqlite3_bind_text, sqlite3_bind_text16, sqlite3_bind_value, sqlite3_busy_handler, sqlite3_busy_timeout, sqlite3_changes, sqlite3_close, sqlite3_collation_needed, sqlite3_collation_needed16, sqlite3_column_blob, sqlite3_column_bytes, sqlite3_column_bytes16, sqlite3_column_count, sqlite3_column_database_name, sqlite3_column_database_name16, sqlite3_column_decltype, sqlite3_column_decltype16, sqlite3_column_double, sqlite3_column_int, sqlite3_column_int64, sqlite3_column_name, sqlite3_column_name16, sqlite3_column_origin_name, sqlite3_column_origin_name16, sqlite3_column_table_name, sqlite3_column_table_name16, sqlite3_column_text, sqlite3_column_text16, sqlite3_column_type, sqlite3_column_value, sqlite3_commit_hook, sqlite3_complete, sqlite3_complete16, sqlite3_create_collation, sqlite3_create_collation16, sqlite3_create_function, sqlite3_create_function16, sqlite3_create_module, sqlite3_data_count, sqlite3_db_handle, sqlite3_declare_vtab, sqlite3_enable_shared_cache, sqlite3_errcode, sqlite3_errmsg, sqlite3_errmsg16, sqlite3_exec, sqlite3_expired, sqlite3_finalize, sqlite3_free, sqlite3_free_table, sqlite3_get_autocommit, sqlite3_get_auxdata, sqlite3_get_table, 0, /* Was sqlite3_global_recover(), but that function is deprecated */ sqlite3_interrupt, sqlite3_last_insert_rowid, sqlite3_libversion, sqlite3_libversion_number, sqlite3_malloc, sqlite3_mprintf, sqlite3_open, sqlite3_open16, sqlite3_prepare, sqlite3_prepare16, sqlite3_profile, sqlite3_progress_handler, sqlite3_realloc, sqlite3_reset, sqlite3_result_blob, sqlite3_result_double, sqlite3_result_error, sqlite3_result_error16, sqlite3_result_int, sqlite3_result_int64, sqlite3_result_null, sqlite3_result_text, sqlite3_result_text16, sqlite3_result_text16be, sqlite3_result_text16le, sqlite3_result_value, sqlite3_rollback_hook, sqlite3_set_authorizer, sqlite3_set_auxdata, sqlite3_snprintf, sqlite3_step, sqlite3_table_column_metadata, sqlite3_thread_cleanup, sqlite3_total_changes, sqlite3_trace, sqlite3_transfer_bindings, sqlite3_update_hook, sqlite3_user_data, sqlite3_value_blob, sqlite3_value_bytes, sqlite3_value_bytes16, sqlite3_value_double, sqlite3_value_int, sqlite3_value_int64, sqlite3_value_numeric_type, sqlite3_value_text, sqlite3_value_text16, sqlite3_value_text16be, sqlite3_value_text16le, sqlite3_value_type, sqlite3_vmprintf, /* ** The original API set ends here. All extensions can call any ** of the APIs above provided that the pointer is not NULL. But ** before calling APIs that follow, extension should check the ** sqlite3_libversion_number() to make sure they are dealing with ** a library that is new enough to support that API. ************************************************************************* */ sqlite3_overload_function, /* ** Added after 3.3.13 */ sqlite3_prepare_v2, sqlite3_prepare16_v2, sqlite3_clear_bindings, /* ** Added for 3.4.1 */ sqlite3_create_module_v2, /* ** Added for 3.5.0 */ sqlite3_bind_zeroblob, sqlite3_blob_bytes, sqlite3_blob_close, sqlite3_blob_open, sqlite3_blob_read, sqlite3_blob_write, sqlite3_create_collation_v2, sqlite3_file_control, sqlite3_memory_highwater, sqlite3_memory_used,#ifdef SQLITE_MUTEX_NOOP 0, 0, 0, 0, 0,#else sqlite3_mutex_alloc, sqlite3_mutex_enter, sqlite3_mutex_free,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -