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