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