aboutsummaryrefslogtreecommitdiff
path: root/callback.go
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2018-09-11 09:39:02 +0900
committerGitHub <noreply@github.com>2018-09-11 09:39:02 +0900
commit0eec847b70cde89021ef4884356f1189d3e8401c (patch)
tree1d1805988ed6fe617c3c78f533385ef02479fdc7 /callback.go
parentMerge pull request #621 from AndrewMurrell/master (diff)
parentclearer const formatting (diff)
downloadgolite-0eec847b70cde89021ef4884356f1189d3e8401c.tar.gz
golite-0eec847b70cde89021ef4884356f1189d3e8401c.tar.xz
Merge pull request #623 from graf0/feature/#619
implementation of set_authorizer interface
Diffstat (limited to 'callback.go')
-rw-r--r--callback.go6
1 files changed, 6 insertions, 0 deletions
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 {