示例#1
0
// UserData returns the user data for functions.
// (See http://sqlite.org/c3ref/user_data.html)
func (c *FunctionContext) UserData() interface{} {
	udf := (*sqliteFunction)(C.sqlite3_user_data(c.sc))
	return udf.pApp
}
示例#2
0
//export doneTrampoline
func doneTrampoline(ctx *C.sqlite3_context) {
	handle := uintptr(C.sqlite3_user_data(ctx))
	ai := lookupHandle(handle).(*aggInfo)
	ai.Done(ctx)
}
示例#3
0
//export stepTrampoline
func stepTrampoline(ctx *C.sqlite3_context, argc C.int, argv **C.sqlite3_value) {
	args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:int(argc):int(argc)]
	ai := lookupHandle(uintptr(C.sqlite3_user_data(ctx))).(*aggInfo)
	ai.Step(ctx, args)
}
示例#4
0
//export callbackTrampoline
func callbackTrampoline(ctx *C.sqlite3_context, argc int, argv **C.sqlite3_value) {
	args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc]
	fi := lookupHandle(uintptr(C.sqlite3_user_data(ctx))).(*functionInfo)
	fi.Call(ctx, args)
}
示例#5
0
//export doneTrampoline
func doneTrampoline(ctx *C.sqlite3_context) {
	ai := (*aggInfo)(unsafe.Pointer(C.sqlite3_user_data(ctx)))
	ai.Done(ctx)
}
示例#6
0
//export stepTrampoline
func stepTrampoline(ctx *C.sqlite3_context, argc int, argv **C.sqlite3_value) {
	args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc]
	ai := (*aggInfo)(unsafe.Pointer(C.sqlite3_user_data(ctx)))
	ai.Step(ctx, args)
}