diff options
author | Wez Furlong <wez@php.net> | 2004-07-10 12:27:51 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2004-07-10 12:27:51 +0000 |
commit | e563b4eafa63ba8beb88defa1e36f037a7a97a60 (patch) | |
tree | 2e72dfa1c4b7fe62fde9ab326a67047ba2f4cc9e /ext/sqlite/libsqlite/src/sqlite.h.in | |
parent | cd732f1a3f5df97407797fe7ebb97830552479ad (diff) | |
download | php-git-e563b4eafa63ba8beb88defa1e36f037a7a97a60.tar.gz |
Upgrade bundled library to 2.8.14 + misc fixes
(http://www.sqlite.org/cvstrac/chngview?cn=1742)
Diffstat (limited to 'ext/sqlite/libsqlite/src/sqlite.h.in')
-rw-r--r-- | ext/sqlite/libsqlite/src/sqlite.h.in | 121 |
1 files changed, 113 insertions, 8 deletions
diff --git a/ext/sqlite/libsqlite/src/sqlite.h.in b/ext/sqlite/libsqlite/src/sqlite.h.in index 436c9bb56b..11edb43489 100644 --- a/ext/sqlite/libsqlite/src/sqlite.h.in +++ b/ext/sqlite/libsqlite/src/sqlite.h.in @@ -167,6 +167,7 @@ int sqlite_exec( #define SQLITE_AUTH 23 /* Authorization denied */ #define SQLITE_FORMAT 24 /* Auxiliary database format error */ #define SQLITE_RANGE 25 /* 2nd parameter to sqlite_bind out of range */ +#define SQLITE_NOTADB 26 /* File opened that is not a database file */ #define SQLITE_ROW 100 /* sqlite_step() has another row ready */ #define SQLITE_DONE 101 /* sqlite_step() has finished executing */ @@ -203,6 +204,32 @@ int sqlite_last_insert_rowid(sqlite*); */ int sqlite_changes(sqlite*); +/* +** This function returns the number of database rows that were changed +** by the last INSERT, UPDATE, or DELETE statment executed by sqlite_exec(), +** or by the last VM to run to completion. The change count is not updated +** by SQL statements other than INSERT, UPDATE or DELETE. +** +** Changes are counted, even if they are later undone by a ROLLBACK or +** ABORT. Changes associated with trigger programs that execute as a +** result of the INSERT, UPDATE, or DELETE statement are not counted. +** +** If a callback invokes sqlite_exec() recursively, then the changes +** in the inner, recursive call are counted together with the changes +** in the outer call. +** +** SQLite implements the command "DELETE FROM table" without a WHERE clause +** by dropping and recreating the table. (This is much faster than going +** through and deleting individual elements form the table.) Because of +** this optimization, the change count for "DELETE FROM table" will be +** zero regardless of the number of elements that were originally in the +** table. To get an accurate count of the number of rows deleted, use +** "DELETE FROM table WHERE 1" instead. +** +******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** +*/ +int sqlite_last_statement_changes(sqlite*); + /* If the parameter to this routine is one of the return value constants ** defined above, then this routine returns a constant text string which ** descripts (in English) the meaning of the return value. @@ -262,7 +289,7 @@ void sqlite_busy_handler(sqlite*, int(*)(void*,const char*,int), void*); ** Calling this routine with an argument less than or equal to zero ** turns off all busy handlers. */ -void sqlite_busy_timeout(sqlite*, long ms); +void sqlite_busy_timeout(sqlite*, int ms); /* ** This next routine is really just a wrapper around sqlite_exec(). @@ -439,13 +466,12 @@ int sqlite_create_aggregate( ** Use the following routine to define the datatype returned by a ** user-defined function. The second argument can be one of the ** constants SQLITE_NUMERIC, SQLITE_TEXT, or SQLITE_ARGS or it -** can be an integer greater than or equal to zero. The datatype -** will be numeric or text (the only two types supported) if the -** argument is SQLITE_NUMERIC or SQLITE_TEXT. If the argument is -** SQLITE_ARGS, then the datatype is numeric if any argument to the -** function is numeric and is text otherwise. If the second argument -** is an integer, then the datatype of the result is the same as the -** parameter to the function that corresponds to that integer. +** can be an integer greater than or equal to zero. When the datatype +** parameter is non-negative, the type of the result will be the +** same as the datatype-th argument. If datatype==SQLITE_NUMERIC +** then the result is always numeric. If datatype==SQLITE_TEXT then +** the result is always text. If datatype==SQLITE_ARGS then the result +** is numeric if any argument is numeric and is text otherwise. */ int sqlite_function_type( sqlite *db, /* The database there the function is registered */ @@ -753,9 +779,88 @@ int sqlite_bind(sqlite_vm*, int idx, const char *value, int len, int copy); ** query is immediately terminated and any database changes rolled back. If the ** query was part of a larger transaction, then the transaction is not rolled ** back and remains active. The sqlite_exec() call returns SQLITE_ABORT. +** +******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** */ void sqlite_progress_handler(sqlite*, int, int(*)(void*), void*); +/* +** Register a callback function to be invoked whenever a new transaction +** is committed. The pArg argument is passed through to the callback. +** callback. If the callback function returns non-zero, then the commit +** is converted into a rollback. +** +** If another function was previously registered, its pArg value is returned. +** Otherwise NULL is returned. +** +** Registering a NULL function disables the callback. +** +******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** +*/ +void *sqlite_commit_hook(sqlite*, int(*)(void*), void*); + +/* +** Open an encrypted SQLite database. If pKey==0 or nKey==0, this routine +** is the same as sqlite_open(). +** +** The code to implement this API is not available in the public release +** of SQLite. +*/ +sqlite *sqlite_open_encrypted( + const char *zFilename, /* Name of the encrypted database */ + const void *pKey, /* Pointer to the key */ + int nKey, /* Number of bytes in the key */ + int *pErrcode, /* Write error code here */ + char **pzErrmsg /* Write error message here */ +); + +/* +** 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 sqlite_rekey( + sqlite *db, /* Database to be rekeyed */ + const void *pKey, int nKey /* The new key */ +); + +/* +** Encode a binary buffer "in" of size n bytes so that it contains +** no instances of characters '\'' or '\000'. The output is +** null-terminated and can be used as a string value in an INSERT +** or UPDATE statement. Use sqlite_decode_binary() to convert the +** string back into its original binary. +** +** The result is written into a preallocated output buffer "out". +** "out" must be able to hold at least 2 +(257*n)/254 bytes. +** In other words, the output will be expanded by as much as 3 +** bytes for every 254 bytes of input plus 2 bytes of fixed overhead. +** (This is approximately 2 + 1.0118*n or about a 1.2% size increase.) +** +** The return value is the number of characters in the encoded +** string, excluding the "\000" terminator. +** +** If out==NULL then no output is generated but the routine still returns +** the number of characters that would have been generated if out had +** not been NULL. +*/ +int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out); + +/* +** Decode the string "in" into binary data and write it into "out". +** This routine reverses the encoding created by sqlite_encode_binary(). +** The output will always be a few bytes less than the input. The number +** of bytes of output is returned. If the input is not a well-formed +** encoding, -1 is returned. +** +** The "in" and "out" parameters may point to the same buffer in order +** to decode a string in place. +*/ +int sqlite_decode_binary(const unsigned char *in, unsigned char *out); + #ifdef __cplusplus } /* End of the 'extern "C"' block */ #endif |