1 /* id2children.c - routines to deal with the id2children index */
12 #include "back-bdb2.h"
25 ldbm_datum_init( key );
27 Debug( LDAP_DEBUG_TRACE, "=> bdb2i_has_children( %ld )\n", p->e_id , 0, 0 );
29 if ( (db = bdb2i_cache_open( be, "dn2id", BDB2_SUFFIX,
30 LDBM_WRCREAT )) == NULL ) {
31 Debug( LDAP_DEBUG_ANY,
32 "<= bdb2i_has_children: could not open \"dn2id" BDB2_SUFFIX "\"\n",
37 key.dsize = strlen( p->e_ndn ) + 2;
38 key.dptr = ch_malloc( key.dsize );
39 sprintf( key.dptr, "%c%s", DN_ONE_PREFIX, p->e_ndn );
41 idl = bdb2i_idl_fetch( be, db, key );
45 bdb2i_cache_close( be, db );
48 bdb2i_idl_free( idl );
52 Debug( LDAP_DEBUG_TRACE, "<= bdb2i_has_children( %ld ): %s\n",
53 p->e_id, rc ? "yes" : "no", 0 );