Exemplo n.º 1
0
//export prescan_cb
func prescan_cb(fd C.int, ftype *C.char, context unsafe.Pointer) C.cl_error_t {
	v := callbackFuncs["prescan"]
	if v == nil {
		return Clean
	}
	ctx := findContext(uintptr(context))
	return C.cl_error_t(v.(CallbackPreScan)(int(fd), C.GoString(ftype), ctx))
}
Exemplo n.º 2
0
//export postscan_cb
func postscan_cb(fd, result C.int, virname *C.char, context unsafe.Pointer) C.cl_error_t {
	v := callbackFuncs["postscan"]
	if v == nil {
		return Clean
	}
	ctx := findContext(uintptr(context))
	return C.cl_error_t(v.(CallbackPostScan)(int(fd), ErrorCode(result), C.GoString(virname), ctx))
}
Exemplo n.º 3
0
//export precache_cb
func precache_cb(fd C.int, ftype *C.char, context unsafe.Pointer) C.cl_error_t {
	fn := callbackFuncs["precache"]
	if fn == nil {
		return Clean
	}
	ctx := findContext(uintptr(context))
	return C.cl_error_t(fn.(CallbackPreCache)(int(fd), C.GoString(ftype), ctx))
}