feisty meow concerns codebase  2.140
tcpip_definitions.h
Go to the documentation of this file.
1 #ifndef TCPIP_DEFINITIONS_GROUP
2 #define TCPIP_DEFINITIONS_GROUP
3 
4 /*****************************************************************************\
5 * *
6 * Name : tcpip_definitions *
7 * Author : Chris Koeritz *
8 * *
9 * Purpose: *
10 * *
11 * Provides some variables that make porting between Unix and W32 easier. *
12 * *
13 *******************************************************************************
14 * Copyright (c) 2001-$now By Author. This program is free software; you can *
15 * redistribute it and/or modify it under the terms of the GNU General Public *
16 * License as published by the Free Software Foundation; either version 2 of *
17 * the License or (at your option) any later version. This is online at: *
18 * http://www.fsf.org/copyleft/gpl.html *
19 * Please send any updates to: fred@gruntose.com *
20 \*****************************************************************************/
21 
23 
24 #ifndef SOCKET_ERROR
25  #define SOCKET_ERROR -1
26 #endif
27 
28 #ifndef INVALID_SOCKET
29  #define INVALID_SOCKET -1
30 #endif
31 
32 //#ifdef __UNIX__
33  // provide some unifying definitions.
34  typedef void sock_hop;
35 
36  // provide synonyms for errors so we don't conflict with the windows
37  // brain-deadness. they define error values like EACCESS but they're not
38  // the real values you need to use with tcp/ip. french fried gates time.
39  #define SOCK_EACCES EACCES
40  #define SOCK_EADDRINUSE EADDRINUSE
41  #define SOCK_EADDRNOTAVAIL EADDRNOTAVAIL
42  #define SOCK_EAFNOSUPPORT EAFNOSUPPORT
43  #define SOCK_EALREADY EALREADY
44  #define SOCK_EBADF EBADF
45  #define SOCK_ECONNABORTED ECONNABORTED
46  #define SOCK_ECONNREFUSED ECONNREFUSED
47  #define SOCK_ECONNRESET ECONNRESET
48  #define SOCK_EDESTADDRREQ EDESTADDRREQ
49  #define SOCK_EDQUOT EDQUOT
50  #define SOCK_EFAULT EFAULT
51  #define SOCK_EHOSTDOWN EHOSTDOWN
52  #define SOCK_EHOSTUNREACH EHOSTUNREACH
53  #define SOCK_EINPROGRESS EINPROGRESS
54  #define SOCK_EINTR EINTR
55  #define SOCK_EINVAL EINVAL
56  #define SOCK_EISCONN EISCONN
57  #define SOCK_ELOOP ELOOP
58  #define SOCK_EMFILE EMFILE
59  #define SOCK_EMSGSIZE EMSGSIZE
60  #define SOCK_ENAMETOOLONG ENAMETOOLONG
61  #define SOCK_ENETDOWN ENETDOWN
62  #define SOCK_ENETUNREACH ENETUNREACH
63  #define SOCK_ENETRESET ENETRESET
64  #define SOCK_ENOBUFS ENOBUFS
65  #define SOCK_ENOPROTOOPT ENOPROTOOPT
66  #define SOCK_ENOTCONN ENOTCONN
67  #define SOCK_ENOTEMPTY ENOTEMPTY
68  #define SOCK_ENOTSOCK ENOTSOCK
69  #define SOCK_EOPNOTSUPP EOPNOTSUPP
70  #define SOCK_EPFNOSUPPORT EPFNOSUPPORT
71  #define SOCK_EPROCLIM EPROCLIM
72  #define SOCK_EPROTOTYPE EPROTOTYPE
73  #define SOCK_EPROTONOSUPPORT EPROTONOSUPPORT
74  #define SOCK_EREMOTE EREMOTE
75  #define SOCK_ESHUTDOWN ESHUTDOWN
76  #define SOCK_ESOCKTNOSUPPORT ESOCKTNOSUPPORT
77  #define SOCK_ESTALE ESTALE
78  #define SOCK_ETIMEDOUT ETIMEDOUT
79  #define SOCK_ETOOMANYREFS ETOOMANYREFS
80  #define SOCK_EWOULDBLOCK EWOULDBLOCK
81  #define SOCK_EUSERS EUSERS
82 //#endif
83 
84  /*
85 #ifdef __WIN32__
86  #include <application/windoze_helper.h>
87 
88  // provide some aliases for w32.
89 #if COMPILER_VERSION==6
90  #define hostent HOSTENT
91 #endif
92  typedef char sock_hop;
93  typedef int socklen_t;
94 
95  // provide close to the real BSD error names using windows values.
96  #define SOCK_EACCES WSAEACCES
97  #define SOCK_EADDRINUSE WSAEADDRINUSE
98  #define SOCK_EADDRNOTAVAIL WSAEADDRNOTAVAIL
99  #define SOCK_EAFNOSUPPORT WSAEAFNOSUPPORT
100  #define SOCK_EALREADY WSAEALREADY
101  #define SOCK_EBADF WSAEBADF
102  #define SOCK_ECONNABORTED WSAECONNABORTED
103  #define SOCK_ECONNREFUSED WSAECONNREFUSED
104  #define SOCK_ECONNRESET WSAECONNRESET
105  #define SOCK_EDESTADDRREQ WSAEDESTADDRREQ
106  #define SOCK_EDQUOT WSAEDQUOT
107  #define SOCK_EFAULT WSAEFAULT
108  #define SOCK_EHOSTDOWN WSAEHOSTDOWN
109  #define SOCK_EHOSTUNREACH WSAEHOSTUNREACH
110  #define SOCK_EINPROGRESS WSAEINPROGRESS
111  #define SOCK_EINTR WSAEINTR
112  #define SOCK_EINVAL WSAEINVAL
113  #define SOCK_EISCONN WSAEISCONN
114  #define SOCK_ELOOP WSAELOOP
115  #define SOCK_EMFILE WSAEMFILE
116  #define SOCK_EMSGSIZE WSAEMSGSIZE
117  #define SOCK_ENAMETOOLONG WSAENAMETOOLONG
118  #define SOCK_ENETDOWN WSAENETDOWN
119  #define SOCK_ENETUNREACH WSAENETUNREACH
120  #define SOCK_ENETRESET WSAENETRESET
121  #define SOCK_ENOBUFS WSAENOBUFS
122  #define SOCK_ENOPROTOOPT WSAENOPROTOOPT
123  #define SOCK_ENOTCONN WSAENOTCONN
124  #define SOCK_ENOTEMPTY WSAENOTEMPTY
125  #define SOCK_ENOTSOCK WSAENOTSOCK
126  #define SOCK_EOPNOTSUPP WSAEOPNOTSUPP
127  #define SOCK_EPFNOSUPPORT WSAEPFNOSUPPORT
128  #define SOCK_EPROCLIM WSAEPROCLIM
129  #define SOCK_EPROTOTYPE WSAEPROTOTYPE
130  #define SOCK_EPROTONOSUPPORT WSAEPROTONOSUPPORT
131  #define SOCK_EREMOTE WSAEREMOTE
132  #define SOCK_ESHUTDOWN WSAESHUTDOWN
133  #define SOCK_ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
134  #define SOCK_ESTALE WSAESTALE
135  #define SOCK_ETIMEDOUT WSAETIMEDOUT
136  #define SOCK_ETOOMANYREFS WSAETOOMANYREFS
137  #define SOCK_EUSERS WSAEUSERS
138 
139  // windows specific names.
140  #define SOCK_EWOULDBLOCK WSAEWOULDBLOCK
141  #define SOCK_HOST_NOT_FOUND WSAHOST_NOT_FOUND
142  #define SOCK_NO_DATA WSANO_DATA
143  #define SOCK_NO_RECOVERY WSANO_RECOVERY
144  #define SOCK_NOTINITIALISED WSANOTINITIALISED
145  #define SOCK_SYSNOTREADY WSASYSNOTREADY
146  #define SOCK_TRY_AGAIN WSATRY_AGAIN
147  #define SOCK_VERNOTSUPPORTED WSAVERNOTSUPPORTED
148 #endif
149 */
150 
151 #endif
152 
void sock_hop
Aids in achievement of platform independence.