]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb2/proto-back-bdb2.h
More timing for performance testing. Re-introduction of cache.c_mutex.
[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 "external.h"
7
8 LDAP_BEGIN_DECL
9
10 /*
11  * alias.c
12  */
13 Entry *bdb2i_derefAlias_r LDAP_P((
14         BackendDB   *be,
15         Connection      *conn,
16         Operation       *op,
17         Entry       *e ));
18 char *bdb2i_derefDN LDAP_P((
19         BackendDB   *be,
20         Connection  *conn,
21         Operation   *op,
22         char        *dn ));
23
24 /*
25  * attr.c
26  */
27
28 void bdb2i_attr_masks LDAP_P(( struct ldbminfo *li, char *type, int *indexmask,
29  int *syntaxmask ));
30 void bdb2i_attr_index_config LDAP_P(( struct ldbminfo *li, char *fname,
31  int lineno, int argc, char **argv, int init ));
32
33 /*
34  * cache.c
35  */
36
37 int bdb2i_cache_add_entry_rw LDAP_P(( struct cache *cache, Entry *e, int rw ));
38 int bdb2i_cache_update_entry LDAP_P(( struct cache *cache, Entry *e ));
39 void bdb2i_cache_return_entry_rw LDAP_P(( struct cache *cache, Entry *e,
40  int rw ));
41 #define bdb2i_cache_return_entry_r(c, e) bdb2i_cache_return_entry_rw((c), (e), 0)
42 #define bdb2i_cache_return_entry_w(c, e) bdb2i_cache_return_entry_rw((c), (e), 1)
43
44 ID bdb2i_cache_find_entry_dn2id LDAP_P(( BackendDB *be, struct cache *cache,
45  char *dn ));
46 Entry * bdb2i_cache_find_entry_id LDAP_P(( struct cache *cache, ID id, int rw ));
47 int bdb2i_cache_delete_entry LDAP_P(( struct cache *cache, Entry *e ));
48
49 /*
50  * dbcache.c
51  */
52
53 struct dbcache * bdb2i_cache_open LDAP_P(( BackendDB *be, char *name, char *suffix,
54  int flags ));
55 void bdb2i_cache_close LDAP_P(( BackendDB *be, struct dbcache *db ));
56 void bdb2i_cache_really_close LDAP_P(( BackendDB *be, struct dbcache *db ));
57 void bdb2i_cache_flush_all LDAP_P(( BackendDB *be ));
58 Datum bdb2i_cache_fetch LDAP_P(( struct dbcache *db, Datum key ));
59 int bdb2i_cache_store LDAP_P(( struct dbcache *db, Datum key, Datum data, int flags ));
60 int bdb2i_cache_delete LDAP_P(( struct dbcache *db, Datum key ));
61
62 /*
63  * dn2id.c
64  */
65
66 int bdb2i_dn2id_add LDAP_P(( BackendDB *be, char *dn, ID id ));
67 ID bdb2i_dn2id LDAP_P(( BackendDB *be, char *dn ));
68 int bdb2i_dn2id_delete LDAP_P(( BackendDB *be, char *dn ));
69
70 Entry * bdb2i_dn2entry_rw LDAP_P(( BackendDB *be, char *dn, char **matched,
71  int rw ));
72 #define bdb2i_dn2entry_r(be, dn, m) bdb2i_dn2entry_rw((be), (dn), (m), 0)
73 #define bdb2i_dn2entry_w(be, dn, m) bdb2i_dn2entry_rw((be), (dn), (m), 1)
74
75 /*
76  * filterindex.c
77  */
78
79 ID_BLOCK * bdb2i_filter_candidates LDAP_P(( BackendDB *be, Filter *f ));
80
81 /*
82  * id2children.c
83  */
84
85 int bdb2i_id2children_add LDAP_P(( BackendDB *be, Entry *p, Entry *e ));
86 int bdb2i_id2children_remove LDAP_P(( BackendDB *be, Entry *p, Entry *e ));
87 int bdb2i_has_children LDAP_P(( BackendDB *be, Entry *p ));
88
89 /*
90  * id2entry.c
91  */
92
93 int bdb2i_id2entry_add LDAP_P(( BackendDB *be, Entry *e ));
94 int bdb2i_id2entry_delete LDAP_P(( BackendDB *be, Entry *e ));
95
96 Entry * bdb2i_id2entry_rw LDAP_P(( BackendDB *be, ID id, int rw )); 
97 #define bdb2i_id2entry_r(be, id)  bdb2i_id2entry_rw((be), (id), 0)
98 #define bdb2i_id2entry_w(be, id)  bdb2i_id2entry_rw((be), (id), 1)
99
100 /*
101  * idl.c
102  */
103
104 ID_BLOCK * bdb2i_idl_alloc LDAP_P(( int nids ));
105 ID_BLOCK * bdb2i_idl_allids LDAP_P(( BackendDB *be ));
106 void bdb2i_idl_free LDAP_P(( ID_BLOCK *idl ));
107 ID_BLOCK * bdb2i_idl_fetch LDAP_P(( BackendDB *be, struct dbcache *db, Datum key ));
108 int bdb2i_idl_insert_key LDAP_P(( BackendDB *be, struct dbcache *db, Datum key, ID id ));
109 int bdb2i_idl_insert LDAP_P(( ID_BLOCK **idl, ID id, int maxids ));
110 int bdb2i_idl_delete_key LDAP_P(( BackendDB *be, struct dbcache *db, Datum key, ID id ));
111 ID_BLOCK * bdb2i_idl_intersection LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
112 ID_BLOCK * bdb2i_idl_union LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
113 ID_BLOCK * bdb2i_idl_notin LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
114 ID bdb2i_idl_firstid LDAP_P(( ID_BLOCK *idl ));
115 ID bdb2i_idl_nextid LDAP_P(( ID_BLOCK *idl, ID id ));
116
117 /*
118  * index.c
119  */
120
121 int bdb2i_index_add_entry LDAP_P(( BackendDB *be, Entry *e ));
122 int bdb2i_index_add_mods LDAP_P(( BackendDB *be, LDAPModList *ml, ID id ));
123 ID_BLOCK * bdb2i_index_read LDAP_P(( BackendDB *be, char *type, int indextype, char *val ));
124 int bdb2i_index_add_values LDAP_P(( BackendDB *be, char *type, struct berval **vals, ID  id ));
125
126 /*
127  * kerberos.c
128  */
129
130 #ifdef HAVE_KERBEROS
131 /* bdb2i_krbv4_ldap_auth LDAP_P(( BackendDB *be, struct berval *cred, AUTH_DAT *ad )); */
132 #endif
133
134 /*
135  * nextid.c
136  */
137
138 ID bdb2i_next_id LDAP_P(( BackendDB *be ));
139 void bdb2i_next_id_return LDAP_P(( BackendDB *be, ID id ));
140 ID bdb2i_next_id_get LDAP_P(( BackendDB *be ));
141 int bdb2i_next_id_save LDAP_P(( BackendDB *be ));
142
143 /*
144  *  startup.c
145  */
146
147 int bdb2i_back_startup     LDAP_P(( BackendInfo *bi ));
148 int bdb2i_back_shutdown    LDAP_P(( BackendInfo *bi ));
149 int bdb2i_back_db_startup  LDAP_P(( BackendDB *be ));
150 int bdb2i_back_db_shutdown LDAP_P(( BackendDB *be ));
151
152 /*
153  *  timing.c
154  */
155
156 void bdb2i_uncond_start_timing LDAP_P(( struct timeval *time1 ));
157 #define bdb2i_start_timing(bi,time1)  if ( with_timing( bi )) bdb2i_uncond_start_timing( (time1) )
158 void bdb2i_uncond_stop_timing LDAP_P(( struct timeval time1,
159   char *func, Connection *conn, Operation *op, int level ));
160 #define bdb2i_stop_timing(bi,time1,func,conn,op)  if ( with_timing( bi )) bdb2i_uncond_stop_timing( (time1), (func), (conn), (op), LDAP_DEBUG_ANY )
161
162 /*
163  * porter.c
164  */
165
166 int bdb2i_enter_backend_rw  LDAP_P(( DB_ENV *dbEnv, DB_LOCK *lock, int writer ));
167 #define bdb2i_enter_backend_r(dbEnv,lock)  bdb2i_enter_backend_rw( (dbEnv), (lock), 0 )
168 #define bdb2i_enter_backend_w(dbEnv,lock)  bdb2i_enter_backend_rw( (dbEnv), (lock), 1 )
169 int bdb2i_leave_backend_rw LDAP_P(( DB_ENV *dbEnv, DB_LOCK lock, int writer ));
170 #define bdb2i_leave_backend_r(dbEnv,lock)  bdb2i_leave_backend_rw( (dbEnv), (lock), 0 )
171 #define bdb2i_leave_backend_w(dbEnv,lock)  bdb2i_leave_backend_rw( (dbEnv), (lock), 1 )
172
173 /*
174  *  txn.c
175  */
176
177 int bdb2i_txn_head_init  LDAP_P(( BDB2_TXN_HEAD *head ));
178 void bdb2i_txn_attr_config LDAP_P((
179  struct ldbminfo  *li,
180  char *attr,
181  int open ));
182 int bdb2i_txn_open_files LDAP_P(( struct ldbminfo *li ));
183 void bdb2i_txn_close_files LDAP_P(( BackendDB *be ));
184 BDB2_TXN_FILES *bdb2i_get_db_file_cache LDAP_P((
185  struct ldbminfo *li,
186  char *name ));
187 int bdb2i_check_additional_attr_index LDAP_P(( struct ldbminfo *li ));
188 void bdb2i_check_default_attr_index_add LDAP_P((
189  struct ldbminfo *li,
190  Entry *e ));
191 void bdb2i_check_default_attr_index_mod LDAP_P((
192  struct ldbminfo *li,
193  LDAPModList *modlist ));
194
195
196
197 LDAP_END_DECL
198 #endif