]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/proto-back-ldbm.h
Replaced add/delete_value() by change_value() and index_add/delete_value()
[openldap] / servers / slapd / back-ldbm / proto-back-ldbm.h
index 5650befa2bf53f9ec4ee3b537357318a7e3871e0..a5066eff8b14b8c00a0d1b193e9e2fe4404f92b3 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <ldap_cdefs.h>
 
+#include "external.h"
+
 LDAP_BEGIN_DECL
 
 /*
@@ -27,18 +29,26 @@ void attr_masks LDAP_P(( struct ldbminfo *li, char *type, int *indexmask,
  int *syntaxmask ));
 void attr_index_config LDAP_P(( struct ldbminfo *li, char *fname, int lineno,
  int argc, char **argv, int init ));
+#ifdef SLAP_CLEANUP
+void attr_index_destroy LDAP_P(( Avlnode *tree ));
+#endif
 
 /*
  * cache.c
  */
 
-void cache_set_state LDAP_P(( struct cache *cache, Entry *e, int state ));
-void cache_return_entry_r LDAP_P(( struct cache *cache, Entry *e ));
-void cache_return_entry_w LDAP_P(( struct cache *cache, Entry *e ));
-int cache_add_entry_lock LDAP_P(( struct cache *cache, Entry *e, int state ));
+int cache_add_entry_rw LDAP_P(( struct cache *cache, Entry *e, int rw ));
+int cache_update_entry LDAP_P(( struct cache *cache, Entry *e ));
+void cache_return_entry_rw LDAP_P(( struct 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)
+
 ID cache_find_entry_dn2id LDAP_P(( Backend *be, struct cache *cache, char *dn ));
 Entry * cache_find_entry_id LDAP_P(( struct cache *cache, ID id, int rw ));
 int cache_delete_entry LDAP_P(( struct cache *cache, Entry *e ));
+#ifdef SLAP_CLEANUP
+void cache_release_all LDAP_P(( struct cache *cache ));
+#endif
 
 /*
  * dbcache.c
@@ -60,8 +70,15 @@ int ldbm_cache_delete LDAP_P(( struct dbcache *db, Datum key ));
 int dn2id_add LDAP_P(( Backend *be, char *dn, ID id ));
 ID dn2id LDAP_P(( Backend *be, char *dn ));
 int dn2id_delete LDAP_P(( Backend *be, char *dn ));
-Entry * dn2entry_r LDAP_P(( Backend *be, char *dn, char **matched ));
-Entry * dn2entry_w LDAP_P(( Backend *be, char *dn, char **matched ));
+
+Entry * dn2entry_rw LDAP_P(( Backend *be, char *dn, char **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 ));
 
 /*
  * filterindex.c
@@ -83,20 +100,21 @@ int has_children LDAP_P(( Backend *be, Entry *p ));
 
 int id2entry_add LDAP_P(( Backend *be, Entry *e ));
 int id2entry_delete LDAP_P(( Backend *be, Entry *e ));
-Entry * id2entry LDAP_P(( Backend *be, ID id, int rw )); 
-Entry * id2entry_r LDAP_P(( Backend *be, ID id ));
-Entry * id2entry_w LDAP_P(( Backend *be, ID id ));
+
+Entry * id2entry_rw LDAP_P(( Backend *be, ID id, int rw )); 
+#define id2entry_r(be, id)     id2entry_rw((be), (id), 0)
+#define id2entry_w(be, id)     id2entry_rw((be), (id), 1)
 
 /*
  * idl.c
  */
 
-ID_BLOCK * idl_alloc LDAP_P(( int nids ));
+ID_BLOCK * idl_alloc LDAP_P(( unsigned int nids ));
 ID_BLOCK * idl_allids LDAP_P(( Backend *be ));
 void idl_free LDAP_P(( ID_BLOCK *idl ));
 ID_BLOCK * idl_fetch LDAP_P(( Backend *be, struct dbcache *db, Datum key ));
 int idl_insert_key LDAP_P(( Backend *be, struct dbcache *db, Datum key, ID id ));
-int idl_insert LDAP_P(( ID_BLOCK **idl, ID id, int maxids ));
+int idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned int maxids ));
 int idl_delete_key LDAP_P(( Backend *be, struct dbcache *db, Datum key, ID id ));
 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 ));
@@ -111,7 +129,15 @@ ID idl_nextid LDAP_P(( ID_BLOCK *idl, ID id ));
 int index_add_entry LDAP_P(( Backend *be, Entry *e ));
 int index_add_mods LDAP_P(( Backend *be, LDAPModList *ml, ID id ));
 ID_BLOCK * index_read LDAP_P(( Backend *be, char *type, int indextype, char *val ));
-int index_add_values LDAP_P(( Backend *be, char *type, struct berval **vals, ID  id ));
+/* Possible operations supported (op) by index_change_values() */
+#define __INDEX_ADD_OP         0x0001
+#define __INDEX_DELETE_OP      0x0002
+int index_change_values LDAP_P(( Backend *be,
+                                char *type,
+                                struct berval **vals,
+                                ID  id,
+                                unsigned int op ));
+
 
 /*
  * kerberos.c
@@ -120,14 +146,24 @@ int index_add_values LDAP_P(( Backend *be, char *type, struct berval **vals, ID
 #ifdef HAVE_KERBEROS
 /* krbv4_ldap_auth LDAP_P(( Backend *be, struct berval *cred, AUTH_DAT *ad )); */
 #endif
-
 /*
- * startup.c
+ * modify.c
+ * These prototypes are placed here because they are used by modify and
+ * modify rdn which are implemented in different files. 
+ *
+ * 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
+ * 
  */
 
-void ldbm_back_startup  LDAP_P(( Backend *be ));
-void ldbm_back_shutdown LDAP_P(( Backend *be ));
-void ldbm_db_errcall LDAP_P(( const char *prefix, char *message ));
+int add_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
+int delete_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
+int replace_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
+int ldbm_modify_internal LDAP_P((Backend *be, Connection *conn, Operation *op,
+                                char *dn, LDAPModList *mods, Entry *e));
 
 /*
  * nextid.c