]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/disptmpl.c
Commit preliminary fix for ldap.conf base usage.
[openldap] / libraries / libldap / disptmpl.c
index 1385ef587b70f9e246217d3a70c52a7081cc473a..35e61d11b2af318903f9cf34c5440295022954af 100644 (file)
  * 7 March 1994 by Mark C Smith
  */
 
+#include "portable.h"
+
 #include <stdio.h>
-#include <ctype.h>
-#include <string.h>
 #include <stdlib.h>
-#ifdef MACOS
-#include "macos.h"
-#else /* MACOS */
-#ifdef DOS
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
+
+#ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
-#ifndef VMS
-#include <unistd.h>
-#endif /* VMS */
-#endif /* DOS */
-#endif /* MACOS */
-
-#include "lber.h"
-#include "ldap.h"
+#endif
+
+#include "ldap-int.h"
 #include "disptmpl.h"
 
-#ifndef NEEDPROTOS
-static void free_disptmpl();
-static int read_next_tmpl();
-int next_line_tokens();
-void free_strarray();
-#else /* !NEEDPROTOS */
-static void free_disptmpl( struct ldap_disptmpl *tmpl );
-static int read_next_tmpl( char **bufp, long *blenp,
-       struct ldap_disptmpl **tmplp, int dtversion );
-int next_line_tokens( char **bufp, long *blenp, char ***toksp );
-void free_strarray( char **sap );
-#endif /* !NEEDPROTOS */
+static void free_disptmpl LDAP_P(( struct ldap_disptmpl *tmpl ));
+static int read_next_tmpl LDAP_P(( char **bufp, long *blenp,
+       struct ldap_disptmpl **tmplp, int dtversion ));
 
 static char            *tmploptions[] = {
     "addable", "modrdn",
@@ -399,7 +384,7 @@ ldap_tmplattrs( struct ldap_disptmpl *tmpl, char **includeattrs,
        for ( i = 0; !memerr && includeattrs[ i ] != NULL; ++i ) {
            if (( attrs = (char **)realloc( attrs, ( attrcnt + 2 ) *
                    sizeof( char * ))) == NULL || ( attrs[ attrcnt++ ] =
-                   strdup( includeattrs[ i ] )) == NULL ) {
+                   ldap_strdup( includeattrs[ i ] )) == NULL ) {
                memerr = 1;
            } else {
                attrs[ attrcnt ] = NULL;
@@ -426,7 +411,7 @@ ldap_tmplattrs( struct ldap_disptmpl *tmpl, char **includeattrs,
            if ( ticolp->ti_attrname != NULL ) {
                if (( attrs = (char **)realloc( attrs, ( attrcnt + 2 ) *
                        sizeof( char * ))) == NULL || ( attrs[ attrcnt++ ] =
-                       strdup( ticolp->ti_attrname )) == NULL ) {
+                       ldap_strdup( ticolp->ti_attrname )) == NULL ) {
                    memerr = 1;
                } else {
                    attrs[ attrcnt ] = NULL;