JunkBox_Lib++ (for Windows) 1.10.1
Loading...
Searching...
No Matches
bdb_tool.h
Go to the documentation of this file.
1#ifndef __JBXL_BERKELEY_DB4_H__
2#define __JBXL_BERKELEY_DB4_H__
3
17#include "tlist.h"
18
19//
20#ifdef DISABLE_BERKELEYDB
21 #ifdef ENABLE_BERKELEYDB
22 #undef ENABLE_BERKELEYDB
23 #endif
24#endif
25
26//
27#ifdef ENABLE_BERKELEYDB
28 #ifndef HAVE_DB_H
29 #ifndef DISABLE_BERKELEYDB
30 #define DISABLE_BERKELEYDB
31 #endif
32 #undef ENABLE_BERKELEYDB
33 #endif
34#endif
35
36
37//
38#ifdef ENABLE_BERKELEYDB
39
40
41#if ! defined (HAVE_DB_H) && ! defined (HAVE_LIBDB_4_2)
42 #error fdb.h needs Berkley
43#endif
44
45
46#define DB_DBM_HSEARCH 1
47#include <db.h>
48
49#include <fcntl.h>
50
51
53//
54DB* open_fdb(char* fname, unsigned int mode);
55void close_fdb(DB** dp);
56
57#define flush_fdb(d) (d)->sync((d), 0)
58
59int set_fdb_data(DB* dp, Buffer id, Buffer dbdata);
60int del_fdb_data(DB* dp, Buffer id);
61Buffer get_fdb_data(DB* dp, Buffer id);
62
63
65// for file
66int check_fdb_file(char* fname);
67int set_fdb_data_file(char* fname, Buffer id, Buffer dbdata);
68int del_fdb_data_file(char* fname, Buffer id);
69Buffer get_fdb_data_file(char* fname, Buffer id);
70
71
73//
74tList* get_all_fdb_data(DB* dp);
75tList* get_all_fdb_data_file(char* fname);
76
77
78#endif // ENABLE_BERKELEYDB
79
80#endif // __JBXL_BERKELEY_DB4_H__
81
Tiny List 構造ライブラリヘッダ