]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/getdxbyname.c
Fix ldap_send_initial_request() to open connection if not already
[openldap] / libraries / libldap / getdxbyname.c
index ed5dcf4fe1d731a1dddd7cdac76c0e3a09df7b5b..af03dd5e7d801a8e8dde24b400a6e08ef4017716 100644 (file)
@@ -1,47 +1,29 @@
-#ifdef LDAP_DNS
 /*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/*  Portions
  *  Copyright (c) 1995 Regents of the University of Michigan.
  *  All rights reserved.
  *
  * ldap_getdxbyname - retrieve DX records from the DNS (from TXT records for now)
  */
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
 
-#ifdef MACOS
-#include <stdlib.h>
-#include "macos.h"
-#endif /* MACOS */
-
-#if !defined(MACOS) && !defined(DOS) && !defined( _WIN32 )
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <resolv.h>
-#endif
-#include "lber.h"
-#include "ldap.h"
-#include "ldap-int.h"
+#include "portable.h"
 
-#if defined( DOS ) || defined( _WIN32 )
-#include "msdos.h"
-#endif /* DOS */
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_DNS
 
+#include <stdio.h>
+#include <stdlib.h>
 
-#ifdef NEEDPROTOS
-static char ** decode_answer( unsigned char *answer, int len );
-#else /* NEEDPROTOS */
-static char **decode_answer();
-#endif /* NEEDPROTOS */
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
 
-extern int h_errno;
-extern char *h_errlist[];
+#include "ldap-int.h"
 
+static char ** decode_answer LDAP_P(( unsigned char *answer, int len ));
 
 #define MAX_TO_SORT    32
 
@@ -217,4 +199,4 @@ decode_answer( unsigned char *answer, int len )
     return( dxs );
 }
 
-#endif /* LDAP_DNS */
+#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_DNS */