]> git.sur5r.net Git - openldap/blob - servers/slapd/back-ldbm/proto-back-ldbm.h
Use a cursor to step through ID_BLOCKS.
[openldap] / servers / slapd / back-ldbm / proto-back-ldbm.h
1 /*
2  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6 #ifndef _PROTO_BACK_LDBM
7 #define _PROTO_BACK_LDBM
8
9 #include <ldap_cdefs.h>
10
11 #include "external.h"
12
13 LDAP_BEGIN_DECL
14
15 /*
16  * alias.c
17  */
18 Entry *deref_internal_r LDAP_P((
19         Backend *be,
20         Entry *e,
21         char *dn,
22         int *err,
23         Entry **matched,
24         char **text ));
25
26 #define deref_entry_r( be, e, err, matched, text ) \
27         deref_internal_r( be, e, NULL, err, matched, text )
28 #define deref_dn_r( be, dn, err, matched, text ) \
29         deref_internal_r( be, NULL, dn, err, matched, text)
30
31 /*
32  * attr.c
33  */
34
35 void attr_masks LDAP_P(( struct ldbminfo *li, char *type, int *indexmask,
36  int *syntaxmask ));
37 void attr_index_config LDAP_P(( struct ldbminfo *li, char *fname, int lineno,
38  int argc, char **argv, int init ));
39 #ifdef SLAP_CLEANUP
40 void attr_index_destroy LDAP_P(( Avlnode *tree ));
41 #endif
42
43 /*
44  * cache.c
45  */
46
47 int cache_add_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
48 int cache_update_entry LDAP_P(( Cache *cache, Entry *e ));
49 void cache_return_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
50 #define cache_return_entry_r(c, e) cache_return_entry_rw((c), (e), 0)
51 #define cache_return_entry_w(c, e) cache_return_entry_rw((c), (e), 1)
52
53 ID cache_find_entry_dn2id LDAP_P(( Backend *be, Cache *cache, char *dn ));
54 Entry * cache_find_entry_id LDAP_P(( Cache *cache, ID id, int rw ));
55 int cache_delete_entry LDAP_P(( Cache *cache, Entry *e ));
56 #ifdef SLAP_CLEANUP
57 void cache_release_all LDAP_P(( Cache *cache ));
58 #endif
59
60 /*
61  * dbcache.c
62  */
63
64 DBCache * ldbm_cache_open LDAP_P(( Backend *be,
65         char *name, char *suffix, int flags ));
66 void ldbm_cache_close LDAP_P(( Backend *be, DBCache *db ));
67 void ldbm_cache_really_close LDAP_P(( Backend *be, DBCache *db ));
68 void ldbm_cache_flush_all LDAP_P(( Backend *be ));
69 Datum ldbm_cache_fetch LDAP_P(( DBCache *db, Datum key ));
70 int ldbm_cache_store LDAP_P(( DBCache *db, Datum key, Datum data, int flags ));
71 int ldbm_cache_delete LDAP_P(( DBCache *db, Datum key ));
72
73 /*
74  * dn2id.c
75  */
76
77 int dn2id_add LDAP_P(( Backend *be, char *dn, ID id ));
78 ID dn2id LDAP_P(( Backend *be, char *dn ));
79 int dn2id_delete LDAP_P(( Backend *be, char *dn ));
80
81 Entry * dn2entry_rw LDAP_P(( Backend *be, char *dn, Entry **matched, int rw ));
82 #define dn2entry_r(be, dn, m) dn2entry_rw((be), (dn), (m), 0)
83 #define dn2entry_w(be, dn, m) dn2entry_rw((be), (dn), (m), 1)
84
85 /*
86  * entry.c
87  */
88 int ldbm_back_entry_release_rw LDAP_P(( Backend *be, Entry *e, int rw ));
89
90 /*
91  * filterindex.c
92  */
93
94 ID_BLOCK * filter_candidates LDAP_P(( Backend *be, Filter *f ));
95
96 /*
97  * id2children.c
98  */
99
100 int id2children_add LDAP_P(( Backend *be, Entry *p, Entry *e ));
101 int id2children_remove LDAP_P(( Backend *be, Entry *p, Entry *e ));
102 int has_children LDAP_P(( Backend *be, Entry *p ));
103
104 /*
105  * id2entry.c
106  */
107
108 int id2entry_add LDAP_P(( Backend *be, Entry *e ));
109 int id2entry_delete LDAP_P(( Backend *be, Entry *e ));
110
111 Entry * id2entry_rw LDAP_P(( Backend *be, ID id, int rw )); 
112 #define id2entry_r(be, id)      id2entry_rw((be), (id), 0)
113 #define id2entry_w(be, id)      id2entry_rw((be), (id), 1)
114
115 /*
116  * idl.c
117  */
118
119 ID_BLOCK * idl_alloc LDAP_P(( unsigned int nids ));
120 ID_BLOCK * idl_allids LDAP_P(( Backend *be ));
121 void idl_free LDAP_P(( ID_BLOCK *idl ));
122 ID_BLOCK * idl_fetch LDAP_P(( Backend *be, DBCache *db, Datum key ));
123 int idl_insert_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
124 int idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned int maxids ));
125 int idl_delete_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
126 ID_BLOCK * idl_intersection LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
127 ID_BLOCK * idl_union LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
128 ID_BLOCK * idl_notin LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
129 ID idl_firstid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
130 ID idl_nextid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
131
132 /*
133  * index.c
134  */
135
136 int index_add_entry LDAP_P(( Backend *be, Entry *e ));
137 int index_add_mods LDAP_P(( Backend *be, LDAPModList *ml, ID id ));
138 ID_BLOCK * index_read LDAP_P(( Backend *be,
139         char *type, int indextype, char *val ));
140 /* Possible operations supported (op) by index_change_values() */
141 #define __INDEX_ADD_OP          0x0001
142 #define __INDEX_DELETE_OP       0x0002
143 int index_change_values LDAP_P(( Backend *be,
144                                  char *type,
145                                  struct berval **vals,
146                                  ID  id,
147                                  unsigned int op ));
148
149
150 /*
151  * kerberos.c
152  */
153
154 #ifdef HAVE_KERBEROS
155 /* krbv4_ldap_auth LDAP_P(( Backend *be, struct berval *cred, AUTH_DAT *ad )); */
156 #endif
157  
158 /*
159  * modify.c
160  * These prototypes are placed here because they are used by modify and
161  * modify rdn which are implemented in different files. 
162  *
163  * We need ldbm_internal_modify here because of LDAP modrdn & modify use 
164  * it. If we do not add this, there would be a bunch of code replication 
165  * here and there and of course the likelihood of bugs increases.
166  * Juan C. Gomez (gomez@engr.sgi.com) 05/18/99
167  * 
168  */
169
170 int add_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
171 int delete_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
172 int replace_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
173 int ldbm_modify_internal LDAP_P((Backend *be,
174         Connection *conn, Operation *op,
175         char *dn, LDAPModList *mods, Entry *e));
176
177 /*
178  * nextid.c
179  */
180
181 ID next_id LDAP_P(( Backend *be ));
182 void next_id_return LDAP_P(( Backend *be, ID id ));
183 ID next_id_get LDAP_P(( Backend *be ));
184 int next_id_save LDAP_P(( Backend *be ));
185
186 LDAP_END_DECL
187 #endif