Commit f67df844 authored by gwenn's avatar gwenn

Fix CommitHook return type.

parent 2e131839
...@@ -17,7 +17,8 @@ import ( ...@@ -17,7 +17,8 @@ import (
"unsafe" "unsafe"
) )
type CommitHook func(udp interface{}) int // If the callback on a commit hook function returns true, then the commit is converted into a rollback.
type CommitHook func(udp interface{}) bool
type sqliteCommitHook struct { type sqliteCommitHook struct {
f CommitHook f CommitHook
...@@ -27,7 +28,7 @@ type sqliteCommitHook struct { ...@@ -27,7 +28,7 @@ type sqliteCommitHook struct {
//export goXCommitHook //export goXCommitHook
func goXCommitHook(udp unsafe.Pointer) C.int { func goXCommitHook(udp unsafe.Pointer) C.int {
arg := (*sqliteCommitHook)(udp) arg := (*sqliteCommitHook)(udp)
return C.int(arg.f(arg.udp)) return btocint(arg.f(arg.udp))
} }
// Commit notification callback // Commit notification callback
......
...@@ -28,9 +28,9 @@ func progressHandler(d interface{}) bool { ...@@ -28,9 +28,9 @@ func progressHandler(d interface{}) bool {
return false return false
} }
func commitHook(d interface{}) int { func commitHook(d interface{}) bool {
fmt.Printf("%s\n", d) fmt.Printf("%s\n", d)
return 0 return false
} }
func rollbackHook(d interface{}) { func rollbackHook(d interface{}) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment