--- libraries/libldap/result.c 1998/08/20 17:42:38 1.6 +++ libraries/libldap/result.c 1998/10/21 22:40:51 1.6.10.2 @@ -5,86 +5,41 @@ * result.c - wait for an ldap result */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include #include -#ifdef MACOS -#include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#ifdef PCNFS -#include -#include -#include -#endif /* PCNFS */ -#ifdef NCSA -#include "externs.h" -#endif /* NCSA */ -#else /* DOS */ -#include -#include -#include -#include -#ifdef _AIX -#include -#endif /* _AIX */ -#endif /* DOS */ -#endif /* MACOS */ -#ifdef VMS -#include "ucx_select.h" -#endif - -#include "portable.h" +#include +#include +#include +#include +#include #include "lber.h" #include "ldap.h" #include "ldap-int.h" -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ - -#ifdef NEEDPROTOS -static int ldap_abandoned( LDAP *ld, int msgid ); -static int ldap_mark_abandoned( LDAP *ld, int msgid ); -static int wait4msg( LDAP *ld, int msgid, int all, struct timeval *timeout, - LDAPMessage **result ); + +static int ldap_abandoned LDAP_P(( LDAP *ld, int msgid )); +static int ldap_mark_abandoned LDAP_P(( LDAP *ld, int msgid )); +static int wait4msg LDAP_P(( LDAP *ld, int msgid, int all, struct timeval *timeout, + LDAPMessage **result )); #ifdef LDAP_REFERRALS -static int read1msg( LDAP *ld, int msgid, int all, Sockbuf *sb, LDAPConn *lc, - LDAPMessage **result ); -static int build_result_ber( LDAP *ld, BerElement *ber, LDAPRequest *lr ); -static void merge_error_info( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr ); +static int read1msg LDAP_P(( LDAP *ld, int msgid, int all, Sockbuf *sb, LDAPConn *lc, + LDAPMessage **result )); +static int build_result_ber LDAP_P(( LDAP *ld, BerElement *ber, LDAPRequest *lr )); +static void merge_error_info LDAP_P(( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr )); #else /* LDAP_REFERRALS */ -static int read1msg( LDAP *ld, int msgid, int all, Sockbuf *sb, - LDAPMessage **result ); -#endif /* LDAP_REFERRALS */ -#if defined( CLDAP ) || !defined( LDAP_REFERRALS ) -static int ldap_select1( LDAP *ld, struct timeval *timeout ); -#endif -#else /* NEEDPROTOS */ -static int ldap_abandoned(); -static int ldap_mark_abandoned(); -static int wait4msg(); -static int read1msg(); -#ifdef LDAP_REFERRALS -static int build_result_ber(); -static void merge_error_info(); +static int read1msg LDAP_P(( LDAP *ld, int msgid, int all, Sockbuf *sb, + LDAPMessage **result )); #endif /* LDAP_REFERRALS */ -#if defined( CLDAP ) || !defined( LDAP_REFERRALS ) -static int ldap_select1(); -#endif -#endif /* NEEDPROTOS */ - -#if !defined( MACOS ) && !defined( DOS ) -extern int errno; +#if defined( LDAP_CONNECTIONLESS ) || !defined( LDAP_REFERRALS ) +static int ldap_select1 LDAP_P(( LDAP *ld, struct timeval *timeout )); #endif @@ -633,7 +588,7 @@ merge_error_info( LDAP *ld, LDAPRequest -#if defined( CLDAP ) || !defined( LDAP_REFERRALS ) +#if defined( LDAP_CONNECTIONLESS ) || !defined( LDAP_REFERRALS ) #if !defined( MACOS ) && !defined( DOS ) && !defined( _WIN32 ) static int ldap_select1( LDAP *ld, struct timeval *timeout ) @@ -642,11 +597,13 @@ ldap_select1( LDAP *ld, struct timeval * static int tblsize; if ( tblsize == 0 ) { -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF tblsize = sysconf( _SC_OPEN_MAX ); -#else /* !USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE tblsize = getdtablesize(); -#endif /* !USE_SYSCONF */ +#else + tblsize = FD_SETSIZE; +#endif #ifdef FD_SETSIZE if ( tblsize > FD_SETSIZE ) { tblsize = FD_SETSIZE; @@ -827,7 +784,7 @@ ldap_mark_abandoned( LDAP *ld, int msgid } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS int cldap_getmsg( LDAP *ld, struct timeval *timeout, BerElement *ber ) { @@ -853,4 +810,4 @@ cldap_getmsg( LDAP *ld, struct timeval * return( tag ); } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */