1 /* index.c - routines for dealing with attribute indexes */
4 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/string.h>
13 #include <ac/socket.h>
16 #include "back-ldbm.h"
30 Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 );
32 ldbm_datum_init( key );
34 key.dsize = k->bv_len;
36 idl = idl_fetch( be, db, key );
38 Debug( LDAP_DEBUG_TRACE, "<= index_read %ld candidates\n",
39 idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
45 /* Add or remove stuff from index files */
58 Debug( LDAP_DEBUG_TRACE, "=> key_change(%s,%lx)\n",
59 op == SLAP_INDEX_ADD_OP ? "ADD":"DELETE", (long) id, 0 );
61 ldbm_datum_init( key );
63 key.dsize = k->bv_len;
65 if (op == SLAP_INDEX_ADD_OP) {
67 rc = idl_insert_key( be, db, key, id );
71 rc = idl_delete_key( be, db, key, id );
75 Debug( LDAP_DEBUG_TRACE, "<= key_change %d\n", rc, 0, 0 );
77 ldap_pvt_thread_yield();