Blob


1 // This is free and unencumbered software released into the public domain.
2 //
3 // Anyone is free to copy, modify, publish, use, compile, sell, or
4 // distribute this software, either in source code form or as a compiled
5 // binary, for any purpose, commercial or non-commercial, and by any
6 // means.
7 //
8 // In jurisdictions that recognize copyright laws, the author or authors
9 // of this software dedicate any and all copyright interest in the
10 // software to the public domain. We make this dedication for the benefit
11 // of the public at large and to the detriment of our heirs and
12 // successors. We intend this dedication to be an overt act of
13 // relinquishment in perpetuity of all present and future rights to this
14 // software under copyright law.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 // OTHER DEALINGS IN THE SOFTWARE.
24 def sqlite_ok: int = 0;
25 def sqlite_row: int = 100;
26 def sqlite_done: int = 101;
28 export type sqlite_error = !void;
29 export type sqlite_internal = !void;
30 export type sqlite_perm = !void;
31 export type sqlite_abort = !void;
32 export type sqlite_busy = !void;
33 export type sqlite_locked = !void;
34 // ...
35 export type sqlite_unknown_error = !void;
37 export type error = !(sqlite_error | sqlite_internal | sqlite_perm |
38 sqlite_abort | sqlite_busy | sqlite_locked |
39 sqlite_unknown_error);
41 export fn strerror(err: error) str = {
42 return "";
43 };
45 fn code2err(code: int) error = {
46 switch (code) {
47 case 1 => return sqlite_error;
48 case => return sqlite_unknown_error;
49 };
50 };