1 /* id2children.c - routines to deal with the id2children index */
5 #include <sys/socket.h>
9 struct dbcache *ldbm_cache_open();
10 extern Datum ldbm_cache_fetch();
26 Debug( LDAP_DEBUG_TRACE, "=> id2children_add( %d, %d )\n", p ? p->e_id
29 if ( (db = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
30 LDBM_WRCREAT )) == NULL ) {
31 Debug( LDAP_DEBUG_ANY,
32 "<= id2children_add -1 could not open \"id2children%s\"\n",
37 sprintf( buf, "%c%d", EQ_PREFIX, p ? p->e_id : 0 );
39 key.dsize = strlen( buf ) + 1;
41 if ( idl_insert_key( be, db, key, e->e_id ) != 0 ) {
42 Debug( LDAP_DEBUG_TRACE, "<= id2children_add -1 (idl_insert)\n",
44 ldbm_cache_close( be, db );
48 ldbm_cache_close( be, db );
50 Debug( LDAP_DEBUG_TRACE, "<= id2children_add 0\n", 0, 0, 0 );
66 Debug( LDAP_DEBUG_TRACE, "=> has_children( %d )\n", p->e_id , 0, 0 );
68 if ( (db = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
69 LDBM_WRCREAT )) == NULL ) {
70 Debug( LDAP_DEBUG_ANY,
71 "<= has_children -1 could not open \"id2children%s\"\n",
76 sprintf( buf, "%c%d", EQ_PREFIX, p->e_id );
78 key.dsize = strlen( buf ) + 1;
80 idl = idl_fetch( be, db, key );
82 ldbm_cache_close( be, db );
86 Debug( LDAP_DEBUG_TRACE, "<= has_children %d\n", rc, 0, 0 );