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