mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 10:38:33 -04:00
refactor(odin): ported list command.
This commit is contained in:
34
sqlite/sqlite.odin
Normal file
34
sqlite/sqlite.odin
Normal file
@@ -0,0 +1,34 @@
|
||||
package sqlite
|
||||
|
||||
import "core:c"
|
||||
|
||||
foreign import lib "system:sqlite3"
|
||||
|
||||
OK :: 0
|
||||
ROW :: 100
|
||||
DONE :: 101
|
||||
|
||||
foreign lib {
|
||||
@(link_name="sqlite3_open")
|
||||
db_open :: proc(filename: cstring, ppDb: ^^rawptr) -> c.int ---
|
||||
@(link_name="sqlite3_close")
|
||||
db_close :: proc(db: ^rawptr) -> c.int ---
|
||||
@(link_name="sqlite3_errmsg")
|
||||
db_errmsg :: proc(db: ^rawptr) -> cstring ---
|
||||
@(link_name="sqlite3_exec")
|
||||
db_exec :: proc(db: ^rawptr, sql: cstring, callback: rawptr, callback_arg: rawptr, errmsg: ^cstring) -> c.int ---
|
||||
@(link_name="sqlite3_prepare_v2")
|
||||
prepare_v2 :: proc(db: ^rawptr, sql: cstring, nByte: c.int, ppStmt: ^^rawptr, pzTail: ^cstring) -> c.int ---
|
||||
@(link_name="sqlite3_step")
|
||||
step :: proc(stmt: ^rawptr) -> c.int ---
|
||||
@(link_name="sqlite3_finalize")
|
||||
finalize :: proc(stmt: ^rawptr) -> c.int ---
|
||||
@(link_name="sqlite3_column_text")
|
||||
column_text :: proc(stmt: ^rawptr, iCol: c.int) -> cstring ---
|
||||
@(link_name="sqlite3_column_bytes")
|
||||
column_bytes :: proc(stmt: ^rawptr, iCol: c.int) -> c.int ---
|
||||
@(link_name="sqlite3_bind_text")
|
||||
bind_text :: proc(stmt: ^rawptr, idx: c.int, val: cstring, n: c.int, destructor: rawptr) -> c.int ---
|
||||
@(link_name="sqlite3_changes")
|
||||
changes :: proc(db: ^rawptr) -> c.int ---
|
||||
}
|
||||
Reference in New Issue
Block a user