From e30f9ffa3a5542b36b683f75e443b0598b33813b Mon Sep 17 00:00:00 2001 From: Grzegorz MarszaƂek Date: Sat, 25 Aug 2018 20:25:16 +0200 Subject: implementation of set_authorizer interface --- callback.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'callback.go') diff --git a/callback.go b/callback.go index 5a735c0..2c68973 100644 --- a/callback.go +++ b/callback.go @@ -77,6 +77,12 @@ func updateHookTrampoline(handle uintptr, op int, db *C.char, table *C.char, row callback(op, C.GoString(db), C.GoString(table), rowid) } +//export authorizerTrampoline +func authorizerTrampoline(handle uintptr, op int, arg1 *C.char, arg2 *C.char, arg3 *C.char) int { + callback := lookupHandle(handle).(func(int, string, string, string) int) + return callback(op, C.GoString(arg1), C.GoString(arg2), C.GoString(arg3)) +} + // Use handles to avoid passing Go pointers to C. type handleVal struct { -- cgit v1.2.3