(file) Return to lslp-perl-windows.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / slp

  1 mday  1.1 //%/////////////////////////////////////////////////////////////////////////////
  2           //
  3 kumpf 1.7 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4           // The Open Group, Tivoli Systems
  5 mday  1.1 //
  6 mike  1.3 // Permission is hereby granted, free of charge, to any person obtaining a copy
  7 kumpf 1.7 // of this software and associated documentation files (the "Software"), to
  8           // deal in the Software without restriction, including without limitation the
  9           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 10 mike  1.3 // sell copies of the Software, and to permit persons to whom the Software is
 11           // furnished to do so, subject to the following conditions:
 12           // 
 13 kumpf 1.7 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14 mike  1.3 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16 kumpf 1.7 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 17           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 18           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 19 mike  1.3 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21 mday  1.1 //
 22           //==============================================================================
 23           //
 24           // Author: Mike Day (mdday@us.ibm.com)
 25           //
 26           //%/////////////////////////////////////////////////////////////////////////////
 27           
 28           
 29           #ifndef _LSLP_WINDOWS_INCL_
 30           #define _LSLP_WINDOWS_INCL_
 31           
 32           
 33           #ifdef _WIN32 
 34           #ifndef _MT
 35           #define _MT
 36           #endif
 37 mday  1.6 #include <windows.h>
 38 mday  1.1 #include <winsock2.h>
 39           #include <ws2tcpip.h>
 40           #include <stdio.h>
 41           #include <process.h>
 42           #include <winbase.h>
 43           #include <tchar.h>
 44           #include <sys/types.h>
 45           #include <sys/timeb.h> 
 46           #include <errno.h>
 47           #include <assert.h>
 48           #include <io.h>
 49 mday  1.4 #include <time.h>
 50 mday  1.1 
 51 mday  1.2 PEGASUS_USING_STD;
 52           
 53           PEGASUS_NAMESPACE_BEGIN
 54           
 55 mday  1.1 typedef char int8;
 56           typedef	unsigned char uint8;
 57           typedef uint8 byte;
 58           typedef short int16;
 59           typedef unsigned short uint16;
 60           typedef int int32;
 61           typedef unsigned int uint32;
 62           typedef __int64 int64;
 63           typedef unsigned __int64 uint64;
 64             typedef int socklen_t;
 65           
 66           /* void SLEEP(int32 milliseconds) */
 67           #define _LSLP_SLEEP Sleep
 68           #define _LSLP_CLOSESOCKET closesocket
 69           #define _LSLP_IOCTLSOCKET ioctlsocket
 70           #define _LSLP_INIT_NETWORK WindowsStartNetwork
 71           #define _LSLP_DEINIT_NETWORK WSACleanup
 72             //#define _LSLP_SET_TTL(s, ttl) WSAIoctl((s), SIO_MULTICAST_SCOPE, &(ttl), sizeof((ttl))  , NULL, 0 , NULL, NULL, NULL)
 73           #define _LSLP_SET_TTL(s, t)  setsockopt((s), IPPROTO_IP, IP_MULTICAST_TTL, (const char *)&(t), sizeof((t))) 
 74           
 75 mday  1.5 
 76           typedef struct socket_address {
 77             sockaddr_in *address;
 78             int address_len;
 79           } socket_addr ;
 80           
 81           typedef struct socket_address_list {
 82             int count;
 83             socket_addr *list;
 84           } socket_addr_list; 
 85           
 86 mday  1.1 #define strcasecmp _stricmp
 87           
 88           #define ENOTSOCK WSAENOTSOCK
 89           #define EADDRNOTAVAIL WSAEADDRNOTAVAIL 
 90           #define EAFNOSUPPORT WSAEAFNOSUPPORT 
 91           #define EISCONN WSAEISCONN 
 92           #define ETIMEDOUT WSAETIMEDOUT
 93           #define ECONNREFUSED WSAECONNREFUSED
 94           #define ENETUNREACH WSAENETUNREACH
 95           #define EADDRINUSE WSAEADDRINUSE
 96           #define EINPROGRESS WSAEINPROGRESS 
 97           #define EALREADY WSAEALREADY 
 98           #define EWOULDBLOCK WSAEWOULDBLOCK
 99           #ifndef EINVAL
100           #define EINVAL WSAEINVAL
101           #endif
102             /* to start as a service */
103           
104           #define _LSLP_GETLASTERROR() WSAGetLastError()
105           
106           
107 mday  1.1 #define _LSLP_STRTOK(n, d, s) strtok((n), (d) )
108           #define _LSLP_SIG_ACTION()
109           #define _LSLP_SIG_ACTION_THREAD()
110           #define _LSLP_PUSH_HANDLER(a, b)
111           #define _LSLP_POP_HANDLER(a, b)
112           
113           #define strncasecmp strnicmp
114           
115           /* maximum path length */
116           #define LSLP_MAXPATH _MAX_PATH
117           #define LSLP_NEWLINE \r\n
118           
119           #define _LSLP_CTIME(t, b) memcpy(((char *)(b)), ctime(((const time_t *)(t))), 26)
120           
121 mday  1.2 PEGASUS_NAMESPACE_END
122           
123 mday  1.1 #endif	 /* WIN 32 */
124           
125           
126           #endif /*_LSLP_WINDOWS_INCL_*/
127           

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2