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