static int
cache_entry_rdwr_lock(Entry *e, int rw)
{
- Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%slock: ID: %lu\n",
+ Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%slock: ID: %ld\n",
rw ? "w" : "r", e->e_id, 0);
if (rw)
static int
cache_entry_rdwr_trylock(Entry *e, int rw)
{
- Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%strylock: ID: %lu\n",
+ Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%strylock: ID: %ld\n",
rw ? "w" : "r", e->e_id, 0);
if (rw)
static int
cache_entry_rdwr_unlock(Entry *e, int rw)
{
- Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%sunlock: ID: %lu\n",
+ Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%sunlock: ID: %ld\n",
rw ? "w" : "r", e->e_id, 0);
if (rw)
if ( LEI(e)->lei_state == CACHE_ENTRY_CREATING ) {
Debug( LDAP_DEBUG_TRACE,
- "====> cache_return_entry_%s( %lu ): created (%d)\n",
+ "====> cache_return_entry_%s( %ld ): created (%d)\n",
rw ? "w" : "r", e->e_id, LEI(e)->lei_refcnt );
LEI(e)->lei_state = CACHE_ENTRY_READY;
} else if ( LEI(e)->lei_state == CACHE_ENTRY_DELETED ) {
if( LEI(e)->lei_refcnt > 0 ) {
Debug( LDAP_DEBUG_TRACE,
- "====> cache_return_entry_%s( %lu ): delete pending (%d)\n",
+ "====> cache_return_entry_%s( %ld ): delete pending (%d)\n",
rw ? "w" : "r", e->e_id, LEI(e)->lei_refcnt );
} else {
Debug( LDAP_DEBUG_TRACE,
- "====> cache_return_entry_%s( %lu ): deleted (%d)\n",
+ "====> cache_return_entry_%s( %ld ): deleted (%d)\n",
rw ? "w" : "r", e->e_id, LEI(e)->lei_refcnt );
cache_entry_private_destroy( e );
} else {
Debug( LDAP_DEBUG_TRACE,
- "====> cache_return_entry_%s( %lu ): returned (%d)\n",
+ "====> cache_return_entry_%s( %ld ): returned (%d)\n",
rw ? "w" : "r", e->e_id, LEI(e)->lei_refcnt);
}
if( cache_entry_private_init(e) != 0 ) {
Debug( LDAP_DEBUG_ANY,
- "====> cache_add_entry( %lu ): \"%s\": private init failed!\n",
+ "====> cache_add_entry( %ld ): \"%s\": private init failed!\n",
e->e_id, e->e_dn, 0 );
return( -1 );
}
entry_dn_cmp, avl_dup_error ) != 0 )
{
Debug( LDAP_DEBUG_TRACE,
- "====> cache_add_entry( %lu ): \"%s\": already in dn cache\n",
+ "====> cache_add_entry( %ld ): \"%s\": already in dn cache\n",
e->e_id, e->e_dn, 0 );
cache_entry_private_destroy(e);
entry_id_cmp, avl_dup_error ) != 0 )
{
Debug( LDAP_DEBUG_ANY,
- "====> cache_add_entry( %lu ): \"%s\": already in id cache\n",
+ "====> cache_add_entry( %ld ): \"%s\": already in id cache\n",
e->e_id, e->e_dn, 0 );
entry_dn_cmp, avl_dup_error ) != 0 )
{
Debug( LDAP_DEBUG_TRACE,
- "====> cache_update_entry( %lu ): \"%s\": already in dn cache\n",
+ "====> cache_update_entry( %ld ): \"%s\": already in dn cache\n",
e->e_id, e->e_dn, 0 );
/* free cache mutex */
entry_id_cmp, avl_dup_error ) != 0 )
{
Debug( LDAP_DEBUG_ANY,
- "====> cache_update_entry( %lu ): \"%s\": already in id cache\n",
+ "====> cache_update_entry( %ld ): \"%s\": already in id cache\n",
e->e_id, e->e_dn, 0 );
/* delete from dn tree inserted above */
assert(LEI(ep)->lei_state != CACHE_ENTRY_UNDEFINED);
#endif
Debug(LDAP_DEBUG_TRACE,
- "====> cache_find_entry_dn2id(\"%s\"): %lu (not ready) %d\n",
+ "====> cache_find_entry_dn2id(\"%s\"): %ld (not ready) %d\n",
dn, ep->e_id, LEI(ep)->lei_state);
/* free cache mutex */
}
Debug(LDAP_DEBUG_TRACE,
- "====> cache_find_entry_dn2id(\"%s\"): %lu\n",
+ "====> cache_find_entry_dn2id(\"%s\"): %ld\n",
dn, ep->e_id, 0);
/* lru */
assert(LEI(ep)->lei_state != CACHE_ENTRY_UNDEFINED);
#endif
Debug(LDAP_DEBUG_TRACE,
- "====> cache_find_entry_id( %lu ): %lu (not ready) %d\n",
+ "====> cache_find_entry_id( %ld ): %ld (not ready) %d\n",
id, ep->e_id, LEI(ep)->lei_state);
/* free cache mutex */
}
Debug(LDAP_DEBUG_TRACE,
- "====> cache_find_entry_id( %lu, %s ) \"%s\" (found)\n",
+ "====> cache_find_entry_id( %ld, %s ) \"%s\" (found)\n",
id, rw ? "w" : "r", ep->e_dn);
/* acquire reader lock */
assert( e->e_private );
#endif
- Debug( LDAP_DEBUG_TRACE, "====> cache_delete_entry( %lu )\n",
+ Debug( LDAP_DEBUG_TRACE, "====> cache_delete_entry( %ld )\n",
e->e_id, 0, 0 );
rc = cache_delete_entry_internal( cache, e );
fprintf( stderr, "LRU queue (head to tail):\n" );
for ( e = cache->c_lruhead; e != NULL; e = LEI(e)->lei_lrunext ) {
- fprintf( stderr, "\tdn \"%20s\" id %lu refcnt %d\n",
+ fprintf( stderr, "\tdn \"%20s\" id %ld refcnt %d\n",
e->e_dn, e->e_id, LEI(e)->lei_refcnt );
}
fprintf( stderr, "LRU queue (tail to head):\n" );
for ( e = cache->c_lrutail; e != NULL; e = LEI(e)->lei_lruprev ) {
- fprintf( stderr, "\tdn \"%20s\" id %lu refcnt %d\n",
+ fprintf( stderr, "\tdn \"%20s\" id %ld refcnt %d\n",
e->e_dn, e->e_id, LEI(e)->lei_refcnt );
}
}
/* first check the cache */
if ( (id = cache_find_entry_dn2id( be, &li->li_cache, dn )) != NOID ) {
free( dn );
- Debug( LDAP_DEBUG_TRACE, "<= dn2id %lu (in cache)\n", id,
+ Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld (in cache)\n", id,
0, 0 );
return( id );
}
ldbm_datum_free( db->dbc_db, data );
- Debug( LDAP_DEBUG_TRACE, "<= dn2id %lu\n", id, 0, 0 );
+ Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld\n", id, 0, 0 );
return( id );
}
if ( id != NOID ) {
Debug(LDAP_DEBUG_ANY,
- "dn2entry_%s: no entry for valid id (%lu), dn \"%s\"\n",
+ "dn2entry_%s: no entry for valid id (%ld), dn \"%s\"\n",
rw ? "w" : "r", id, dn);
/* must have been deleted from underneath us */
/* treat as if NOID was found */
break;
}
- Debug( LDAP_DEBUG_TRACE, "<= filter_candidates %lu\n",
+ Debug( LDAP_DEBUG_TRACE, "<= filter_candidates %ld\n",
result ? ID_BLOCK_NIDS(result) : 0, 0, 0 );
return( result );
}
break;
}
- Debug( LDAP_DEBUG_TRACE, "<= ava_candidates %lu\n",
+ Debug( LDAP_DEBUG_TRACE, "<= ava_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
return( idl );
}
idl = index_read( be, type, 0, "*" );
- Debug( LDAP_DEBUG_TRACE, "<= presence_candidates %lu\n",
+ Debug( LDAP_DEBUG_TRACE, "<= presence_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
return( idl );
}
}
}
- Debug( LDAP_DEBUG_TRACE, "<= approx_candidates %lu\n",
+ Debug( LDAP_DEBUG_TRACE, "<= approx_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
return( idl );
}
}
}
- Debug( LDAP_DEBUG_TRACE, "<= list_candidates %lu\n",
+ Debug( LDAP_DEBUG_TRACE, "<= list_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
return( idl );
}
}
}
- Debug( LDAP_DEBUG_TRACE, "<= substring_candidates %lu\n",
+ Debug( LDAP_DEBUG_TRACE, "<= substring_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
return( idl );
}
}
}
- Debug( LDAP_DEBUG_TRACE, "<= substring_comp_candidates %lu\n",
+ Debug( LDAP_DEBUG_TRACE, "<= substring_comp_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
return( idl );
}
ldbm_datum_init( key );
- Debug( LDAP_DEBUG_TRACE, "=> id2children_add( %lu, %lu )\n",
+ Debug( LDAP_DEBUG_TRACE, "=> id2children_add( %ld, %ld )\n",
p ? p->e_id : 0, e->e_id, 0 );
if ( (db = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
ID_BLOCK *idl;
char buf[20];
- Debug( LDAP_DEBUG_TRACE, "=> id2children_remove( %lu, %lu )\n", p ? p->e_id
+ Debug( LDAP_DEBUG_TRACE, "=> id2children_remove( %ld, %ld )\n", p ? p->e_id
: 0, e->e_id, 0 );
if ( (db = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
ldbm_datum_init( key );
- Debug( LDAP_DEBUG_TRACE, "=> has_children( %lu )\n", p->e_id , 0, 0 );
+ Debug( LDAP_DEBUG_TRACE, "=> has_children( %ld )\n", p->e_id , 0, 0 );
if ( (db = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
LDBM_WRCREAT )) == NULL ) {
rc = 1;
}
- Debug( LDAP_DEBUG_TRACE, "<= has_children( %lu ): %s\n",
+ Debug( LDAP_DEBUG_TRACE, "<= has_children( %ld ): %s\n",
p->e_id, rc ? "yes" : "no", 0 );
return( rc );
}
ldbm_datum_init( key );
ldbm_datum_init( data );
- Debug( LDAP_DEBUG_TRACE, "=> id2entry_add( %lu, \"%s\" )\n", e->e_id,
+ Debug( LDAP_DEBUG_TRACE, "=> id2entry_add( %ld, \"%s\" )\n", e->e_id,
e->e_dn, 0 );
if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
Datum key;
int rc;
- Debug(LDAP_DEBUG_TRACE, "=> id2entry_delete( %lu, \"%s\" )\n", e->e_id,
+ Debug(LDAP_DEBUG_TRACE, "=> id2entry_delete( %ld, \"%s\" )\n", e->e_id,
e->e_dn, 0 );
#ifdef notdef
}
if ( cache_delete_entry( &li->li_cache, e ) != 0 ) {
- Debug(LDAP_DEBUG_ANY, "could not delete %lu (%s) from cache\n",
+ Debug(LDAP_DEBUG_ANY, "could not delete %ld (%s) from cache\n",
e->e_id, e->e_dn, 0 );
}
}
free( (char *) tmp );
- Debug( LDAP_DEBUG_TRACE, "<= idl_fetch %lu ids (%lu max)\n",
+ Debug( LDAP_DEBUG_TRACE, "<= idl_fetch %ld ids (%ld max)\n",
ID_BLOCK_NIDS(idl), ID_BLOCK_NMAX(idl), 0 );
return( idl );
}
case 0: /* id inserted */
if ( rc == 2 ) {
Debug( LDAP_DEBUG_ANY,
- "id %lu already in next block\n",
+ "id %ld already in next block\n",
id, 0, 0 );
}
free( kstr );
if ( ! (indextype & indexmask) ) {
idl = idl_allids( be );
Debug( LDAP_DEBUG_TRACE,
- "<= index_read %lu candidates (allids - not indexed)\n",
+ "<= index_read %ld candidates (allids - not indexed)\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
return( idl );
}
ldbm_cache_close( be, db );
- Debug( LDAP_DEBUG_TRACE, "<= index_read %lu candidates\n",
+ Debug( LDAP_DEBUG_TRACE, "<= index_read %ld candidates\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
return( idl );
}
if(id < 1) {
Debug( LDAP_DEBUG_ANY,
- "next_id_read %lu: atol(%s) return non-positive integer\n",
+ "next_id_read %ld: atol(%s) return non-positive integer\n",
id, buf, 0 );
return NOID;
}
int rc;
if ( (fp = fopen( file, "w" )) == NULL ) {
- Debug( LDAP_DEBUG_ANY, "next_id_write(%lu): could not open \"%s\"\n",
+ Debug( LDAP_DEBUG_ANY, "next_id_write(%ld): could not open \"%s\"\n",
id, file, 0 );
return -1;
}
rc = 0;
if ( fprintf( fp, "%ld\n", id ) == EOF ) {
- Debug( LDAP_DEBUG_ANY, "next_id_write(%lu): cannot fprintf\n",
+ Debug( LDAP_DEBUG_ANY, "next_id_write(%ld): cannot fprintf\n",
id, 0, 0 );
rc = -1;
}
if( fclose( fp ) != 0 ) {
- Debug( LDAP_DEBUG_ANY, "next_id_write %lu: cannot fclose\n",
+ Debug( LDAP_DEBUG_ANY, "next_id_write %ld: cannot fclose\n",
id, 0, 0 );
rc = -1;
}
/* get the entry with reader lock */
if ( (e = id2entry_r( be, id )) == NULL ) {
- Debug( LDAP_DEBUG_ARGS, "candidate %lu not found\n",
+ Debug( LDAP_DEBUG_ARGS, "candidate %ld not found\n",
id, 0, 0 );
continue;
}
if ( strcasecmp( type, "dn" ) == 0 ) {
if ( e->e_dn != NULL ) {
Debug( LDAP_DEBUG_ANY,
- "str2entry: entry %lu has multiple dns \"%s\" and \"%s\" (second ignored)\n",
+ "str2entry: entry %ld has multiple dns \"%s\" and \"%s\" (second ignored)\n",
e->e_id, e->e_dn, value );
continue;
}
if ( e->e_ndn != NULL ) {
Debug( LDAP_DEBUG_ANY,
- "str2entry: entry %lu already has a normalized dn \"%s\" for \"%s\" (first ignored)\n",
+ "str2entry: entry %ld already has a normalized dn \"%s\" for \"%s\" (first ignored)\n",
e->e_id, e->e_ndn, value );
free( e->e_ndn );
}
/* check to make sure there was a dn: line */
if ( e->e_dn == NULL ) {
- Debug( LDAP_DEBUG_ANY, "str2entry: entry %lu has no dn\n",
+ Debug( LDAP_DEBUG_ANY, "str2entry: entry %ld has no dn\n",
e->e_id, 0, 0 );
entry_free( e );
return( NULL );
if ( e->e_ndn == NULL ) {
Debug( LDAP_DEBUG_ANY,
- "str2entry: entry %lu (\"%s\") has no normalized dn\n",
+ "str2entry: entry %ld (\"%s\") has no normalized dn\n",
e->e_id, e->e_dn, 0 );
entry_free( e );
return( NULL );
}
- Debug(LDAP_DEBUG_TRACE, "<= str2entry(%s) -> %lu (0x%lx)\n",
+ Debug(LDAP_DEBUG_TRACE, "<= str2entry(%s) -> %ld (0x%lx)\n",
e->e_dn, e->e_id, (unsigned long)e );
return( e );