1191
|
1 #
|
|
2 #
|
|
3 # Nim's Runtime Library
|
|
4 # (c) Copyright 2012 Andreas Rumpf
|
|
5 #
|
|
6 # See the file "copying.txt", included in this
|
|
7 # distribution, for details about the copyright.
|
|
8 #
|
|
9
|
|
10 when defined(nimHasStyleChecks):
|
|
11 {.push styleChecks: off.}
|
|
12
|
|
13 when defined(windows):
|
|
14 when defined(nimOldDlls):
|
|
15 const Lib = "sqlite3.dll"
|
|
16 elif defined(cpu64):
|
|
17 const Lib = "sqlite3_64.dll"
|
|
18 else:
|
|
19 const Lib = "sqlite3_32.dll"
|
|
20 elif defined(macosx):
|
|
21 const
|
|
22 Lib = "libsqlite3(|.0).dylib"
|
|
23 else:
|
|
24 const
|
|
25 Lib = "libsqlite3.so(|.0)"
|
|
26
|
|
27 {.pragma: mylib.}
|
|
28 {.compile("sqlite3.c", "-O3").}
|
|
29
|
|
30 const
|
|
31 SQLITE_INTEGER* = 1
|
|
32 SQLITE_FLOAT* = 2
|
|
33 SQLITE_BLOB* = 4
|
|
34 SQLITE_NULL* = 5
|
|
35 SQLITE_TEXT* = 3
|
|
36 SQLITE_UTF8* = 1
|
|
37 SQLITE_UTF16LE* = 2
|
|
38 SQLITE_UTF16BE* = 3 # Use native byte order
|
|
39 SQLITE_UTF16* = 4 # sqlite3_create_function only
|
|
40 SQLITE_ANY* = 5 #sqlite_exec return values
|
|
41 SQLITE_OK* = 0
|
|
42 SQLITE_ERROR* = 1 # SQL error or missing database
|
|
43 SQLITE_INTERNAL* = 2 # An internal logic error in SQLite
|
|
44 SQLITE_PERM* = 3 # Access permission denied
|
|
45 SQLITE_ABORT* = 4 # Callback routine requested an abort
|
|
46 SQLITE_BUSY* = 5 # The database file is locked
|
|
47 SQLITE_LOCKED* = 6 # A table in the database is locked
|
|
48 SQLITE_NOMEM* = 7 # A malloc() failed
|
|
49 SQLITE_READONLY* = 8 # Attempt to write a readonly database
|
|
50 SQLITE_INTERRUPT* = 9 # Operation terminated by sqlite3_interrupt()
|
|
51 SQLITE_IOERR* = 10 # Some kind of disk I/O error occurred
|
|
52 SQLITE_CORRUPT* = 11 # The database disk image is malformed
|
|
53 SQLITE_NOTFOUND* = 12 # (Internal Only) Table or record not found
|
|
54 SQLITE_FULL* = 13 # Insertion failed because database is full
|
|
55 SQLITE_CANTOPEN* = 14 # Unable to open the database file
|
|
56 SQLITE_PROTOCOL* = 15 # Database lock protocol error
|
|
57 SQLITE_EMPTY* = 16 # Database is empty
|
|
58 SQLITE_SCHEMA* = 17 # The database schema changed
|
|
59 SQLITE_TOOBIG* = 18 # Too much data for one row of a table
|
|
60 SQLITE_CONSTRAINT* = 19 # Abort due to constraint violation
|
|
61 SQLITE_MISMATCH* = 20 # Data type mismatch
|
|
62 SQLITE_MISUSE* = 21 # Library used incorrectly
|
|
63 SQLITE_NOLFS* = 22 # Uses OS features not supported on host
|
|
64 SQLITE_AUTH* = 23 # Authorization denied
|
|
65 SQLITE_FORMAT* = 24 # Auxiliary database format error
|
|
66 SQLITE_RANGE* = 25 # 2nd parameter to sqlite3_bind out of range
|
|
67 SQLITE_NOTADB* = 26 # File opened that is not a database file
|
|
68 SQLITE_ROW* = 100 # sqlite3_step() has another row ready
|
|
69 SQLITE_DONE* = 101 # sqlite3_step() has finished executing
|
|
70 SQLITE_COPY* = 0
|
|
71 SQLITE_CREATE_INDEX* = 1
|
|
72 SQLITE_CREATE_TABLE* = 2
|
|
73 SQLITE_CREATE_TEMP_INDEX* = 3
|
|
74 SQLITE_CREATE_TEMP_TABLE* = 4
|
|
75 SQLITE_CREATE_TEMP_TRIGGER* = 5
|
|
76 SQLITE_CREATE_TEMP_VIEW* = 6
|
|
77 SQLITE_CREATE_TRIGGER* = 7
|
|
78 SQLITE_CREATE_VIEW* = 8
|
|
79 SQLITE_DELETE* = 9
|
|
80 SQLITE_DROP_INDEX* = 10
|
|
81 SQLITE_DROP_TABLE* = 11
|
|
82 SQLITE_DROP_TEMP_INDEX* = 12
|
|
83 SQLITE_DROP_TEMP_TABLE* = 13
|
|
84 SQLITE_DROP_TEMP_TRIGGER* = 14
|
|
85 SQLITE_DROP_TEMP_VIEW* = 15
|
|
86 SQLITE_DROP_TRIGGER* = 16
|
|
87 SQLITE_DROP_VIEW* = 17
|
|
88 SQLITE_INSERT* = 18
|
|
89 SQLITE_PRAGMA* = 19
|
|
90 SQLITE_READ* = 20
|
|
91 SQLITE_SELECT* = 21
|
|
92 SQLITE_TRANSACTION* = 22
|
|
93 SQLITE_UPDATE* = 23
|
|
94 SQLITE_ATTACH* = 24
|
|
95 SQLITE_DETACH* = 25
|
|
96 SQLITE_ALTER_TABLE* = 26
|
|
97 SQLITE_REINDEX* = 27
|
|
98 SQLITE_DENY* = 1
|
|
99 SQLITE_IGNORE* = 2 # Original from sqlite3.h:
|
|
100 #define SQLITE_STATIC ((void(*)(void *))0)
|
|
101 #define SQLITE_TRANSIENT ((void(*)(void *))-1)
|
|
102 SQLITE_DETERMINISTIC* = 0x800
|
|
103
|
|
104 type
|
|
105 Sqlite3 {.pure, final.} = object
|
|
106 PSqlite3* = ptr Sqlite3
|
|
107 PPSqlite3* = ptr PSqlite3
|
|
108 Sqlite3_Backup {.pure, final.} = object
|
|
109 PSqlite3_Backup* = ptr Sqlite3_Backup
|
|
110 PPSqlite3_Backup* = ptr PSqlite3_Backup
|
|
111 Context{.pure, final.} = object
|
|
112 Pcontext* = ptr Context
|
|
113 TStmt{.pure, final.} = object
|
|
114 PStmt* = ptr TStmt
|
|
115 Value{.pure, final.} = object
|
|
116 PValue* = ptr Value
|
|
117 PValueArg* = array[0..127, PValue]
|
|
118
|
|
119 Callback* = proc (para1: pointer, para2: int32, para3,
|
|
120 para4: cstringArray): int32{.cdecl.}
|
|
121 Tbind_destructor_func* = proc (para1: pointer){.cdecl, tags: [], gcsafe.}
|
|
122 Create_function_step_func* = proc (para1: Pcontext, para2: int32,
|
|
123 para3: PValueArg){.cdecl.}
|
|
124 Create_function_func_func* = proc (para1: Pcontext, para2: int32,
|
|
125 para3: PValueArg){.cdecl.}
|
|
126 Create_function_final_func* = proc (para1: Pcontext){.cdecl.}
|
|
127 Result_func* = proc (para1: pointer){.cdecl.}
|
|
128 Create_collation_func* = proc (para1: pointer, para2: int32, para3: pointer,
|
|
129 para4: int32, para5: pointer): int32{.cdecl.}
|
|
130 Collation_needed_func* = proc (para1: pointer, para2: PSqlite3, eTextRep: int32,
|
|
131 para4: cstring){.cdecl.}
|
|
132
|
|
133 const
|
|
134 SQLITE_STATIC* = nil
|
|
135 SQLITE_TRANSIENT* = cast[Tbind_destructor_func](-1)
|
|
136
|
|
137 proc close*(para1: PSqlite3): int32{.cdecl, mylib, importc: "sqlite3_close".}
|
|
138 proc exec*(para1: PSqlite3, sql: cstring, para3: Callback, para4: pointer,
|
|
139 errmsg: var cstring): int32{.cdecl, mylib,
|
|
140 importc: "sqlite3_exec".}
|
|
141 proc last_insert_rowid*(para1: PSqlite3): int64{.cdecl, mylib,
|
|
142 importc: "sqlite3_last_insert_rowid".}
|
|
143 proc changes*(para1: PSqlite3): int32{.cdecl, mylib, importc: "sqlite3_changes".}
|
|
144 proc total_changes*(para1: PSqlite3): int32{.cdecl, mylib,
|
|
145 importc: "sqlite3_total_changes".}
|
|
146 proc interrupt*(para1: PSqlite3){.cdecl, mylib, importc: "sqlite3_interrupt".}
|
|
147 proc complete*(sql: cstring): int32{.cdecl, mylib,
|
|
148 importc: "sqlite3_complete".}
|
|
149 proc complete16*(sql: pointer): int32{.cdecl, mylib,
|
|
150 importc: "sqlite3_complete16".}
|
|
151 proc busy_handler*(para1: PSqlite3,
|
|
152 para2: proc (para1: pointer, para2: int32): int32{.cdecl.},
|
|
153 para3: pointer): int32{.cdecl, mylib,
|
|
154 importc: "sqlite3_busy_handler".}
|
|
155 proc busy_timeout*(para1: PSqlite3, ms: int32): int32{.cdecl, mylib,
|
|
156 importc: "sqlite3_busy_timeout".}
|
|
157 proc get_table*(para1: PSqlite3, sql: cstring, resultp: var cstringArray,
|
|
158 nrow, ncolumn: var cint, errmsg: ptr cstring): int32{.cdecl,
|
|
159 mylib, importc: "sqlite3_get_table".}
|
|
160 proc free_table*(result: cstringArray){.cdecl, mylib,
|
|
161 importc: "sqlite3_free_table".}
|
|
162 # Todo: see how translate sqlite3_mprintf, sqlite3_vmprintf, sqlite3_snprintf
|
|
163 # function sqlite3_mprintf(_para1:Pchar; args:array of const):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_mprintf';
|
|
164 proc mprintf*(para1: cstring): cstring{.cdecl, varargs, mylib,
|
|
165 importc: "sqlite3_mprintf".}
|
|
166 #function sqlite3_vmprintf(_para1:Pchar; _para2:va_list):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_vmprintf';
|
|
167 proc free*(z: cstring){.cdecl, mylib, importc: "sqlite3_free".}
|
|
168 #function sqlite3_snprintf(_para1:longint; _para2:Pchar; _para3:Pchar; args:array of const):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_snprintf';
|
|
169 proc snprintf*(para1: int32, para2: cstring, para3: cstring): cstring{.cdecl,
|
|
170 mylib, varargs, importc: "sqlite3_snprintf".}
|
|
171 proc set_authorizer*(para1: PSqlite3, xAuth: proc (para1: pointer, para2: int32,
|
|
172 para3: cstring, para4: cstring, para5: cstring, para6: cstring): int32{.
|
|
173 cdecl.}, pUserData: pointer): int32{.cdecl, mylib,
|
|
174 importc: "sqlite3_set_authorizer".}
|
|
175 proc trace*(para1: PSqlite3, xTrace: proc (para1: pointer, para2: cstring){.cdecl.},
|
|
176 para3: pointer): pointer{.cdecl, mylib,
|
|
177 importc: "sqlite3_trace".}
|
|
178 proc progress_handler*(para1: PSqlite3, para2: int32,
|
|
179 para3: proc (para1: pointer): int32{.cdecl.},
|
|
180 para4: pointer){.cdecl, mylib,
|
|
181 importc: "sqlite3_progress_handler".}
|
|
182 proc commit_hook*(para1: PSqlite3, para2: proc (para1: pointer): int32{.cdecl.},
|
|
183 para3: pointer): pointer{.cdecl, mylib,
|
|
184 importc: "sqlite3_commit_hook".}
|
|
185 proc open*(filename: cstring, ppDb: var PSqlite3): int32{.cdecl, mylib,
|
|
186 importc: "sqlite3_open".}
|
|
187 proc open16*(filename: pointer, ppDb: var PSqlite3): int32{.cdecl, mylib,
|
|
188 importc: "sqlite3_open16".}
|
|
189 proc errcode*(db: PSqlite3): int32{.cdecl, mylib, importc: "sqlite3_errcode".}
|
|
190 proc errmsg*(para1: PSqlite3): cstring{.cdecl, mylib, importc: "sqlite3_errmsg".}
|
|
191 proc errmsg16*(para1: PSqlite3): pointer{.cdecl, mylib,
|
|
192 importc: "sqlite3_errmsg16".}
|
|
193 proc prepare*(db: PSqlite3, zSql: cstring, nBytes: int32, ppStmt: var PStmt,
|
|
194 pzTail: ptr cstring): int32{.cdecl, mylib,
|
|
195 importc: "sqlite3_prepare".}
|
|
196
|
|
197 proc prepare_v2*(db: PSqlite3, zSql: cstring, nByte: cint, ppStmt: var PStmt,
|
|
198 pzTail: ptr cstring): cint {.
|
|
199 importc: "sqlite3_prepare_v2", cdecl, mylib.}
|
|
200
|
|
201 proc prepare16*(db: PSqlite3, zSql: pointer, nBytes: int32, ppStmt: var PStmt,
|
|
202 pzTail: var pointer): int32{.cdecl, mylib,
|
|
203 importc: "sqlite3_prepare16".}
|
|
204 proc bind_blob*(para1: PStmt, para2: int32, para3: pointer, n: int32,
|
|
205 para5: Tbind_destructor_func): int32{.cdecl, mylib,
|
|
206 importc: "sqlite3_bind_blob".}
|
|
207 proc bind_double*(para1: PStmt, para2: int32, para3: float64): int32{.cdecl,
|
|
208 mylib, importc: "sqlite3_bind_double".}
|
|
209 proc bind_int*(para1: PStmt, para2: int32, para3: int32): int32{.cdecl,
|
|
210 mylib, importc: "sqlite3_bind_int".}
|
|
211 proc bind_int64*(para1: PStmt, para2: int32, para3: int64): int32{.cdecl,
|
|
212 mylib, importc: "sqlite3_bind_int64".}
|
|
213 proc bind_null*(para1: PStmt, para2: int32): int32{.cdecl, mylib,
|
|
214 importc: "sqlite3_bind_null".}
|
|
215 proc bind_text*(para1: PStmt, para2: int32, para3: cstring, n: int32,
|
|
216 para5: Tbind_destructor_func): int32{.cdecl, mylib,
|
|
217 importc: "sqlite3_bind_text".}
|
|
218 proc bind_text16*(para1: PStmt, para2: int32, para3: pointer, para4: int32,
|
|
219 para5: Tbind_destructor_func): int32{.cdecl, mylib,
|
|
220 importc: "sqlite3_bind_text16".}
|
|
221 #function sqlite3_bind_value(_para1:Psqlite3_stmt; _para2:longint; _para3:Psqlite3_value):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_value';
|
|
222 #These overloaded functions were introduced to allow the use of SQLITE_STATIC and SQLITE_TRANSIENT
|
|
223 #It's the c world man ;-)
|
|
224 proc bind_blob*(para1: PStmt, para2: int32, para3: pointer, n: int32,
|
|
225 para5: int32): int32{.cdecl, mylib,
|
|
226 importc: "sqlite3_bind_blob".}
|
|
227 proc bind_text*(para1: PStmt, para2: int32, para3: cstring, n: int32,
|
|
228 para5: int32): int32{.cdecl, mylib,
|
|
229 importc: "sqlite3_bind_text".}
|
|
230 proc bind_text16*(para1: PStmt, para2: int32, para3: pointer, para4: int32,
|
|
231 para5: int32): int32{.cdecl, mylib,
|
|
232 importc: "sqlite3_bind_text16".}
|
|
233 proc bind_parameter_count*(para1: PStmt): int32{.cdecl, mylib,
|
|
234 importc: "sqlite3_bind_parameter_count".}
|
|
235 proc bind_parameter_name*(para1: PStmt, para2: int32): cstring{.cdecl,
|
|
236 mylib, importc: "sqlite3_bind_parameter_name".}
|
|
237 proc bind_parameter_index*(para1: PStmt, zName: cstring): int32{.cdecl,
|
|
238 mylib, importc: "sqlite3_bind_parameter_index".}
|
|
239 proc clear_bindings*(para1: PStmt): int32 {.cdecl,
|
|
240 mylib, importc: "sqlite3_clear_bindings".}
|
|
241 proc column_count*(PStmt: PStmt): int32{.cdecl, mylib,
|
|
242 importc: "sqlite3_column_count".}
|
|
243 proc column_name*(para1: PStmt, para2: int32): cstring{.cdecl, mylib,
|
|
244 importc: "sqlite3_column_name".}
|
|
245 proc column_table_name*(para1: PStmt; para2: int32): cstring{.cdecl, mylib,
|
|
246 importc: "sqlite3_column_table_name".}
|
|
247 proc column_name16*(para1: PStmt, para2: int32): pointer{.cdecl, mylib,
|
|
248 importc: "sqlite3_column_name16".}
|
|
249 proc column_decltype*(para1: PStmt, i: int32): cstring{.cdecl, mylib,
|
|
250 importc: "sqlite3_column_decltype".}
|
|
251 proc column_decltype16*(para1: PStmt, para2: int32): pointer{.cdecl,
|
|
252 mylib, importc: "sqlite3_column_decltype16".}
|
|
253 proc step*(para1: PStmt): int32{.cdecl, mylib, importc: "sqlite3_step".}
|
|
254 proc data_count*(PStmt: PStmt): int32{.cdecl, mylib,
|
|
255 importc: "sqlite3_data_count".}
|
|
256 proc column_blob*(para1: PStmt, iCol: int32): pointer{.cdecl, mylib,
|
|
257 importc: "sqlite3_column_blob".}
|
|
258 proc column_bytes*(para1: PStmt, iCol: int32): int32{.cdecl, mylib,
|
|
259 importc: "sqlite3_column_bytes".}
|
|
260 proc column_bytes16*(para1: PStmt, iCol: int32): int32{.cdecl, mylib,
|
|
261 importc: "sqlite3_column_bytes16".}
|
|
262 proc column_double*(para1: PStmt, iCol: int32): float64{.cdecl, mylib,
|
|
263 importc: "sqlite3_column_double".}
|
|
264 proc column_int*(para1: PStmt, iCol: int32): int32{.cdecl, mylib,
|
|
265 importc: "sqlite3_column_int".}
|
|
266 proc column_int64*(para1: PStmt, iCol: int32): int64{.cdecl, mylib,
|
|
267 importc: "sqlite3_column_int64".}
|
|
268 proc column_text*(para1: PStmt, iCol: int32): cstring{.cdecl, mylib,
|
|
269 importc: "sqlite3_column_text".}
|
|
270 proc column_text16*(para1: PStmt, iCol: int32): pointer{.cdecl, mylib,
|
|
271 importc: "sqlite3_column_text16".}
|
|
272 proc column_type*(para1: PStmt, iCol: int32): int32{.cdecl, mylib,
|
|
273 importc: "sqlite3_column_type".}
|
|
274 proc finalize*(PStmt: PStmt): int32{.cdecl, mylib,
|
|
275 importc: "sqlite3_finalize".}
|
|
276 proc reset*(PStmt: PStmt): int32{.cdecl, mylib, importc: "sqlite3_reset".}
|
|
277 proc create_function*(para1: PSqlite3, zFunctionName: cstring, nArg: int32,
|
|
278 eTextRep: int32, para5: pointer,
|
|
279 xFunc: Create_function_func_func,
|
|
280 xStep: Create_function_step_func,
|
|
281 xFinal: Create_function_final_func): int32{.cdecl,
|
|
282 mylib, importc: "sqlite3_create_function".}
|
|
283 proc create_function16*(para1: PSqlite3, zFunctionName: pointer, nArg: int32,
|
|
284 eTextRep: int32, para5: pointer,
|
|
285 xFunc: Create_function_func_func,
|
|
286 xStep: Create_function_step_func,
|
|
287 xFinal: Create_function_final_func): int32{.cdecl,
|
|
288 mylib, importc: "sqlite3_create_function16".}
|
|
289 proc aggregate_count*(para1: Pcontext): int32{.cdecl, mylib,
|
|
290 importc: "sqlite3_aggregate_count".}
|
|
291 proc value_blob*(para1: PValue): pointer{.cdecl, mylib,
|
|
292 importc: "sqlite3_value_blob".}
|
|
293 proc value_bytes*(para1: PValue): int32{.cdecl, mylib,
|
|
294 importc: "sqlite3_value_bytes".}
|
|
295 proc value_bytes16*(para1: PValue): int32{.cdecl, mylib,
|
|
296 importc: "sqlite3_value_bytes16".}
|
|
297 proc value_double*(para1: PValue): float64{.cdecl, mylib,
|
|
298 importc: "sqlite3_value_double".}
|
|
299 proc value_int*(para1: PValue): int32{.cdecl, mylib,
|
|
300 importc: "sqlite3_value_int".}
|
|
301 proc value_int64*(para1: PValue): int64{.cdecl, mylib,
|
|
302 importc: "sqlite3_value_int64".}
|
|
303 proc value_text*(para1: PValue): cstring{.cdecl, mylib,
|
|
304 importc: "sqlite3_value_text".}
|
|
305 proc value_text16*(para1: PValue): pointer{.cdecl, mylib,
|
|
306 importc: "sqlite3_value_text16".}
|
|
307 proc value_text16le*(para1: PValue): pointer{.cdecl, mylib,
|
|
308 importc: "sqlite3_value_text16le".}
|
|
309 proc value_text16be*(para1: PValue): pointer{.cdecl, mylib,
|
|
310 importc: "sqlite3_value_text16be".}
|
|
311 proc value_type*(para1: PValue): int32{.cdecl, mylib,
|
|
312 importc: "sqlite3_value_type".}
|
|
313 proc aggregate_context*(para1: Pcontext, nBytes: int32): pointer{.cdecl,
|
|
314 mylib, importc: "sqlite3_aggregate_context".}
|
|
315 proc user_data*(para1: Pcontext): pointer{.cdecl, mylib,
|
|
316 importc: "sqlite3_user_data".}
|
|
317 proc get_auxdata*(para1: Pcontext, para2: int32): pointer{.cdecl, mylib,
|
|
318 importc: "sqlite3_get_auxdata".}
|
|
319 proc set_auxdata*(para1: Pcontext, para2: int32, para3: pointer,
|
|
320 para4: proc (para1: pointer){.cdecl.}){.cdecl, mylib,
|
|
321 importc: "sqlite3_set_auxdata".}
|
|
322 proc result_blob*(para1: Pcontext, para2: pointer, para3: int32,
|
|
323 para4: Result_func){.cdecl, mylib,
|
|
324 importc: "sqlite3_result_blob".}
|
|
325 proc result_double*(para1: Pcontext, para2: float64){.cdecl, mylib,
|
|
326 importc: "sqlite3_result_double".}
|
|
327 proc result_error*(para1: Pcontext, para2: cstring, para3: int32){.cdecl,
|
|
328 mylib, importc: "sqlite3_result_error".}
|
|
329 proc result_error16*(para1: Pcontext, para2: pointer, para3: int32){.cdecl,
|
|
330 mylib, importc: "sqlite3_result_error16".}
|
|
331 proc result_int*(para1: Pcontext, para2: int32){.cdecl, mylib,
|
|
332 importc: "sqlite3_result_int".}
|
|
333 proc result_int64*(para1: Pcontext, para2: int64){.cdecl, mylib,
|
|
334 importc: "sqlite3_result_int64".}
|
|
335 proc result_null*(para1: Pcontext){.cdecl, mylib,
|
|
336 importc: "sqlite3_result_null".}
|
|
337 proc result_text*(para1: Pcontext, para2: cstring, para3: int32,
|
|
338 para4: Result_func){.cdecl, mylib,
|
|
339 importc: "sqlite3_result_text".}
|
|
340 proc result_text16*(para1: Pcontext, para2: pointer, para3: int32,
|
|
341 para4: Result_func){.cdecl, mylib,
|
|
342 importc: "sqlite3_result_text16".}
|
|
343 proc result_text16le*(para1: Pcontext, para2: pointer, para3: int32,
|
|
344 para4: Result_func){.cdecl, mylib,
|
|
345 importc: "sqlite3_result_text16le".}
|
|
346 proc result_text16be*(para1: Pcontext, para2: pointer, para3: int32,
|
|
347 para4: Result_func){.cdecl, mylib,
|
|
348 importc: "sqlite3_result_text16be".}
|
|
349 proc result_value*(para1: Pcontext, para2: PValue){.cdecl, mylib,
|
|
350 importc: "sqlite3_result_value".}
|
|
351 proc create_collation*(para1: PSqlite3, zName: cstring, eTextRep: int32,
|
|
352 para4: pointer, xCompare: Create_collation_func): int32{.
|
|
353 cdecl, mylib, importc: "sqlite3_create_collation".}
|
|
354 proc create_collation16*(para1: PSqlite3, zName: cstring, eTextRep: int32,
|
|
355 para4: pointer, xCompare: Create_collation_func): int32{.
|
|
356 cdecl, mylib, importc: "sqlite3_create_collation16".}
|
|
357 proc collation_needed*(para1: PSqlite3, para2: pointer, para3: Collation_needed_func): int32{.
|
|
358 cdecl, mylib, importc: "sqlite3_collation_needed".}
|
|
359 proc collation_needed16*(para1: PSqlite3, para2: pointer, para3: Collation_needed_func): int32{.
|
|
360 cdecl, mylib, importc: "sqlite3_collation_needed16".}
|
|
361 proc libversion*(): cstring{.cdecl, mylib, importc: "sqlite3_libversion".}
|
|
362 #Alias for allowing better code portability (win32 is not working with external variables)
|
|
363 proc version*(): cstring{.cdecl, mylib, importc: "sqlite3_libversion".}
|
|
364 # Not published functions
|
|
365 proc libversion_number*(): int32{.cdecl, mylib,
|
|
366 importc: "sqlite3_libversion_number".}
|
|
367
|
|
368 proc backup_init*(pDest: PSqlite3, zDestName: cstring, pSource: PSqlite3, zSourceName: cstring): PSqlite3_Backup {.
|
|
369 cdecl, mylib, importc: "sqlite3_backup_init".}
|
|
370
|
|
371 proc backup_step*(pBackup: PSqlite3_Backup, nPage: int32): int32 {.cdecl, mylib, importc: "sqlite3_backup_step".}
|
|
372
|
|
373 proc backup_finish*(pBackup: PSqlite3_Backup): int32 {.cdecl, mylib, importc: "sqlite3_backup_finish".}
|
|
374
|
|
375 proc backup_pagecount*(pBackup: PSqlite3_Backup): int32 {.cdecl, mylib, importc: "sqlite3_backup_pagecount".}
|
|
376
|
|
377 proc backup_remaining*(pBackup: PSqlite3_Backup): int32 {.cdecl, mylib, importc: "sqlite3_backup_remaining".}
|
|
378
|
|
379 proc sqlite3_sleep*(t: int64): int64 {.cdecl, mylib, importc: "sqlite3_sleep".}
|
|
380
|
|
381 #function sqlite3_key(db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_key';
|
|
382 #function sqlite3_rekey(db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_rekey';
|
|
383 #function sqlite3_sleep(_para1:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_sleep';
|
|
384 #function sqlite3_expired(_para1:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_expired';
|
|
385 #function sqlite3_global_recover:longint;cdecl; external Sqlite3Lib name 'sqlite3_global_recover';
|
|
386 # implementation
|
|
387
|
|
388 when defined(nimHasStyleChecks):
|
|
389 {.pop.}
|