~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/include/ws2tcpip.h

Version: ~ [ wine-1.5.31 ] ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * Copyright (C) 2001 Francois Gouget
  3  *
  4  * This library is free software; you can redistribute it and/or
  5  * modify it under the terms of the GNU Lesser General Public
  6  * License as published by the Free Software Foundation; either
  7  * version 2.1 of the License, or (at your option) any later version.
  8  *
  9  * This library is distributed in the hope that it will be useful,
 10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 12  * Lesser General Public License for more details.
 13  *
 14  * You should have received a copy of the GNU Lesser General Public
 15  * License along with this library; if not, write to the Free Software
 16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 17  */
 18 
 19 #ifndef __WS2TCPIP__
 20 #define __WS2TCPIP__
 21 
 22 #include <winsock2.h>
 23 #include <ws2ipdef.h>
 24 #include <limits.h>
 25 
 26 #ifdef USE_WS_PREFIX
 27 #define WS(x)    WS_##x
 28 #else
 29 #define WS(x)    x
 30 #endif
 31 
 32 /* for addrinfo calls */
 33 typedef struct WS(addrinfo)
 34 {
 35     int                ai_flags;
 36     int                ai_family;
 37     int                ai_socktype;
 38     int                ai_protocol;
 39     size_t             ai_addrlen;
 40     char *             ai_canonname;
 41     struct WS(sockaddr)*   ai_addr;
 42     struct WS(addrinfo)*   ai_next;
 43 } ADDRINFOA, *PADDRINFOA;
 44 
 45 typedef struct WS(addrinfoW)
 46 {
 47     int                ai_flags;
 48     int                ai_family;
 49     int                ai_socktype;
 50     int                ai_protocol;
 51     size_t             ai_addrlen;
 52     PWSTR              ai_canonname;
 53     struct WS(sockaddr)*   ai_addr;
 54     struct WS(addrinfoW)*   ai_next;
 55 } ADDRINFOW, *PADDRINFOW;
 56 
 57 typedef int WS(socklen_t);
 58 
 59 typedef ADDRINFOA ADDRINFO, *LPADDRINFO;
 60 
 61 /* Possible Windows flags for getaddrinfo() */
 62 #ifndef USE_WS_PREFIX
 63 # define AI_PASSIVE     0x0001
 64 # define AI_CANONNAME   0x0002
 65 # define AI_NUMERICHOST 0x0004
 66 /* getaddrinfo error codes */
 67 # define EAI_AGAIN      WSATRY_AGAIN
 68 # define EAI_BADFLAGS   WSAEINVAL
 69 # define EAI_FAIL       WSANO_RECOVERY
 70 # define EAI_FAMILY     WSAEAFNOSUPPORT
 71 # define EAI_MEMORY     WSA_NOT_ENOUGH_MEMORY
 72 # define EAI_NODATA     EAI_NONAME
 73 # define EAI_NONAME     WSAHOST_NOT_FOUND
 74 # define EAI_SERVICE    WSATYPE_NOT_FOUND
 75 # define EAI_SOCKTYPE   WSAESOCKTNOSUPPORT
 76 #else
 77 # define WS_AI_PASSIVE     0x0001
 78 # define WS_AI_CANONNAME   0x0002
 79 # define WS_AI_NUMERICHOST 0x0004
 80 /* getaddrinfo error codes */
 81 # define WS_EAI_AGAIN   WSATRY_AGAIN
 82 # define WS_EAI_BADFLAGS        WSAEINVAL
 83 # define WS_EAI_FAIL    WSANO_RECOVERY
 84 # define WS_EAI_FAMILY  WSAEAFNOSUPPORT
 85 # define WS_EAI_MEMORY  WSA_NOT_ENOUGH_MEMORY
 86 # define WS_EAI_NODATA  WS_EAI_NONAME
 87 # define WS_EAI_NONAME  WSAHOST_NOT_FOUND
 88 # define WS_EAI_SERVICE WSATYPE_NOT_FOUND
 89 # define WS_EAI_SOCKTYPE        WSAESOCKTNOSUPPORT
 90 #endif
 91 
 92 #ifndef USE_WS_PREFIX
 93 # define NI_MAXHOST         1025
 94 # define NI_MAXSERV         32
 95 #else
 96 # define WS_NI_MAXHOST      1025
 97 # define WS_NI_MAXSERV      32
 98 #endif
 99 
100 /* Possible Windows flags for getnameinfo() */
101 #ifndef USE_WS_PREFIX
102 # define NI_NOFQDN          0x01
103 # define NI_NUMERICHOST     0x02
104 # define NI_NAMEREQD        0x04
105 # define NI_NUMERICSERV     0x08
106 # define NI_DGRAM           0x10
107 #else
108 # define WS_NI_NOFQDN       0x01
109 # define WS_NI_NUMERICHOST  0x02
110 # define WS_NI_NAMEREQD     0x04
111 # define WS_NI_NUMERICSERV  0x08
112 # define WS_NI_DGRAM        0x10
113 #endif
114 
115 
116 #ifdef __cplusplus
117 extern "C" {
118 #endif
119 
120 #define GAI_STRERROR_BUFFER_SIZE        1024
121 
122 static inline char *gai_strerrorA(int errcode)
123 {
124     static char buffer[GAI_STRERROR_BUFFER_SIZE + 1];
125 
126     /* FIXME: should format message from system, ignoring inserts in neutral
127      * language */
128     buffer[0] = '\0';
129 
130     return buffer;
131 }
132 
133 static inline WCHAR *gai_strerrorW(int errcode)
134 {
135     static WCHAR buffer[GAI_STRERROR_BUFFER_SIZE + 1];
136 
137     /* FIXME: should format message from system, ignoring inserts in neutral
138      * language */
139     buffer[0] = '\0';
140 
141     return buffer;
142 }
143 
144 #ifdef USE_WS_PREFIX
145 # define WS_gai_strerror WINELIB_NAME_AW(gai_strerror)
146 #elif defined(WINE_NO_UNICODE_MACROS)
147 # define gai_strerror gai_strerrorA
148 #else
149 # define gai_strerror WINELIB_NAME_AW(gai_strerror)
150 #endif
151 
152 void WINAPI WS(freeaddrinfo)(LPADDRINFO);
153 #define     FreeAddrInfoA WS(freeaddrinfo)
154 void WINAPI FreeAddrInfoW(PADDRINFOW);
155 #define     FreeAddrInfo WINELIB_NAME_AW(FreeAddrInfo)
156 int WINAPI  WS(getaddrinfo)(const char*,const char*,const struct WS(addrinfo)*,struct WS(addrinfo)**);
157 #define     GetAddrInfoA WS(getaddrinfo)
158 int WINAPI  GetAddrInfoW(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*);
159 #define     GetAddrInfo WINELIB_NAME_AW(GetAddrInfo)
160 int WINAPI  WS(getnameinfo)(const SOCKADDR*,WS(socklen_t),PCHAR,DWORD,PCHAR,DWORD,INT);
161 #define     GetNameInfoA WS(getnameinfo)
162 INT WINAPI  GetNameInfoW(const SOCKADDR*,WS(socklen_t),PWCHAR,DWORD,PWCHAR,DWORD,INT);
163 #define     GetNameInfo WINELIB_NAME_AW(GetNameInfo)
164 PCSTR WINAPI WS(inet_ntop)(INT,PVOID,PSTR,SIZE_T);
165 #define     InetNtopA WS(inet_ntop)
166 PCWSTR WINAPI InetNtopW(INT,PVOID,PWSTR,SIZE_T);
167 #define     InetNtop WINELIB_NAME_AW(InetNtop)
168 int WINAPI  WS(inet_pton)(INT,PCSTR,PVOID);
169 #define     InetPtonA WS(inet_pton)
170 int WINAPI  InetPtonW(INT,PCWSTR,PVOID);
171 #define     InetPton WINELIB_NAME_AW(InetPton)
172 
173 /*
174  * Ws2tcpip Function Typedefs
175  *
176  * Remember to keep this section in sync with the
177  * prototypes above.
178  */
179 #if INCL_WINSOCK_API_TYPEDEFS
180 
181 typedef void (WINAPI *LPFN_FREEADDRINFO)(LPADDRINFO);
182 #define LPFN_FREEADDRINFOA LPFN_FREEADDRINFO
183 typedef void (WINAPI *LPFN_FREEADDRINFOW)(PADDRINFOW);
184 #define LPFN_FREEADDRINFOT WINELIB_NAME_AW(LPFN_FREEADDRINFO)
185 typedef int (WINAPI *LPFN_GETADDRINFO)(const char*,const char*,const struct WS(addrinfo)*,struct WS(addrinfo)**);
186 #define LPFN_GETADDRINFOA LPFN_GETADDRINFO
187 typedef int (WINAPI *LPFN_GETADDRINFOW)(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*);
188 #define LPFN_GETADDRINFOT WINELIB_NAME_AW(LPFN_GETADDRINFO)
189 typedef int (WINAPI *LPFN_GETNAMEINFO)(const struct sockaddr*,socklen_t,char*,DWORD,char*,DWORD,int);
190 #define LPFN_GETNAMEINFOA LPFN_GETNAMEINFO
191 typedef int (WINAPI *LPFN_GETNAMEINFOW)(const SOCKADDR*,socklen_t,PWCHAR,DWORD,PWCHAR,DWORD,INT);
192 #define LPFN_GETNAMEINFOT WINELIB_NAME_AW(LPFN_GETNAMEINFO)
193 
194 #endif
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif /* __WS2TCPIP__ */
201 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.