2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1998-2004 The OpenLDAP Foundation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
11 * A copy of this license is available in the file LICENSE in the
12 * top-level directory of the distribution or, alternatively, at
13 * <http://www.OpenLDAP.org/license.html>.
16 #ifndef _PROTO_BACK_LDBM
17 #define _PROTO_BACK_LDBM
19 #include <ldap_cdefs.h>
28 Entry *deref_internal_r LDAP_P((
36 #define deref_entry_r( be, e, err, matched, text ) \
37 deref_internal_r( be, e, NULL, err, matched, text )
38 #define deref_dn_r( be, dn, err, matched, text ) \
39 deref_internal_r( be, NULL, dn, err, matched, text)
45 void attr_mask LDAP_P(( struct ldbminfo *li,
46 AttributeDescription *desc,
47 slap_mask_t *indexmask ));
49 int attr_index_config LDAP_P(( struct ldbminfo *li,
50 const char *fname, int lineno,
51 int argc, char **argv ));
52 void attr_index_destroy LDAP_P(( Avlnode *tree ));
58 int cache_add_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
59 int cache_update_entry LDAP_P(( Cache *cache, Entry *e ));
60 void cache_return_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
61 #define cache_return_entry_r(c, e) cache_return_entry_rw((c), (e), 0)
62 #define cache_return_entry_w(c, e) cache_return_entry_rw((c), (e), 1)
63 void cache_entry_commit LDAP_P(( Entry *e ));
65 ID cache_find_entry_ndn2id LDAP_P(( Backend *be, Cache *cache, struct berval *ndn ));
66 Entry * cache_find_entry_id LDAP_P(( Cache *cache, ID id, int rw ));
67 int cache_delete_entry LDAP_P(( Cache *cache, Entry *e ));
68 void cache_release_all LDAP_P(( Cache *cache ));
74 DBCache * ldbm_cache_open LDAP_P(( Backend *be,
75 const char *name, const char *suffix, int flags ));
76 void ldbm_cache_close LDAP_P(( Backend *be, DBCache *db ));
77 void ldbm_cache_really_close LDAP_P(( Backend *be, DBCache *db ));
78 void ldbm_cache_flush_all LDAP_P(( Backend *be ));
79 void ldbm_cache_sync LDAP_P(( Backend *be ));
80 #if 0 /* replaced by macro */
81 Datum ldbm_cache_fetch LDAP_P(( DBCache *db, Datum key ));
83 #define ldbm_cache_fetch( db, key ) ldbm_fetch( (db)->dbc_db, (key) )
85 int ldbm_cache_store LDAP_P(( DBCache *db, Datum key, Datum data, int flags ));
86 int ldbm_cache_delete LDAP_P(( DBCache *db, Datum key ));
87 void *ldbm_cache_sync_daemon LDAP_P(( void *));
93 int dn2id_add LDAP_P(( Backend *be, struct berval *dn, ID id ));
94 int dn2id LDAP_P(( Backend *be, struct berval *dn, ID *idp ));
95 int dn2idl LDAP_P(( Backend *be, struct berval *dn, int prefix, ID_BLOCK **idlp ));
96 int dn2id_delete LDAP_P(( Backend *be, struct berval *dn, ID id ));
98 Entry * dn2entry_rw LDAP_P(( Backend *be, struct berval *dn, Entry **matched, int rw ));
99 #define dn2entry_r(be, dn, m) dn2entry_rw((be), (dn), (m), 0)
100 #define dn2entry_w(be, dn, m) dn2entry_rw((be), (dn), (m), 1)
105 BI_entry_release_rw ldbm_back_entry_release_rw;
106 BI_entry_get_rw ldbm_back_entry_get;
112 ID_BLOCK * filter_candidates LDAP_P(( Operation *op, Filter *f ));
118 int id2children_add LDAP_P(( Backend *be, Entry *p, Entry *e ));
119 int id2children_remove LDAP_P(( Backend *be, Entry *p, Entry *e ));
120 int has_children LDAP_P(( Backend *be, Entry *p ));
126 int id2entry_add LDAP_P(( Backend *be, Entry *e ));
127 int id2entry_delete LDAP_P(( Backend *be, Entry *e ));
129 Entry * id2entry_rw LDAP_P(( Backend *be, ID id, int rw ));
130 #define id2entry_r(be, id) id2entry_rw((be), (id), 0)
131 #define id2entry_w(be, id) id2entry_rw((be), (id), 1)
137 ID_BLOCK * idl_alloc LDAP_P(( unsigned int nids ));
138 ID_BLOCK * idl_allids LDAP_P(( Backend *be ));
139 void idl_free LDAP_P(( ID_BLOCK *idl ));
140 ID_BLOCK * idl_fetch LDAP_P(( Backend *be, DBCache *db, Datum key ));
141 int idl_insert_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
142 int idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned int maxids ));
143 int idl_delete_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
144 ID_BLOCK * idl_intersection LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
145 ID_BLOCK * idl_union LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
146 ID_BLOCK * idl_notin LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
147 ID idl_firstid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
148 ID idl_nextid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
154 index_is_indexed LDAP_P((
156 AttributeDescription *desc ));
161 AttributeDescription *desc,
165 struct berval *prefix ));
168 index_values LDAP_P((
170 AttributeDescription *desc,
175 int index_entry LDAP_P(( Operation *op, int r, Entry *e ));
176 #define index_entry_add(be,e) index_entry((be),SLAP_INDEX_ADD_OP,(e))
177 #define index_entry_del(be,e) index_entry((be),SLAP_INDEX_DELETE_OP,(e))
199 * These prototypes are placed here because they are used by modify and
200 * modify rdn which are implemented in different files.
202 * We need ldbm_internal_modify here because of LDAP modrdn & modify use
203 * it. If we do not add this, there would be a bunch of code replication
204 * here and there and of course the likelihood of bugs increases.
205 * Juan C. Gomez (gomez@engr.sgi.com) 05/18/99
209 /* returns LDAP error code indicating error OR SLAPD_ABANDON */
210 int ldbm_modify_internal LDAP_P(( Operation *op,
211 Modifications *mods, Entry *e,
212 const char **text, char *textbuf, size_t textlen ));
218 int next_id LDAP_P(( Backend *be, ID *idp ));
219 int next_id_get LDAP_P(( Backend *be, ID *idp ));
220 int next_id_write LDAP_P(( Backend *be, ID id ));