diff options
| author | 2022-09-11 17:37:06 +0200 | |
|---|---|---|
| committer | 2022-09-18 02:30:19 +0200 | |
| commit | a06f729842c9c1fd858040f53076cdb71e205b11 (patch) | |
| tree | 80a5ac803c30bf5a7069d7508b1e06ab6b5ff9b0 /c | |
| parent | c: add header files specifically for building loadable extensions (diff) | |
| download | zig-sqlite-a06f729842c9c1fd858040f53076cdb71e205b11.tar.gz zig-sqlite-a06f729842c9c1fd858040f53076cdb71e205b11.tar.xz zig-sqlite-a06f729842c9c1fd858040f53076cdb71e205b11.zip | |
add wrapper functions when building a loadable extension
Diffstat (limited to '')
| -rw-r--r-- | c.zig | 11 | ||||
| -rw-r--r-- | c/loadable_extension.zig | 809 |
2 files changed, 817 insertions, 3 deletions
| @@ -1,6 +1,11 @@ | |||
| 1 | pub const c = @cImport({ | 1 | const root = @import("root"); |
| 2 | @cInclude("sqlite3.h"); | 2 | |
| 3 | }); | 3 | pub const c = if (@hasDecl(root, "loadable_extension")) |
| 4 | @import("c/loadable_extension.zig") | ||
| 5 | else | ||
| 6 | @cImport({ | ||
| 7 | @cInclude("sqlite3.h"); | ||
| 8 | }); | ||
| 4 | 9 | ||
| 5 | // versionGreaterThanOrEqualTo returns true if the SQLite version is >= to the major.minor.patch provided. | 10 | // versionGreaterThanOrEqualTo returns true if the SQLite version is >= to the major.minor.patch provided. |
| 6 | pub fn versionGreaterThanOrEqualTo(major: u8, minor: u8, patch: u8) bool { | 11 | pub fn versionGreaterThanOrEqualTo(major: u8, minor: u8, patch: u8) bool { |
diff --git a/c/loadable_extension.zig b/c/loadable_extension.zig new file mode 100644 index 0000000..95fd215 --- /dev/null +++ b/c/loadable_extension.zig | |||
| @@ -0,0 +1,809 @@ | |||
| 1 | const c = @cImport({ | ||
| 2 | @cInclude("loadable-ext-sqlite3ext.h"); | ||
| 3 | }); | ||
| 4 | |||
| 5 | pub usingnamespace c; | ||
| 6 | |||
| 7 | pub var sqlite3_api: [*c]c.sqlite3_api_routines = null; | ||
| 8 | |||
| 9 | pub const sqlite3_transfer_bindings = @compileError("sqlite3_transfer_bindings is deprecated"); | ||
| 10 | pub const sqlite3_global_recover = @compileError("sqlite3_global_recover is deprecated"); | ||
| 11 | pub const sqlite3_expired = @compileError("sqlite3_expired is deprecated"); | ||
| 12 | |||
| 13 | pub const sqlite3_mprintf = @compileError("sqlite3_mprintf can't be implemented in Zig"); | ||
| 14 | pub const sqlite3_snprintf = @compileError("sqlite3_snprintf can't be implemented in Zig"); | ||
| 15 | pub const sqlite3_vmprintf = @compileError("sqlite3_vmprintf can't be implemented in Zig"); | ||
| 16 | pub const sqlite3_vsnprintf = @compileError("sqlite3_vsnprintf can't be implemented in Zig"); | ||
| 17 | pub const sqlite3_test_control = @compileError("sqlite3_test_control can't be implemented in Zig"); | ||
| 18 | pub const sqlite3_db_config = @compileError("sqlite3_db_config can't be implemented in Zig"); | ||
| 19 | pub const sqlite3_log = @compileError("sqlite3_log can't be implemented in Zig"); | ||
| 20 | pub const sqlite3_vtab_config = @compileError("sqlite3_vtab_config can't be implemented in Zig"); | ||
| 21 | pub const sqlite3_uri_vsnprintf = @compileError("sqlite3_uri_vsnprintf can't be implemented in Zig"); | ||
| 22 | pub const sqlite3_str_appendf = @compileError("sqlite3_str_appendf can't be implemented in Zig"); | ||
| 23 | pub const sqlite3_str_vappendf = @compileError("sqlite3_str_vappendf can't be implemented in Zig"); | ||
| 24 | |||
| 25 | pub export fn sqlite3_aggregate_context(p: ?*c.sqlite3_context, nBytes: c_int) callconv(.C) ?*anyopaque { | ||
| 26 | return sqlite3_api.*.aggregate_context.?(p, nBytes); | ||
| 27 | } | ||
| 28 | pub export fn sqlite3_bind_blob(pStmt: ?*c.sqlite3_stmt, i: c_int, zData: ?*const anyopaque, nData: c_int, xDel: ?fn (?*anyopaque) callconv(.C) void) c_int { | ||
| 29 | return sqlite3_api.*.bind_blob.?(pStmt, i, zData, nData, xDel); | ||
| 30 | } | ||
| 31 | pub export fn sqlite3_bind_double(pStmt: ?*c.sqlite3_stmt, i: c_int, rValue: f64) callconv(.C) c_int { | ||
| 32 | return sqlite3_api.*.bind_double.?(pStmt, i, rValue); | ||
| 33 | } | ||
| 34 | pub export fn sqlite3_bind_int(pStmt: ?*c.sqlite3_stmt, i: c_int, iValue: c_int) callconv(.C) c_int { | ||
| 35 | return sqlite3_api.*.bind_int.?(pStmt, i, iValue); | ||
| 36 | } | ||
| 37 | pub export fn sqlite3_bind_int64(pStmt: ?*c.sqlite3_stmt, i: c_int, iValue: c.sqlite3_int64) c_int { | ||
| 38 | return sqlite3_api.*.bind_int64.?(pStmt, i, iValue); | ||
| 39 | } | ||
| 40 | pub export fn sqlite3_bind_null(pStmt: ?*c.sqlite3_stmt, i: c_int) c_int { | ||
| 41 | return sqlite3_api.*.bind_null.?(pStmt, i); | ||
| 42 | } | ||
| 43 | pub export fn sqlite3_bind_parameter_count(pStmt: ?*c.sqlite3_stmt) c_int { | ||
| 44 | return sqlite3_api.*.bind_parameter_count.?(pStmt); | ||
| 45 | } | ||
| 46 | pub export fn sqlite3_bind_parameter_index(pStmt: ?*c.sqlite3_stmt, zName: [*c]const u8) c_int { | ||
| 47 | return sqlite3_api.*.bind_parameter_index.?(pStmt, zName); | ||
| 48 | } | ||
| 49 | pub export fn sqlite3_bind_parameter_name(pStmt: ?*c.sqlite3_stmt, i: c_int) [*c]const u8 { | ||
| 50 | return sqlite3_api.*.bind_parameter_name.?(pStmt, i); | ||
| 51 | } | ||
| 52 | pub export fn sqlite3_bind_text(pStmt: ?*c.sqlite3_stmt, i: c_int, zData: [*c]const u8, nData: c_int, xDel: ?fn (?*anyopaque) callconv(.C) void) c_int { | ||
| 53 | return sqlite3_api.*.bind_text.?(pStmt, i, zData, nData, xDel); | ||
| 54 | } | ||
| 55 | pub export fn sqlite3_bind_text16(pStmt: ?*c.sqlite3_stmt, i: c_int, zData: ?*const anyopaque, nData: c_int, xDel: ?fn (?*anyopaque) callconv(.C) void) c_int { | ||
| 56 | return sqlite3_api.*.bind_text16.?(pStmt, i, zData, nData, xDel); | ||
| 57 | } | ||
| 58 | pub export fn sqlite3_bind_value(pStmt: ?*c.sqlite3_stmt, i: c_int, pValue: ?*const c.sqlite3_value) c_int { | ||
| 59 | return sqlite3_api.*.bind_value.?(pStmt, i, pValue); | ||
| 60 | } | ||
| 61 | pub export fn sqlite3_busy_handler(db: ?*c.sqlite3, xBusy: ?fn (?*anyopaque, c_int) callconv(.C) c_int, pArg: ?*anyopaque) c_int { | ||
| 62 | return sqlite3_api.*.busy_handler.?(db, xBusy, pArg); | ||
| 63 | } | ||
| 64 | pub export fn sqlite3_busy_timeout(db: ?*c.sqlite3, ms: c_int) c_int { | ||
| 65 | return sqlite3_api.*.busy_timeout.?(db, ms); | ||
| 66 | } | ||
| 67 | pub export fn sqlite3_changes(db: ?*c.sqlite3) c_int { | ||
| 68 | return sqlite3_api.*.changes.?(db); | ||
| 69 | } | ||
| 70 | pub export fn sqlite3_close(db: ?*c.sqlite3) c_int { | ||
| 71 | return sqlite3_api.*.close.?(db); | ||
| 72 | } | ||
| 73 | pub export fn sqlite3_collation_needed(db: ?*c.sqlite3, pCollNeededArg: ?*anyopaque, xCollNeeded: ?fn (?*anyopaque, ?*c.sqlite3, c_int, [*c]const u8) callconv(.C) void) c_int { | ||
| 74 | return sqlite3_api.*.collation_needed.?(db, pCollNeededArg, xCollNeeded); | ||
| 75 | } | ||
| 76 | pub export fn sqlite3_collation_needed16(db: ?*c.sqlite3, pCollNeededArg: ?*anyopaque, xCollNeeded16: ?fn (?*anyopaque, ?*c.sqlite3, c_int, ?*const anyopaque) callconv(.C) void) c_int { | ||
| 77 | return sqlite3_api.*.collation_needed16.?(db, pCollNeededArg, xCollNeeded16); | ||
| 78 | } | ||
| 79 | pub export fn sqlite3_column_blob(pStmt: ?*c.sqlite3_stmt, iCol: c_int) ?*const anyopaque { | ||
| 80 | return sqlite3_api.*.column_blob.?(pStmt, iCol); | ||
| 81 | } | ||
| 82 | pub export fn sqlite3_column_bytes(pStmt: ?*c.sqlite3_stmt, iCol: c_int) c_int { | ||
| 83 | return sqlite3_api.*.column_bytes.?(pStmt, iCol); | ||
| 84 | } | ||
| 85 | pub export fn sqlite3_column_bytes16(pStmt: ?*c.sqlite3_stmt, iCol: c_int) c_int { | ||
| 86 | return sqlite3_api.*.column_bytes16.?(pStmt, iCol); | ||
| 87 | } | ||
| 88 | pub export fn sqlite3_column_count(pStmt: ?*c.sqlite3_stmt) c_int { | ||
| 89 | return sqlite3_api.*.column_count.?(pStmt); | ||
| 90 | } | ||
| 91 | pub export fn sqlite3_column_database_name(pStmt: ?*c.sqlite3_stmt, iCol: c_int) [*c]const u8 { | ||
| 92 | return sqlite3_api.*.column_database_name.?(pStmt, iCol); | ||
| 93 | } | ||
| 94 | pub export fn sqlite3_column_database_name16(pStmt: ?*c.sqlite3_stmt, iCol: c_int) ?*const anyopaque { | ||
| 95 | return sqlite3_api.*.column_database_name16.?(pStmt, iCol); | ||
| 96 | } | ||
| 97 | pub export fn sqlite3_column_decltype(pStmt: ?*c.sqlite3_stmt, iCol: c_int) [*c]const u8 { | ||
| 98 | return sqlite3_api.*.column_decltype.?(pStmt, iCol); | ||
| 99 | } | ||
| 100 | pub export fn sqlite3_column_decltype16(pStmt: ?*c.sqlite3_stmt, iCol: c_int) ?*const anyopaque { | ||
| 101 | return sqlite3_api.*.column_decltype16.?(pStmt, iCol); | ||
| 102 | } | ||
| 103 | pub export fn sqlite3_column_double(pStmt: ?*c.sqlite3_stmt, iCol: c_int) f64 { | ||
| 104 | return sqlite3_api.*.column_double.?(pStmt, iCol); | ||
| 105 | } | ||
| 106 | pub export fn sqlite3_column_int(pStmt: ?*c.sqlite3_stmt, iCol: c_int) c_int { | ||
| 107 | return sqlite3_api.*.column_int.?(pStmt, iCol); | ||
| 108 | } | ||
| 109 | pub export fn sqlite3_column_int64(pStmt: ?*c.sqlite3_stmt, iCol: c_int) c.sqlite3_int64 { | ||
| 110 | return sqlite3_api.*.column_int64.?(pStmt, iCol); | ||
| 111 | } | ||
| 112 | pub export fn sqlite3_column_name(pStmt: ?*c.sqlite3_stmt, N: c_int) [*c]const u8 { | ||
| 113 | return sqlite3_api.*.column_name.?(pStmt, N); | ||
| 114 | } | ||
| 115 | pub export fn sqlite3_column_name16(pStmt: ?*c.sqlite3_stmt, N: c_int) ?*const anyopaque { | ||
| 116 | return sqlite3_api.*.column_name16.?(pStmt, N); | ||
| 117 | } | ||
| 118 | pub export fn sqlite3_column_origin_name(pStmt: ?*c.sqlite3_stmt, N: c_int) [*c]const u8 { | ||
| 119 | return sqlite3_api.*.column_origin_name.?(pStmt, N); | ||
| 120 | } | ||
| 121 | pub export fn sqlite3_column_origin_name16(pStmt: ?*c.sqlite3_stmt, N: c_int) ?*const anyopaque { | ||
| 122 | return sqlite3_api.*.column_origin_name16.?(pStmt, N); | ||
| 123 | } | ||
| 124 | pub export fn sqlite3_column_table_name(pStmt: ?*c.sqlite3_stmt, N: c_int) [*c]const u8 { | ||
| 125 | return sqlite3_api.*.column_table_name.?(pStmt, N); | ||
| 126 | } | ||
| 127 | pub export fn sqlite3_column_table_name16(pStmt: ?*c.sqlite3_stmt, N: c_int) ?*const anyopaque { | ||
| 128 | return sqlite3_api.*.column_table_name16.?(pStmt, N); | ||
| 129 | } | ||
| 130 | pub export fn sqlite3_column_text(pStmt: ?*c.sqlite3_stmt, iCol: c_int) [*c]const u8 { | ||
| 131 | return sqlite3_api.*.column_text.?(pStmt, iCol); | ||
| 132 | } | ||
| 133 | pub export fn sqlite3_column_text16(pStmt: ?*c.sqlite3_stmt, iCol: c_int) ?*const anyopaque { | ||
| 134 | return sqlite3_api.*.column_text16.?(pStmt, iCol); | ||
| 135 | } | ||
| 136 | pub export fn sqlite3_column_type(pStmt: ?*c.sqlite3_stmt, iCol: c_int) c_int { | ||
| 137 | return sqlite3_api.*.column_type.?(pStmt, iCol); | ||
| 138 | } | ||
| 139 | pub export fn sqlite3_column_value(pStmt: ?*c.sqlite3_stmt, iCol: c_int) ?*c.sqlite3_value { | ||
| 140 | return sqlite3_api.*.column_value.?(pStmt, iCol); | ||
| 141 | } | ||
| 142 | pub export fn sqlite3_commit_hook(db: ?*c.sqlite3, xCallback: ?fn (?*anyopaque) callconv(.C) c_int, pArg: ?*anyopaque) ?*anyopaque { | ||
| 143 | return sqlite3_api.*.commit_hook.?(db, xCallback, pArg); | ||
| 144 | } | ||
| 145 | pub export fn sqlite3_complete(sql: [*c]const u8) c_int { | ||
| 146 | return sqlite3_api.*.complete.?(sql); | ||
| 147 | } | ||
| 148 | pub export fn sqlite3_complete16(sql: ?*const anyopaque) c_int { | ||
| 149 | return sqlite3_api.*.complete16.?(sql); | ||
| 150 | } | ||
| 151 | pub export fn sqlite3_create_collation(db: ?*c.sqlite3, zName: [*c]const u8, eTextRep: c_int, pArg: ?*anyopaque, xCompare: ?fn (?*anyopaque, c_int, ?*const anyopaque, c_int, ?*const anyopaque) callconv(.C) c_int) c_int { | ||
| 152 | return sqlite3_api.*.create_collation.?(db, zName, eTextRep, pArg, xCompare); | ||
| 153 | } | ||
| 154 | pub export fn sqlite3_create_collation16(db: ?*c.sqlite3, zName: ?*const anyopaque, eTextRep: c_int, pArg: ?*anyopaque, xCompare: ?fn (?*anyopaque, c_int, ?*const anyopaque, c_int, ?*const anyopaque) callconv(.C) c_int) c_int { | ||
| 155 | return sqlite3_api.*.create_collation16.?(db, zName, eTextRep, pArg, xCompare); | ||
| 156 | } | ||
| 157 | pub export fn sqlite3_create_function(db: ?*c.sqlite3, zFunctionName: [*c]const u8, nArg: c_int, eTextRep: c_int, pApp: ?*anyopaque, xFunc: ?fn (?*c.sqlite3_context, c_int, [*c]?*c.sqlite3_value) callconv(.C) void, xStep: ?fn (?*c.sqlite3_context, c_int, [*c]?*c.sqlite3_value) callconv(.C) void, xFinal: ?fn (?*c.sqlite3_context) callconv(.C) void) c_int { | ||
| 158 | return sqlite3_api.*.create_function.?(db, zFunctionName, nArg, eTextRep, pApp, xFunc, xStep, xFinal); | ||
| 159 | } | ||
| 160 | pub export fn sqlite3_create_function16(db: ?*c.sqlite3, zFunctionName: ?*const anyopaque, nArg: c_int, eTextRep: c_int, pApp: ?*anyopaque, xFunc: ?fn (?*c.sqlite3_context, c_int, [*c]?*c.sqlite3_value) callconv(.C) void, xStep: ?fn (?*c.sqlite3_context, c_int, [*c]?*c.sqlite3_value) callconv(.C) void, xFinal: ?fn (?*c.sqlite3_context) callconv(.C) void) c_int { | ||
| 161 | return sqlite3_api.*.create_function16.?(db, zFunctionName, nArg, eTextRep, pApp, xFunc, xStep, xFinal); | ||
| 162 | } | ||
| 163 | pub export fn sqlite3_create_module(db: ?*c.sqlite3, zName: [*c]const u8, pModule: [*c]const c.sqlite3_module, pAux: ?*anyopaque) c_int { | ||
| 164 | return sqlite3_api.*.create_module.?(db, zName, pModule, pAux); | ||
| 165 | } | ||
| 166 | pub export fn sqlite3_create_module_v2(db: ?*c.sqlite3, zName: [*c]const u8, pModule: [*c]const c.sqlite3_module, pAux: ?*anyopaque, xDestroy: ?fn (?*anyopaque) callconv(.C) void) c_int { | ||
| 167 | return sqlite3_api.*.create_module_v2.?(db, zName, pModule, pAux, xDestroy); | ||
| 168 | } | ||
| 169 | pub export fn sqlite3_data_count(pStmt: ?*c.sqlite3_stmt) c_int { | ||
| 170 | return sqlite3_api.*.data_count.?(pStmt); | ||
| 171 | } | ||
| 172 | pub export fn sqlite3_db_handle(pStmt: ?*c.sqlite3_stmt) ?*c.sqlite3 { | ||
| 173 | return sqlite3_api.*.db_handle.?(pStmt); | ||
| 174 | } | ||
| 175 | |||
| 176 | pub export fn sqlite3_declare_vtab(db: ?*c.sqlite3, zSQL: [*c]const u8) c_int { | ||
| 177 | return sqlite3_api.*.declare_vtab.?(db, zSQL); | ||
| 178 | } | ||
| 179 | pub export fn sqlite3_enable_shared_cache(enable: c_int) c_int { | ||
| 180 | return sqlite3_api.*.enable_shared_cache.?(enable); | ||
| 181 | } | ||
| 182 | pub export fn sqlite3_errcode(db: ?*c.sqlite3) c_int { | ||
| 183 | return sqlite3_api.*.errcode.?(db); | ||
| 184 | } | ||
| 185 | pub export fn sqlite3_errmsg(db: ?*c.sqlite3) [*c]const u8 { | ||
| 186 | return sqlite3_api.*.errmsg.?(db); | ||
| 187 | } | ||
| 188 | pub export fn sqlite3_errmsg16(db: ?*c.sqlite3) ?*const anyopaque { | ||
| 189 | return sqlite3_api.*.errmsg16.?(db); | ||
| 190 | } | ||
| 191 | pub export fn sqlite3_exec(db: ?*c.sqlite3, zSql: [*c]const u8, xCallback: ?fn (?*anyopaque, c_int, [*c][*c]u8, [*c][*c]u8) callconv(.C) c_int, pArg: ?*anyopaque, pzErrMsg: [*c][*c]u8) c_int { | ||
| 192 | return sqlite3_api.*.exec.?(db, zSql, xCallback, pArg, pzErrMsg); | ||
| 193 | } | ||
| 194 | pub export fn sqlite3_finalize(pStmt: ?*c.sqlite3_stmt) c_int { | ||
| 195 | return sqlite3_api.*.finalize.?(pStmt); | ||
| 196 | } | ||
| 197 | pub export fn sqlite3_free(p: ?*anyopaque) void { | ||
| 198 | return sqlite3_api.*.free.?(p); | ||
| 199 | } | ||
| 200 | pub export fn sqlite3_free_table(result: [*c][*c]u8) void { | ||
| 201 | return sqlite3_api.*.free_table.?(result); | ||
| 202 | } | ||
| 203 | pub export fn sqlite3_get_autocommit(db: ?*c.sqlite3) c_int { | ||
| 204 | return sqlite3_api.*.get_autocommit.?(db); | ||
| 205 | } | ||
| 206 | pub export fn sqlite3_get_auxdata(pCtx: ?*c.sqlite3_context, iArg: c_int) ?*anyopaque { | ||
| 207 | return sqlite3_api.*.get_auxdata.?(pCtx, iArg); | ||
| 208 | } | ||
| 209 | pub export fn sqlite3_get_table(db: ?*c.sqlite3, zSql: [*c]const u8, pazResult: [*c][*c][*c]u8, pnRow: [*c]c_int, pnColumn: [*c]c_int, pzErrMsg: [*c][*c]u8) c_int { | ||
| 210 | return sqlite3_api.*.get_table.?(db, zSql, pazResult, pnRow, pnColumn, pzErrMsg); | ||
| 211 | } | ||
| 212 | pub export fn sqlite3_interrupt(db: ?*c.sqlite3) void { | ||
| 213 | return sqlite3_api.*.interruptx.?(db); | ||
| 214 | } | ||
| 215 | pub export fn sqlite3_last_insert_rowid(db: ?*c.sqlite3) c.sqlite3_int64 { | ||
| 216 | return sqlite3_api.*.last_insert_rowid.?(db); | ||
| 217 | } | ||
| 218 | pub export fn sqlite3_libversion() callconv(.C) [*c]const u8 { | ||
| 219 | return sqlite3_api.*.libversion.?(); | ||
| 220 | } | ||
| 221 | pub export fn sqlite3_libversion_number() c_int { | ||
| 222 | return sqlite3_api.*.libversion_number.?(); | ||
| 223 | } | ||
| 224 | pub export fn sqlite3_malloc(n: c_int) ?*anyopaque { | ||
| 225 | return sqlite3_api.*.malloc.?(n); | ||
| 226 | } | ||
| 227 | pub export fn sqlite3_open(filename: [*c]const u8, ppDb: [*c]?*c.sqlite3) c_int { | ||
| 228 | return sqlite3_api.*.open.?(filename, ppDb); | ||
| 229 | } | ||
| 230 | pub export fn sqlite3_open16(filename: ?*const anyopaque, ppDb: [*c]?*c.sqlite3) c_int { | ||
| 231 | return sqlite3_api.*.open16.?(filename, ppDb); | ||
| 232 | } | ||
| 233 | pub export fn sqlite3_prepare(db: ?*c.sqlite3, zSql: [*c]const u8, nByte: c_int, ppStmt: [*c]?*c.sqlite3_stmt, pzTail: [*c][*c]const u8) c_int { | ||
| 234 | return sqlite3_api.*.prepare.?(db, zSql, nByte, ppStmt, pzTail); | ||
| 235 | } | ||
| 236 | pub export fn sqlite3_prepare16(db: ?*c.sqlite3, zSql: ?*const anyopaque, nByte: c_int, ppStmt: [*c]?*c.sqlite3_stmt, pzTail: [*c]?*const anyopaque) c_int { | ||
| 237 | return sqlite3_api.*.prepare16.?(db, zSql, nByte, ppStmt, pzTail); | ||
| 238 | } | ||
| 239 | pub export fn sqlite3_prepare_v2(db: ?*c.sqlite3, zSql: [*c]const u8, nByte: c_int, ppStmt: [*c]?*c.sqlite3_stmt, pzTail: [*c][*c]const u8) c_int { | ||
| 240 | return sqlite3_api.*.prepare_v2.?(db, zSql, nByte, ppStmt, pzTail); | ||
| 241 | } | ||
| 242 | pub export fn sqlite3_prepare16_v2(db: ?*c.sqlite3, zSql: ?*const anyopaque, nByte: c_int, ppStmt: [*c]?*c.sqlite3_stmt, pzTail: [*c]?*const anyopaque) c_int { | ||
| 243 | return sqlite3_api.*.prepare16_v2.?(db, zSql, nByte, ppStmt, pzTail); | ||
| 244 | } | ||
| 245 | pub export fn sqlite3_profile(db: ?*c.sqlite3, xProfile: ?fn (?*anyopaque, [*c]const u8, c.sqlite3_uint64) callconv(.C) void, pArg: ?*anyopaque) ?*anyopaque { | ||
| 246 | return sqlite3_api.*.profile.?(db, xProfile, pArg); | ||
| 247 | } | ||
| 248 | pub export fn sqlite3_progress_handler(db: ?*c.sqlite3, nOps: c_int, xProgress: ?fn (?*anyopaque) callconv(.C) c_int, pArg: ?*anyopaque) void { | ||
| 249 | return sqlite3_api.*.progress_handler.?(db, nOps, xProgress, pArg); | ||
| 250 | } | ||
| 251 | pub export fn sqlite3_realloc(pOld: ?*anyopaque, n: c_int) ?*anyopaque { | ||
| 252 | return sqlite3_api.*.realloc.?(pOld, n); | ||
| 253 | } | ||
| 254 | pub export fn sqlite3_reset(pStmt: ?*c.sqlite3_stmt) c_int { | ||
| 255 | return sqlite3_api.*.reset.?(pStmt); | ||
| 256 | } | ||
| 257 | pub export fn sqlite3_result_blob(pCtx: ?*c.sqlite3_context, z: ?*const anyopaque, n: c_int, xDel: ?fn (?*anyopaque) callconv(.C) void) void { | ||
| 258 | return sqlite3_api.*.result_blob.?(pCtx, z, n, xDel); | ||
| 259 | } | ||
| 260 | |||
| 261 | pub export fn sqlite3_result_double(pCtx: ?*c.sqlite3_context, rVal: f64) void { | ||
| 262 | return sqlite3_api.*.result_double.?(pCtx, rVal); | ||
| 263 | } | ||
| 264 | |||
| 265 | pub export fn sqlite3_result_error(pCtx: ?*c.sqlite3_context, z: [*c]const u8, n: c_int) void { | ||
| 266 | return sqlite3_api.*.result_error.?(pCtx, z, n); | ||
| 267 | } | ||
| 268 | pub export fn sqlite3_result_error16(pCtx: ?*c.sqlite3_context, z: ?*const anyopaque, n: c_int) void { | ||
| 269 | return sqlite3_api.*.result_error16.?(pCtx, z, n); | ||
| 270 | } | ||
| 271 | pub export fn sqlite3_result_int(pCtx: ?*c.sqlite3_context, iVal: c_int) void { | ||
| 272 | return sqlite3_api.*.result_int.?(pCtx, iVal); | ||
| 273 | } | ||
| 274 | pub export fn sqlite3_result_int64(pCtx: ?*c.sqlite3_context, iVal: c.sqlite3_int64) void { | ||
| 275 | return sqlite3_api.*.result_int64.?(pCtx, iVal); | ||
| 276 | } | ||
| 277 | pub export fn sqlite3_result_null(pCtx: ?*c.sqlite3_context) void { | ||
| 278 | return sqlite3_api.*.result_null.?(pCtx); | ||
| 279 | } | ||
| 280 | pub export fn sqlite3_result_text(pCtx: ?*c.sqlite3_context, z: [*c]const u8, n: c_int, xDel: ?fn (?*anyopaque) callconv(.C) void) void { | ||
| 281 | return sqlite3_api.*.result_text.?(pCtx, z, n, xDel); | ||
| 282 | } | ||
| 283 | pub export fn sqlite3_result_text16(pCtx: ?*c.sqlite3_context, z: ?*const anyopaque, n: c_int, xDel: ?fn (?*anyopaque) callconv(.C) void) void { | ||
| 284 | return sqlite3_api.*.result_text16.?(pCtx, z, n, xDel); | ||
| 285 | } | ||
| 286 | pub export fn sqlite3_result_text16be(pCtx: ?*c.sqlite3_context, z: ?*const anyopaque, n: c_int, xDel: ?fn (?*anyopaque) callconv(.C) void) void { | ||
| 287 | return sqlite3_api.*.result_text16be.?(pCtx, z, n, xDel); | ||
| 288 | } | ||
| 289 | pub export fn sqlite3_result_text16le(pCtx: ?*c.sqlite3_context, z: ?*const anyopaque, n: c_int, xDel: ?fn (?*anyopaque) callconv(.C) void) void { | ||
| 290 | return sqlite3_api.*.result_text16le.?(pCtx, z, n, xDel); | ||
| 291 | } | ||
| 292 | pub export fn sqlite3_result_value(pCtx: ?*c.sqlite3_context, pValue: ?*c.sqlite3_value) void { | ||
| 293 | return sqlite3_api.*.result_value.?(pCtx, pValue); | ||
| 294 | } | ||
| 295 | pub export fn sqlite3_rollback_hook(db: ?*c.sqlite3, xCallback: ?fn (?*anyopaque) callconv(.C) void, pArg: ?*anyopaque) ?*anyopaque { | ||
| 296 | return sqlite3_api.*.rollback_hook.?(db, xCallback, pArg); | ||
| 297 | } | ||
| 298 | pub export fn sqlite3_set_authorizer(db: ?*c.sqlite3, xAuth: ?fn (?*anyopaque, c_int, [*c]const u8, [*c]const u8, [*c]const u8, [*c]const u8) callconv(.C) c_int, pArg: ?*anyopaque) c_int { | ||
| 299 | return sqlite3_api.*.set_authorizer.?(db, xAuth, pArg); | ||
| 300 | } | ||
| 301 | pub export fn sqlite3_set_auxdata(pCtx: ?*c.sqlite3_context, iArg: c_int, pAux: ?*anyopaque, xDelete: ?fn (?*anyopaque) callconv(.C) void) void { | ||
| 302 | return sqlite3_api.*.set_auxdata.?(pCtx, iArg, pAux, xDelete); | ||
| 303 | } | ||
| 304 | pub export fn sqlite3_step(pStmt: ?*c.sqlite3_stmt) c_int { | ||
| 305 | return sqlite3_api.*.step.?(pStmt); | ||
| 306 | } | ||
| 307 | pub export fn sqlite3_table_column_metadata(db: ?*c.sqlite3, zDbName: [*c]const u8, zTableName: [*c]const u8, zColumnName: [*c]const u8, pzDataType: [*c][*c]const u8, pzCollSeq: [*c][*c]const u8, pNotNull: [*c]c_int, pPrimaryKey: [*c]c_int, pAutoinc: [*c]c_int) c_int { | ||
| 308 | return sqlite3_api.*.table_column_metadata.?(db, zDbName, zTableName, zColumnName, pzDataType, pzCollSeq, pNotNull, pPrimaryKey, pAutoinc); | ||
| 309 | } | ||
| 310 | pub export fn sqlite3_thread_cleanup() void { | ||
| 311 | return sqlite3_api.*.thread_cleanup.?(); | ||
| 312 | } | ||
| 313 | pub export fn sqlite3_total_changes(db: ?*c.sqlite3) c_int { | ||
| 314 | return sqlite3_api.*.total_changes.?(db); | ||
| 315 | } | ||
| 316 | pub export fn sqlite3_trace(db: ?*c.sqlite3, xTrace: ?fn (?*anyopaque, [*c]const u8) callconv(.C) void, pArg: ?*anyopaque) ?*anyopaque { | ||
| 317 | return sqlite3_api.*.trace.?(db, xTrace, pArg); | ||
| 318 | } | ||
| 319 | pub export fn sqlite3_update_hook(db: ?*c.sqlite3, xCallback: ?fn (?*anyopaque, c_int, [*c]const u8, [*c]const u8, c.sqlite3_int64) callconv(.C) void, pArg: ?*anyopaque) ?*anyopaque { | ||
| 320 | return sqlite3_api.*.update_hook.?(db, xCallback, pArg); | ||
| 321 | } | ||
| 322 | pub export fn sqlite3_user_data(pCtx: ?*c.sqlite3_context) ?*anyopaque { | ||
| 323 | return sqlite3_api.*.user_data.?(pCtx); | ||
| 324 | } | ||
| 325 | pub export fn sqlite3_value_blob(pVal: ?*c.sqlite3_value) ?*const anyopaque { | ||
| 326 | return sqlite3_api.*.value_blob.?(pVal); | ||
| 327 | } | ||
| 328 | pub export fn sqlite3_value_bytes(pVal: ?*c.sqlite3_value) c_int { | ||
| 329 | return sqlite3_api.*.value_bytes.?(pVal); | ||
| 330 | } | ||
| 331 | pub export fn sqlite3_value_bytes16(pVal: ?*c.sqlite3_value) c_int { | ||
| 332 | return sqlite3_api.*.value_bytes16.?(pVal); | ||
| 333 | } | ||
| 334 | pub export fn sqlite3_value_double(pVal: ?*c.sqlite3_value) f64 { | ||
| 335 | return sqlite3_api.*.value_double.?(pVal); | ||
| 336 | } | ||
| 337 | pub export fn sqlite3_value_int(pVal: ?*c.sqlite3_value) c_int { | ||
| 338 | return sqlite3_api.*.value_int.?(pVal); | ||
| 339 | } | ||
| 340 | pub export fn sqlite3_value_int64(pVal: ?*c.sqlite3_value) c.sqlite3_int64 { | ||
| 341 | return sqlite3_api.*.value_int64.?(pVal); | ||
| 342 | } | ||
| 343 | pub export fn sqlite3_value_numeric_type(pVal: ?*c.sqlite3_value) c_int { | ||
| 344 | return sqlite3_api.*.value_numeric_type.?(pVal); | ||
| 345 | } | ||
| 346 | pub export fn sqlite3_value_text(pVal: ?*c.sqlite3_value) [*c]const u8 { | ||
| 347 | return sqlite3_api.*.value_text.?(pVal); | ||
| 348 | } | ||
| 349 | pub export fn sqlite3_value_text16(pVal: ?*c.sqlite3_value) ?*const anyopaque { | ||
| 350 | return sqlite3_api.*.value_text16.?(pVal); | ||
| 351 | } | ||
| 352 | pub export fn sqlite3_value_text16be(pVal: ?*c.sqlite3_value) ?*const anyopaque { | ||
| 353 | return sqlite3_api.*.value_text16be.?(pVal); | ||
| 354 | } | ||
| 355 | pub export fn sqlite3_value_text16le(pVal: ?*c.sqlite3_value) ?*const anyopaque { | ||
| 356 | return sqlite3_api.*.value_text16le.?(pVal); | ||
| 357 | } | ||
| 358 | pub export fn sqlite3_value_type(pVal: ?*c.sqlite3_value) c_int { | ||
| 359 | return sqlite3_api.*.value_type.?(pVal); | ||
| 360 | } | ||
| 361 | pub export fn sqlite3_overload_function(db: ?*c.sqlite3, zFuncName: [*c]const u8, nArg: c_int) c_int { | ||
| 362 | return sqlite3_api.*.overload_function.?(db, zFuncName, nArg); | ||
| 363 | } | ||
| 364 | pub export fn sqlite3_clear_bindings(pStmt: ?*c.sqlite3_stmt) c_int { | ||
| 365 | return sqlite3_api.*.clear_bindings.?(pStmt); | ||
| 366 | } | ||
| 367 | pub export fn sqlite3_bind_zeroblob(pStmt: ?*c.sqlite3_stmt, i: c_int, n: c_int) c_int { | ||
| 368 | return sqlite3_api.*.bind_zeroblob.?(pStmt, i, n); | ||
| 369 | } | ||
| 370 | pub export fn sqlite3_blob_bytes(pBlob: ?*c.sqlite3_blob) c_int { | ||
| 371 | return sqlite3_api.*.blob_bytes.?(pBlob); | ||
| 372 | } | ||
| 373 | pub export fn sqlite3_blob_close(pBlob: ?*c.sqlite3_blob) c_int { | ||
| 374 | return sqlite3_api.*.blob_close.?(pBlob); | ||
| 375 | } | ||
| 376 | pub export fn sqlite3_blob_open(db: ?*c.sqlite3, zDb: [*c]const u8, zTable: [*c]const u8, zColumn: [*c]const u8, iRow: c.sqlite3_int64, flags: c_int, ppBlob: [*c]?*c.sqlite3_blob) c_int { | ||
| 377 | return sqlite3_api.*.blob_open.?(db, zDb, zTable, zColumn, iRow, flags, ppBlob); | ||
| 378 | } | ||
| 379 | pub export fn sqlite3_blob_read(pBlob: ?*c.sqlite3_blob, z: ?*anyopaque, n: c_int, iOffset: c_int) c_int { | ||
| 380 | return sqlite3_api.*.blob_read.?(pBlob, z, n, iOffset); | ||
| 381 | } | ||
| 382 | pub export fn sqlite3_blob_write(pBlob: ?*c.sqlite3_blob, z: ?*const anyopaque, n: c_int, iOffset: c_int) c_int { | ||
| 383 | return sqlite3_api.*.blob_write.?(pBlob, z, n, iOffset); | ||
| 384 | } | ||
| 385 | pub export fn sqlite3_create_collation_v2(db: ?*c.sqlite3, zName: [*c]const u8, eTextRep: c_int, pCtx: ?*anyopaque, xCompare: ?fn (?*anyopaque, c_int, ?*const anyopaque, c_int, ?*const anyopaque) callconv(.C) c_int, xDel: ?fn (?*anyopaque) callconv(.C) void) c_int { | ||
| 386 | return sqlite3_api.*.create_collation_v2.?(db, zName, eTextRep, pCtx, xCompare, xDel); | ||
| 387 | } | ||
| 388 | pub export fn sqlite3_file_control(db: ?*c.sqlite3, zDbName: [*c]const u8, op: c_int, pArg: ?*anyopaque) c_int { | ||
| 389 | return sqlite3_api.*.file_control.?(db, zDbName, op, pArg); | ||
| 390 | } | ||
| 391 | pub export fn sqlite3_memory_highwater(resetFlag: c_int) c.sqlite3_int64 { | ||
| 392 | return sqlite3_api.*.memory_highwater.?(resetFlag); | ||
| 393 | } | ||
| 394 | pub export fn sqlite3_memory_used() c.sqlite3_int64 { | ||
| 395 | return sqlite3_api.*.memory_used.?(); | ||
| 396 | } | ||
| 397 | pub export fn sqlite3_mutex_alloc(id: c_int) ?*c.sqlite3_mutex { | ||
| 398 | return sqlite3_api.*.mutex_alloc.?(id); | ||
| 399 | } | ||
| 400 | pub export fn sqlite3_mutex_enter(p: ?*c.sqlite3_mutex) void { | ||
| 401 | return sqlite3_api.*.mutex_enter.?(p); | ||
| 402 | } | ||
| 403 | pub export fn sqlite3_mutex_free(p: ?*c.sqlite3_mutex) void { | ||
| 404 | return sqlite3_api.*.mutex_free.?(p); | ||
| 405 | } | ||
| 406 | pub export fn sqlite3_mutex_leave(p: ?*c.sqlite3_mutex) void { | ||
| 407 | return sqlite3_api.*.mutex_leave.?(p); | ||
| 408 | } | ||
| 409 | pub export fn sqlite3_mutex_try(p: ?*c.sqlite3_mutex) c_int { | ||
| 410 | return sqlite3_api.*.mutex_try.?(p); | ||
| 411 | } | ||
| 412 | pub export fn sqlite3_open_v2(filename: [*c]const u8, ppDb: [*c]?*c.sqlite3, flags: c_int, zVfs: [*c]const u8) c_int { | ||
| 413 | return sqlite3_api.*.open_v2.?(filename, ppDb, flags, zVfs); | ||
| 414 | } | ||
| 415 | pub export fn sqlite3_release_memory(n: c_int) c_int { | ||
| 416 | return sqlite3_api.*.release_memory.?(n); | ||
| 417 | } | ||
| 418 | pub export fn sqlite3_result_error_nomem(pCtx: ?*c.sqlite3_context) void { | ||
| 419 | return sqlite3_api.*.result_error_nomem.?(pCtx); | ||
| 420 | } | ||
| 421 | pub export fn sqlite3_result_error_toobig(pCtx: ?*c.sqlite3_context) void { | ||
| 422 | return sqlite3_api.*.result_error_toobig.?(pCtx); | ||
| 423 | } | ||
| 424 | pub export fn sqlite3_sleep(ms: c_int) c_int { | ||
| 425 | return sqlite3_api.*.sleep.?(ms); | ||
| 426 | } | ||
| 427 | pub export fn sqlite3_soft_heap_limit(n: c_int) void { | ||
| 428 | return sqlite3_api.*.soft_heap_limit.?(n); | ||
| 429 | } | ||
| 430 | pub export fn sqlite3_vfs_find(zVfsName: [*c]const u8) [*c]c.sqlite3_vfs { | ||
| 431 | return sqlite3_api.*.vfs_find.?(zVfsName); | ||
| 432 | } | ||
| 433 | pub export fn sqlite3_vfs_register(pVfs: [*c]c.sqlite3_vfs, makeDflt: c_int) c_int { | ||
| 434 | return sqlite3_api.*.vfs_register.?(pVfs, makeDflt); | ||
| 435 | } | ||
| 436 | pub export fn sqlite3_vfs_unregister(pVfs: [*c]c.sqlite3_vfs) c_int { | ||
| 437 | return sqlite3_api.*.vfs_unregister.?(pVfs); | ||
| 438 | } | ||
| 439 | pub export fn sqlite3_threadsafe() c_int { | ||
| 440 | return sqlite3_api.*.xthreadsafe.?(); | ||
| 441 | } | ||
| 442 | pub export fn sqlite3_result_zeroblob(pCtx: ?*c.sqlite3_context, n: c_int) void { | ||
| 443 | return sqlite3_api.*.result_zeroblob.?(pCtx, n); | ||
| 444 | } | ||
| 445 | pub export fn sqlite3_result_error_code(pCtx: ?*c.sqlite3_context, errCode: c_int) void { | ||
| 446 | return sqlite3_api.*.result_error_code.?(pCtx, errCode); | ||
| 447 | } | ||
| 448 | pub export fn sqlite3_randomness(N: c_int, pBuf: ?*anyopaque) void { | ||
| 449 | return sqlite3_api.*.randomness.?(N, pBuf); | ||
| 450 | } | ||
| 451 | pub export fn sqlite3_context_db_handle(pCtx: ?*c.sqlite3_context) ?*c.sqlite3 { | ||
| 452 | return sqlite3_api.*.context_db_handle.?(pCtx); | ||
| 453 | } | ||
| 454 | pub export fn sqlite3_extended_result_codes(pCtx: ?*c.sqlite3, onoff: c_int) c_int { | ||
| 455 | return sqlite3_api.*.extended_result_codes.?(pCtx, onoff); | ||
| 456 | } | ||
| 457 | pub export fn sqlite3_limit(db: ?*c.sqlite3, id: c_int, newVal: c_int) c_int { | ||
| 458 | return sqlite3_api.*.limit.?(db, id, newVal); | ||
| 459 | } | ||
| 460 | pub export fn sqlite3_next_stmt(pDb: ?*c.sqlite3, pStmt: ?*c.sqlite3_stmt) ?*c.sqlite3_stmt { | ||
| 461 | return sqlite3_api.*.next_stmt.?(pDb, pStmt); | ||
| 462 | } | ||
| 463 | pub export fn sqlite3_sql(pStmt: ?*c.sqlite3_stmt) [*c]const u8 { | ||
| 464 | return sqlite3_api.*.sql.?(pStmt); | ||
| 465 | } | ||
| 466 | pub export fn sqlite3_status(op: c_int, pCurrent: [*c]c_int, pHighwater: [*c]c_int, resetFlag: c_int) c_int { | ||
| 467 | return sqlite3_api.*.status.?(op, pCurrent, pHighwater, resetFlag); | ||
| 468 | } | ||
| 469 | pub export fn sqlite3_backup_finish(p: ?*c.sqlite3_backup) c_int { | ||
| 470 | return sqlite3_api.*.backup_finish.?(p); | ||
| 471 | } | ||
| 472 | pub export fn sqlite3_backup_init(pDest: ?*c.sqlite3, zDestName: [*c]const u8, pSource: ?*c.sqlite3, zSourceName: [*c]const u8) ?*c.sqlite3_backup { | ||
| 473 | return sqlite3_api.*.backup_init.?(pDest, zDestName, pSource, zSourceName); | ||
| 474 | } | ||
| 475 | pub export fn sqlite3_backup_pagecount(p: ?*c.sqlite3_backup) c_int { | ||
| 476 | return sqlite3_api.*.backup_pagecount.?(p); | ||
| 477 | } | ||
| 478 | pub export fn sqlite3_backup_remaining(p: ?*c.sqlite3_backup) c_int { | ||
| 479 | return sqlite3_api.*.backup_remaining.?(p); | ||
| 480 | } | ||
| 481 | pub export fn sqlite3_backup_step(p: ?*c.sqlite3_backup, nPage: c_int) c_int { | ||
| 482 | return sqlite3_api.*.backup_step.?(p, nPage); | ||
| 483 | } | ||
| 484 | pub export fn sqlite3_compileoption_get(N: c_int) [*c]const u8 { | ||
| 485 | return sqlite3_api.*.compileoption_get.?(N); | ||
| 486 | } | ||
| 487 | pub export fn sqlite3_compileoption_used(zOptName: [*c]const u8) c_int { | ||
| 488 | return sqlite3_api.*.compileoption_used.?(zOptName); | ||
| 489 | } | ||
| 490 | pub export fn sqlite3_create_function_v2( | ||
| 491 | db: ?*c.sqlite3, | ||
| 492 | zFunctionName: [*c]const u8, | ||
| 493 | nArg: c_int, | ||
| 494 | eTextRep: c_int, | ||
| 495 | pApp: ?*anyopaque, | ||
| 496 | xFunc: ?fn (?*c.sqlite3_context, c_int, [*c]?*c.sqlite3_value) callconv(.C) void, | ||
| 497 | xStep: ?fn (?*c.sqlite3_context, c_int, [*c]?*c.sqlite3_value) callconv(.C) void, | ||
| 498 | xFinal: ?fn (?*c.sqlite3_context) callconv(.C) void, | ||
| 499 | xDestroy: ?fn (?*anyopaque) callconv(.C) void, | ||
| 500 | ) c_int { | ||
| 501 | return sqlite3_api.*.create_function_v2.?(db, zFunctionName, nArg, eTextRep, pApp, xFunc, xStep, xFinal, xDestroy); | ||
| 502 | } | ||
| 503 | pub export fn sqlite3_db_mutex(db: ?*c.sqlite3) ?*c.sqlite3_mutex { | ||
| 504 | return sqlite3_api.*.db_mutex.?(db); | ||
| 505 | } | ||
| 506 | pub export fn sqlite3_db_status(db: ?*c.sqlite3, op: c_int, pCurrent: [*c]c_int, pHighwater: [*c]c_int, resetFlag: c_int) c_int { | ||
| 507 | return sqlite3_api.*.db_status.?(db, op, pCurrent, pHighwater, resetFlag); | ||
| 508 | } | ||
| 509 | pub export fn sqlite3_extended_errcode(db: ?*c.sqlite3) c_int { | ||
| 510 | return sqlite3_api.*.extended_errcode.?(db); | ||
| 511 | } | ||
| 512 | pub export fn sqlite3_soft_heap_limit64(N: c.sqlite3_int64) c.sqlite3_int64 { | ||
| 513 | return sqlite3_api.*.soft_heap_limit64.?(N); | ||
| 514 | } | ||
| 515 | pub export fn sqlite3_sourceid() [*c]const u8 { | ||
| 516 | return sqlite3_api.*.sourceid.?(); | ||
| 517 | } | ||
| 518 | pub export fn sqlite3_stmt_status(pStmt: ?*c.sqlite3_stmt, op: c_int, resetFlag: c_int) c_int { | ||
| 519 | return sqlite3_api.*.stmt_status.?(pStmt, op, resetFlag); | ||
| 520 | } | ||
| 521 | pub export fn sqlite3_strnicmp(zLeft: [*c]const u8, zRight: [*c]const u8, N: c_int) c_int { | ||
| 522 | return sqlite3_api.*.strnicmp.?(zLeft, zRight, N); | ||
| 523 | } | ||
| 524 | pub export fn sqlite3_unlock_notify(pBlocked: ?*c.sqlite3, xNotify: ?fn ([*c]?*anyopaque, c_int) callconv(.C) void, pNotifyArg: ?*anyopaque) c_int { | ||
| 525 | return sqlite3_api.*.unlock_notify.?(pBlocked, xNotify, pNotifyArg); | ||
| 526 | } | ||
| 527 | pub export fn sqlite3_wal_autocheckpoint(db: ?*c.sqlite3, N: c_int) c_int { | ||
| 528 | return sqlite3_api.*.wal_autocheckpoint.?(db, N); | ||
| 529 | } | ||
| 530 | pub export fn sqlite3_wal_checkpoint(db: ?*c.sqlite3, zDb: [*c]const u8) c_int { | ||
| 531 | return sqlite3_api.*.wal_checkpoint.?(db, zDb); | ||
| 532 | } | ||
| 533 | pub export fn sqlite3_wal_hook(db: ?*c.sqlite3, xCallback: ?fn (?*anyopaque, ?*c.sqlite3, [*c]const u8, c_int) callconv(.C) c_int, pArg: ?*anyopaque) ?*anyopaque { | ||
| 534 | return sqlite3_api.*.wal_hook.?(db, xCallback, pArg); | ||
| 535 | } | ||
| 536 | pub export fn sqlite3_blob_reopen(pBlob: ?*c.sqlite3_blob, iRow: c.sqlite3_int64) c_int { | ||
| 537 | return sqlite3_api.*.blob_reopen.?(pBlob, iRow); | ||
| 538 | } | ||
| 539 | pub export fn sqlite3_vtab_on_conflict(db: ?*c.sqlite3) c_int { | ||
| 540 | return sqlite3_api.*.vtab_on_conflict.?(db); | ||
| 541 | } | ||
| 542 | pub export fn sqlite3_close_v2(db: ?*c.sqlite3) c_int { | ||
| 543 | return sqlite3_api.*.close_v2.?(db); | ||
| 544 | } | ||
| 545 | pub export fn sqlite3_db_filename(db: ?*c.sqlite3, zDbName: [*c]const u8) [*c]const u8 { | ||
| 546 | return sqlite3_api.*.db_filename.?(db, zDbName); | ||
| 547 | } | ||
| 548 | pub export fn sqlite3_db_readonly(db: ?*c.sqlite3, zDbName: [*c]const u8) c_int { | ||
| 549 | return sqlite3_api.*.db_readonly.?(db, zDbName); | ||
| 550 | } | ||
| 551 | pub export fn sqlite3_db_release_memory(db: ?*c.sqlite3) c_int { | ||
| 552 | return sqlite3_api.*.db_release_memory.?(db); | ||
| 553 | } | ||
| 554 | pub export fn sqlite3_errstr(rc: c_int) [*c]const u8 { | ||
| 555 | return sqlite3_api.*.errstr.?(rc); | ||
| 556 | } | ||
| 557 | pub export fn sqlite3_stmt_busy(pStmt: ?*c.sqlite3_stmt) c_int { | ||
| 558 | return sqlite3_api.*.stmt_busy.?(pStmt); | ||
| 559 | } | ||
| 560 | pub export fn sqlite3_stmt_readonly(pStmt: ?*c.sqlite3_stmt) c_int { | ||
| 561 | return sqlite3_api.*.stmt_readonly.?(pStmt); | ||
| 562 | } | ||
| 563 | pub export fn sqlite3_stricmp(zLeft: [*c]const u8, zRight: [*c]const u8) c_int { | ||
| 564 | return sqlite3_api.*.stricmp.?(zLeft, zRight); | ||
| 565 | } | ||
| 566 | pub export fn sqlite3_uri_boolean(zFile: [*c]const u8, zParam: [*c]const u8, bDefault: c_int) c_int { | ||
| 567 | return sqlite3_api.*.uri_boolean.?(zFile, zParam, bDefault); | ||
| 568 | } | ||
| 569 | pub export fn sqlite3_uri_int64(zFilename: [*c]const u8, zParam: [*c]const u8, bDflt: c.sqlite3_int64) c.sqlite3_int64 { | ||
| 570 | return sqlite3_api.*.uri_int64.?(zFilename, zParam, bDflt); | ||
| 571 | } | ||
| 572 | pub export fn sqlite3_uri_parameter(zFilename: [*c]const u8, zParam: [*c]const u8) [*c]const u8 { | ||
| 573 | return sqlite3_api.*.uri_parameter.?(zFilename, zParam); | ||
| 574 | } | ||
| 575 | pub export fn sqlite3_wal_checkpoint_v2(db: ?*c.sqlite3, zDb: [*c]const u8, eMode: c_int, pnLog: [*c]c_int, pnCkpt: [*c]c_int) c_int { | ||
| 576 | return sqlite3_api.*.wal_checkpoint_v2.?(db, zDb, eMode, pnLog, pnCkpt); | ||
| 577 | } | ||
| 578 | pub export fn sqlite3_auto_extension(xEntryPoint: ?fn () callconv(.C) void) c_int { | ||
| 579 | return sqlite3_api.*.auto_extension.?(xEntryPoint); | ||
| 580 | } | ||
| 581 | pub export fn sqlite3_bind_blob64(pStmt: ?*c.sqlite3_stmt, i: c_int, zData: ?*const anyopaque, nData: c.sqlite3_uint64, xDel: ?fn (?*anyopaque) callconv(.C) void) c_int { | ||
| 582 | return sqlite3_api.*.bind_blob64.?(pStmt, i, zData, nData, xDel); | ||
| 583 | } | ||
| 584 | pub export fn sqlite3_bind_text64(pStmt: ?*c.sqlite3_stmt, i: c_int, zData: [*c]const u8, nData: c.sqlite3_uint64, xDel: ?fn (?*anyopaque) callconv(.C) void, encoding: u8) c_int { | ||
| 585 | return sqlite3_api.*.bind_text64.?(pStmt, i, zData, nData, xDel, encoding); | ||
| 586 | } | ||
| 587 | pub export fn sqlite3_cancel_auto_extension(xEntryPoint: ?fn () callconv(.C) void) c_int { | ||
| 588 | return sqlite3_api.*.cancel_auto_extension.?(xEntryPoint); | ||
| 589 | } | ||
| 590 | pub export fn sqlite3_load_extension(db: ?*c.sqlite3, zFile: [*c]const u8, zProc: [*c]const u8, pzErrMsg: [*c][*c]u8) c_int { | ||
| 591 | return sqlite3_api.*.load_extension.?(db, zFile, zProc, pzErrMsg); | ||
| 592 | } | ||
| 593 | pub export fn sqlite3_malloc64(n: c.sqlite3_uint64) ?*anyopaque { | ||
| 594 | return sqlite3_api.*.malloc64.?(n); | ||
| 595 | } | ||
| 596 | pub export fn sqlite3_msize(p: ?*anyopaque) c.sqlite3_uint64 { | ||
| 597 | return sqlite3_api.*.msize.?(p); | ||
| 598 | } | ||
| 599 | pub export fn sqlite3_realloc64(pOld: ?*anyopaque, n: c.sqlite3_uint64) ?*anyopaque { | ||
| 600 | return sqlite3_api.*.realloc64.?(pOld, n); | ||
| 601 | } | ||
| 602 | pub export fn sqlite3_reset_auto_extension() void { | ||
| 603 | return sqlite3_api.*.reset_auto_extension.?(); | ||
| 604 | } | ||
| 605 | pub export fn sqlite3_result_blob64(pCtx: ?*c.sqlite3_context, z: ?*const anyopaque, n: c.sqlite3_uint64, xDel: ?fn (?*anyopaque) callconv(.C) void) void { | ||
| 606 | return sqlite3_api.*.result_blob64.?(pCtx, z, n, xDel); | ||
| 607 | } | ||
| 608 | pub export fn sqlite3_result_text64(pCtx: ?*c.sqlite3_context, z: [*c]const u8, n: c.sqlite3_uint64, xDel: ?fn (?*anyopaque) callconv(.C) void, encoding: u8) void { | ||
| 609 | return sqlite3_api.*.result_text64.?(pCtx, z, n, xDel, encoding); | ||
| 610 | } | ||
| 611 | pub export fn sqlite3_strglob(zGlob: [*c]const u8, zStr: [*c]const u8) c_int { | ||
| 612 | return sqlite3_api.*.strglob.?(zGlob, zStr); | ||
| 613 | } | ||
| 614 | pub export fn sqlite3_value_dup(pOrig: ?*const c.sqlite3_value) ?*c.sqlite3_value { | ||
| 615 | return sqlite3_api.*.value_dup.?(pOrig); | ||
| 616 | } | ||
| 617 | pub export fn sqlite3_value_free(pOld: ?*c.sqlite3_value) void { | ||
| 618 | return sqlite3_api.*.value_free.?(pOld); | ||
| 619 | } | ||
| 620 | pub export fn sqlite3_result_zeroblob64(pCtx: ?*c.sqlite3_context, n: c.sqlite3_uint64) c_int { | ||
| 621 | return sqlite3_api.*.result_zeroblob64.?(pCtx, n); | ||
| 622 | } | ||
| 623 | pub export fn sqlite3_bind_zeroblob64(pStmt: ?*c.sqlite3_stmt, i: c_int, n: c.sqlite3_uint64) c_int { | ||
| 624 | return sqlite3_api.*.bind_zeroblob64.?(pStmt, i, n); | ||
| 625 | } | ||
| 626 | pub export fn sqlite3_value_subtype(pVal: ?*c.sqlite3_value) c_uint { | ||
| 627 | return sqlite3_api.*.value_subtype.?(pVal); | ||
| 628 | } | ||
| 629 | pub export fn sqlite3_result_subtype(pCtx: ?*c.sqlite3_context, eSubtype: c_uint) void { | ||
| 630 | return sqlite3_api.*.result_subtype.?(pCtx, eSubtype); | ||
| 631 | } | ||
| 632 | pub export fn sqlite3_status64(op: c_int, pCurrent: [*c]c.sqlite3_int64, pHighwater: [*c]c.sqlite3_int64, resetFlag: c_int) c_int { | ||
| 633 | return sqlite3_api.*.status64.?(op, pCurrent, pHighwater, resetFlag); | ||
| 634 | } | ||
| 635 | pub export fn sqlite3_strlike(zGlob: [*c]const u8, zStr: [*c]const u8, cEsc: c_uint) c_int { | ||
| 636 | return sqlite3_api.*.strlike.?(zGlob, zStr, cEsc); | ||
| 637 | } | ||
| 638 | pub export fn sqlite3_db_cacheflush(db: ?*c.sqlite3) c_int { | ||
| 639 | return sqlite3_api.*.db_cacheflush.?(db); | ||
| 640 | } | ||
| 641 | pub export fn sqlite3_system_errno(db: ?*c.sqlite3) c_int { | ||
| 642 | return sqlite3_api.*.system_errno.?(db); | ||
| 643 | } | ||
| 644 | pub export fn sqlite3_trace_v2(db: ?*c.sqlite3, uMask: c_uint, xCallback: ?fn (c_uint, ?*anyopaque, ?*anyopaque, ?*anyopaque) callconv(.C) c_int, pCtx: ?*anyopaque) c_int { | ||
| 645 | return sqlite3_api.*.trace_v2.?(db, uMask, xCallback, pCtx); | ||
| 646 | } | ||
| 647 | pub export fn sqlite3_expanded_sql(pStmt: ?*c.sqlite3_stmt) [*c]u8 { | ||
| 648 | return sqlite3_api.*.expanded_sql.?(pStmt); | ||
| 649 | } | ||
| 650 | pub export fn sqlite3_set_last_insert_rowid(db: ?*c.sqlite3, iRowid: c.sqlite3_int64) void { | ||
| 651 | return sqlite3_api.*.set_last_insert_rowid.?(db, iRowid); | ||
| 652 | } | ||
| 653 | pub export fn sqlite3_prepare_v3(db: ?*c.sqlite3, zSql: [*c]const u8, nByte: c_int, prepFlags: c_uint, ppStmt: [*c]?*c.sqlite3_stmt, pzTail: [*c][*c]const u8) c_int { | ||
| 654 | return sqlite3_api.*.prepare_v3.?(db, zSql, nByte, prepFlags, ppStmt, pzTail); | ||
| 655 | } | ||
| 656 | pub export fn sqlite3_prepare16_v3(db: ?*c.sqlite3, zSql: ?*const anyopaque, nByte: c_int, prepFlags: c_uint, ppStmt: [*c]?*c.sqlite3_stmt, pzTail: [*c]?*const anyopaque) c_int { | ||
| 657 | return sqlite3_api.*.prepare16_v3.?(db, zSql, nByte, prepFlags, ppStmt, pzTail); | ||
| 658 | } | ||
| 659 | pub export fn sqlite3_bind_pointer(pStmt: ?*c.sqlite3_stmt, i: c_int, pPtr: ?*anyopaque, zPTtype: [*c]const u8, xDestructor: ?fn (?*anyopaque) callconv(.C) void) c_int { | ||
| 660 | return sqlite3_api.*.bind_pointer.?(pStmt, i, pPtr, zPTtype, xDestructor); | ||
| 661 | } | ||
| 662 | pub export fn sqlite3_result_pointer(pCtx: ?*c.sqlite3_context, pPtr: ?*anyopaque, zPType: [*c]const u8, xDestructor: ?fn (?*anyopaque) callconv(.C) void) void { | ||
| 663 | return sqlite3_api.*.result_pointer.?(pCtx, pPtr, zPType, xDestructor); | ||
| 664 | } | ||
| 665 | pub export fn sqlite3_value_pointer(pVal: ?*c.sqlite3_value, zPType: [*c]const u8) ?*anyopaque { | ||
| 666 | return sqlite3_api.*.value_pointer.?(pVal, zPType); | ||
| 667 | } | ||
| 668 | pub export fn sqlite3_vtab_nochange(pCtx: ?*c.sqlite3_context) c_int { | ||
| 669 | return sqlite3_api.*.vtab_nochange.?(pCtx); | ||
| 670 | } | ||
| 671 | pub export fn sqlite3_value_nochange(pVal: ?*c.sqlite3_value) c_int { | ||
| 672 | return sqlite3_api.*.value_nochange.?(pVal); | ||
| 673 | } | ||
| 674 | pub export fn sqlite3_vtab_collation(pIdxInfo: [*c]c.sqlite3_index_info, iCons: c_int) [*c]const u8 { | ||
| 675 | return sqlite3_api.*.vtab_collation.?(pIdxInfo, iCons); | ||
| 676 | } | ||
| 677 | pub export fn sqlite3_keyword_count() c_int { | ||
| 678 | return sqlite3_api.*.keyword_count.?(); | ||
| 679 | } | ||
| 680 | pub export fn sqlite3_keyword_name(i: c_int, pzName: [*c][*c]const u8, pnName: [*c]c_int) c_int { | ||
| 681 | return sqlite3_api.*.keyword_name.?(i, pzName, pnName); | ||
| 682 | } | ||
| 683 | pub export fn sqlite3_keyword_check(zName: [*c]const u8, nName: c_int) c_int { | ||
| 684 | return sqlite3_api.*.keyword_check.?(zName, nName); | ||
| 685 | } | ||
| 686 | pub export fn sqlite3_str_new(db: ?*c.sqlite3) ?*c.sqlite3_str { | ||
| 687 | return sqlite3_api.*.str_new.?(db); | ||
| 688 | } | ||
| 689 | pub export fn sqlite3_str_finish(p: ?*c.sqlite3_str) [*c]u8 { | ||
| 690 | return sqlite3_api.*.str_finish.?(p); | ||
| 691 | } | ||
| 692 | pub export fn sqlite3_str_append(p: ?*c.sqlite3_str, zIn: [*c]const u8, N: c_int) void { | ||
| 693 | return sqlite3_api.*.str_append.?(p, zIn, N); | ||
| 694 | } | ||
| 695 | pub export fn sqlite3_str_appendall(p: ?*c.sqlite3_str, zIn: [*c]const u8) void { | ||
| 696 | return sqlite3_api.*.str_appendall.?(p, zIn); | ||
| 697 | } | ||
| 698 | pub export fn sqlite3_str_appendchar(p: ?*c.sqlite3_str, N: c_int, C: u8) void { | ||
| 699 | return sqlite3_api.*.str_appendchar.?(p, N, C); | ||
| 700 | } | ||
| 701 | pub export fn sqlite3_str_reset(p: ?*c.sqlite3_str) void { | ||
| 702 | return sqlite3_api.*.str_reset.?(p); | ||
| 703 | } | ||
| 704 | pub export fn sqlite3_str_errcode(p: ?*c.sqlite3_str) c_int { | ||
| 705 | return sqlite3_api.*.str_errcode.?(p); | ||
| 706 | } | ||
| 707 | pub export fn sqlite3_str_length(p: ?*c.sqlite3_str) c_int { | ||
| 708 | return sqlite3_api.*.str_length.?(p); | ||
| 709 | } | ||
| 710 | pub export fn sqlite3_str_value(p: ?*c.sqlite3_str) [*c]u8 { | ||
| 711 | return sqlite3_api.*.str_value.?(p); | ||
| 712 | } | ||
| 713 | pub export fn sqlite3_create_window_function( | ||
| 714 | db: ?*c.sqlite3, | ||
| 715 | zFunctionName: [*c]const u8, | ||
| 716 | nArg: c_int, | ||
| 717 | eTextRep: c_int, | ||
| 718 | pArg: ?*anyopaque, | ||
| 719 | xStep: ?fn (?*c.sqlite3_context, c_int, [*c]?*c.sqlite3_value) callconv(.C) void, | ||
| 720 | xFinal: ?fn (?*c.sqlite3_context) callconv(.C) void, | ||
| 721 | xValue: ?fn (?*c.sqlite3_context) callconv(.C) void, | ||
| 722 | xInverse: ?fn (?*c.sqlite3_context, c_int, [*c]?*c.sqlite3_value) callconv(.C) void, | ||
| 723 | xDestroy: ?fn (?*anyopaque) callconv(.C) void, | ||
| 724 | ) c_int { | ||
| 725 | return sqlite3_api.*.create_window_function.?( | ||
| 726 | db, | ||
| 727 | zFunctionName, | ||
| 728 | nArg, | ||
| 729 | eTextRep, | ||
| 730 | pArg, | ||
| 731 | xStep, | ||
| 732 | xFinal, | ||
| 733 | xValue, | ||
| 734 | xInverse, | ||
| 735 | xDestroy, | ||
| 736 | ); | ||
| 737 | } | ||
| 738 | pub export fn sqlite3_stmt_isexplain(pStmt: ?*c.sqlite3_stmt) c_int { | ||
| 739 | return sqlite3_api.*.stmt_isexplain.?(pStmt); | ||
| 740 | } | ||
| 741 | pub export fn sqlite3_value_frombind(pVal: ?*c.sqlite3_value) c_int { | ||
| 742 | return sqlite3_api.*.value_frombind.?(pVal); | ||
| 743 | } | ||
| 744 | pub export fn sqlite3_drop_modules(db: ?*c.sqlite3, azKeep: [*c][*c]const u8) c_int { | ||
| 745 | return sqlite3_api.*.drop_modules.?(db, azKeep); | ||
| 746 | } | ||
| 747 | pub export fn sqlite3_hard_heap_limit64(N: c.sqlite3_int64) c.sqlite3_int64 { | ||
| 748 | return sqlite3_api.*.hard_heap_limit64.?(N); | ||
| 749 | } | ||
| 750 | pub export fn sqlite3_uri_key(zFilename: [*c]const u8, N: c_int) [*c]const u8 { | ||
| 751 | return sqlite3_api.*.uri_key.?(zFilename, N); | ||
| 752 | } | ||
| 753 | pub export fn sqlite3_filename_database(zFilename: [*c]const u8) [*c]const u8 { | ||
| 754 | return sqlite3_api.*.filename_database.?(zFilename); | ||
| 755 | } | ||
| 756 | pub export fn sqlite3_filename_journal(zFilename: [*c]const u8) [*c]const u8 { | ||
| 757 | return sqlite3_api.*.filename_journal.?(zFilename); | ||
| 758 | } | ||
| 759 | pub export fn sqlite3_filename_wal(zFilename: [*c]const u8) [*c]const u8 { | ||
| 760 | return sqlite3_api.*.filename_wal.?(zFilename); | ||
| 761 | } | ||
| 762 | pub export fn sqlite3_create_filename(zDatabase: [*c]const u8, zJournal: [*c]const u8, zWal: [*c]const u8, nParam: c_int, azParam: [*c][*c]const u8) [*c]u8 { | ||
| 763 | return sqlite3_api.*.create_filename.?(zDatabase, zJournal, zWal, nParam, azParam); | ||
| 764 | } | ||
| 765 | pub export fn sqlite3_free_filename(p: [*c]u8) void { | ||
| 766 | return sqlite3_api.*.free_filename.?(p); | ||
| 767 | } | ||
| 768 | pub export fn sqlite3_database_file_object(zName: [*c]const u8) [*c]c.sqlite3_file { | ||
| 769 | return sqlite3_api.*.database_file_object.?(zName); | ||
| 770 | } | ||
| 771 | pub export fn sqlite3_txn_state(db: ?*c.sqlite3, zSchema: [*c]const u8) c_int { | ||
| 772 | return sqlite3_api.*.txn_state.?(db, zSchema); | ||
| 773 | } | ||
| 774 | pub export fn sqlite3_changes64(db: ?*c.sqlite3) c.sqlite3_int64 { | ||
| 775 | return sqlite3_api.*.changes64.?(db); | ||
| 776 | } | ||
| 777 | pub export fn sqlite3_total_changes64(db: ?*c.sqlite3) c.sqlite3_int64 { | ||
| 778 | return sqlite3_api.*.total_changes64.?(db); | ||
| 779 | } | ||
| 780 | pub export fn sqlite3_autovacuum_pages(db: ?*c.sqlite3, xCallback: ?fn (?*anyopaque, [*c]const u8, c_uint, c_uint, c_uint) callconv(.C) c_uint, pArg: ?*anyopaque, xDestructor: ?fn (?*anyopaque) callconv(.C) void) c_int { | ||
| 781 | return sqlite3_api.*.autovacuum_pages.?(db, xCallback, pArg, xDestructor); | ||
| 782 | } | ||
| 783 | pub export fn sqlite3_error_offset(db: ?*c.sqlite3) c_int { | ||
| 784 | return sqlite3_api.*.error_offset.?(db); | ||
| 785 | } | ||
| 786 | pub export fn sqlite3_vtab_rhs_value(pIdxInfo: [*c]c.sqlite3_index_info, iCons: c_int, ppVal: [*c]?*c.sqlite3_value) c_int { | ||
| 787 | return sqlite3_api.*.vtab_rhs_value.?(pIdxInfo, iCons, ppVal); | ||
| 788 | } | ||
| 789 | pub export fn sqlite3_vtab_distinct(pIdxInfo: [*c]c.sqlite3_index_info) c_int { | ||
| 790 | return sqlite3_api.*.vtab_distinct.?(pIdxInfo); | ||
| 791 | } | ||
| 792 | pub export fn sqlite3_vtab_in(pIdxInfo: [*c]c.sqlite3_index_info, iCons: c_int, bHandle: c_int) c_int { | ||
| 793 | return sqlite3_api.*.vtab_in.?(pIdxInfo, iCons, bHandle); | ||
| 794 | } | ||
| 795 | pub export fn sqlite3_vtab_in_first(pVal: ?*c.sqlite3_value, ppOut: [*c]?*c.sqlite3_value) c_int { | ||
| 796 | return sqlite3_api.*.vtab_in_first.?(pVal, ppOut); | ||
| 797 | } | ||
| 798 | pub export fn sqlite3_vtab_in_next(pVal: ?*c.sqlite3_value, ppOut: [*c]?*c.sqlite3_value) c_int { | ||
| 799 | return sqlite3_api.*.vtab_in_next.?(pVal, ppOut); | ||
| 800 | } | ||
| 801 | pub export fn sqlite3_deserialize(db: ?*c.sqlite3, zSchema: [*c]const u8, pData: [*c]u8, szDb: c.sqlite3_int64, szBuf: c.sqlite3_int64, mFlags: c_uint) c_int { | ||
| 802 | return sqlite3_api.*.deserialize.?(db, zSchema, pData, szDb, szBuf, mFlags); | ||
| 803 | } | ||
| 804 | pub export fn sqlite3_serialize(db: ?*c.sqlite3, zSchema: [*c]const u8, piSize: [*c]c.sqlite3_int64, mFlags: c_uint) [*c]u8 { | ||
| 805 | return sqlite3_api.*.serialize.?(db, zSchema, piSize, mFlags); | ||
| 806 | } | ||
| 807 | pub export fn sqlite3_db_name(db: ?*c.sqlite3, N: c_int) [*c]const u8 { | ||
| 808 | return sqlite3_api.*.db_name.?(db, N); | ||
| 809 | } | ||