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