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