1 /* id2children.c - routines to deal with the id2children index */
4 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/string.h>
13 #include <ac/socket.h>
16 #include "back-ldbm.h"
30 ldbm_datum_init( key );
32 Debug( LDAP_DEBUG_TRACE, "=> has_children( %ld )\n", p->e_id , 0, 0 );
34 if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX,
35 LDBM_WRCREAT )) == NULL ) {
36 Debug( LDAP_DEBUG_ANY,
37 "<= has_children -1 could not open \"dn2id%s\"\n",
42 key.dsize = strlen( p->e_ndn ) + 2;
43 key.dptr = ch_malloc( key.dsize );
44 sprintf( key.dptr, "%c%s", DN_ONE_PREFIX, p->e_ndn );
46 idl = idl_fetch( be, db, key );
50 ldbm_cache_close( be, db );
57 Debug( LDAP_DEBUG_TRACE, "<= has_children( %ld ): %s\n",
58 p->e_id, rc ? "yes" : "no", 0 );