?? capi3ref.tcl
字號:
const void *sqlite3_value_text16(sqlite3_value*);const void *sqlite3_value_text16be(sqlite3_value*);const void *sqlite3_value_text16le(sqlite3_value*);int sqlite3_value_type(sqlite3_value*);} { This group of routines returns information about arguments to a user-defined function. Function implementations use these routines to access their arguments. 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. See the documentation under sqlite3_column_blob for additional information.}api {} { int sqlite3_sleep(int);} { 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.}api {} { int sqlite3_expired(sqlite3_stmt*);} { 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.}api {} { int sqlite3_transfer_bindings(sqlite3_stmt*, 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.}api {} { int sqlite3_global_recover();} { This function used to be involved in recovering from out-of-memory errors. But as of SQLite version 3.3.0, out-of-memory recovery is automatic and this routine now does nothing. THe interface is retained to avoid link errors with legacy code.}api {} { int sqlite3_get_autocommit(sqlite3*);} { 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.}api {} { int sqlite3_clear_bindings(sqlite3_stmt*);} { Set all the parameters in the compiled SQL statement back to NULL.}api {} { sqlite3 *sqlite3_db_handle(sqlite3_stmt*);} { 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.}api {} { void *sqlite3_update_hook( sqlite3*, void(*)(void *,int ,char const *,char const *,sqlite_int64), void* );} { Register a callback function with the database connection identified by the first argument to be invoked whenever a row is updated, inserted or deleted. Any callback set by a previous call to this function for the same database connection is overridden. The second argument is a pointer to the function to invoke when a row is updated, inserted or deleted. The first argument to the callback is a copy of the third argument to sqlite3_update_hook. The second callback argument is one of SQLITE_INSERT, SQLITE_DELETE or SQLITE_UPDATE, depending on the operation that caused the callback to be invoked. The third and fourth arguments to the callback contain pointers to the database and table name containing the affected row. The final callback parameter is the rowid of the row. In the case of an update, this is the rowid after the update takes place. The update hook is not invoked when internal system tables are modified (i.e. sqlite_master and sqlite_sequence). If another function was previously registered, its pArg value is returned. Otherwise NULL is returned. See also: sqlite3_commit_hook(), sqlite3_rollback_hook()}api {} { void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);} { Register a callback to be invoked whenever a transaction is rolled back. The new callback function overrides any existing rollback-hook callback. If there was an existing callback, then it's pArg value (the third argument to sqlite3_rollback_hook() when it was registered) is returned. Otherwise, NULL is returned. For the purposes of this API, a transaction is said to have been rolled back if an explicit "ROLLBACK" statement is executed, or an error or constraint causes an implicit rollback to occur. The callback is not invoked if a transaction is automatically rolled back because the database connection is closed.}api {} { int sqlite3_enable_shared_cache(int);} { This routine enables or disables the sharing of the database cache and schema data structures between connections to the same database. Sharing is enabled if the argument is true and disabled if the argument is false. Cache sharing is enabled and disabled on a thread-by-thread basis. Each call to this routine enables or disables cache sharing only for connections created in the same thread in which this routine is called. There is no mechanism for sharing cache between database connections running in different threads. Sharing must be disabled prior to shutting down a thread or else the thread will leak memory. Call this routine with an argument of 0 to turn off sharing. Or use the sqlite3_thread_cleanup() API. This routine must not be called when any database connections are active in the current thread. Enabling or disabling shared cache while there are active database connections will result in memory corruption. When the shared cache is enabled, the following routines must always be called from the same thread: sqlite3_open(), sqlite3_prepare(), sqlite3_step(), sqlite3_reset(), sqlite3_finalize(), and sqlite3_close(). This is due to the fact that the shared cache makes use of thread-specific storage so that it will be available for sharing with other connections. This routine returns SQLITE_OK if shared cache was enabled or disabled successfully. An error code is returned otherwise. Shared cache is disabled by default for backward compatibility.}api {} { void sqlite3_thread_cleanup(void);} { This routine makes sure that all thread local storage used by SQLite in the current thread has been deallocated. A thread can call this routine prior to terminating in order to make sure there are no memory leaks. This routine is not strictly necessary. If cache sharing has been disabled using sqlite3_enable_shared_cache() and if all database connections have been closed and if SQLITE_ENABLE_MEMORY_MANAGMENT is on and all memory has been freed, then the thread local storage will already have been automatically deallocated. This routine is provided as a convenience to the program who just wants to make sure that there are no leaks.}api {} { int sqlite3_release_memory(int N);} { This routine attempts to free at least N bytes of memory from the caches of database connecions that were created in the same thread from which this routine is called. The value returned is the number of bytes actually freed. This routine is only available if memory management has been enabled by compiling with the SQLITE_ENABLE_MEMORY_MANAGMENT macro.}api {} { void sqlite3_soft_heap_limit(int N);} { This routine sets the soft heap limit for the current thread to N. If the total heap usage by SQLite in the current thread exceeds N, then sqlite3_release_memory() is called to try to reduce the memory usage below the soft limit. Prior to shutting down a thread sqlite3_soft_heap_limit() must be set to zero (the default) or else the thread will leak memory. Alternatively, use the sqlite3_thread_cleanup() API. A negative or zero value for N means that there is no soft heap limit and sqlite3_release_memory() will only be called when memory is exhaused. The default value for the soft heap limit is zero. SQLite makes a best effort to honor the soft heap limit. But if it is unable to reduce memory usage below the soft limit, execution will continue without error or notification. This is why the limit is called a "soft" limit. It is advisory only. This routine is only available if memory management has been enabled by compiling with the SQLITE_ENABLE_MEMORY_MANAGMENT macro.}api {} { void sqlite3_thread_cleanup(void);} { This routine ensures that a thread that has used SQLite in the past has released any thread-local storage it might have allocated. When the rest of the API is used properly, the cleanup of thread-local storage should be completely automatic. You should never really need to invoke this API. But it is provided to you as a precaution and as a potential work-around for future thread-releated memory-leaks.}set n 0set i 0foreach item $apilist { set namelist [lindex $item 0] foreach name $namelist { set n_to_name($n) $name set n_to_idx($n) $i set name_to_idx($name) $i incr n } incr i}set i 0foreach name [lsort [array names name_to_idx]] { set sname($i) $name incr i}#parray n_to_name#parray n_to_idx#parray name_to_idx#parray snameincr n -1puts {<table width="100%" cellpadding="5"><tr>}set nrow [expr {($n+2)/3}]set i 0for {set j 0} {$j<3} {incr j} { if {$j>0} {puts {<td width="10"></td>}} puts {<td valign="top">} set limit [expr {$i+$nrow}] puts {<ul>} while {$i<$limit && $i<$n} { set name $sname($i) if {[regexp {^sqlite} $name]} {set display $name} {set display <i>$name</i>} puts "<li><a href=\"#$name\">$display</a></li>" incr i } puts {</ul></td>}}puts "</table>"puts "<!-- $n entries. $nrow rows in 3 columns -->"proc resolve_name {ignore_list name} { global name_to_idx if {![info exists name_to_idx($name)] || [lsearch $ignore_list $name]>=0} { return $name } else { return "<a href=\"#$name\">$name</a>" }}foreach name [lsort [array names name_to_idx]] { set i $name_to_idx($name) if {[info exists done($i)]} continue set done($i) 1 foreach {namelist prototype desc} [lindex $apilist $i] break foreach name $namelist { puts "<a name=\"$name\">" } puts "<p><hr></p>" puts "<blockquote><pre>" regsub "^( *\n)+" $prototype {} p2 regsub "(\n *)+\$" $p2 {} p3 puts $p3 puts "</pre></blockquote>" regsub -all {\[} $desc {\[} desc regsub -all {sqlite3_[a-z0-9_]+} $desc "\[resolve_name $name &\]" d2 regsub -all "\n( *\n)+" [subst $d2] "</p>\n\n<p>" d3 puts "<p>$d3</p>"}footer $rcsid
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -