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