Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Linux-x64/libsqlite3.so
Binary file not shown.
Binary file added OSX-x64/libsqlite3.dylib
Binary file not shown.
16 changes: 14 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
local ffi = require "ffi"
local bit = require "bit"

local lib = require('ffi-loader')(module.dir, "sqlite3.h")
local sqlite3 = nil
--------------------------------------------------------------------------------
local so_names = {
['Linux-x64'] = 'libsqlite3.so',
['OSX-x64'] = 'libsqlite3.dylib',
}

ffi.cdef( module:load('sqlite3.h') )
local arch = ffi.os .. '-' .. ffi.arch
module:action( arch .. '/' .. so_names[arch], function(path)
sqlite3 = ffi.load( path )
end)

--local sqlite3 = ffi.load("sqlite3")

local sqlite3 = ffi.load("sqlite3")
local new_db_ptr = ffi.typeof("sqlite3*[1]")
local new_stmt_ptr = ffi.typeof("sqlite3_stmt*[1]")
--local new_exec_ptr = ffi.typeof("int (*)(void*,int,char**,char**)")
Expand Down