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