]> gitweb.factorcode.org Git - factor.git/blob - basis/db/sqlite/ffi/ffi.factor
factor: more top level forms.
[factor.git] / basis / db / sqlite / ffi / ffi.factor
1 ! Copyright (C) 2005 Chris Double, Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 ! An interface to the sqlite database. Tested against sqlite v3.1.3.
4 ! Not all functions have been wrapped.
5 USING: alien alien.c-types alien.libraries alien.syntax
6 combinators system ;
7 IN: db.sqlite.ffi
8
9 LIBRARY-UNIX: sqlite cdecl "libsqlite3.so"
10 LIBRARY-MACOSX: sqlite cdecl "libsqlite3.dylib"
11 LIBRARY-WINDOWS: sqlite cdecl "sqlite3.dll"
12
13 ! Return values from sqlite functions
14 CONSTANT: SQLITE_OK           0  ! Successful result
15 CONSTANT: SQLITE_ERROR        1  ! SQL error or missing database
16 CONSTANT: SQLITE_INTERNAL     2  ! An internal logic error in SQLite
17 CONSTANT: SQLITE_PERM         3  ! Access permission denied
18 CONSTANT: SQLITE_ABORT        4  ! Callback routine requested an abort
19 CONSTANT: SQLITE_BUSY         5  ! The database file is locked
20 CONSTANT: SQLITE_LOCKED       6  ! A table in the database is locked
21 CONSTANT: SQLITE_NOMEM        7  ! A malloc() failed
22 CONSTANT: SQLITE_READONLY     8  ! Attempt to write a readonly database
23 CONSTANT: SQLITE_INTERRUPT    9  ! Operation terminated by sqlite_interrupt()
24 CONSTANT: SQLITE_IOERR       10  ! Some kind of disk I/O error occurred
25 CONSTANT: SQLITE_CORRUPT     11  ! The database disk image is malformed
26 CONSTANT: SQLITE_NOTFOUND    12  ! (Internal Only) Table or record not found
27 CONSTANT: SQLITE_FULL        13  ! Insertion failed because database is full
28 CONSTANT: SQLITE_CANTOPEN    14  ! Unable to open the database file
29 CONSTANT: SQLITE_PROTOCOL    15  ! Database lock protocol error
30 CONSTANT: SQLITE_EMPTY       16  ! (Internal Only) Database table is empty
31 CONSTANT: SQLITE_SCHEMA      17  ! The database schema changed
32 CONSTANT: SQLITE_TOOBIG      18  ! Too much data for one row of a table
33 CONSTANT: SQLITE_CONSTRAINT  19  ! Abort due to contraint violation
34 CONSTANT: SQLITE_MISMATCH    20  ! Data type mismatch
35 CONSTANT: SQLITE_MISUSE      21  ! Library used incorrectly
36 CONSTANT: SQLITE_NOLFS       22  ! Uses OS features not supported on host
37 CONSTANT: SQLITE_AUTH        23  ! Authorization denied
38 CONSTANT: SQLITE_FORMAT      24  ! Auxiliary database format error
39 CONSTANT: SQLITE_RANGE       25  ! 2nd parameter to sqlite3_bind out of range
40 CONSTANT: SQLITE_NOTADB      26  ! File opened that is not a database file
41 CONSTANT: SQLITE_NOTICE      27  ! Notifications from sqlite3_log()
42 CONSTANT: SQLITE_WARNING     28  ! Warnings from sqlite3_log()
43
44 CONSTANT: sqlite-error-messages {
45     "Successful result"
46     "SQL error or missing database"
47     "An internal logic error in SQLite"
48     "Access permission denied"
49     "Callback routine requested an abort"
50     "The database file is locked"
51     "A table in the database is locked"
52     "A malloc() failed"
53     "Attempt to write a readonly database"
54     "Operation terminated by sqlite_interrupt()"
55     "Some kind of disk I/O error occurred"
56     "The database disk image is malformed"
57     "(Internal Only) Table or record not found"
58     "Insertion failed because database is full"
59     "Unable to open the database file"
60     "Database lock protocol error"
61     "(Internal Only) Database table is empty"
62     "The database schema changed"
63     "Too much data for one row of a table"
64     "Abort due to contraint violation"
65     "Data type mismatch"
66     "Library used incorrectly"
67     "Uses OS features not supported on host"
68     "Authorization denied"
69     "Auxiliary database format error"
70     "2nd parameter to sqlite3_bind out of range"
71     "File opened that is not a database file"
72     "Notifications from sqlite3_log()"
73     "Warnings from sqlite3_log()"
74 }
75
76 ! Return values from sqlite3_step
77 CONSTANT: SQLITE_ROW         100
78 CONSTANT: SQLITE_DONE        101
79
80 ! Return values from the sqlite3_column_type function
81 CONSTANT: SQLITE_INTEGER     1
82 CONSTANT: SQLITE_FLOAT       2
83 CONSTANT: SQLITE_TEXT        3
84 CONSTANT: SQLITE_BLOB        4
85 CONSTANT: SQLITE_NULL        5
86
87 ! Values for the 'destructor' parameter of the 'bind' routines.
88 CONSTANT: SQLITE_STATIC      0
89 CONSTANT: SQLITE_TRANSIENT   -1
90
91 CONSTANT: SQLITE_OPEN_READONLY         0x00000001
92 CONSTANT: SQLITE_OPEN_READWRITE        0x00000002
93 CONSTANT: SQLITE_OPEN_CREATE           0x00000004
94 CONSTANT: SQLITE_OPEN_DELETEONCLOSE    0x00000008
95 CONSTANT: SQLITE_OPEN_EXCLUSIVE        0x00000010
96 CONSTANT: SQLITE_OPEN_MAIN_DB          0x00000100
97 CONSTANT: SQLITE_OPEN_TEMP_DB          0x00000200
98 CONSTANT: SQLITE_OPEN_TRANSIENT_DB     0x00000400
99 CONSTANT: SQLITE_OPEN_MAIN_JOURNAL     0x00000800
100 CONSTANT: SQLITE_OPEN_TEMP_JOURNAL     0x00001000
101 CONSTANT: SQLITE_OPEN_SUBJOURNAL       0x00002000
102 CONSTANT: SQLITE_OPEN_MASTER_JOURNAL   0x00004000
103
104 CONSTANT: SQLITE_IOCAP_ATOMIC                 0x00000001
105 CONSTANT: SQLITE_IOCAP_ATOMIC512              0x00000002
106 CONSTANT: SQLITE_IOCAP_ATOMIC1K               0x00000004
107 CONSTANT: SQLITE_IOCAP_ATOMIC2K               0x00000008
108 CONSTANT: SQLITE_IOCAP_ATOMIC4K               0x00000010
109 CONSTANT: SQLITE_IOCAP_ATOMIC8K               0x00000020
110 CONSTANT: SQLITE_IOCAP_ATOMIC16K              0x00000040
111 CONSTANT: SQLITE_IOCAP_ATOMIC32K              0x00000080
112 CONSTANT: SQLITE_IOCAP_ATOMIC64K              0x00000100
113 CONSTANT: SQLITE_IOCAP_SAFE_APPEND            0x00000200
114 CONSTANT: SQLITE_IOCAP_SEQUENTIAL             0x00000400
115 CONSTANT: SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN  0x00000800
116 CONSTANT: SQLITE_IOCAP_POWERSAFE_OVERWRITE    0x00001000
117 CONSTANT: SQLITE_IOCAP_IMMUTABLE              0x00002000
118 CONSTANT: SQLITE_IOCAP_BATCH_ATOMIC           0x00004000
119
120 CONSTANT: SQLITE_LOCK_NONE          0
121 CONSTANT: SQLITE_LOCK_SHARED        1
122 CONSTANT: SQLITE_LOCK_RESERVED      2
123 CONSTANT: SQLITE_LOCK_PENDING       3
124 CONSTANT: SQLITE_LOCK_EXCLUSIVE     4
125
126 CONSTANT: SQLITE_SYNC_NORMAL        0x00002
127 CONSTANT: SQLITE_SYNC_FULL          0x00003
128 CONSTANT: SQLITE_SYNC_DATAONLY      0x00010
129
130 C-TYPE: sqlite3
131 C-TYPE: sqlite3_stmt
132 C-TYPE: sqlite3_value
133 C-TYPE: sqlite3_context
134 C-TYPE: sqlite3_file
135 TYPEDEF: longlong sqlite3_int64
136 TYPEDEF: ulonglong sqlite3_uint64
137
138 LIBRARY: sqlite
139
140 ! FUNCTION: char sqlite3_version[]
141 FUNCTION: c-string sqlite3_libversion ( )
142 FUNCTION: c-string sqlite3_sourceid ( )
143 FUNCTION: int sqlite3_libversion_number ( )
144 FUNCTION: int sqlite3_compileoption_used ( char* zOptName )
145 FUNCTION: c-string sqlite3_compileoption_get ( int N )
146 FUNCTION: int sqlite3_threadsafe ( )
147
148 FUNCTION: int sqlite3_close ( sqlite3* pDb )
149 FUNCTION: int sqlite3_close_v2 ( sqlite3* pDb )
150
151 FUNCTION: int sqlite3_exec (
152   sqlite3* pDb,
153   char* sql,
154   void* callback,
155   void* arg,
156   char** errmsg
157 )
158
159 FUNCTION: int sqlite3_initialize ( )
160 FUNCTION: int sqlite3_shutdown ( )
161 FUNCTION: int sqlite3_os_init ( )
162 FUNCTION: int sqlite3_os_end ( )
163
164 FUNCTION: int sqlite3_extended_result_codes ( sqlite3* pDb, int onoff )
165 FUNCTION: sqlite3_uint64 sqlite3_last_insert_rowid ( sqlite3* pDb )
166 FUNCTION: sqlite3_uint64 sqlite3_set_last_insert_rowid ( sqlite3* pDb, sqlite3_int64 n )
167 FUNCTION: int sqlite3_changes ( sqlite3* pDb )
168 FUNCTION: int sqlite3_total_changes ( sqlite3* pDb )
169 FUNCTION: void sqlite3_interrupt ( sqlite3* pDb )
170
171 FUNCTION: int sqlite3_complete ( c-string sql )
172 FUNCTION: int sqlite3_complete16 ( void *sql )
173
174 FUNCTION: void *sqlite3_malloc ( int i )
175 FUNCTION: void *sqlite3_malloc64 ( sqlite3_uint64 u )
176 FUNCTION: void *sqlite3_realloc ( void* ptr, int i )
177 FUNCTION: void *sqlite3_realloc64 ( void* ptr, sqlite3_uint64 u )
178 FUNCTION: void sqlite3_free ( void* ptr )
179 FUNCTION: sqlite3_uint64 sqlite3_msize ( void* ptr )
180
181 FUNCTION: sqlite3_int64 sqlite3_memory_used ( )
182 FUNCTION: sqlite3_int64 sqlite3_memory_highwater ( int resetFlag )
183
184 FUNCTION: void sqlite3_randomness ( int N, void *P )
185
186 FUNCTION: int sqlite3_set_authorizer (
187   sqlite3* pDb,
188   void* cb, ! int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
189   void* pUserData
190 )
191
192 FUNCTION: int sqlite3_trace_v2 (
193   sqlite3* pDb,
194   uint uMask,
195   void* cb, ! int(*xCallback)(unsigned,void*,void*,void*),
196   void* pCtx
197 )
198
199 FUNCTION: void sqlite3_progress_handler ( sqlite3* pDb, int arg1, void* cb, void* arg2 )
200
201 FUNCTION: int sqlite3_open (
202   c-string filename,      ! Database filename (UTF-8)
203   sqlite3** ppDb          ! OUT: SQLite db handle
204 )
205 FUNCTION: int sqlite3_open16 (
206   c-string filename,      ! Database filename (UTF-16)
207   sqlite3** ppDb          ! OUT: SQLite db handle
208 )
209 FUNCTION: int sqlite3_open_v2 (
210   c-string filename,      ! Database filename (UTF-8)
211   sqlite3** ppDb,         ! OUT: SQLite db handle
212   int flags,              ! Flags
213   c-string zVfs           ! Name of VFS module to use
214 )
215
216 FUNCTION: c-string sqlite3_uri_parameter ( c-string zFilename, c-string zParam )
217 FUNCTION: int sqlite3_uri_boolean ( c-string zFile, c-string zParam, int bDefault )
218 FUNCTION: sqlite3_int64 sqlite3_uri_int64 ( c-string str1, c-string str2, sqlite3_int64 i )
219 FUNCTION: c-string sqlite3_uri_key ( c-string zFilename, int N )
220
221 FUNCTION: c-string sqlite3_filename_database ( c-string str )
222 FUNCTION: c-string sqlite3_filename_journal ( c-string str )
223 FUNCTION: c-string sqlite3_filename_wal ( c-string str )
224
225 FUNCTION: sqlite3_file* sqlite3_database_file_object ( c-string str )
226
227 FUNCTION: char* sqlite3_create_filename (
228   c-string zDatabase,
229   c-string zJournal,
230   c-string zWal,
231   int nParam,
232   c-string *azParam
233 )
234 FUNCTION: void sqlite3_free_filename ( c-string name )
235
236 FUNCTION: int sqlite3_errcode ( sqlite3 *db )
237 FUNCTION: int sqlite3_extended_errcode ( sqlite3 *db )
238 FUNCTION: c-string sqlite3_errmsg ( sqlite3* pDb )
239 FUNCTION: void *sqlite3_errmsg16 ( sqlite3* pDb )
240 FUNCTION: c-string sqlite3_errstr ( int N )
241
242 FUNCTION: int sqlite3_limit ( sqlite3* pDb, int id, int newVal )
243
244 ! FUNCTION: int sqlite3_prepare ( sqlite3* pDb, c-string zSql, int nBytes, void* ppStmt, void* pzTail )
245 ! FUNCTION: int sqlite3_prepare_v2 ( sqlite3* pDb, c-string zSql, int nBytes, void* ppStmt, void* pzTail )
246
247 FUNCTION: int sqlite3_prepare (
248   sqlite3* db,            ! Database handle
249   c-string zSql,          ! SQL statement, UTF-8 encoded
250   int nByte,              ! Maximum length of zSql in bytes.
251   sqlite3_stmt** ppStmt,  ! OUT: Statement handle
252   char** pzTail           ! OUT: Pointer to unused portion of zSql
253 )
254
255 FUNCTION: int sqlite3_prepare_v2 (
256   sqlite3* db,            ! Database handle
257   c-string zSql,          ! SQL statement, UTF-8 encoded
258   int nByte,              ! Maximum length of zSql in bytes.
259   sqlite3_stmt** ppStmt,  ! OUT: Statement handle
260   char** pzTail           ! OUT: Pointer to unused portion of zSql
261 )
262
263 FUNCTION: int sqlite3_prepare_v3 (
264   sqlite3* db,            ! Database handle
265   c-string zSql,          ! SQL statement, UTF-8 encoded
266   int nByte,              ! Maximum length of zSql in bytes.
267   uint prepFlags,         ! Zero or more SQLITE_PREPARE_ flags
268   sqlite3_stmt** ppStmt,  ! OUT: Statement handle
269   char** pzTail           ! OUT: Pointer to unused portion of zSql
270 )
271
272 FUNCTION: int sqlite3_prepare16 (
273   sqlite3* db,            ! Database handle
274   c-string zSql,          ! SQL statement, UTF-16 encoded
275   int nByte,              ! Maximum length of zSql in bytes.
276   sqlite3_stmt** ppStmt,  ! OUT: Statement handle
277   void** pzTail           ! OUT: Pointer to unused portion of zSql
278 )
279
280 FUNCTION: int sqlite3_prepare16_v2 (
281   sqlite3* db,            ! Database handle
282   c-string zSql,          ! SQL statement, UTF-16 encoded
283   int nByte,              ! Maximum length of zSql in bytes.
284   sqlite3_stmt** ppStmt,  ! OUT: Statement handle
285   void** pzTail           ! OUT: Pointer to unused portion of zSql
286 )
287
288 FUNCTION: int sqlite3_prepare16_v3 (
289   sqlite3* db,            ! Database handle
290   c-string zSql,          ! SQL statement, UTF-16 encoded
291   int nByte,              ! Maximum length of zSql in bytes.
292   uint prepFlags,         ! Zero or more SQLITE_PREPARE_ flags
293   sqlite3_stmt** ppStmt,  ! OUT: Statement handle
294   void** pzTail           ! OUT: Pointer to unused portion of zSql
295 )
296
297 FUNCTION: char *sqlite3_sql ( sqlite3_stmt *pStmt )
298 FUNCTION: char *sqlite3_expanded_sql ( sqlite3_stmt *pStmt )
299 FUNCTION: char *sqlite3_normalized_sql ( sqlite3_stmt *pStmt )
300
301 FUNCTION: int sqlite3_stmt_readonly ( sqlite3_stmt *pStmt )
302 FUNCTION: int sqlite3_stmt_isexplain ( sqlite3_stmt *pStmt )
303 FUNCTION: int sqlite3_stmt_busy ( sqlite3_stmt *pStmt )
304
305
306 FUNCTION: int sqlite3_bind_parameter_count ( sqlite3_stmt* pStmt )
307 FUNCTION: char* sqlite3_bind_parameter_name ( sqlite3_stmt* pStmt, int N )
308 FUNCTION: int sqlite3_bind_parameter_index ( sqlite3_stmt* pStmt, c-string zName )
309 FUNCTION: int sqlite3_clear_bindings ( sqlite3_stmt* pStmt )
310 FUNCTION: int sqlite3_column_count ( sqlite3_stmt* pStmt )
311 FUNCTION: char* sqlite3_column_name ( sqlite3_stmt* pStmt, int N )
312 FUNCTION: void* sqlite3_column_name16 ( sqlite3_stmt* pStmt, int N )
313 FUNCTION: char* sqlite3_column_database_name ( sqlite3_stmt* pStmt, int N )
314 FUNCTION: void* sqlite3_column_database_name16 ( sqlite3_stmt* pStmt, int N )
315 FUNCTION: char* sqlite3_column_table_name ( sqlite3_stmt* pStmt, int N )
316 FUNCTION: void* sqlite3_column_table_name16 ( sqlite3_stmt* pStmt, int N )
317 FUNCTION: char* sqlite3_column_origin_name ( sqlite3_stmt* pStmt, int N )
318 FUNCTION: void* sqlite3_column_origin_name16 ( sqlite3_stmt* pStmt, int N )
319
320 FUNCTION: c-string sqlite3_column_decltype ( sqlite3_stmt* pStmt, int col )
321 FUNCTION: void* sqlite3_column_decltype16 ( sqlite3_stmt* pStmt, int col )
322
323 FUNCTION: int sqlite3_step ( sqlite3_stmt* pStmt )
324
325 FUNCTION: void* sqlite3_column_blob ( sqlite3_stmt* pStmt, int col )
326 FUNCTION: double sqlite3_column_double ( sqlite3_stmt* pStmt, int col )
327 FUNCTION: int sqlite3_column_int ( sqlite3_stmt* pStmt, int col )
328 FUNCTION: sqlite3_int64 sqlite3_column_int64 ( sqlite3_stmt* pStmt, int col )
329 ! Bind the same function as above, but for unsigned 64bit integers
330 FUNCTION-ALIAS: sqlite3_column_uint64
331     sqlite3_uint64 sqlite3_column_int64 ( sqlite3_stmt* pStmt, int col )
332 FUNCTION: c-string sqlite3_column_text ( sqlite3_stmt* pStmt, int col )
333 FUNCTION: c-string sqlite3_column_text16 ( sqlite3_stmt* pStmt, int col )
334 FUNCTION: sqlite3_value* sqlite3_column_value ( sqlite3_stmt* pStmt, int col )
335 FUNCTION: int sqlite3_column_bytes ( sqlite3_stmt* pStmt, int col )
336 FUNCTION: int sqlite3_column_bytes16 ( sqlite3_stmt* pStmt, int col )
337 FUNCTION: int sqlite3_column_type ( sqlite3_stmt* pStmt, int col )
338
339 FUNCTION: int sqlite3_finalize ( sqlite3_stmt* pStmt )
340 FUNCTION: int sqlite3_reset ( sqlite3_stmt* pStmt )
341
342 FUNCTION: void* sqlite3_value_blob ( sqlite3_value* value )
343 FUNCTION: double sqlite3_value_double ( sqlite3_value* value )
344 FUNCTION: int sqlite3_value_int ( sqlite3_value* value )
345 FUNCTION: sqlite3_int64 sqlite3_value_int64 ( sqlite3_value* value )
346 FUNCTION: void* sqlite3_value_pointer ( sqlite3_value* value, char* value )
347 FUNCTION: uchar* sqlite3_value_text ( sqlite3_value* value )
348 FUNCTION: void* sqlite3_value_text16 ( sqlite3_value* value )
349 FUNCTION: void* sqlite3_value_text16le ( sqlite3_value* value )
350 FUNCTION: void* sqlite3_value_text16be ( sqlite3_value* value )
351 FUNCTION: int sqlite3_value_bytes ( sqlite3_value* value )
352 FUNCTION: int sqlite3_value_bytes16 ( sqlite3_value* value )
353 FUNCTION: int sqlite3_value_type ( sqlite3_value* value )
354 FUNCTION: int sqlite3_value_numeric_type ( sqlite3_value* value )
355 FUNCTION: int sqlite3_value_nochange ( sqlite3_value* value )
356 FUNCTION: int sqlite3_value_frombind ( sqlite3_value* value )
357
358 FUNCTION: uint sqlite3_value_subtype ( sqlite3_value* value )
359 FUNCTION: sqlite3_value *sqlite3_value_dup ( sqlite3_value* value )
360 FUNCTION: void sqlite3_value_free ( sqlite3_value* value )
361
362
363
364 FUNCTION: int sqlite3_data_count ( sqlite3_stmt *pStmt )
365
366 FUNCTION: int sqlite3_bind_blob ( sqlite3_stmt* pStmt, int index, void* ptr, int len, int destructor )
367 FUNCTION: int sqlite3_bind_double ( sqlite3_stmt* pStmt, int index, double x )
368 FUNCTION: int sqlite3_bind_int ( sqlite3_stmt* pStmt, int index, int n )
369 FUNCTION: int sqlite3_bind_int64 ( sqlite3_stmt* pStmt, int index, sqlite3_int64 n )
370 ! Bind the same function as above, but for unsigned 64bit integers
371 FUNCTION-ALIAS: sqlite3-bind-uint64
372     int sqlite3_bind_int64 ( sqlite3_stmt* pStmt, int index, sqlite3_uint64 in64 )
373 FUNCTION: int sqlite3_bind_null ( sqlite3_stmt* pStmt, int n )
374 FUNCTION: int sqlite3_bind_text ( sqlite3_stmt* pStmt, int index, c-string text, int len, int destructor )
375
376
377 FUNCTION: void* sqlite3_aggregate_context ( sqlite3_context* context, int nBytes )
378 FUNCTION: void* sqlite3_user_data ( sqlite3_context* context )
379 FUNCTION: sqlite3 *sqlite3_context_db_handle ( sqlite3_context* context )
380
381 FUNCTION: void *sqlite3_get_auxdata ( sqlite3_context* context, int N )
382 FUNCTION: void sqlite3_set_auxdata ( sqlite3_context* context, int N, void* arg, void* arg2 )
383
384 FUNCTION: void sqlite3_result_blob ( sqlite3_context* context, void* arg, int arg2, void* cb )
385 FUNCTION: void sqlite3_result_blob64 ( sqlite3_context* context, void* arg1, sqlite3_uint64 arg2, void* cb )
386 FUNCTION: void sqlite3_result_double ( sqlite3_context* context, double d )
387 FUNCTION: void sqlite3_result_error ( sqlite3_context* context, char* arg1, int arg2 )
388 FUNCTION: void sqlite3_result_error16 ( sqlite3_context* context, void* arg1, int arg2 )
389 FUNCTION: void sqlite3_result_error_toobig ( sqlite3_context* context )
390 FUNCTION: void sqlite3_result_error_nomem ( sqlite3_context* context )
391 FUNCTION: void sqlite3_result_error_code ( sqlite3_context* context, int i )
392 FUNCTION: void sqlite3_result_int ( sqlite3_context* context, int i )
393 FUNCTION: void sqlite3_result_int64 ( sqlite3_context* context, sqlite3_int64 i )
394 FUNCTION: void sqlite3_result_null ( sqlite3_context* context )
395 FUNCTION: void sqlite3_result_text ( sqlite3_context* context, char* c, int i, void* cb )
396 FUNCTION: void sqlite3_result_text64 ( sqlite3_context* context, char* c, sqlite3_uint64 ui, void* v, uchar encoding )
397 FUNCTION: void sqlite3_result_text16 ( sqlite3_context* context, void* arg, int arg2, void* arg3 )
398 FUNCTION: void sqlite3_result_text16le ( sqlite3_context* context, void* arg1, int arg2, void* arg3 )
399 FUNCTION: void sqlite3_result_text16be ( sqlite3_context* context, void* arg1, int arg2, void* arg3 )
400 FUNCTION: void sqlite3_result_value ( sqlite3_context* context, sqlite3_value* value )
401 FUNCTION: void sqlite3_result_pointer ( sqlite3_context* context, void* arg1, char* arg2, void* ptr )
402 FUNCTION: void sqlite3_result_zeroblob ( sqlite3_context* context, int n )
403 FUNCTION: int sqlite3_result_zeroblob64 ( sqlite3_context* context, sqlite3_uint64 n )
404
405 FUNCTION: void sqlite3_result_subtype ( sqlite3_context* context, uint u )
406
407 FUNCTION: int sqlite3_create_collation (
408   sqlite3* pDb,
409   c-string zName,
410   int eTextRep,
411   void* pArg,
412   void* cb ! int(*xCompare)(void*,int,const void*,int,const void*)
413 )
414 FUNCTION: int sqlite3_create_collation_v2 (
415   sqlite3* pDb,
416   c-string zName,
417   int eTextRep,
418   void *pArg,
419   void* cb1, ! int(*xCompare)(void*,int,const void*,int,const void*),
420   void* cb2, ! void(*xDestroy)(void*)
421 )
422 FUNCTION: int sqlite3_create_collation16 (
423   sqlite3* pDb,
424   void *zName,
425   int eTextRep,
426   void* pArg,
427   void* cb ! int(*xCompare)(void*,int,const void*,int,const void*)
428 )
429
430 FUNCTION: int sqlite3_collation_needed (
431   sqlite3* pDb,
432   void* ptr,
433   void* cb ! void(*)(void*,sqlite3*,int eTextRep,const char*)
434 )
435 FUNCTION: int sqlite3_collation_needed16 (
436   sqlite3* pDb,
437   void* ptr,
438   void* cb ! void(*)(void*,sqlite3*,int eTextRep,const void*)
439 )
440
441 FUNCTION: int sqlite3_sleep ( int n )
442
443 C-GLOBAL: c-string sqlite3_temp_directory
444 C-GLOBAL: c-string sqlite3_data_directory
445
446 FUNCTION: int sqlite3_win32_set_directory (
447   ulong type,         ! Identifier for directory being set or reset
448   void* zValue        ! New value for directory being set or reset
449 )
450 FUNCTION: int sqlite3_win32_set_directory8 ( ulong type, c-string zValue )
451 FUNCTION: int sqlite3_win32_set_directory16 ( ulong type, c-string zValue )
452
453 CONSTANT: SQLITE_WIN32_DATA_DIRECTORY_TYPE  1
454 CONSTANT: SQLITE_WIN32_TEMP_DIRECTORY_TYPE  2
455
456 FUNCTION: int sqlite3_get_autocommit ( sqlite3* pDb )
457 FUNCTION: sqlite3* sqlite3_db_handle ( sqlite3_stmt* pStmt )
458
459 FUNCTION: c-string sqlite3_db_filename ( sqlite3* db, c-string zDbName )
460 FUNCTION: int sqlite3_db_readonly ( sqlite3* db, c-string zDbName )