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