forked from gfphoenix/unqlite
/
callback.c
35 lines (32 loc) · 993 Bytes
/
callback.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <_cgo_export.h>
#include "callback.h"
int cArrayWalk(unqlite_value *a, unqlite_value *b, void *fn)
{
return goArrayWalk(a,b,fn);
}
int cKvFetchCallback(const void *a, unsigned int b, void *fn)
{
void *aa = (void *)a;
return goKvFetchCallback(aa, b, fn);
}
int cKvCursorCallback(const void *key, unsigned int len, void *fn)
{
void *kk = (void *)key;
return goKvCursorCallback(kk, len, fn);
}
int unqlite_array_walk_CB(unqlite_value *arr, void *fn)
{
return unqlite_array_walk(arr, cArrayWalk, fn);
}
int unqlite_kv_fetch_callback_CB(unqlite *pDb, const void *key, int nKeyLen, void *fn)
{
return unqlite_kv_fetch_callback(pDb, key, nKeyLen, cKvFetchCallback, fn);
}
int unqlite_kv_cursor_key_callback_CB(unqlite_kv_cursor *c, void *fn)
{
return unqlite_kv_cursor_key_callback(c, cKvCursorCallback, fn);
}
int unqlite_kv_cursor_data_callback_CB(unqlite_kv_cursor *c, void *fn)
{
return unqlite_kv_cursor_data_callback(c, cKvCursorCallback, fn);
}