]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb2/idl.c
Factor out ldif2* intialization to ldif2common.c
[openldap] / servers / slapd / back-bdb2 / idl.c
index d9be424cedf0fa8e0c00ad48310c771cdd9ba20c..49521a318baa2b30f037ec4d5d3d93a0b0bfab35 100644 (file)
@@ -7,7 +7,7 @@
 #include <ac/string.h>
 #include <ac/socket.h>
 
-#include "ldapconfig.h"
+#include "ldap_defaults.h"
 #include "slap.h"
 #include "back-bdb2.h"
 
@@ -15,7 +15,7 @@ static ID_BLOCK* idl_dup( ID_BLOCK *idl );
 
 /* Allocate an ID_BLOCK with room for nids ids */
 ID_BLOCK *
-bdb2i_idl_alloc( int nids )
+bdb2i_idl_alloc( unsigned int nids )
 {
        ID_BLOCK        *new;
 
@@ -30,7 +30,7 @@ bdb2i_idl_alloc( int nids )
 
 /* Allocate an empty ALLIDS ID_BLOCK */
 ID_BLOCK       *
-bdb2i_idl_allids( Backend *be )
+bdb2i_idl_allids( BackendDB *be )
 {
        ID_BLOCK        *idl;
 
@@ -60,7 +60,7 @@ bdb2i_idl_free( ID_BLOCK *idl )
 /* Fetch an single ID_BLOCK from the cache */
 static ID_BLOCK *
 idl_fetch_one(
-    Backend            *be,
+    BackendDB          *be,
     struct dbcache     *db,
     Datum              key
 )
@@ -96,7 +96,7 @@ idl_fetch_one(
  */
 ID_BLOCK *
 bdb2i_idl_fetch(
-    Backend            *be,
+    BackendDB          *be,
     struct dbcache     *db,
     Datum              key
 )
@@ -181,7 +181,7 @@ bdb2i_idl_fetch(
        }
        free( (char *) tmp );
 
-       Debug( LDAP_DEBUG_TRACE, "<= bdb2i_idl_fetch %lu ids (%lu max)\n",
+       Debug( LDAP_DEBUG_TRACE, "<= bdb2i_idl_fetch %ld ids (%ld max)\n",
               ID_BLOCK_NIDS(idl), ID_BLOCK_NMAX(idl), 0 );
        return( idl );
 }
@@ -190,7 +190,7 @@ bdb2i_idl_fetch(
 /* store a single block */
 static int
 idl_store(
-    Backend            *be,
+    BackendDB          *be,
     struct dbcache     *db,
     Datum              key, 
     ID_BLOCK           *idl
@@ -276,7 +276,7 @@ idl_split_block(
  */
 static int
 idl_change_first(
-    Backend            *be,
+    BackendDB          *be,
     struct dbcache     *db,
     Datum              hkey,           /* header block key     */
     ID_BLOCK           *h,             /* header block         */
@@ -292,7 +292,7 @@ idl_change_first(
        /* delete old key block */
        if ( (rc = bdb2i_cache_delete( db, bkey )) != 0 ) {
                Debug( LDAP_DEBUG_ANY,
-                   "ldbm_delete of (%s) returns %d\n", bkey.dptr, rc,
+                   "bdb2i_db_delete of (%s) returns %d\n", bkey.dptr, rc,
                    0 );
                return( rc );
        }
@@ -320,7 +320,7 @@ idl_change_first(
 
 int
 bdb2i_idl_insert_key(
-    Backend            *be,
+    BackendDB          *be,
     struct dbcache     *db,
     Datum              key,
     ID                 id
@@ -500,7 +500,7 @@ bdb2i_idl_insert_key(
                        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 );
@@ -615,7 +615,7 @@ bdb2i_idl_insert_key(
  *             3       id not inserted, block must be split
  */
 int
-bdb2i_idl_insert( ID_BLOCK **idl, ID id, int maxids )
+bdb2i_idl_insert( ID_BLOCK **idl, ID id, unsigned int maxids )
 {
        unsigned int    i, j;
 
@@ -663,7 +663,7 @@ bdb2i_idl_insert( ID_BLOCK **idl, ID id, int maxids )
 
 int
 bdb2i_idl_delete_key (
-       Backend         *be,
+       BackendDB         *be,
        struct dbcache  *db,
        Datum           key,
        ID              id
@@ -801,7 +801,7 @@ idl_min( ID_BLOCK *a, ID_BLOCK *b )
  */
 ID_BLOCK *
 bdb2i_idl_intersection(
-    Backend    *be,
+    BackendDB  *be,
     ID_BLOCK   *a,
     ID_BLOCK   *b
 )
@@ -853,7 +853,7 @@ bdb2i_idl_intersection(
  */
 ID_BLOCK *
 bdb2i_idl_union(
-    Backend    *be,
+    BackendDB  *be,
     ID_BLOCK   *a,
     ID_BLOCK   *b
 )
@@ -912,7 +912,7 @@ bdb2i_idl_union(
  */
 ID_BLOCK *
 bdb2i_idl_notin(
-    Backend    *be,
+    BackendDB  *be,
     ID_BLOCK   *a,
     ID_BLOCK   *b
 )