VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2tcpip.h@ 78046

Last change on this file since 78046 was 53206, checked in by vboxsync, 10 years ago

Devices/vmsvga: header fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.0 KB
Line 
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/*
20 * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
21 * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
22 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
23 * a choice of LGPL license versions is made available with the language indicating
24 * that LGPLv2 or any later version may be used, or where a choice of which version
25 * of the LGPL is applied is otherwise unspecified.
26 */
27
28#ifndef __WS2TCPIP__
29#define __WS2TCPIP__
30
31#include <winsock2.h>
32#include <ws2ipdef.h>
33#include <limits.h>
34
35#ifdef USE_WS_PREFIX
36#define WS(x) WS_##x
37#else
38#define WS(x) x
39#endif
40
41/* for addrinfo calls */
42typedef struct WS(addrinfo)
43{
44 int ai_flags;
45 int ai_family;
46 int ai_socktype;
47 int ai_protocol;
48 size_t ai_addrlen;
49 char * ai_canonname;
50 struct WS(sockaddr)* ai_addr;
51 struct WS(addrinfo)* ai_next;
52} ADDRINFOA, *PADDRINFOA;
53
54typedef struct WS(addrinfoW)
55{
56 int ai_flags;
57 int ai_family;
58 int ai_socktype;
59 int ai_protocol;
60 size_t ai_addrlen;
61 PWSTR ai_canonname;
62 struct WS(sockaddr)* ai_addr;
63 struct WS(addrinfoW)* ai_next;
64} ADDRINFOW, *PADDRINFOW;
65
66typedef int WS(socklen_t);
67
68typedef ADDRINFOA ADDRINFO, *LPADDRINFO;
69
70/* Possible Windows flags for getaddrinfo() */
71#ifndef USE_WS_PREFIX
72# define AI_PASSIVE 0x00000001
73# define AI_CANONNAME 0x00000002
74# define AI_NUMERICHOST 0x00000004
75# define AI_ADDRCONFIG 0x00000400
76# define AI_NON_AUTHORITATIVE 0x00004000
77# define AI_SECURE 0x00008000
78# define AI_RETURN_PREFERRED_NAMES 0x00010000
79/* getaddrinfo error codes */
80# define EAI_AGAIN WSATRY_AGAIN
81# define EAI_BADFLAGS WSAEINVAL
82# define EAI_FAIL WSANO_RECOVERY
83# define EAI_FAMILY WSAEAFNOSUPPORT
84# define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY
85# define EAI_NODATA EAI_NONAME
86# define EAI_NONAME WSAHOST_NOT_FOUND
87# define EAI_SERVICE WSATYPE_NOT_FOUND
88# define EAI_SOCKTYPE WSAESOCKTNOSUPPORT
89#else
90# define WS_AI_PASSIVE 0x00000001
91# define WS_AI_CANONNAME 0x00000002
92# define WS_AI_NUMERICHOST 0x00000004
93# define WS_AI_ADDRCONFIG 0x00000400
94# define WS_AI_NON_AUTHORITATIVE 0x00004000
95# define WS_AI_SECURE 0x00008000
96# define WS_AI_RETURN_PREFERRED_NAMES 0x00010000
97/* getaddrinfo error codes */
98# define WS_EAI_AGAIN WSATRY_AGAIN
99# define WS_EAI_BADFLAGS WSAEINVAL
100# define WS_EAI_FAIL WSANO_RECOVERY
101# define WS_EAI_FAMILY WSAEAFNOSUPPORT
102# define WS_EAI_MEMORY WSA_NOT_ENOUGH_MEMORY
103# define WS_EAI_NODATA WS_EAI_NONAME
104# define WS_EAI_NONAME WSAHOST_NOT_FOUND
105# define WS_EAI_SERVICE WSATYPE_NOT_FOUND
106# define WS_EAI_SOCKTYPE WSAESOCKTNOSUPPORT
107#endif
108
109#ifndef USE_WS_PREFIX
110# define NI_MAXHOST 1025
111# define NI_MAXSERV 32
112#else
113# define WS_NI_MAXHOST 1025
114# define WS_NI_MAXSERV 32
115#endif
116
117/* Possible Windows flags for getnameinfo() */
118#ifndef USE_WS_PREFIX
119# define NI_NOFQDN 0x01
120# define NI_NUMERICHOST 0x02
121# define NI_NAMEREQD 0x04
122# define NI_NUMERICSERV 0x08
123# define NI_DGRAM 0x10
124#else
125# define WS_NI_NOFQDN 0x01
126# define WS_NI_NUMERICHOST 0x02
127# define WS_NI_NAMEREQD 0x04
128# define WS_NI_NUMERICSERV 0x08
129# define WS_NI_DGRAM 0x10
130#endif
131
132
133#ifdef __cplusplus
134extern "C" {
135#endif
136
137#define GAI_STRERROR_BUFFER_SIZE 1024
138
139static inline char *gai_strerrorA(int errcode)
140{
141 static char buffer[GAI_STRERROR_BUFFER_SIZE + 1];
142
143 /* FIXME: should format message from system, ignoring inserts in neutral
144 * language */
145 buffer[0] = '\0';
146
147 return buffer;
148}
149
150static inline WCHAR *gai_strerrorW(int errcode)
151{
152 static WCHAR buffer[GAI_STRERROR_BUFFER_SIZE + 1];
153
154 /* FIXME: should format message from system, ignoring inserts in neutral
155 * language */
156 buffer[0] = '\0';
157
158 return buffer;
159}
160
161#ifdef USE_WS_PREFIX
162# define WS_gai_strerror WINELIB_NAME_AW(gai_strerror)
163#elif defined(WINE_NO_UNICODE_MACROS)
164# define gai_strerror gai_strerrorA
165#else
166# define gai_strerror WINELIB_NAME_AW(gai_strerror)
167#endif
168
169void WINAPI WS(freeaddrinfo)(LPADDRINFO);
170#define FreeAddrInfoA WS(freeaddrinfo)
171void WINAPI FreeAddrInfoW(PADDRINFOW);
172#define FreeAddrInfo WINELIB_NAME_AW(FreeAddrInfo)
173int WINAPI WS(getaddrinfo)(const char*,const char*,const struct WS(addrinfo)*,struct WS(addrinfo)**);
174#define GetAddrInfoA WS(getaddrinfo)
175int WINAPI GetAddrInfoW(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*);
176#define GetAddrInfo WINELIB_NAME_AW(GetAddrInfo)
177int WINAPI WS(getnameinfo)(const SOCKADDR*,WS(socklen_t),PCHAR,DWORD,PCHAR,DWORD,INT);
178#define GetNameInfoA WS(getnameinfo)
179INT WINAPI GetNameInfoW(const SOCKADDR*,WS(socklen_t),PWCHAR,DWORD,PWCHAR,DWORD,INT);
180#define GetNameInfo WINELIB_NAME_AW(GetNameInfo)
181PCSTR WINAPI WS(inet_ntop)(INT,PVOID,PSTR,SIZE_T);
182#define InetNtopA WS(inet_ntop)
183PCWSTR WINAPI InetNtopW(INT,PVOID,PWSTR,SIZE_T);
184#define InetNtop WINELIB_NAME_AW(InetNtop)
185int WINAPI WS(inet_pton)(INT,PCSTR,PVOID);
186#define InetPtonA WS(inet_pton)
187int WINAPI InetPtonW(INT,PCWSTR,PVOID);
188#define InetPton WINELIB_NAME_AW(InetPton)
189
190/*
191 * Ws2tcpip Function Typedefs
192 *
193 * Remember to keep this section in sync with the
194 * prototypes above.
195 */
196#if INCL_WINSOCK_API_TYPEDEFS
197
198typedef void (WINAPI *LPFN_FREEADDRINFO)(LPADDRINFO);
199#define LPFN_FREEADDRINFOA LPFN_FREEADDRINFO
200typedef void (WINAPI *LPFN_FREEADDRINFOW)(PADDRINFOW);
201#define LPFN_FREEADDRINFOT WINELIB_NAME_AW(LPFN_FREEADDRINFO)
202typedef int (WINAPI *LPFN_GETADDRINFO)(const char*,const char*,const struct WS(addrinfo)*,struct WS(addrinfo)**);
203#define LPFN_GETADDRINFOA LPFN_GETADDRINFO
204typedef int (WINAPI *LPFN_GETADDRINFOW)(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*);
205#define LPFN_GETADDRINFOT WINELIB_NAME_AW(LPFN_GETADDRINFO)
206typedef int (WINAPI *LPFN_GETNAMEINFO)(const struct sockaddr*,socklen_t,char*,DWORD,char*,DWORD,int);
207#define LPFN_GETNAMEINFOA LPFN_GETNAMEINFO
208typedef int (WINAPI *LPFN_GETNAMEINFOW)(const SOCKADDR*,socklen_t,PWCHAR,DWORD,PWCHAR,DWORD,INT);
209#define LPFN_GETNAMEINFOT WINELIB_NAME_AW(LPFN_GETNAMEINFO)
210
211#endif
212
213#ifdef __cplusplus
214}
215#endif
216
217#endif /* __WS2TCPIP__ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette