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