⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sqlite3.h

📁 sqlite 嵌入式数据库的源码
💻 H
📖 第 1 页 / 共 4 页
字号:
  void (*xFinal)(sqlite3_context*));int sqlite3_create_function16(  sqlite3*,  const void *zFunctionName,  int nArg,  int eTextRep,  void*,  void (*xFunc)(sqlite3_context*,int,sqlite3_value**),  void (*xStep)(sqlite3_context*,int,sqlite3_value**),  void (*xFinal)(sqlite3_context*));/*** The next routine returns the number of calls to xStep for a particular** aggregate function instance.  The current call to xStep counts so this** routine always returns at least 1.*/int sqlite3_aggregate_count(sqlite3_context*);/*** The next group of routines returns information about parameters to** a user-defined function.  Function implementations use these routines** to access their parameters.  These routines are the same as the** sqlite3_column_* routines except that these routines take a single** sqlite3_value* pointer instead of an sqlite3_stmt* and an integer** column number.*/const void *sqlite3_value_blob(sqlite3_value*);int sqlite3_value_bytes(sqlite3_value*);int sqlite3_value_bytes16(sqlite3_value*);double sqlite3_value_double(sqlite3_value*);int sqlite3_value_int(sqlite3_value*);sqlite_int64 sqlite3_value_int64(sqlite3_value*);const unsigned char *sqlite3_value_text(sqlite3_value*);const void *sqlite3_value_text16(sqlite3_value*);const void *sqlite3_value_text16le(sqlite3_value*);const void *sqlite3_value_text16be(sqlite3_value*);int sqlite3_value_type(sqlite3_value*);/*** Aggregate functions use the following routine to allocate** a structure for storing their state.  The first time this routine** is called for a particular aggregate, a new structure of size nBytes** is allocated, zeroed, and returned.  On subsequent calls (for the** same aggregate instance) the same buffer is returned.  The implementation** of the aggregate can use the returned buffer to accumulate data.**** The buffer allocated is freed automatically by SQLite.*/void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);/*** The pUserData parameter to the sqlite3_create_function() and** sqlite3_create_aggregate() routines used to register user functions** is available to the implementation of the function using this** call.*/void *sqlite3_user_data(sqlite3_context*);/*** The following two functions may be used by scalar user functions to** associate meta-data with argument values. If the same value is passed to** multiple invocations of the user-function during query execution, under** some circumstances the associated meta-data may be preserved. This may** be used, for example, to add a regular-expression matching scalar** function. The compiled version of the regular expression is stored as** meta-data associated with the SQL value passed as the regular expression** pattern.**** Calling sqlite3_get_auxdata() returns a pointer to the meta data** associated with the Nth argument value to the current user function** call, where N is the second parameter. If no meta-data has been set for** that value, then a NULL pointer is returned.**** The sqlite3_set_auxdata() is used to associate meta data with a user** function argument. The third parameter is a pointer to the meta data** to be associated with the Nth user function argument value. The fourth** parameter specifies a 'delete function' that will be called on the meta** data pointer to release it when it is no longer required. If the delete** function pointer is NULL, it is not invoked.**** In practice, meta-data is preserved between function calls for** expressions that are constant at compile time. This includes literal** values and SQL variables.*/void *sqlite3_get_auxdata(sqlite3_context*, int);void sqlite3_set_auxdata(sqlite3_context*, int, void*, void (*)(void*));/*** These are special value for the destructor that is passed in as the** final argument to routines like sqlite3_result_blob().  If the destructor** argument is SQLITE_STATIC, it means that the content pointer is constant** and will never change.  It does not need to be destroyed.  The ** SQLITE_TRANSIENT value means that the content will likely change in** the near future and that SQLite should make its own private copy of** the content before returning.*/#define SQLITE_STATIC      ((void(*)(void *))0)#define SQLITE_TRANSIENT   ((void(*)(void *))-1)/*** User-defined functions invoke the following routines in order to** set their return value.*/void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));void sqlite3_result_double(sqlite3_context*, double);void sqlite3_result_error(sqlite3_context*, const char*, int);void sqlite3_result_error16(sqlite3_context*, const void*, int);void sqlite3_result_int(sqlite3_context*, int);void sqlite3_result_int64(sqlite3_context*, sqlite_int64);void sqlite3_result_null(sqlite3_context*);void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));void sqlite3_result_value(sqlite3_context*, sqlite3_value*);/*** These are the allowed values for the eTextRep argument to** sqlite3_create_collation and sqlite3_create_function.*/#define SQLITE_UTF8    1#define SQLITE_UTF16LE 2#define SQLITE_UTF16BE 3#define SQLITE_UTF16   4    /* Use native byte order */#define SQLITE_ANY     5    /* sqlite3_create_function only *//*** These two functions are used to add new collation sequences to the** sqlite3 handle specified as the first argument. **** The name of the new collation sequence is specified as a UTF-8 string** for sqlite3_create_collation() and a UTF-16 string for** sqlite3_create_collation16(). In both cases the name is passed as the** second function argument.**** The third argument must be one of the constants SQLITE_UTF8,** SQLITE_UTF16LE or SQLITE_UTF16BE, indicating that the user-supplied** routine expects to be passed pointers to strings encoded using UTF-8,** UTF-16 little-endian or UTF-16 big-endian respectively.**** A pointer to the user supplied routine must be passed as the fifth** argument. If it is NULL, this is the same as deleting the collation** sequence (so that SQLite cannot call it anymore). Each time the user** supplied function is invoked, it is passed a copy of the void* passed as** the fourth argument to sqlite3_create_collation() or** sqlite3_create_collation16() as its first parameter.**** The remaining arguments to the user-supplied routine are two strings,** each represented by a [length, data] pair and encoded in the encoding** that was passed as the third argument when the collation sequence was** registered. The user routine should return negative, zero or positive if** the first string is less than, equal to, or greater than the second** string. i.e. (STRING1 - STRING2).*/int sqlite3_create_collation(  sqlite3*,   const char *zName,   int eTextRep,   void*,  int(*xCompare)(void*,int,const void*,int,const void*));int sqlite3_create_collation16(  sqlite3*,   const char *zName,   int eTextRep,   void*,  int(*xCompare)(void*,int,const void*,int,const void*));/*** To avoid having to register all collation sequences before a database** can be used, a single callback function may be registered with the** database handle to be called whenever an undefined collation sequence is** required.**** If the function is registered using the sqlite3_collation_needed() API,** then it is passed the names of undefined collation sequences as strings** encoded in UTF-8. If sqlite3_collation_needed16() is used, the names** are passed as UTF-16 in machine native byte order. A call to either** function replaces any existing callback.**** When the user-function is invoked, the first argument passed is a copy** of the second argument to sqlite3_collation_needed() or** sqlite3_collation_needed16(). The second argument is the database** handle. The third argument is one of SQLITE_UTF8, SQLITE_UTF16BE or** SQLITE_UTF16LE, indicating the most desirable form of the collation** sequence function required. The fourth parameter is the name of the** required collation sequence.**** The collation sequence is returned to SQLite by a collation-needed** callback using the sqlite3_create_collation() or** sqlite3_create_collation16() APIs, described above.*/int sqlite3_collation_needed(  sqlite3*,   void*,   void(*)(void*,sqlite3*,int eTextRep,const char*));int sqlite3_collation_needed16(  sqlite3*,   void*,  void(*)(void*,sqlite3*,int eTextRep,const void*));/*** Specify the key for an encrypted database.  This routine should be** called right after sqlite3_open().**** The code to implement this API is not available in the public release** of SQLite.*/int sqlite3_key(  sqlite3 *db,                   /* Database to be rekeyed */  const void *pKey, int nKey     /* The key */);/*** Change the key on an open database.  If the current database is not** encrypted, this routine will encrypt it.  If pNew==0 or nNew==0, the** database is decrypted.**** The code to implement this API is not available in the public release** of SQLite.*/int sqlite3_rekey(  sqlite3 *db,                   /* Database to be rekeyed */  const void *pKey, int nKey     /* The new key */);/*** Sleep for a little while. The second parameter is the number of** miliseconds to sleep for. **** If the operating system does not support sleep requests with ** milisecond time resolution, then the time will be rounded up to ** the nearest second. The number of miliseconds of sleep actually ** requested from the operating system is returned.*/int sqlite3_sleep(int);/*** Return TRUE (non-zero) if the statement supplied as an argument needs** to be recompiled.  A statement needs to be recompiled whenever the** execution environment changes in a way that would alter the program** that sqlite3_prepare() generates.  For example, if new functions or** collating sequences are registered or if an authorizer function is** added or changed.***/int sqlite3_expired(sqlite3_stmt*);/*** Move all bindings from the first prepared statement over to the second.** This routine is useful, for example, if the first prepared statement** fails with an SQLITE_SCHEMA error.  The same SQL can be prepared into** the second prepared statement then all of the bindings transfered over** to the second statement before the first statement is finalized.*/int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);/*** If the following global variable is made to point to a** string which is the name of a directory, then all temporary files** created by SQLite will be placed in that directory.  If this variable** is NULL pointer, then SQLite does a search for an appropriate temporary** file directory.**** Once sqlite3_open() has been called, changing this variable will invalidate** the current temporary database, if any.*/extern char *sqlite3_temp_directory;/*** This function is called to recover from a malloc() failure that occured** within the SQLite library. Normally, after a single malloc() fails the ** library refuses to function (all major calls return SQLITE_NOMEM).** This function restores the library state so that it can be used again.**** All existing statements (sqlite3_stmt pointers) must be finalized or** reset before this call is made. Otherwise, SQLITE_BUSY is returned.** If any in-memory databases are in use, either as a main or TEMP** database, SQLITE_ERROR is returned. In either of these cases, the ** library is not reset and remains unusable.**** This function is *not* threadsafe. Calling this from within a threaded** application when threads other than the caller have used SQLite is** dangerous and will almost certainly result in malfunctions.**** This functionality can be omitted from a build by defining the ** SQLITE_OMIT_GLOBALRECOVER at compile time.*/int sqlite3_global_recover();/*** Test to see whether or not the database connection is in autocommit** mode.  Return TRUE if it is and FALSE if not.  Autocommit mode is on** by default.  Autocommit is disabled by a BEGIN statement and reenabled** by the next COMMIT or ROLLBACK.*/int sqlite3_get_autocommit(sqlite3*);/*** Return the sqlite3* database handle to which the prepared statement given** in the argument belongs.  This is the same database handle that was** the first argument to the sqlite3_prepare() that was used to create** the statement in the first place.*/sqlite3 *sqlite3_db_handle(sqlite3_stmt*);#ifdef __cplusplus}  /* End of the 'extern "C"' block */#endif#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -