/* $OpenLDAP$ */
-/*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2005 The OpenLDAP Foundation.
+ * 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>.
*/
#ifndef _PROTO_BACK_LDBM
#include <ldap_cdefs.h>
-#include "external.h"
-
LDAP_BEGIN_DECL
/*
Entry *deref_internal_r LDAP_P((
Backend *be,
Entry *e,
- const char *dn,
+ struct berval *dn,
int *err,
Entry **matched,
const char **text ));
*/
void attr_mask LDAP_P(( struct ldbminfo *li,
- const char *desc,
- slap_index *indexmask ));
+ AttributeDescription *desc,
+ slap_mask_t *indexmask ));
int attr_index_config LDAP_P(( struct ldbminfo *li,
const char *fname, int lineno,
void cache_return_entry_rw LDAP_P(( Cache *cache, Entry *e, int rw ));
#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)
+void cache_entry_commit LDAP_P(( Entry *e ));
-ID cache_find_entry_dn2id LDAP_P(( Backend *be, Cache *cache, const char *dn ));
+ID cache_find_entry_ndn2id LDAP_P(( Backend *be, Cache *cache, struct berval *ndn ));
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 ));
void ldbm_cache_close LDAP_P(( Backend *be, DBCache *db ));
void ldbm_cache_really_close LDAP_P(( Backend *be, DBCache *db ));
void ldbm_cache_flush_all LDAP_P(( Backend *be ));
+void ldbm_cache_sync LDAP_P(( Backend *be ));
+#if 0 /* replaced by macro */
Datum ldbm_cache_fetch LDAP_P(( DBCache *db, Datum key ));
+#else /* 1 */
+#define ldbm_cache_fetch( db, key ) ldbm_fetch( (db)->dbc_db, (key) )
+#endif /* 1 */
int ldbm_cache_store LDAP_P(( DBCache *db, Datum key, Datum data, int flags ));
int ldbm_cache_delete LDAP_P(( DBCache *db, Datum key ));
+void *ldbm_cache_sync_daemon LDAP_P(( void *));
/*
* dn2id.c
*/
-int dn2id_add LDAP_P(( Backend *be, const char *dn, ID id ));
-ID dn2id LDAP_P(( Backend *be, const char *dn ));
-ID_BLOCK *dn2idl LDAP_P(( Backend *be, const char *dn, int prefix ));
-int dn2id_delete LDAP_P(( Backend *be, const char *dn, ID id ));
+int dn2id_add LDAP_P(( Backend *be, struct berval *dn, ID id ));
+int dn2id LDAP_P(( Backend *be, struct berval *dn, ID *idp ));
+int dn2idl LDAP_P(( Backend *be, struct berval *dn, int prefix, ID_BLOCK **idlp ));
+int dn2id_delete LDAP_P(( Backend *be, struct berval *dn, ID id ));
-Entry * dn2entry_rw LDAP_P(( Backend *be, const char *dn, Entry **matched, int rw ));
+Entry * dn2entry_rw LDAP_P(( Backend *be, struct berval *dn, Entry **matched, int rw ));
#define dn2entry_r(be, dn, m) dn2entry_rw((be), (dn), (m), 0)
#define dn2entry_w(be, dn, m) dn2entry_rw((be), (dn), (m), 1)
/*
* entry.c
*/
-int ldbm_back_entry_release_rw LDAP_P(( Backend *be, Entry *e, int rw ));
+BI_entry_release_rw ldbm_back_entry_release_rw;
+BI_entry_get_rw ldbm_back_entry_get;
/*
* filterindex.c
*/
-ID_BLOCK * filter_candidates LDAP_P(( Backend *be, Filter *f ));
+ID_BLOCK * filter_candidates LDAP_P(( Operation *op, Filter *f ));
/*
* id2children.c
* index.c
*/
extern int
+index_is_indexed LDAP_P((
+ Backend *be,
+ AttributeDescription *desc ));
+
+extern int
index_param LDAP_P((
Backend *be,
AttributeDescription *desc,
int ftype,
char **dbname,
- slap_index *mask,
- struct berval **prefix ));
+ slap_mask_t *mask,
+ struct berval *prefix ));
extern int
index_values LDAP_P((
- Backend *be,
+ Operation *op,
AttributeDescription *desc,
- struct berval **vals,
+ BerVarray vals,
ID id,
- int op ));
+ int opid ));
-int index_entry LDAP_P(( Backend *be, int r, Entry *e, Attribute *ap ));
-#define index_entry_add(be,e,ap) index_entry((be),SLAP_INDEX_ADD_OP,(e),(ap))
-#define index_entry_del(be,e,ap) index_entry((be),SLAP_INDEX_DELETE_OP,(e),(ap))
+int index_entry LDAP_P(( Operation *op, int r, Entry *e ));
+#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))
/*
struct berval *k,
ID_BLOCK **idout ));
-/*
- * passwd.c
- */
-extern int ldbm_back_exop_passwd LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op,
- const char *reqoid,
- struct berval *reqdata,
- char **rspoid,
- struct berval **rspdata,
- LDAPControl ***rspctrls,
- const char **text,
- struct berval *** refs ));
-
-
/*
* modify.c
* These prototypes are placed here because they are used by modify and
*/
/* returns LDAP error code indicating error OR SLAPD_ABANDON */
-int ldbm_modify_internal LDAP_P((Backend *be,
- Connection *conn, Operation *op,
- const char *dn, Modifications *mods, Entry *e,
- const char ** ));
+int ldbm_modify_internal LDAP_P(( Operation *op,
+ Modifications *mods, Entry *e,
+ const char **text, char *textbuf, size_t textlen ));
/*
* nextid.c
*/
-ID next_id LDAP_P(( Backend *be ));
-ID next_id_get LDAP_P(( Backend *be ));
-ID next_id_write LDAP_P(( Backend *be, ID id ));
+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 ));
+
+/*
+ * former external.h
+ */
+
+extern BI_init ldbm_back_initialize;
+
+extern BI_open ldbm_back_open;
+extern BI_close ldbm_back_close;
+extern BI_destroy ldbm_back_destroy;
+
+extern BI_db_init ldbm_back_db_init;
+extern BI_db_open ldbm_back_db_open;
+extern BI_db_close ldbm_back_db_close;
+extern BI_db_destroy ldbm_back_db_destroy;
+extern BI_db_config ldbm_back_db_config;
+
+extern BI_op_extended ldbm_back_extended;
+extern BI_op_bind ldbm_back_bind;
+extern BI_op_search ldbm_back_search;
+extern BI_op_compare ldbm_back_compare;
+extern BI_op_modify ldbm_back_modify;
+extern BI_op_modrdn ldbm_back_modrdn;
+extern BI_op_add ldbm_back_add;
+extern BI_op_delete ldbm_back_delete;
+
+extern BI_operational ldbm_back_operational;
+extern BI_has_subordinates ldbm_back_hasSubordinates;
+
+/* hooks for slap tools */
+extern BI_tool_entry_open ldbm_tool_entry_open;
+extern BI_tool_entry_close ldbm_tool_entry_close;
+extern BI_tool_entry_first ldbm_tool_entry_first;
+extern BI_tool_entry_next ldbm_tool_entry_next;
+extern BI_tool_entry_get ldbm_tool_entry_get;
+extern BI_tool_entry_put ldbm_tool_entry_put;
+
+extern BI_tool_entry_reindex ldbm_tool_entry_reindex;
+extern BI_tool_sync ldbm_tool_sync;
+
+extern BI_chk_referrals ldbm_back_referrals;
LDAP_END_DECL
-#endif
+
+#endif /* _PROTO_BACK_LDBM */