]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/proto-bdb.h
4fd1c3f02a9d04b8cd9a84bd56faf2c32c369b9c
[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         BackendDB *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  * attr.c
30  */
31
32 void bdb_attr_mask( struct bdb_info *bdb,
33         AttributeDescription *desc,
34         slap_mask_t *indexmask );
35
36 int bdb_attr_index_config LDAP_P(( struct bdb_info *bdb,
37         const char *fname, int lineno,
38         int argc, char **argv ));
39
40 void bdb_attr_index_destroy LDAP_P(( Avlnode *tree ));
41
42 /*
43  * attribute.c
44  */
45
46 int
47 bdb_attribute LDAP_P(( Backend *be, Connection *conn, Operation *op,
48         Entry *target, const char *e_ndn, AttributeDescription *entry_at,
49         struct berval ***vals ));
50
51 /*
52  * dbcache.c
53  */
54 int
55 bdb_db_cache(
56     Backend     *be,
57     const char *name,
58         DB **db );
59
60 /*
61  * dn2entry.c
62  */
63 int bdb_dn2entry LDAP_P(( BackendDB *be, DB_TXN *tid,
64         const char *dn, Entry **e, Entry **matched, int flags ));
65
66 /*
67  * dn2id.c
68  */
69 int bdb_dn2id(
70         BackendDB *be,
71         DB_TXN *tid,
72         const char *dn,
73         ID *id );
74
75 int bdb_dn2id_matched(
76         BackendDB *be,
77         DB_TXN *tid,
78         const char *dn,
79         ID *id,
80         char **matchedDN );
81
82 int bdb_dn2id_add(
83         BackendDB *be,
84         DB_TXN *tid,
85         const char *dn,
86         ID id );
87
88 int bdb_dn2id_delete(
89         BackendDB *be,
90         DB_TXN *tid,
91         const char *dn,
92         ID id );
93
94 int bdb_dn2id_children(
95         BackendDB *be,
96         DB_TXN *tid,
97         const char *dn );
98
99 int
100 bdb_dn2idl(
101         BackendDB       *be,
102         const char      *dn,
103         int prefix,
104         ID *ids );
105
106 /*
107  * entry.c
108  */
109 int bdb_entry_return( BackendDB *be, Entry *e );
110
111 /*
112  * error.c
113  */
114 void bdb_errcall( const char *pfx, char * msg );
115
116 /*
117  * filterentry.c
118  */
119 int bdb_filter_candidates(
120         Backend *be,
121         Filter  *f,
122         ID *ids );
123
124 /*
125  * group.c
126  */
127
128 int bdb_group(
129         Backend *be,
130         Connection *conn,
131         Operation *op,
132         Entry   *target,
133         const char      *gr_ndn,
134         const char      *op_ndn,
135         ObjectClass *group_oc,
136         AttributeDescription *group_at);
137
138 /*
139  * id2entry
140  */
141 int bdb_id2entry_add(
142         BackendDB *be,
143         DB_TXN *tid,
144         Entry *e );
145
146 int bdb_id2entry_update(
147         BackendDB *be,
148         DB_TXN *tid,
149         Entry *e );
150
151 int bdb_id2entry_delete(
152         BackendDB *be,
153         DB_TXN *tid,
154         ID id );
155
156 int bdb_id2entry(
157         BackendDB *be,
158         DB_TXN *tid,
159         ID id,
160         Entry **e );
161
162 /*
163  * idl.c
164  */
165 unsigned bdb_idl_search( ID *ids, ID id );
166
167 int bdb_idl_fetch_key(
168         BackendDB *be,
169         DB *db,
170         DB_TXN *txn,
171         DBT *key,
172         ID *ids );
173
174 int bdb_idl_insert_key(
175         BackendDB *be,
176         DB *db,
177         DB_TXN *txn,
178         DBT *key,
179         ID id );
180
181 int bdb_idl_delete_key(
182         BackendDB *be,
183         DB *db,
184         DB_TXN *txn,
185         DBT *key,
186         ID id );
187
188 int
189 bdb_idl_notin(
190     ID  *a,
191     ID  *b,
192         ID      *ids );
193
194 int
195 bdb_idl_intersection(
196         ID *a,
197         ID *b,
198         ID *ids );
199
200 int
201 bdb_idl_union(
202         ID *a,
203         ID *b,
204         ID *ids );
205
206 ID bdb_idl_first( ID *ids, ID *cursor );
207 ID bdb_idl_next( ID *ids, ID *cursor );
208
209
210 /*
211  * index.c
212  */
213 extern int
214 bdb_index_param LDAP_P((
215         Backend *be,
216         AttributeDescription *desc,
217         int ftype,
218         DB **db,
219         slap_mask_t *mask,
220         struct berval *prefix ));
221
222 extern int
223 bdb_index_values LDAP_P((
224         Backend *be,
225         DB_TXN *txn,
226         AttributeDescription *desc,
227         struct berval **vals,
228         ID id,
229         int op ));
230
231 int bdb_index_entry LDAP_P(( Backend *be, DB_TXN *t,
232         int r, Entry *e, Attribute *ap ));
233
234 #define bdb_index_entry_add(be,t,e,ap) \
235         bdb_index_entry((be),(t),SLAP_INDEX_ADD_OP,(e),(ap))
236 #define bdb_index_entry_del(be,t,e,ap) \
237         bdb_index_entry((be),(t),SLAP_INDEX_DELETE_OP,(e),(ap))
238
239 /*
240  * key.c
241  */
242 extern int
243 bdb_key_read(
244     Backend     *be,
245         DB *db,
246         DB_TXN *txn,
247     struct berval *k,
248         ID *ids );
249
250 extern int
251 bdb_key_change(
252     Backend      *be,
253     DB *db,
254         DB_TXN *txn,
255     struct berval *k,
256     ID id,
257     int op );
258         
259 /*
260  * nextid.c
261  */
262 int bdb_next_id( BackendDB *be, DB_TXN *tid, ID *id );
263 int bdb_last_id( BackendDB *be, DB_TXN *tid );
264
265 /*
266  * modify.c
267  */
268 int bdb_modify_internal(
269         BackendDB *be,
270         Connection *conn,
271         Operation *op,
272         DB_TXN *tid,
273         Modifications *modlist,
274         Entry *e,
275         const char **text,
276         char *textbuf,
277         size_t textlen );
278
279 /*
280  * passwd.c
281  */
282 int
283 bdb_exop_passwd(
284         Backend         *be,
285         Connection              *conn,
286         Operation               *op,
287         const char              *reqoid,
288         struct berval   *reqdata,
289         char                    **rspoid,
290         struct berval   **rspdata,
291         LDAPControl             *** rspctrls,
292         const char              **text,
293         struct berval   *** refs );
294
295 /*
296  * tools.c
297  */
298 int bdb_tool_entry_open( BackendDB *be, int mode );
299 int bdb_tool_entry_close( BackendDB *be );
300 ID bdb_tool_entry_next( BackendDB *be );
301 Entry* bdb_tool_entry_get( BackendDB *be, ID id );
302 ID bdb_tool_entry_put( BackendDB *be, Entry *e );
303 int bdb_tool_entry_reindex( BackendDB *be, ID id );
304
305
306 LDAP_END_DECL
307
308 #endif /* _PROTO_BDB_H */