]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/getdxbyname.c
Add strdup.c from -llutil, renamed to ldap_strdup() and always used.
[openldap] / libraries / libldap / getdxbyname.c
index 97548e218c353c31b632af35a5333b5451f5e043..c31d926374b09d9dea095cdb43e01f92cd2d7691 100644 (file)
@@ -1,6 +1,3 @@
-#include "portable.h"
-
-#ifdef LDAP_DNS
 /*
  *  Copyright (c) 1995 Regents of the University of Michigan.
  *  All rights reserved.
@@ -8,23 +5,22 @@
  * ldap_getdxbyname - retrieve DX records from the DNS (from TXT records for now)
  */
 
+#include "portable.h"
+
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_DNS
+
 #include <stdio.h>
 #include <stdlib.h>
-#include <ctype.h>
 
+#include <ac/ctype.h>
 #include <ac/socket.h>
 #include <ac/string.h>
+#include <ac/time.h>
 
-#include "lber.h"
-#include "ldap.h"
 #include "ldap-int.h"
 
 static char ** decode_answer LDAP_P(( unsigned char *answer, int len ));
 
-extern int h_errno;
-extern char *h_errlist[];
-
-
 #define MAX_TO_SORT    32
 
 
@@ -49,7 +45,7 @@ ldap_getdxbyname( char *domain )
         * punt:  return list conisting of the original domain name only
         */
        if (( dxs = (char **)malloc( 2 * sizeof( char * ))) == NULL ||
-               ( dxs[ 0 ] = strdup( domain )) == NULL ) {
+               ( dxs[ 0 ] = ldap_strdup( domain )) == NULL ) {
            if ( dxs != NULL ) {
                free( dxs );
            }
@@ -199,4 +195,4 @@ decode_answer( unsigned char *answer, int len )
     return( dxs );
 }
 
-#endif /* LDAP_DNS */
+#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_DNS */