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