Commit d251084b authored by gwenn's avatar gwenn

Fix signature of the BusyHandler and ProgressHandler callbacks.

parent ddcc9654
......@@ -187,8 +187,9 @@ func (c *Conn) SetAuthorizer(f Authorizer, udp interface{}) error {
return c.error(C.goSqlite3SetAuthorizer(c.db, unsafe.Pointer(c.authorizer)))
}
// Returns true to try again.
// See Conn.BusyHandler
type BusyHandler func(udp interface{}, count int) int
type BusyHandler func(udp interface{}, count int) bool
type sqliteBusyHandler struct {
f BusyHandler
......@@ -199,7 +200,7 @@ type sqliteBusyHandler struct {
func goXBusy(udp unsafe.Pointer, count C.int) C.int {
arg := (*sqliteBusyHandler)(udp)
result := arg.f(arg.udp, int(count))
return C.int(result)
return btocint(result)
}
// Register a callback to handle SQLITE_BUSY errors
......@@ -215,9 +216,9 @@ func (c *Conn) BusyHandler(f BusyHandler, udp interface{}) error {
return c.error(C.goSqlite3BusyHandler(c.db, unsafe.Pointer(c.busyHandler)))
}
// Returns non-zero to interrupt.
// Returns true to interrupt.
// See Conn.ProgressHandler
type ProgressHandler func(udp interface{}) int
type ProgressHandler func(udp interface{}) bool
type sqliteProgressHandler struct {
f ProgressHandler
......@@ -228,7 +229,7 @@ type sqliteProgressHandler struct {
func goXProgress(udp unsafe.Pointer) C.int {
arg := (*sqliteProgressHandler)(udp)
result := arg.f(arg.udp)
return C.int(result)
return btocint(result)
}
// Query progress callbacks
......
......@@ -23,9 +23,9 @@ func profile(d interface{}, sql string, nanoseconds uint64) {
//fmt.Printf("%s: %s = %d\n", d, sql, nanoseconds/1000)
}
func progressHandler(d interface{}) int {
func progressHandler(d interface{}) bool {
//fmt.Print("+")
return 0
return false
}
func commitHook(d interface{}) int {
......
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