]> git.sur5r.net Git - openldap/blob - servers/slapd/back-ldbm/proto-back-ldbm.h
Another round of changes behind -DSLAPD_SCHEMA_NOT_COMPAT
[openldap] / servers / slapd / back-ldbm / proto-back-ldbm.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-1999 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         char *dn,
23         int *err,
24         Entry **matched,
25         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, char *type, int *indexmask ));
37 void attr_index_config LDAP_P(( struct ldbminfo *li,
38         const char *fname, int lineno,
39         int argc, char **argv, int init ));
40 void attr_index_destroy LDAP_P(( Avlnode *tree ));
41
42 /*
43  * cache.c
44  */
45
46 int cache_add_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
47 int cache_update_entry LDAP_P(( Cache *cache, Entry *e ));
48 void cache_return_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
49 #define cache_return_entry_r(c, e) cache_return_entry_rw((c), (e), 0)
50 #define cache_return_entry_w(c, e) cache_return_entry_rw((c), (e), 1)
51
52 ID cache_find_entry_dn2id LDAP_P(( Backend *be, Cache *cache, const char *dn ));
53 Entry * cache_find_entry_id LDAP_P(( Cache *cache, ID id, int rw ));
54 int cache_delete_entry LDAP_P(( Cache *cache, Entry *e ));
55 void cache_release_all LDAP_P(( Cache *cache ));
56
57 /*
58  * dbcache.c
59  */
60
61 DBCache * ldbm_cache_open LDAP_P(( Backend *be,
62         char *name, char *suffix, int flags ));
63 void ldbm_cache_close LDAP_P(( Backend *be, DBCache *db ));
64 void ldbm_cache_really_close LDAP_P(( Backend *be, DBCache *db ));
65 void ldbm_cache_flush_all LDAP_P(( Backend *be ));
66 Datum ldbm_cache_fetch LDAP_P(( DBCache *db, Datum key ));
67 int ldbm_cache_store LDAP_P(( DBCache *db, Datum key, Datum data, int flags ));
68 int ldbm_cache_delete LDAP_P(( DBCache *db, Datum key ));
69
70 /*
71  * dn2id.c
72  */
73
74 int dn2id_add LDAP_P(( Backend *be, const char *dn, ID id ));
75 ID dn2id LDAP_P(( Backend *be, const char *dn ));
76 ID_BLOCK *dn2idl LDAP_P(( Backend *be, const char *dn, int prefix ));
77 int dn2id_delete LDAP_P(( Backend *be, const char *dn, ID id ));
78
79 Entry * dn2entry_rw LDAP_P(( Backend *be, const char *dn, Entry **matched, int rw ));
80 #define dn2entry_r(be, dn, m) dn2entry_rw((be), (dn), (m), 0)
81 #define dn2entry_w(be, dn, m) dn2entry_rw((be), (dn), (m), 1)
82
83 /*
84  * entry.c
85  */
86 int ldbm_back_entry_release_rw LDAP_P(( Backend *be, Entry *e, int rw ));
87
88 /*
89  * filterindex.c
90  */
91
92 ID_BLOCK * filter_candidates LDAP_P(( Backend *be, Filter *f ));
93
94 /*
95  * id2children.c
96  */
97
98 int id2children_add LDAP_P(( Backend *be, Entry *p, Entry *e ));
99 int id2children_remove LDAP_P(( Backend *be, Entry *p, Entry *e ));
100 int has_children LDAP_P(( Backend *be, Entry *p ));
101
102 /*
103  * id2entry.c
104  */
105
106 int id2entry_add LDAP_P(( Backend *be, Entry *e ));
107 int id2entry_delete LDAP_P(( Backend *be, Entry *e ));
108
109 Entry * id2entry_rw LDAP_P(( Backend *be, ID id, int rw )); 
110 #define id2entry_r(be, id)      id2entry_rw((be), (id), 0)
111 #define id2entry_w(be, id)      id2entry_rw((be), (id), 1)
112
113 /*
114  * idl.c
115  */
116
117 ID_BLOCK * idl_alloc LDAP_P(( unsigned int nids ));
118 ID_BLOCK * idl_allids LDAP_P(( Backend *be ));
119 void idl_free LDAP_P(( ID_BLOCK *idl ));
120 ID_BLOCK * idl_fetch LDAP_P(( Backend *be, DBCache *db, Datum key ));
121 int idl_insert_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
122 int idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned int maxids ));
123 int idl_delete_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
124 ID_BLOCK * idl_intersection LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
125 ID_BLOCK * idl_union LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
126 ID_BLOCK * idl_notin LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
127 ID idl_firstid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
128 ID idl_nextid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
129
130 /*
131  * index.c
132  */
133
134 int index_add_entry LDAP_P(( Backend *be, Entry *e ));
135 int index_add_mods LDAP_P(( Backend *be, Modifications *ml, ID id ));
136 ID_BLOCK * index_read LDAP_P(( Backend *be,
137         char *type, int indextype, char *val ));
138 /* Possible operations supported (op) by index_change_values() */
139 int index_change_values LDAP_P(( Backend *be,
140                                  char *type,
141                                  struct berval **vals,
142                                  ID  id,
143                                  unsigned int op ));
144
145 /*
146  * passwd.c
147  */
148 extern int ldbm_back_exop_passwd LDAP_P(( BackendDB *bd,
149         Connection *conn, Operation *op,
150         char *reqoid,
151         struct berval *reqdata,
152         char **rspoid,
153         struct berval **rspdata,
154         LDAPControl ***rspctrls,
155         char **text,
156         struct berval *** refs ));
157  
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 ldbm_internal_modify 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 /* returns LDAP error code indicating error OR SLAPD_ABANDON */
172 int ldbm_modify_internal LDAP_P((Backend *be,
173         Connection *conn, Operation *op,
174         char *dn, Modifications *mods, Entry *e ));
175
176 #ifdef HAVE_CYRUS_SASL
177 /*
178  * sasl.c
179  */
180 int ldbm_sasl_authorize LDAP_P((
181         BackendDB *be,
182         const char *auth_identity,
183         const char *requested_user,
184         const char **user,
185         const char **errstring ));
186 int ldbm_sasl_getsecret LDAP_P((
187         Backend *be,
188         const char *mechanism,
189         const char *auth_identity,
190         const char *realm,
191         sasl_secret_t **secret ));
192 int ldbm_sasl_putsecret LDAP_P((
193         Backend *be,
194         const char *mechanism,
195         const char *auth_identity,
196         const char *realm,
197         const sasl_secret_t *secret ));
198 #endif /* HAVE_CYRUS_SASL */
199
200 /*
201  * nextid.c
202  */
203
204 ID next_id LDAP_P(( Backend *be ));
205 ID next_id_get LDAP_P(( Backend *be ));
206 ID next_id_write LDAP_P(( Backend *be, ID id ));
207
208 LDAP_END_DECL
209 #endif