#include <ac/string.h>
#include <ac/socket.h>
-#include "ldapconfig.h"
+#include "ldap_defaults.h"
#include "slap.h"
#include "back-ldbm.h"
/* Allocate an ID_BLOCK with room for nids ids */
ID_BLOCK *
-idl_alloc( int nids )
+idl_alloc( unsigned int nids )
{
ID_BLOCK *new;
static ID_BLOCK *
idl_fetch_one(
Backend *be,
- struct dbcache *db,
+ DBCache *db,
Datum key
)
{
ID_BLOCK *
idl_fetch(
Backend *be,
- struct dbcache *db,
+ DBCache *db,
Datum key
)
{
static int
idl_store(
Backend *be,
- struct dbcache *db,
+ DBCache *db,
Datum key,
ID_BLOCK *idl
)
static int
idl_change_first(
Backend *be,
- struct dbcache *db,
+ DBCache *db,
Datum hkey, /* header block key */
ID_BLOCK *h, /* header block */
int pos, /* pos in h to update */
int
idl_insert_key(
Backend *be,
- struct dbcache *db,
+ DBCache *db,
Datum key,
ID id
)
idl_free( idl );
idl = idl_allids( be );
rc = idl_store( be, db, key, idl );
- idl_free( idl );
-
- return( rc );
+ break;
}
idl_split_block( idl, id, &tmp, &tmp2 );
Debug( LDAP_DEBUG_ANY, "nonexistent continuation block (%s)\n",
k2.dptr, 0, 0 );
free( kstr );
+ idl_free( idl );
return( -1 );
}
return( 0 );
case 3: /* split the original block */
- idl_free( tmp2 );
break;
}
-
+ idl_free( tmp2 );
}
/*
* 3 id not inserted, block must be split
*/
int
-idl_insert( ID_BLOCK **idl, ID id, int maxids )
+idl_insert( ID_BLOCK **idl, ID id, unsigned int maxids )
{
unsigned int i, j;
int
idl_delete_key (
Backend *be,
- struct dbcache *db,
+ DBCache *db,
Datum key,
ID id
)
idl_store( be, db, key, idl );
}
+ idl_free( idl );
return 0;
}
/* We didn't find the ID. Hmmm... */
}
+ idl_free( idl );
return -1;
}
else
idl_store( be, db, key, idl );
}
+ idl_free( tmp );
free( kstr );
+ idl_free( idl );
return 0;
}
}
+ idl_free( tmp );
}
free( kstr );
+ idl_free( idl );
return -1;
}