]> git.sur5r.net Git - openldap/blob - servers/slapd/back-ldbm/proto-back-ldbm.h
unifdef -DSLAP_CLEANUP
[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 void attr_index_destroy LDAP_P(( Avlnode *tree ));
40
41 /*
42  * cache.c
43  */
44
45 int cache_add_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
46 int cache_update_entry LDAP_P(( Cache *cache, Entry *e ));
47 void cache_return_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
48 #define cache_return_entry_r(c, e) cache_return_entry_rw((c), (e), 0)
49 #define cache_return_entry_w(c, e) cache_return_entry_rw((c), (e), 1)
50
51 ID cache_find_entry_dn2id LDAP_P(( Backend *be, Cache *cache, char *dn ));
52 Entry * cache_find_entry_id LDAP_P(( Cache *cache, ID id, int rw ));
53 int cache_delete_entry LDAP_P(( Cache *cache, Entry *e ));
54 void cache_release_all LDAP_P(( Cache *cache ));
55
56 /*
57  * dbcache.c
58  */
59
60 DBCache * ldbm_cache_open LDAP_P(( Backend *be,
61         char *name, char *suffix, int flags ));
62 void ldbm_cache_close LDAP_P(( Backend *be, DBCache *db ));
63 void ldbm_cache_really_close LDAP_P(( Backend *be, DBCache *db ));
64 void ldbm_cache_flush_all LDAP_P(( Backend *be ));
65 Datum ldbm_cache_fetch LDAP_P(( DBCache *db, Datum key ));
66 int ldbm_cache_store LDAP_P(( DBCache *db, Datum key, Datum data, int flags ));
67 int ldbm_cache_delete LDAP_P(( DBCache *db, Datum key ));
68
69 /*
70  * dn2id.c
71  */
72
73 int dn2id_add LDAP_P(( Backend *be, char *dn, ID id ));
74 ID dn2id LDAP_P(( Backend *be, char *dn ));
75 ID_BLOCK *dn2idl LDAP_P(( Backend *be, char *dn, int prefix ));
76 int dn2id_delete LDAP_P(( Backend *be, char *dn ));
77
78 Entry * dn2entry_rw LDAP_P(( Backend *be, char *dn, Entry **matched, int rw ));
79 #define dn2entry_r(be, dn, m) dn2entry_rw((be), (dn), (m), 0)
80 #define dn2entry_w(be, dn, m) dn2entry_rw((be), (dn), (m), 1)
81
82 /*
83  * entry.c
84  */
85 int ldbm_back_entry_release_rw LDAP_P(( Backend *be, Entry *e, int rw ));
86
87 /*
88  * filterindex.c
89  */
90
91 ID_BLOCK * filter_candidates LDAP_P(( Backend *be, Filter *f ));
92
93 /*
94  * id2children.c
95  */
96
97 int id2children_add LDAP_P(( Backend *be, Entry *p, Entry *e ));
98 int id2children_remove LDAP_P(( Backend *be, Entry *p, Entry *e ));
99 int has_children LDAP_P(( Backend *be, Entry *p ));
100
101 /*
102  * id2entry.c
103  */
104
105 int id2entry_add LDAP_P(( Backend *be, Entry *e ));
106 int id2entry_delete LDAP_P(( Backend *be, Entry *e ));
107
108 Entry * id2entry_rw LDAP_P(( Backend *be, ID id, int rw )); 
109 #define id2entry_r(be, id)      id2entry_rw((be), (id), 0)
110 #define id2entry_w(be, id)      id2entry_rw((be), (id), 1)
111
112 /*
113  * idl.c
114  */
115
116 ID_BLOCK * idl_alloc LDAP_P(( unsigned int nids ));
117 ID_BLOCK * idl_allids LDAP_P(( Backend *be ));
118 void idl_free LDAP_P(( ID_BLOCK *idl ));
119 ID_BLOCK * idl_fetch LDAP_P(( Backend *be, DBCache *db, Datum key ));
120 int idl_insert_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
121 int idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned int maxids ));
122 int idl_delete_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
123 ID_BLOCK * idl_intersection LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
124 ID_BLOCK * idl_union LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
125 ID_BLOCK * idl_notin LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
126 ID idl_firstid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
127 ID idl_nextid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
128
129 /*
130  * index.c
131  */
132
133 int index_add_entry LDAP_P(( Backend *be, Entry *e ));
134 int index_add_mods LDAP_P(( Backend *be, LDAPModList *ml, ID id ));
135 ID_BLOCK * index_read LDAP_P(( Backend *be,
136         char *type, int indextype, char *val ));
137 /* Possible operations supported (op) by index_change_values() */
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  * kerberos.c
146  */
147
148 #ifdef HAVE_KERBEROS
149 /* krbv4_ldap_auth LDAP_P(( Backend *be, struct berval *cred, AUTH_DAT *ad )); */
150 #endif
151  
152 /*
153  * modify.c
154  * These prototypes are placed here because they are used by modify and
155  * modify rdn which are implemented in different files. 
156  *
157  * We need ldbm_internal_modify here because of LDAP modrdn & modify use 
158  * it. If we do not add this, there would be a bunch of code replication 
159  * here and there and of course the likelihood of bugs increases.
160  * Juan C. Gomez (gomez@engr.sgi.com) 05/18/99
161  * 
162  */
163
164 int add_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
165 int delete_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
166 int replace_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
167 int ldbm_modify_internal LDAP_P((Backend *be,
168         Connection *conn, Operation *op,
169         char *dn, LDAPModList *mods, Entry *e));
170
171 /*
172  * nextid.c
173  */
174
175 ID next_id LDAP_P(( Backend *be ));
176 ID next_id_get LDAP_P(( Backend *be ));
177 ID next_id_write LDAP_P(( Backend *be, ID id ));
178
179 LDAP_END_DECL
180 #endif