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