Small. Fast. Reliable.
Choose any three.

SQLite C 接口

SQL函数上下文对象
SQL Function Context Object

typedef struct sqlite3_context sqlite3_context;

SQL函数执行的上下文是存储在一个sqlite3_context对象中的。sqlite3_context对象的指针一般是应用程序自定义SQL函数的第一个参数。应用自定义的SQL函数实现中需要将这个指针传递到sqlite3_result()sqlite3_aggregate_context()sqlite3_user_data()sqlite3_context_db_handle()sqlite3_get_auxdata()sqlite3_set_auxdata()调用中。
The context in which an SQL function executes is stored in an sqlite3_context object. A pointer to an sqlite3_context object is always first parameter to application-defined SQL functions. The application-defined SQL function implementation will pass this pointer through into calls to sqlite3_result(), sqlite3_aggregate_context(), sqlite3_user_data(), sqlite3_context_db_handle(), sqlite3_get_auxdata(), and/or sqlite3_set_auxdata().

另行参见ObjectsConstantsFunctions的列表。
See also lists of Objects, Constants, and Functions.