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