]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/proto-bdb.h
An incremental step.
[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 LDAP_P(( struct bdb_info *bdb,
33         const char *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  * dn2entry.c
44  */
45 int bdb_dn2entry LDAP_P(( BackendDB *be, DB_TXN *tid,
46         const char *dn, Entry **e, Entry **matched, int flags ));
47
48 /*
49  * dn2id.c
50  */
51 int bdb_dn2id(
52         BackendDB *be,
53         DB_TXN *tid,
54         const char *dn,
55         ID *id );
56
57 int bdb_dn2id_matched(
58         BackendDB *be,
59         DB_TXN *tid,
60         const char *dn,
61         ID *id,
62         char **matchedDN );
63
64 int bdb_dn2id_add(
65         BackendDB *be,
66         DB_TXN *tid,
67         const char *dn,
68         ID id );
69
70 int bdb_dn2id_delete(
71         BackendDB *be,
72         DB_TXN *tid,
73         const char *dn,
74         ID id );
75
76 int bdb_dn2id_children(
77         BackendDB *be,
78         DB_TXN *tid,
79         const char *dn );
80
81 int
82 bdb_dn2idl(
83         BackendDB       *be,
84         const char      *dn,
85         int prefix,
86         ID *ids );
87
88 /*
89  * entry.c
90  */
91 int bdb_entry_return( BackendDB *be, Entry *e );
92
93 /*
94  * error.c
95  */
96 void bdb_errcall( const char *pfx, char * msg );
97
98 /*
99  * filterentry.c
100  */
101 int bdb_filter_candidates(
102         Backend *be,
103         ID *range,
104         Filter  *f,
105         ID *ids );
106
107 /*
108  * id2entry
109  */
110 int bdb_id2entry_add(
111         BackendDB *be,
112         DB_TXN *tid,
113         Entry *e );
114
115 int bdb_id2entry_update(
116         BackendDB *be,
117         DB_TXN *tid,
118         Entry *e );
119
120 int bdb_id2entry_delete(
121         BackendDB *be,
122         DB_TXN *tid,
123         ID id );
124
125 int bdb_id2entry(
126         BackendDB *be,
127         DB_TXN *tid,
128         ID id,
129         Entry **e );
130
131 /*
132  * idl.c
133  */
134 unsigned bdb_idl_search( ID *ids, ID id );
135
136 int bdb_idl_insert_key(
137         BackendDB *be,
138         DB *db,
139         DB_TXN *txn,
140         DBT *key,
141         ID id );
142
143 int bdb_idl_delete_key(
144         BackendDB *be,
145         DB *db,
146         DB_TXN *txn,
147         DBT *key,
148         ID id );
149
150 int
151 bdb_idl_notin(
152     ID  *a,
153     ID  *b,
154         ID      *ids );
155
156 int
157 bdb_idl_intersection(
158         ID *a,
159         ID *b,
160         ID *ids );
161
162 int
163 bdb_idl_union(
164         ID *a,
165         ID *b,
166         ID *ids );
167
168 ID bdb_idl_first( ID *ids, ID *cursor );
169 ID bdb_idl_next( ID *ids, ID *cursor );
170
171
172 /*
173  * index.c
174  */
175 extern int
176 bdb_index_param(
177         Backend *be,
178         AttributeDescription *desc,
179         int ftype,
180         DB **db,
181         slap_mask_t *mask,
182         struct berval **prefix );
183         
184 /*
185  * key.c
186  */
187 extern int
188 bdb_key_read(
189     Backend     *be,
190         DB *db,
191     struct berval *k,
192         ID *ids );
193         
194 /*
195  * nextid.c
196  */
197 int bdb_next_id( BackendDB *be, DB_TXN *tid, ID *id );
198 int bdb_last_id( BackendDB *be, DB_TXN *tid );
199
200 /*
201  * modify.c
202  */
203 int bdb_modify_internal(
204         BackendDB *be,
205         Connection *conn,
206         Operation *op,
207         DB_TXN *tid,
208         Modifications *modlist,
209         Entry *e,
210         const char **text,
211         char *textbuf,
212         size_t textlen );
213
214 /*
215  * passwd.c
216  */
217 int
218 bdb_exop_passwd(
219         Backend         *be,
220         Connection              *conn,
221         Operation               *op,
222         const char              *reqoid,
223         struct berval   *reqdata,
224         char                    **rspoid,
225         struct berval   **rspdata,
226         LDAPControl             *** rspctrls,
227         const char              **text,
228         struct berval   *** refs );
229
230 /*
231  * tools.c
232  */
233 int bdb_tool_entry_open( BackendDB *be, int mode );
234 int bdb_tool_entry_close( BackendDB *be );
235 ID bdb_tool_entry_next( BackendDB *be );
236 Entry* bdb_tool_entry_get( BackendDB *be, ID id );
237 ID bdb_tool_entry_put( BackendDB *be, Entry *e );
238 int bdb_tool_entry_reindex( BackendDB *be, ID id );
239
240
241 LDAP_END_DECL
242
243 #endif /* _PROTO_BDB_H */