]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/proto-bdb.h
1f4daa3fd51b32055130afd81139659aee1b575f
[openldap] / servers / slapd / back-bdb / proto-bdb.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 2000 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7 #ifndef _PROTO_BDB_H
8 #define _PROTO_BDB_H
9
10 LDAP_BEGIN_DECL
11
12 /*
13  * alias.c
14  */
15 Entry *bdb_deref_internal_r LDAP_P((
16         Backend *be,
17         Entry *e,
18         const char *dn,
19         int *err,
20         Entry **matched,
21         const char **text ));
22
23 #define deref_entry_r( be, e, err, matched, text ) \
24         bdb_deref_internal_r( be, e, NULL, err, matched, text )
25 #define deref_dn_r( be, dn, err, matched, text ) \
26         bdb_deref_internal_r( be, NULL, dn, err, matched, text)
27
28 /*
29  * dn2entry.c
30  */
31 int bdb_dn2entry LDAP_P(( Backend *be, DB_TXN *tid,
32         const char *dn, Entry **e, Entry **matched, int flags ));
33
34 #define dn2entry_r(be, tid, dn, p, m) \
35         bdb_dn2entry((be), (tid), (dn), (p), (m), 0 )
36
37 #define dn2entry_w(be, tid, dn, p, m) \
38         bdb_dn2entry((be), (tid), (dn), (p), (m), DB_RMW )
39
40 /*
41  * dn2id.c
42  */
43 int bdb_dn2id(
44         BackendDB *be,
45         DB_TXN *tid,
46         const char *dn,
47         ID *id );
48
49 int bdb_dn2id_matched(
50         BackendDB *be,
51         DB_TXN *tid,
52         const char *dn,
53         ID *id,
54         char **matchedDN );
55
56 int bdb_dn2id_add(
57         BackendDB *be,
58         DB_TXN *tid,
59         const char *dn,
60         ID id );
61
62 int bdb_dn2id_delete(
63         BackendDB *be,
64         DB_TXN *tid,
65         const char *dn,
66         ID id );
67
68 int bdb_dn2id_children(
69         BackendDB *be,
70         DB_TXN *tid,
71         const char *dn );
72
73 /*
74  * entry.c
75  */
76 int bdb_entry_return( BackendDB *be, Entry *e );
77
78 /*
79  * error.c
80  */
81 void bdb_errcall( const char *pfx, char * msg );
82
83 /*
84  * id2entry
85  */
86 int bdb_id2entry_add(
87         Backend *be,
88         DB_TXN *tid,
89         Entry *e );
90
91 int bdb_id2entry_delete(
92         Backend *be,
93         DB_TXN *tid,
94         ID id );
95
96 int bdb_id2entry(
97         Backend *be,
98         DB_TXN *tid,
99         ID id,
100         Entry **e );
101
102 /*
103  * idl.c
104  */
105 int bdb_idl_search( ID *ids, ID id );
106
107 int bdb_idl_insert_key(
108         BackendDB *be,
109         DB *db,
110         DB_TXN *txn,
111         DBT *key,
112         ID id );
113
114 int bdb_idl_delete_key(
115         BackendDB *be,
116         DB *db,
117         DB_TXN *txn,
118         DBT *key,
119         ID id );
120
121 /*
122  * nextid.c
123  */
124 int bdb_next_id( BackendDB *be, DB_TXN *tid, ID *id );
125
126 /*
127  * tools.c
128  */
129 int bdb_tool_entry_open( BackendDB *be, int mode );
130 int bdb_tool_entry_close( BackendDB *be );
131 ID bdb_tool_entry_next( BackendDB *be );
132 Entry* bdb_tool_entry_get( BackendDB *be, ID id );
133 ID bdb_tool_entry_put( BackendDB *be, Entry *e );
134
135
136 LDAP_END_DECL
137
138 #endif /* _PROTO_BDB_H */