]> git.sur5r.net Git - openldap/blob - servers/slapd/back-ldbm/proto-back-ldbm.h
Clean up
[openldap] / servers / slapd / back-ldbm / proto-back-ldbm.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7 #ifndef _PROTO_BACK_LDBM
8 #define _PROTO_BACK_LDBM
9
10 #include <ldap_cdefs.h>
11
12 #include "external.h"
13
14 LDAP_BEGIN_DECL
15
16 /*
17  * alias.c
18  */
19 Entry *deref_internal_r LDAP_P((
20         Backend *be,
21         Entry *e,
22         const char *dn,
23         int *err,
24         Entry **matched,
25         const char **text ));
26
27 #define deref_entry_r( be, e, err, matched, text ) \
28         deref_internal_r( be, e, NULL, err, matched, text )
29 #define deref_dn_r( be, dn, err, matched, text ) \
30         deref_internal_r( be, NULL, dn, err, matched, text)
31
32 /*
33  * attr.c
34  */
35
36 void attr_mask LDAP_P(( struct ldbminfo *li,
37         const char *desc,
38         slap_mask_t *indexmask ));
39
40 int attr_index_config LDAP_P(( struct ldbminfo *li,
41         const char *fname, int lineno,
42         int argc, char **argv ));
43 void attr_index_destroy LDAP_P(( Avlnode *tree ));
44
45 /*
46  * cache.c
47  */
48
49 int cache_add_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
50 int cache_update_entry LDAP_P(( Cache *cache, Entry *e ));
51 void cache_return_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
52 #define cache_return_entry_r(c, e) cache_return_entry_rw((c), (e), 0)
53 #define cache_return_entry_w(c, e) cache_return_entry_rw((c), (e), 1)
54 void cache_entry_commit LDAP_P(( Entry *e ));
55
56 ID cache_find_entry_dn2id LDAP_P(( Backend *be, Cache *cache, const char *dn ));
57 ID cache_find_entry_ndn2id LDAP_P(( Backend *be, Cache *cache, const char *ndn ));
58 Entry * cache_find_entry_id LDAP_P(( Cache *cache, ID id, int rw ));
59 int cache_delete_entry LDAP_P(( Cache *cache, Entry *e ));
60 void cache_release_all LDAP_P(( Cache *cache ));
61
62 /*
63  * dbcache.c
64  */
65
66 DBCache * ldbm_cache_open LDAP_P(( Backend *be,
67         const char *name, const char *suffix, int flags ));
68 void ldbm_cache_close LDAP_P(( Backend *be, DBCache *db ));
69 void ldbm_cache_really_close LDAP_P(( Backend *be, DBCache *db ));
70 void ldbm_cache_flush_all LDAP_P(( Backend *be ));
71 void ldbm_cache_sync LDAP_P(( Backend *be ));
72 Datum ldbm_cache_fetch LDAP_P(( DBCache *db, Datum key ));
73 int ldbm_cache_store LDAP_P(( DBCache *db, Datum key, Datum data, int flags ));
74 int ldbm_cache_delete LDAP_P(( DBCache *db, Datum key ));
75 void *ldbm_cache_sync_daemon LDAP_P(( void *));
76
77 /*
78  * dn2id.c
79  */
80
81 int dn2id_add LDAP_P(( Backend *be, const char *dn, ID id ));
82 int dn2id LDAP_P(( Backend *be, const char *dn, ID *idp ));
83 int dn2idl LDAP_P(( Backend *be, const char *dn, int prefix, ID_BLOCK **idlp ));
84 int dn2id_delete LDAP_P(( Backend *be, const char *dn, ID id ));
85
86 Entry * dn2entry_rw LDAP_P(( Backend *be, const char *dn, Entry **matched, int rw ));
87 #define dn2entry_r(be, dn, m) dn2entry_rw((be), (dn), (m), 0)
88 #define dn2entry_w(be, dn, m) dn2entry_rw((be), (dn), (m), 1)
89
90 /*
91  * entry.c
92  */
93 int ldbm_back_entry_release_rw LDAP_P(( Backend *be,
94         Connection *conn, Operation *op,
95         Entry *e, int rw ));
96
97 /*
98  * filterindex.c
99  */
100
101 ID_BLOCK * filter_candidates LDAP_P(( Backend *be, Filter *f ));
102
103 /*
104  * id2children.c
105  */
106
107 int id2children_add LDAP_P(( Backend *be, Entry *p, Entry *e ));
108 int id2children_remove LDAP_P(( Backend *be, Entry *p, Entry *e ));
109 int has_children LDAP_P(( Backend *be, Entry *p ));
110
111 /*
112  * id2entry.c
113  */
114
115 int id2entry_add LDAP_P(( Backend *be, Entry *e ));
116 int id2entry_delete LDAP_P(( Backend *be, Entry *e ));
117
118 Entry * id2entry_rw LDAP_P(( Backend *be, ID id, int rw )); 
119 #define id2entry_r(be, id)      id2entry_rw((be), (id), 0)
120 #define id2entry_w(be, id)      id2entry_rw((be), (id), 1)
121
122 /*
123  * idl.c
124  */
125
126 ID_BLOCK * idl_alloc LDAP_P(( unsigned int nids ));
127 ID_BLOCK * idl_allids LDAP_P(( Backend *be ));
128 void idl_free LDAP_P(( ID_BLOCK *idl ));
129 ID_BLOCK * idl_fetch LDAP_P(( Backend *be, DBCache *db, Datum key ));
130 int idl_insert_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
131 int idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned int maxids ));
132 int idl_delete_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
133 ID_BLOCK * idl_intersection LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
134 ID_BLOCK * idl_union LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
135 ID_BLOCK * idl_notin LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
136 ID idl_firstid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
137 ID idl_nextid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
138
139 /*
140  * index.c
141  */
142 extern int
143 index_param LDAP_P((
144         Backend *be,
145         AttributeDescription *desc,
146         int ftype,
147         char **dbname,
148         slap_mask_t *mask,
149         struct berval **prefix ));
150
151 extern int
152 index_values LDAP_P((
153         Backend *be,
154         AttributeDescription *desc,
155         struct berval **vals,
156         ID id,
157         int op ));
158
159 int index_entry LDAP_P(( Backend *be, int r, Entry *e, Attribute *ap ));
160 #define index_entry_add(be,e,ap) index_entry((be),SLAP_INDEX_ADD_OP,(e),(ap))
161 #define index_entry_del(be,e,ap) index_entry((be),SLAP_INDEX_DELETE_OP,(e),(ap))
162
163
164 /*
165  * key.c
166  */
167 extern int
168 key_change LDAP_P((
169     Backend             *be,
170     DBCache     *db,
171     struct berval *k,
172     ID                  id,
173     int                 op ));
174 extern int
175 key_read LDAP_P((
176     Backend     *be,
177         DBCache *db,
178     struct berval *k,
179         ID_BLOCK **idout ));
180
181 /*
182  * passwd.c
183  */
184 extern int ldbm_back_exop_passwd LDAP_P(( BackendDB *bd,
185         Connection *conn, Operation *op,
186         const char *reqoid,
187         struct berval *reqdata,
188         char **rspoid,
189         struct berval **rspdata,
190         LDAPControl ***rspctrls,
191         const char **text,
192         struct berval *** refs ));
193  
194
195 /*
196  * modify.c
197  * These prototypes are placed here because they are used by modify and
198  * modify rdn which are implemented in different files. 
199  *
200  * We need ldbm_internal_modify here because of LDAP modrdn & modify use 
201  * it. If we do not add this, there would be a bunch of code replication 
202  * here and there and of course the likelihood of bugs increases.
203  * Juan C. Gomez (gomez@engr.sgi.com) 05/18/99
204  * 
205  */
206
207 /* returns LDAP error code indicating error OR SLAPD_ABANDON */
208 int ldbm_modify_internal LDAP_P((Backend *be,
209         Connection *conn, Operation *op,
210         const char *dn, Modifications *mods, Entry *e,
211         const char **text, char *textbuf, size_t textlen ));
212
213 /*
214  * nextid.c
215  */
216
217 int next_id LDAP_P(( Backend *be, ID *idp ));
218 int next_id_get LDAP_P(( Backend *be, ID *idp ));
219 int next_id_write LDAP_P(( Backend *be, ID id ));
220
221 LDAP_END_DECL
222 #endif