--- parser3/src/main/pa_socks.C 2001/06/28 07:44:17 1.5 +++ parser3/src/main/pa_socks.C 2003/01/31 12:34:37 1.18.2.3 @@ -1,35 +1,25 @@ /** @file Parser: socks initialization/finalization. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - - Author: Alexander Petrosyan (http://design.ru/paf) + Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char *RCSId="$Id: pa_socks.C,v 1.5 2001/06/28 07:44:17 parser Exp $"; + +static const char* IDENT_SOCKS_C="$Date: 2003/01/31 12:34:37 $"; #define NO_UNISTD_H #include "pa_config_includes.h" -#ifdef WIN32 -#include -#else -//#include -//#include -//#include -//#include -#endif - -#include "pa_socks.h" +#ifdef HAVE_WINSOCK_H #include "pa_exception.h" +#include "pa_socks.h" +#include "pa_string.h" - -/* ************************ Common stuff *********************** */ - -#ifdef WIN32 +#include WSADATA wsaData; -void init_socks(Pool& pool) { +void pa_init_socks() { WORD wVersionRequested; int err; wVersionRequested = MAKEWORD( 1, 1 ); @@ -38,14 +28,14 @@ void init_socks(Pool& pool) { if ( err != 0 ) { /* Tell the user that we could not find a usable */ /* WinSock DLL. */ - PTHROW(0, 0, - 0, + throw Exception(0, + Exception::undefined_source, "can not WSAStartup, err=%d", err); } } -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 */ @@ -60,7 +50,7 @@ void done_socks() { #else -void init_socks(Pool& pool) {} -void done_socks() {} +void pa_init_socks() {} +void pa_done_socks() {} #endif