]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/attr.c
Initial step of index files fix, more tomorrow.
[openldap] / servers / slapd / back-ldbm / attr.c
index d0bb831c263337797c0f5ed1e8f2603c35664ec8..7818fb1ff671eb5e8069b1da43d582ff9efefa42 100644 (file)
@@ -1,14 +1,15 @@
 /* attr.c - backend routines for dealing with attributes */
 
+#include "portable.h"
+
 #include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+
 #include "slap.h"
 #include "back-ldbm.h"
 
-extern char    **str2charray();
-
 static int
 ainfo_type_cmp(
     char               *type,
@@ -100,7 +101,7 @@ attr_index_config(
        }
        for ( i = 0; attrs[i] != NULL; i++ ) {
                a = (struct attrinfo *) ch_malloc( sizeof(struct attrinfo) );
-               a->ai_type = strdup( attrs[i] );
+               a->ai_type = ch_strdup( attrs[i] );
                a->ai_syntaxmask = attr_syntax( a->ai_type );
                if ( argc == 1 ) {
                        a->ai_indexmask = (INDEX_PRESENCE | INDEX_EQUALITY |
@@ -141,7 +142,7 @@ attr_index_config(
                        a->ai_indexmask |= INDEX_FROMINIT;
                }
 
-               switch (avl_insert( &li->li_attrs, a, ainfo_cmp, ainfo_dup )) {
+               switch (avl_insert( &li->li_attrs, (caddr_t) a, ainfo_cmp, ainfo_dup )) {
                case 1:         /* duplicate - updating init version */
                        free( a->ai_type );
                        free( (char *) a );