LMDB
lmdb.h
Go to the documentation of this file.
1 
159 #ifndef _LMDB_H_
160 #define _LMDB_H_
161 
162 #include <sys/types.h>
163 
164 #ifdef __cplusplus
165 extern "C" {
166 #endif
167 
169 #ifdef _MSC_VER
170 typedef int mdb_mode_t;
171 #else
172 typedef mode_t mdb_mode_t;
173 #endif
174 
179 #ifdef _WIN32
180 typedef void *mdb_filehandle_t;
181 #else
182 typedef int mdb_filehandle_t;
183 #endif
184 
193 #define MDB_VERSION_MAJOR 0
194 
195 #define MDB_VERSION_MINOR 9
196 
197 #define MDB_VERSION_PATCH 18
198 
200 #define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c))
201 
203 #define MDB_VERSION_FULL \
204  MDB_VERINT(MDB_VERSION_MAJOR,MDB_VERSION_MINOR,MDB_VERSION_PATCH)
205 
207 #define MDB_VERSION_DATE "February 5, 2016"
208 
210 #define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")"
211 
213 #define MDB_VERFOO(a,b,c,d) MDB_VERSTR(a,b,c,d)
214 
216 #define MDB_VERSION_STRING \
217  MDB_VERFOO(MDB_VERSION_MAJOR,MDB_VERSION_MINOR,MDB_VERSION_PATCH,MDB_VERSION_DATE)
218 
225 typedef struct MDB_env MDB_env;
226 
232 typedef struct MDB_txn MDB_txn;
233 
235 typedef unsigned int MDB_dbi;
236 
238 typedef struct MDB_cursor MDB_cursor;
239 
251 typedef struct MDB_val {
252  size_t mv_size;
253  void *mv_data;
254 } MDB_val;
255 
257 typedef int (MDB_cmp_func)(const MDB_val *a, const MDB_val *b);
258 
273 typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *relctx);
274 
279 #define MDB_FIXEDMAP 0x01
280 
281 #define MDB_NOSUBDIR 0x4000
282 
283 #define MDB_NOSYNC 0x10000
284 
285 #define MDB_RDONLY 0x20000
286 
287 #define MDB_NOMETASYNC 0x40000
288 
289 #define MDB_WRITEMAP 0x80000
290 
291 #define MDB_MAPASYNC 0x100000
292 
293 #define MDB_NOTLS 0x200000
294 
295 #define MDB_NOLOCK 0x400000
296 
297 #define MDB_NORDAHEAD 0x800000
298 
299 #define MDB_NOMEMINIT 0x1000000
300 
306 #define MDB_REVERSEKEY 0x02
307 
308 #define MDB_DUPSORT 0x04
309 
311 #define MDB_INTEGERKEY 0x08
312 
313 #define MDB_DUPFIXED 0x10
314 
315 #define MDB_INTEGERDUP 0x20
316 
317 #define MDB_REVERSEDUP 0x40
318 
319 #define MDB_CREATE 0x40000
320 
326 #define MDB_NOOVERWRITE 0x10
327 
331 #define MDB_NODUPDATA 0x20
332 
333 #define MDB_CURRENT 0x40
334 
337 #define MDB_RESERVE 0x10000
338 
339 #define MDB_APPEND 0x20000
340 
341 #define MDB_APPENDDUP 0x40000
342 
343 #define MDB_MULTIPLE 0x80000
344 /* @} */
345 
352 #define MDB_CP_COMPACT 0x01
353 /* @} */
354 
360 typedef enum MDB_cursor_op {