Debian Codegraph @

lmdb/lmdbgo.h

raw symbols SCIP
1 /* lmdbgo.h
2 * Helper utilities for github.com/bmatsuo/lmdb-go/lmdb. These functions have
3 * no compatibility guarantees and may be modified or deleted without warning.
4 * */
5 #ifndef _LMDBGO_H_
6 #define _LMDBGO_H_
7
8 #include "lmdb.h"
9
10 /* Proxy functions for lmdb get/put operations. The functions are defined to
11 * take char* values instead of void* to keep cgo from cheking their data for
12 * nested pointers and causing a couple of allocations per argument.
13 *
14 * For more information see github issues for more information about the
15 * problem and the decision.
16 * https://github.com/golang/go/issues/14387
17 * https://github.com/golang/go/issues/15048
18 * https://github.com/bmatsuo/lmdb-go/issues/63
19 * */
20 int lmdbgo_mdb_del(MDB_txn *txn, MDB_dbi dbi, char *kdata, size_t kn, char *vdata, size_t vn);
21 int lmdbgo_mdb_get(MDB_txn *txn, MDB_dbi dbi, char *kdata, size_t kn, MDB_val *val);
22 int lmdbgo_mdb_put1(MDB_txn *txn, MDB_dbi dbi, char *kdata, size_t kn, MDB_val *val, unsigned int flags);
23 int lmdbgo_mdb_put2(MDB_txn *txn, MDB_dbi dbi, char *kdata, size_t kn, char *vdata, size_t vn, unsigned int flags);
24 int lmdbgo_mdb_cursor_put1(MDB_cursor *cur, char *kdata, size_t kn, MDB_val *val, unsigned int flags);
25 int lmdbgo_mdb_cursor_put2(MDB_cursor *cur, char *kdata, size_t kn, char *vdata, size_t vn, unsigned int flags);
26 int lmdbgo_mdb_cursor_putmulti(MDB_cursor *cur, char *kdata, size_t kn, char *vdata, size_t vn, size_t vstride, unsigned int flags);
27 int lmdbgo_mdb_cursor_get1(MDB_cursor *cur, char *kdata, size_t kn, MDB_val *key, MDB_val *val, MDB_cursor_op op);
28 int lmdbgo_mdb_cursor_get2(MDB_cursor *cur, char *kdata, size_t kn, char *vdata, size_t vn, MDB_val *key, MDB_val *val, MDB_cursor_op op);
29
30 /* ConstCString wraps a null-terminated (const char *) because Go's type system
31 * does not represent the 'cosnt' qualifier directly on a function argument and
32 * causes warnings to be emitted during linking.
33 * */
34 typedef struct{ const char *p; } lmdbgo_ConstCString;
35
36 /* lmdbgo_mdb_reader_list is a proxy for mdb_reader_list that uses a special
37 * mdb_msg_func proxy function to relay messages over the
38 * lmdbgo_mdb_reader_list_bridge external Go func.
39 * */
40 int lmdbgo_mdb_reader_list(MDB_env *env, size_t ctx);
41
42 #endif