]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb2/proto-back-bdb2.h
Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers.
[openldap] / servers / slapd / back-bdb2 / proto-back-bdb2.h
1 /* $OpenLDAP$ */
2 #ifndef _PROTO_BACK_BDB2
3 #define _PROTO_BACK_BDB2
4
5 #include <ldap_cdefs.h>
6
7 #include <ac/time.h>            /* Needed in add.c compare.c struct timeval */
8
9 #include "external.h"
10
11 LDAP_BEGIN_DECL
12
13 /*
14  * add.c
15  */
16 int bdb2i_release_add_lock LDAP_P(());
17
18 /*
19  * alias.c
20  */
21
22 Entry * bdb2i_deref_r LDAP_P((
23         Backend *be,
24         Entry *e,
25         char *dn,
26         int *err,
27         Entry **matched,
28         char **text ));
29
30 #define deref_entry_r( be, e, err, matched, text ) \
31         bdb2i_deref_r( be, e, NULL, err, matched, text )
32 #define deref_dn_r( be, dn, err, matched, text ) \
33         bdb2i_deref_r( be, NULL, dn, err, matched, text )
34
35 /*
36  * attr.c
37  */
38
39 void bdb2i_attr_masks LDAP_P(( struct ldbminfo *li, char *type, int *indexmask,
40  int *syntaxmask ));
41 void bdb2i_attr_index_config LDAP_P(( struct ldbminfo *li,
42  const char *fname,
43  int lineno, int argc, char **argv, int init ));
44
45 /*
46  * cache.c
47  */
48
49 int bdb2i_cache_add_entry_rw LDAP_P(( struct cache *cache, Entry *e, int rw ));
50 int bdb2i_cache_update_entry LDAP_P(( struct cache *cache, Entry *e ));
51 void bdb2i_cache_return_entry_rw LDAP_P(( struct cache *cache, Entry *e,
52  int rw ));
53 #define bdb2i_cache_return_entry_r(c, e) bdb2i_cache_return_entry_rw((c), (e), 0)
54 #define bdb2i_cache_return_entry_w(c, e) bdb2i_cache_return_entry_rw((c), (e), 1)
55
56 ID bdb2i_cache_find_entry_dn2id LDAP_P(( BackendDB *be, struct cache *cache,
57  const char *dn ));
58 Entry * bdb2i_cache_find_entry_id LDAP_P(( struct cache *cache, ID id, int rw ));
59 int bdb2i_cache_delete_entry LDAP_P(( struct cache *cache, Entry *e ));
60
61 /*
62  * dbcache.c
63  */
64
65 struct dbcache * bdb2i_cache_open LDAP_P(( BackendDB *be, char *name, char *suffix,
66  int flags ));
67 void bdb2i_cache_close LDAP_P(( BackendDB *be, struct dbcache *db ));
68 void bdb2i_cache_really_close LDAP_P(( BackendDB *be, struct dbcache *db ));
69 void bdb2i_cache_flush_all LDAP_P(( BackendDB *be ));
70 Datum bdb2i_cache_fetch LDAP_P(( struct dbcache *db, Datum key ));
71 int bdb2i_cache_store LDAP_P(( struct dbcache *db, Datum key, Datum data, int flags ));
72 int bdb2i_cache_delete LDAP_P(( struct dbcache *db, Datum key ));
73
74 /*
75  * dn2id.c
76  */
77
78 int bdb2i_dn2id_add LDAP_P(( BackendDB *be, const char *dn, ID id ));
79 ID bdb2i_dn2id LDAP_P(( BackendDB *be, const char *dn ));
80 int bdb2i_dn2id_delete LDAP_P(( BackendDB *be, const char *dn, ID id ));
81
82 ID_BLOCK *
83 bdb2i_dn2idl LDAP_P((
84     BackendDB   *be,
85     const char  *dn,
86         int     prefix ));
87
88 Entry * bdb2i_dn2entry_rw LDAP_P((
89         BackendDB *be,
90         const char *dn,
91         Entry **matched,
92         int rw ));
93
94 #define bdb2i_dn2entry_r(be, dn, m) bdb2i_dn2entry_rw((be), (dn), (m), 0)
95 #define bdb2i_dn2entry_w(be, dn, m) bdb2i_dn2entry_rw((be), (dn), (m), 1)
96
97 /*
98  * entry.c
99  */
100 int bdb2_back_entry_release_rw LDAP_P(( BackendDB *be, Entry *e, int rw ));
101
102 /*
103  * filterindex.c
104  */
105
106 ID_BLOCK * bdb2i_filter_candidates LDAP_P(( BackendDB *be, Filter *f ));
107
108 /*
109  * id2children.c
110  */
111
112 int bdb2i_has_children LDAP_P(( BackendDB *be, Entry *p ));
113
114 /*
115  * id2entry.c
116  */
117
118 int bdb2i_id2entry_add LDAP_P(( BackendDB *be, Entry *e ));
119 int bdb2i_id2entry_delete LDAP_P(( BackendDB *be, Entry *e ));
120
121 Entry * bdb2i_id2entry_rw LDAP_P(( BackendDB *be, ID id, int rw )); 
122 #define bdb2i_id2entry_r(be, id)  bdb2i_id2entry_rw((be), (id), 0)
123 #define bdb2i_id2entry_w(be, id)  bdb2i_id2entry_rw((be), (id), 1)
124
125 /*
126  * idl.c
127  */
128
129 ID_BLOCK * bdb2i_idl_alloc LDAP_P(( unsigned int nids ));
130 ID_BLOCK * bdb2i_idl_allids LDAP_P(( BackendDB *be ));
131 void bdb2i_idl_free LDAP_P(( ID_BLOCK *idl ));
132 ID_BLOCK * bdb2i_idl_fetch LDAP_P(( BackendDB *be, struct dbcache *db, Datum key ));
133 int bdb2i_idl_insert_key LDAP_P(( BackendDB *be, struct dbcache *db, Datum key, ID id ));
134 int bdb2i_idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned int maxids ));
135 int bdb2i_idl_delete_key LDAP_P(( BackendDB *be, struct dbcache *db, Datum key, ID id ));
136 ID_BLOCK * bdb2i_idl_intersection LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
137 ID_BLOCK * bdb2i_idl_union LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
138 ID_BLOCK * bdb2i_idl_notin LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
139 ID bdb2i_idl_firstid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
140 ID bdb2i_idl_nextid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
141
142 /*
143  * index.c
144  */
145
146 int bdb2i_index_add_entry LDAP_P(( BackendDB *be, Entry *e ));
147 int bdb2i_index_add_mods LDAP_P(( BackendDB *be, LDAPModList *ml, ID id ));
148 ID_BLOCK * bdb2i_index_read LDAP_P(( BackendDB *be, char *type, int indextype, char *val ));
149 int bdb2i_index_add_values LDAP_P(( BackendDB *be, char *type, struct berval **vals, ID  id ));
150
151 /*
152  * kerberos.c
153  */
154
155 #ifdef HAVE_KERBEROS
156 /* bdb2i_krbv4_ldap_auth LDAP_P(( BackendDB *be, struct berval *cred, AUTH_DAT *ad )); */
157 #endif
158
159 /*
160  * modify.c
161  * These prototypes are placed here because they are used by modify and
162  * modify rdn which are implemented in different files. 
163  *
164  * We need bdb2i_back_modify_internal here because of LDAP modrdn & modify use 
165  * it. If we do not add this, there would be a bunch of code replication 
166  * here and there and of course the likelihood of bugs increases.
167  * Juan C. Gomez (gomez@engr.sgi.com) 05/18/99
168  *
169  */
170
171 int bdb2i_add_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
172 int bdb2i_delete_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
173 int bdb2i_replace_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
174 int bdb2i_back_modify_internal LDAP_P((Backend *be, Connection *conn, Operation *op,
175                                  char *dn, LDAPModList *mods, Entry *e));
176 /*
177  * nextid.c
178  */
179
180 ID bdb2i_next_id LDAP_P(( BackendDB *be ));
181 void bdb2i_next_id_return LDAP_P(( BackendDB *be, ID id ));
182 ID bdb2i_next_id_get LDAP_P(( BackendDB *be ));
183 int bdb2i_next_id_save LDAP_P(( BackendDB *be ));
184
185 /*
186  *  startup.c
187  */
188
189 int bdb2i_back_startup     LDAP_P(( BackendInfo *bi ));
190 int bdb2i_back_shutdown    LDAP_P(( BackendInfo *bi ));
191 int bdb2i_back_db_startup  LDAP_P(( BackendDB *be ));
192 int bdb2i_back_db_shutdown LDAP_P(( BackendDB *be ));
193
194 /*
195  *  timing.c
196  */
197
198 void bdb2i_uncond_start_timing LDAP_P(( struct timeval *time1 ));
199 #define bdb2i_start_timing(bi,time1)  if ( with_timing( bi )) bdb2i_uncond_start_timing( (time1) )
200 void bdb2i_uncond_stop_timing LDAP_P(( struct timeval time1,
201   char *func, Connection *conn, Operation *op, int level ));
202 #define bdb2i_stop_timing(bi,time1,func,conn,op)  if ( with_timing( bi )) bdb2i_uncond_stop_timing( (time1), (func), (conn), (op), LDAP_DEBUG_ANY )
203
204 /*
205  * porter.c
206  */
207
208 int bdb2i_enter_backend_rw  LDAP_P(( DB_LOCK *lock, int writer ));
209 #define bdb2i_enter_backend_r(lock)  bdb2i_enter_backend_rw((lock), 0 )
210 #define bdb2i_enter_backend_w(lock)  bdb2i_enter_backend_rw((lock), 1 )
211 int bdb2i_leave_backend_rw LDAP_P(( DB_LOCK lock, int writer ));
212 #define bdb2i_leave_backend_r(lock)  bdb2i_leave_backend_rw((lock), 0 )
213 #define bdb2i_leave_backend_w(lock)  bdb2i_leave_backend_rw((lock), 1 )
214
215 /*
216  *  txn.c
217  */
218
219 int bdb2i_txn_head_init  LDAP_P(( BDB2_TXN_HEAD *head ));
220 void bdb2i_txn_attr_config LDAP_P((
221  struct ldbminfo  *li,
222  char *attr,
223  int open ));
224 int bdb2i_txn_open_files LDAP_P(( BackendDB *be ));
225 void bdb2i_txn_close_files LDAP_P(( BackendDB *be ));
226 BDB2_TXN_FILES *bdb2i_get_db_file_cache LDAP_P((
227  struct ldbminfo *li,
228  char *name ));
229 int bdb2i_check_additional_attr_index LDAP_P(( struct ldbminfo *li ));
230 void bdb2i_check_default_attr_index_add LDAP_P((
231  struct ldbminfo *li,
232  Entry *e ));
233 void bdb2i_check_default_attr_index_mod LDAP_P((
234  struct ldbminfo *li,
235  LDAPModList *modlist ));
236 ID bdb2i_get_nextid  LDAP_P(( BackendDB *be ));
237 int bdb2i_put_nextid LDAP_P(( BackendDB *be, ID id ));
238 LDBM bdb2i_db_open LDAP_P(( char *name, int type, int rw, int mode,
239  int dbcachesize ));
240 int bdb2i_db_store   LDAP_P(( LDBM ldbm, Datum key, Datum data, int flags ));
241 int bdb2i_db_delete  LDAP_P(( LDBM ldbm, Datum key ));
242 Datum bdb2i_db_fetch LDAP_P(( LDBM ldbm, Datum key ));
243 Datum bdb2i_db_firstkey LDAP_P(( LDBM ldbm, DBC **dbch ));
244 Datum bdb2i_db_nextkey  LDAP_P(( LDBM ldbm, Datum key, DBC *dbcp ));
245 int bdb2i_start_transction   LDAP_P(( DB_TXNMGR *txmgr ));
246 int bdb2i_finish_transaction LDAP_P(( ));
247 int bdb2i_set_txn_checkpoint LDAP_P(( DB_TXNMGR *txmgr, int forced ));
248
249
250 LDAP_END_DECL
251 #endif