1999-09-08 15:06:24 -04:00
|
|
|
/* $OpenLDAP$ */
|
2003-11-28 16:08:20 -05:00
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
|
*
|
2004-01-01 14:15:16 -05:00
|
|
|
* Copyright 1998-2004 The OpenLDAP Foundation.
|
2003-11-28 16:08:20 -05:00
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
|
* Public License.
|
|
|
|
|
*
|
|
|
|
|
* A copy of this license is available in the file LICENSE in the
|
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
1999-08-04 19:59:13 -04:00
|
|
|
*/
|
1999-08-06 19:07:46 -04:00
|
|
|
|
1998-08-08 20:43:13 -04:00
|
|
|
#ifndef _PROTO_BACK_LDBM
|
|
|
|
|
#define _PROTO_BACK_LDBM
|
|
|
|
|
|
1998-10-24 21:41:42 -04:00
|
|
|
#include <ldap_cdefs.h>
|
|
|
|
|
|
1999-02-05 04:03:47 -05:00
|
|
|
#include "external.h"
|
|
|
|
|
|
1998-10-24 21:41:42 -04:00
|
|
|
LDAP_BEGIN_DECL
|
|
|
|
|
|
1998-10-23 22:42:38 -04:00
|
|
|
/*
|
|
|
|
|
* alias.c
|
|
|
|
|
*/
|
1999-07-15 22:45:46 -04:00
|
|
|
Entry *deref_internal_r LDAP_P((
|
|
|
|
|
Backend *be,
|
|
|
|
|
Entry *e,
|
2001-12-26 19:26:59 -05:00
|
|
|
struct berval *dn,
|
1999-07-15 22:45:46 -04:00
|
|
|
int *err,
|
|
|
|
|
Entry **matched,
|
2000-05-21 23:46:57 -04:00
|
|
|
const char **text ));
|
1999-07-15 22:45:46 -04:00
|
|
|
|
|
|
|
|
#define deref_entry_r( be, e, err, matched, text ) \
|
|
|
|
|
deref_internal_r( be, e, NULL, err, matched, text )
|
|
|
|
|
#define deref_dn_r( be, dn, err, matched, text ) \
|
|
|
|
|
deref_internal_r( be, NULL, dn, err, matched, text)
|
1998-10-23 22:42:38 -04:00
|
|
|
|
1998-08-08 20:43:13 -04:00
|
|
|
/*
|
|
|
|
|
* attr.c
|
|
|
|
|
*/
|
|
|
|
|
|
2000-06-04 18:59:38 -04:00
|
|
|
void attr_mask LDAP_P(( struct ldbminfo *li,
|
2001-11-16 02:45:37 -05:00
|
|
|
AttributeDescription *desc,
|
2000-08-22 17:26:25 -04:00
|
|
|
slap_mask_t *indexmask ));
|
2000-06-04 18:59:38 -04:00
|
|
|
|
|
|
|
|
int attr_index_config LDAP_P(( struct ldbminfo *li,
|
1999-08-20 15:00:44 -04:00
|
|
|
const char *fname, int lineno,
|
2000-06-06 15:31:45 -04:00
|
|
|
int argc, char **argv ));
|
1999-04-05 21:55:11 -04:00
|
|
|
void attr_index_destroy LDAP_P(( Avlnode *tree ));
|
1998-08-08 20:43:13 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* cache.c
|
|
|
|
|
*/
|
|
|
|
|
|
1999-07-19 15:40:33 -04:00
|
|
|
int cache_add_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
|
|
|
|
|
int cache_update_entry LDAP_P(( Cache *cache, Entry *e ));
|
|
|
|
|
void cache_return_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
|
1999-02-11 12:46:56 -05:00
|
|
|
#define cache_return_entry_r(c, e) cache_return_entry_rw((c), (e), 0)
|
|
|
|
|
#define cache_return_entry_w(c, e) cache_return_entry_rw((c), (e), 1)
|
2001-07-21 06:53:06 -04:00
|
|
|
void cache_entry_commit LDAP_P(( Entry *e ));
|
1999-02-11 12:46:56 -05:00
|
|
|
|
2002-01-01 08:31:20 -05:00
|
|
|
ID cache_find_entry_ndn2id LDAP_P(( Backend *be, Cache *cache, struct berval *ndn ));
|
1999-07-19 15:40:33 -04:00
|
|
|
Entry * cache_find_entry_id LDAP_P(( Cache *cache, ID id, int rw ));
|
|
|
|
|
int cache_delete_entry LDAP_P(( Cache *cache, Entry *e ));
|
|
|
|
|
void cache_release_all LDAP_P(( Cache *cache ));
|
1998-08-08 20:43:13 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* dbcache.c
|
|
|
|
|
*/
|
|
|
|
|
|
1999-07-19 15:40:33 -04:00
|
|
|
DBCache * ldbm_cache_open LDAP_P(( Backend *be,
|
2000-05-21 23:46:57 -04:00
|
|
|
const char *name, const char *suffix, int flags ));
|
1999-07-19 15:40:33 -04:00
|
|
|
void ldbm_cache_close LDAP_P(( Backend *be, DBCache *db ));
|
|
|
|
|
void ldbm_cache_really_close LDAP_P(( Backend *be, DBCache *db ));
|
1998-10-24 21:41:42 -04:00
|
|
|
void ldbm_cache_flush_all LDAP_P(( Backend *be ));
|
2001-06-22 04:38:58 -04:00
|
|
|
void ldbm_cache_sync LDAP_P(( Backend *be ));
|
2003-02-07 10:20:57 -05:00
|
|
|
#if 0 /* replaced by macro */
|
1999-07-19 15:40:33 -04:00
|
|
|
Datum ldbm_cache_fetch LDAP_P(( DBCache *db, Datum key ));
|
2003-02-07 10:20:57 -05:00
|
|
|
#else /* 1 */
|
|
|
|
|
#define ldbm_cache_fetch( db, key ) ldbm_fetch( (db)->dbc_db, (key) )
|
|
|
|
|
#endif /* 1 */
|
1999-07-19 15:40:33 -04:00
|
|
|
int ldbm_cache_store LDAP_P(( DBCache *db, Datum key, Datum data, int flags ));
|
|
|
|
|
int ldbm_cache_delete LDAP_P(( DBCache *db, Datum key ));
|
2001-06-28 05:20:33 -04:00
|
|
|
void *ldbm_cache_sync_daemon LDAP_P(( void *));
|
1998-08-08 20:43:13 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* dn2id.c
|
|
|
|
|
*/
|
|
|
|
|
|
2002-01-01 08:31:20 -05:00
|
|
|
int dn2id_add LDAP_P(( Backend *be, struct berval *dn, ID id ));
|
|
|
|
|
int dn2id LDAP_P(( Backend *be, struct berval *dn, ID *idp ));
|
2001-12-26 18:37:59 -05:00
|
|
|
int dn2idl LDAP_P(( Backend *be, struct berval *dn, int prefix, ID_BLOCK **idlp ));
|
2002-01-01 08:31:20 -05:00
|
|
|
int dn2id_delete LDAP_P(( Backend *be, struct berval *dn, ID id ));
|
1999-02-11 12:46:56 -05:00
|
|
|
|
2002-01-01 08:31:20 -05:00
|
|
|
Entry * dn2entry_rw LDAP_P(( Backend *be, struct berval *dn, Entry **matched, int rw ));
|
1999-02-11 12:46:56 -05:00
|
|
|
#define dn2entry_r(be, dn, m) dn2entry_rw((be), (dn), (m), 0)
|
|
|
|
|
#define dn2entry_w(be, dn, m) dn2entry_rw((be), (dn), (m), 1)
|
1998-08-08 20:43:13 -04:00
|
|
|
|
1999-04-13 02:08:28 -04:00
|
|
|
/*
|
|
|
|
|
* entry.c
|
|
|
|
|
*/
|
2003-03-30 04:03:54 -05:00
|
|
|
BI_entry_release_rw ldbm_back_entry_release_rw;
|
2003-03-26 06:50:03 -05:00
|
|
|
BI_entry_get_rw ldbm_back_entry_get;
|
|
|
|
|
|
1998-08-08 20:43:13 -04:00
|
|
|
/*
|
|
|
|
|
* filterindex.c
|
|
|
|
|
*/
|
|
|
|
|
|
2003-04-10 21:29:28 -04:00
|
|
|
ID_BLOCK * filter_candidates LDAP_P(( Operation *op, Filter *f ));
|
1998-08-08 20:43:13 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* id2children.c
|
|
|
|
|
*/
|
|
|
|
|
|
1998-10-24 21:41:42 -04:00
|
|
|
int id2children_add LDAP_P(( Backend *be, Entry *p, Entry *e ));
|
Protoized, moved extern definitions to .h files, fixed related bugs.
Most function and variable definitions are now preceded by its extern
definition, for error checking. Retyped a number of functions, usually
to return void. Fixed a number of printf format errors.
API changes (in ldap/include):
Added avl_dup_ok, avl_prefixapply, removed ber_fatten (probably typo
for ber_flatten), retyped ldap_sort_strcasecmp, grew lutil.h.
A number of `extern' declarations are left (some added by protoize), to
be cleaned away later. Mostly strdup(), strcasecmp(), mktemp(), optind,
optarg, errno.
1998-11-15 17:40:11 -05:00
|
|
|
int id2children_remove LDAP_P(( Backend *be, Entry *p, Entry *e ));
|
1998-10-24 21:41:42 -04:00
|
|
|
int has_children LDAP_P(( Backend *be, Entry *p ));
|
1998-08-08 20:43:13 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* id2entry.c
|
|
|
|
|
*/
|
|
|
|
|
|
1998-10-24 21:41:42 -04:00
|
|
|
int id2entry_add LDAP_P(( Backend *be, Entry *e ));
|
|
|
|
|
int id2entry_delete LDAP_P(( Backend *be, Entry *e ));
|
1999-02-11 12:46:56 -05:00
|
|
|
|
1999-02-10 13:28:25 -05:00
|
|
|
Entry * id2entry_rw LDAP_P(( Backend *be, ID id, int rw ));
|
1999-02-11 12:46:56 -05:00
|
|
|
#define id2entry_r(be, id) id2entry_rw((be), (id), 0)
|
|
|
|
|
#define id2entry_w(be, id) id2entry_rw((be), (id), 1)
|
1998-08-08 20:43:13 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* idl.c
|
|
|
|
|
*/
|
|
|
|
|
|
1999-03-01 17:37:05 -05:00
|
|
|
ID_BLOCK * idl_alloc LDAP_P(( unsigned int nids ));
|
1999-01-31 02:55:53 -05:00
|
|
|
ID_BLOCK * idl_allids LDAP_P(( Backend *be ));
|
|
|
|
|
void idl_free LDAP_P(( ID_BLOCK *idl ));
|
1999-07-19 15:40:33 -04:00
|
|
|
ID_BLOCK * idl_fetch LDAP_P(( Backend *be, DBCache *db, Datum key ));
|
|
|
|
|
int idl_insert_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
|
1999-03-01 17:37:05 -05:00
|
|
|
int idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned int maxids ));
|
1999-07-19 15:40:33 -04:00
|
|
|
int idl_delete_key LDAP_P(( Backend *be, DBCache *db, Datum key, ID id ));
|
1999-01-31 02:55:53 -05:00
|
|
|
ID_BLOCK * idl_intersection LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
|
|
|
|
|
ID_BLOCK * idl_union LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
|
|
|
|
|
ID_BLOCK * idl_notin LDAP_P(( Backend *be, ID_BLOCK *a, ID_BLOCK *b ));
|
1999-08-07 17:14:24 -04:00
|
|
|
ID idl_firstid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
|
|
|
|
|
ID idl_nextid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
|
1998-08-08 20:43:13 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* index.c
|
|
|
|
|
*/
|
2000-06-04 18:59:38 -04:00
|
|
|
extern int
|
2002-01-13 18:23:23 -05:00
|
|
|
index_is_indexed LDAP_P((
|
|
|
|
|
Backend *be,
|
|
|
|
|
AttributeDescription *desc ));
|
|
|
|
|
|
|
|
|
|
extern int
|
2000-06-04 18:59:38 -04:00
|
|
|
index_param LDAP_P((
|
|
|
|
|
Backend *be,
|
|
|
|
|
AttributeDescription *desc,
|
|
|
|
|
int ftype,
|
|
|
|
|
char **dbname,
|
2000-08-22 17:26:25 -04:00
|
|
|
slap_mask_t *mask,
|
2001-11-16 02:45:37 -05:00
|
|
|
struct berval *prefix ));
|
2000-06-04 18:59:38 -04:00
|
|
|
|
|
|
|
|
extern int
|
|
|
|
|
index_values LDAP_P((
|
2003-04-10 21:29:28 -04:00
|
|
|
Operation *op,
|
2000-06-04 18:59:38 -04:00
|
|
|
AttributeDescription *desc,
|
2002-01-13 20:43:17 -05:00
|
|
|
BerVarray vals,
|
2000-06-04 18:59:38 -04:00
|
|
|
ID id,
|
2003-04-10 21:29:28 -04:00
|
|
|
int opid ));
|
2000-06-04 18:59:38 -04:00
|
|
|
|
2003-04-10 21:29:28 -04:00
|
|
|
int index_entry LDAP_P(( Operation *op, int r, Entry *e ));
|
2003-03-30 04:03:54 -05:00
|
|
|
#define index_entry_add(be,e) index_entry((be),SLAP_INDEX_ADD_OP,(e))
|
|
|
|
|
#define index_entry_del(be,e) index_entry((be),SLAP_INDEX_DELETE_OP,(e))
|
2000-06-04 18:59:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* key.c
|
|
|
|
|
*/
|
|
|
|
|
extern int
|
|
|
|
|
key_change LDAP_P((
|
|
|
|
|
Backend *be,
|
|
|
|
|
DBCache *db,
|
|
|
|
|
struct berval *k,
|
|
|
|
|
ID id,
|
|
|
|
|
int op ));
|
|
|
|
|
extern int
|
|
|
|
|
key_read LDAP_P((
|
|
|
|
|
Backend *be,
|
|
|
|
|
DBCache *db,
|
|
|
|
|
struct berval *k,
|
|
|
|
|
ID_BLOCK **idout ));
|
1999-06-15 19:56:28 -04:00
|
|
|
|
1999-03-03 17:00:16 -05:00
|
|
|
/*
|
|
|
|
|
* modify.c
|
|
|
|
|
* These prototypes are placed here because they are used by modify and
|
|
|
|
|
* modify rdn which are implemented in different files.
|
1999-05-19 00:00:58 -04:00
|
|
|
*
|
|
|
|
|
* We need ldbm_internal_modify here because of LDAP modrdn & modify use
|
|
|
|
|
* it. If we do not add this, there would be a bunch of code replication
|
|
|
|
|
* here and there and of course the likelihood of bugs increases.
|
|
|
|
|
* Juan C. Gomez (gomez@engr.sgi.com) 05/18/99
|
|
|
|
|
*
|
1999-03-03 17:00:16 -05:00
|
|
|
*/
|
|
|
|
|
|
1999-12-07 23:37:59 -05:00
|
|
|
/* returns LDAP error code indicating error OR SLAPD_ABANDON */
|
2003-03-30 04:03:54 -05:00
|
|
|
int ldbm_modify_internal LDAP_P(( Operation *op,
|
|
|
|
|
Modifications *mods, Entry *e,
|
2001-06-05 20:23:56 -04:00
|
|
|
const char **text, char *textbuf, size_t textlen ));
|
1998-08-08 20:43:13 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* nextid.c
|
|
|
|
|
*/
|
|
|
|
|
|
2001-07-20 05:50:28 -04:00
|
|
|
int next_id LDAP_P(( Backend *be, ID *idp ));
|
|
|
|
|
int next_id_get LDAP_P(( Backend *be, ID *idp ));
|
|
|
|
|
int next_id_write LDAP_P(( Backend *be, ID id ));
|
1998-08-08 20:43:13 -04:00
|
|
|
|
1998-10-24 21:41:42 -04:00
|
|
|
LDAP_END_DECL
|
1998-08-08 20:43:13 -04:00
|
|
|
#endif
|