1 /* id2children.c - routines to deal with the id2children index */
3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
10 #include <ac/string.h>
12 #include <ac/socket.h>
15 #include "back-ldbm.h"
29 ldbm_datum_init( key );
31 Debug( LDAP_DEBUG_TRACE, "=> has_children( %ld )\n", p->e_id , 0, 0 );
33 if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX,
34 LDBM_WRCREAT )) == NULL ) {
35 Debug( LDAP_DEBUG_ANY,
36 "<= has_children -1 could not open \"dn2id%s\"\n",
41 key.dsize = strlen( p->e_ndn ) + 2;
42 key.dptr = ch_malloc( key.dsize );
43 sprintf( key.dptr, "%c%s", DN_ONE_PREFIX, p->e_ndn );
45 idl = idl_fetch( be, db, key );
49 ldbm_cache_close( be, db );
56 Debug( LDAP_DEBUG_TRACE, "<= has_children( %ld ): %s\n",
57 p->e_id, rc ? "yes" : "no", 0 );