]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/proto-bdb.h
e7a869ba4bbdfe3939ad7ba0fda345780580da0b
[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_insert_key(
106         BackendDB *be,
107         DB *db,
108         DB_TXN *txn,
109         DBT *key,
110         ID id );
111
112 int bdb_idl_delete_key(
113         BackendDB *be,
114         DB *db,
115         DB_TXN *txn,
116         DBT *key,
117         ID id );
118
119 /*
120  * nextid.c
121  */
122 int bdb_next_id( BackendDB *be, DB_TXN *tid, ID *id );
123
124 /*
125  * tools.c
126  */
127 int bdb_tool_entry_open( BackendDB *be, int mode );
128 int bdb_tool_entry_close( BackendDB *be );
129 ID bdb_tool_entry_next( BackendDB *be );
130 Entry* bdb_tool_entry_get( BackendDB *be, ID id );
131 ID bdb_tool_entry_put( BackendDB *be, Entry *e );
132
133
134 LDAP_END_DECL
135
136 #endif /* _PROTO_BDB_H */