--- parser3/src/main/pa_socks.C 2002/08/01 11:41:19 1.16 +++ parser3/src/main/pa_socks.C 2003/11/20 16:34:26 1.20 @@ -1,24 +1,46 @@ /** @file Parser: socks initialization/finalization. - Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_SOCKS_C="$Date: 2002/08/01 11:41:19 $"; +static const char * const IDENT_SOCKS_C="$Date: 2003/11/20 16:34:26 $"; #define NO_UNISTD_H #include "pa_config_includes.h" -#ifndef HAVE_SYS_SELECT_H +#ifdef WIN32 #include "pa_exception.h" #include "pa_socks.h" +#include "pa_string.h" -#include +// in cygwin: for pascal +// in MSVC: for everything +#include + +#ifdef CYGWIN +// WSADATA +#define WSADESCRIPTION_LEN 256 +#define WSASYS_STATUS_LEN 128 +typedef struct WSAData { + WORD wVersion; + WORD wHighVersion; + char szDescription[WSADESCRIPTION_LEN+1]; + char szSystemStatus[WSASYS_STATUS_LEN+1]; + unsigned short iMaxSockets; + unsigned short iMaxUdpDg; + char * lpVendorInfo; +} WSADATA; +typedef WSADATA *LPWSADATA; + +int PASCAL WSAStartup(WORD,LPWSADATA); +int PASCAL WSACleanup(void); +#endif WSADATA wsaData; -void init_socks(Pool& pool) { +void pa_init_socks() { WORD wVersionRequested; int err; wVersionRequested = MAKEWORD( 1, 1 ); @@ -34,7 +56,7 @@ void init_socks(Pool& pool) { } } -void done_socks() { +void pa_done_socks() { /* Confirm that the WinSock DLL supports 2.2.*/ /* Note that if the DLL supports versions greater */ /* than 2.2 in addition to 2.2, it will still return */ @@ -49,9 +71,7 @@ void done_socks() { #else -#include "pa_pool.h" - -void init_socks(Pool& pool) {} -void done_socks() {} +void pa_init_socks() {} +void pa_done_socks() {} #endif