Mercurial > games > semicongine
comparison fuhtark_test/include/winapi/winsock.h @ 1500:91c8c3b7cbf0
add: futhark tests for generating vulkan api
| author | sam <sam@basx.dev> |
|---|---|
| date | Wed, 26 Nov 2025 21:36:48 +0700 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1499:1f58458b7ef7 | 1500:91c8c3b7cbf0 |
|---|---|
| 1 /** | |
| 2 * This file has no copyright assigned and is placed in the Public Domain. | |
| 3 * This file is part of the w64 mingw-runtime package. | |
| 4 * No warranty is given; refer to the file DISCLAIMER within this package. | |
| 5 */ | |
| 6 #if 0 | |
| 7 #ifndef _WINSOCKAPI_ | |
| 8 #define _WINSOCKAPI_ | |
| 9 | |
| 10 #define IP_MULTICAST_IF 2 | |
| 11 #define IP_MULTICAST_TTL 3 | |
| 12 #define IP_MULTICAST_LOOP 4 | |
| 13 #define IP_ADD_MEMBERSHIP 5 | |
| 14 #define IP_DROP_MEMBERSHIP 6 | |
| 15 #define IP_TTL 7 | |
| 16 #define IP_TOS 8 | |
| 17 #define IP_DONTFRAGMENT 9 | |
| 18 | |
| 19 #define IP_DEFAULT_MULTICAST_TTL 1 | |
| 20 #define IP_DEFAULT_MULTICAST_LOOP 1 | |
| 21 #define IP_MAX_MEMBERSHIPS 20 | |
| 22 | |
| 23 struct ip_mreq { | |
| 24 struct in_addr imr_multiaddr; | |
| 25 struct in_addr imr_interface; | |
| 26 }; | |
| 27 | |
| 28 #define INVALID_SOCKET(SOCKET)(~0) | |
| 29 #define SOCKET_ERROR (-1) | |
| 30 | |
| 31 #define SOCK_STREAM 1 | |
| 32 #define SOCK_DGRAM 2 | |
| 33 #define SOCK_RAW 3 | |
| 34 #define SOCK_RDM 4 | |
| 35 #define SOCK_SEQPACKET 5 | |
| 36 | |
| 37 #define SO_DEBUG 0x0001 | |
| 38 #define SO_ACCEPTCONN 0x0002 | |
| 39 #define SO_REUSEADDR 0x0004 | |
| 40 #define SO_KEEPALIVE 0x0008 | |
| 41 #define SO_DONTROUTE 0x0010 | |
| 42 #define SO_BROADCAST 0x0020 | |
| 43 #define SO_USELOOPBACK 0x0040 | |
| 44 #define SO_LINGER 0x0080 | |
| 45 #define SO_OOBINLINE 0x0100 | |
| 46 | |
| 47 #define SO_DONTLINGER (u_int)(~SO_LINGER) | |
| 48 | |
| 49 #define SO_SNDBUF 0x1001 | |
| 50 #define SO_RCVBUF 0x1002 | |
| 51 #define SO_SNDLOWAT 0x1003 | |
| 52 #define SO_RCVLOWAT 0x1004 | |
| 53 #define SO_SNDTIMEO 0x1005 | |
| 54 #define SO_RCVTIMEO 0x1006 | |
| 55 #define SO_ERROR 0x1007 | |
| 56 #define SO_TYPE 0x1008 | |
| 57 | |
| 58 #define SO_CONNDATA 0x7000 | |
| 59 #define SO_CONNOPT 0x7001 | |
| 60 #define SO_DISCDATA 0x7002 | |
| 61 #define SO_DISCOPT 0x7003 | |
| 62 #define SO_CONNDATALEN 0x7004 | |
| 63 #define SO_CONNOPTLEN 0x7005 | |
| 64 #define SO_DISCDATALEN 0x7006 | |
| 65 #define SO_DISCOPTLEN 0x7007 | |
| 66 | |
| 67 #define SO_UPDATE_ACCEPT_CONTEXT 0x700B | |
| 68 #define SO_CONNECT_TIME 0x700C | |
| 69 | |
| 70 #define TCP_NODELAY 0x0001 | |
| 71 #define TCP_BSDURGENT 0x7000 | |
| 72 | |
| 73 #define AF_UNSPEC 0 | |
| 74 #define AF_UNIX 1 | |
| 75 #define AF_INET 2 | |
| 76 #define AF_IMPLINK 3 | |
| 77 #define AF_PUP 4 | |
| 78 #define AF_CHAOS 5 | |
| 79 #define AF_IPX 6 | |
| 80 #define AF_NS 6 | |
| 81 #define AF_ISO 7 | |
| 82 #define AF_OSI AF_ISO | |
| 83 #define AF_ECMA 8 | |
| 84 #define AF_DATAKIT 9 | |
| 85 #define AF_CCITT 10 | |
| 86 #define AF_SNA 11 | |
| 87 #define AF_DECnet 12 | |
| 88 #define AF_DLI 13 | |
| 89 #define AF_LAT 14 | |
| 90 #define AF_HYLINK 15 | |
| 91 #define AF_APPLETALK 16 | |
| 92 #define AF_NETBIOS 17 | |
| 93 #define AF_VOICEVIEW 18 | |
| 94 #define AF_FIREFOX 19 | |
| 95 #define AF_UNKNOWN1 20 | |
| 96 #define AF_BAN 21 | |
| 97 | |
| 98 #define AF_MAX 22 | |
| 99 | |
| 100 struct sockaddr { | |
| 101 u_short sa_family; | |
| 102 char sa_data[14]; | |
| 103 }; | |
| 104 | |
| 105 struct sockproto { | |
| 106 u_short sp_family; | |
| 107 u_short sp_protocol; | |
| 108 }; | |
| 109 | |
| 110 #define PF_UNSPEC AF_UNSPEC | |
| 111 #define PF_UNIX AF_UNIX | |
| 112 #define PF_INET AF_INET | |
| 113 #define PF_IMPLINK AF_IMPLINK | |
| 114 #define PF_PUP AF_PUP | |
| 115 #define PF_CHAOS AF_CHAOS | |
| 116 #define PF_NS AF_NS | |
| 117 #define PF_IPX AF_IPX | |
| 118 #define PF_ISO AF_ISO | |
| 119 #define PF_OSI AF_OSI | |
| 120 #define PF_ECMA AF_ECMA | |
| 121 #define PF_DATAKIT AF_DATAKIT | |
| 122 #define PF_CCITT AF_CCITT | |
| 123 #define PF_SNA AF_SNA | |
| 124 #define PF_DECnet AF_DECnet | |
| 125 #define PF_DLI AF_DLI | |
| 126 #define PF_LAT AF_LAT | |
| 127 #define PF_HYLINK AF_HYLINK | |
| 128 #define PF_APPLETALK AF_APPLETALK | |
| 129 #define PF_VOICEVIEW AF_VOICEVIEW | |
| 130 #define PF_FIREFOX AF_FIREFOX | |
| 131 #define PF_UNKNOWN1 AF_UNKNOWN1 | |
| 132 #define PF_BAN AF_BAN | |
| 133 | |
| 134 #define PF_MAX AF_MAX | |
| 135 | |
| 136 struct linger { | |
| 137 u_short l_onoff; | |
| 138 u_short l_linger; | |
| 139 }; | |
| 140 | |
| 141 #define SOL_SOCKET 0xffff | |
| 142 | |
| 143 #define SOMAXCONN 5 | |
| 144 | |
| 145 #define MSG_OOB 0x1 | |
| 146 #define MSG_PEEK 0x2 | |
| 147 #define MSG_DONTROUTE 0x4 | |
| 148 | |
| 149 #define MSG_MAXIOVLEN 16 | |
| 150 | |
| 151 #define MSG_PARTIAL 0x8000 | |
| 152 | |
| 153 #define MAXGETHOSTSTRUCT 1024 | |
| 154 | |
| 155 #define FD_READ 0x01 | |
| 156 #define FD_WRITE 0x02 | |
| 157 #define FD_OOB 0x04 | |
| 158 #define FD_ACCEPT 0x08 | |
| 159 #define FD_CONNECT 0x10 | |
| 160 #define FD_CLOSE 0x20 | |
| 161 | |
| 162 #ifndef WSABASEERR | |
| 163 | |
| 164 #define WSABASEERR 10000 | |
| 165 | |
| 166 #define WSAEINTR (WSABASEERR+4) | |
| 167 #define WSAEBADF (WSABASEERR+9) | |
| 168 #define WSAEACCES (WSABASEERR+13) | |
| 169 #define WSAEFAULT (WSABASEERR+14) | |
| 170 #define WSAEINVAL (WSABASEERR+22) | |
| 171 #define WSAEMFILE (WSABASEERR+24) | |
| 172 | |
| 173 #define WSAEWOULDBLOCK (WSABASEERR+35) | |
| 174 #define WSAEINPROGRESS (WSABASEERR+36) | |
| 175 #define WSAEALREADY (WSABASEERR+37) | |
| 176 #define WSAENOTSOCK (WSABASEERR+38) | |
| 177 #define WSAEDESTADDRREQ (WSABASEERR+39) | |
| 178 #define WSAEMSGSIZE (WSABASEERR+40) | |
| 179 #define WSAEPROTOTYPE (WSABASEERR+41) | |
| 180 #define WSAENOPROTOOPT (WSABASEERR+42) | |
| 181 #define WSAEPROTONOSUPPORT (WSABASEERR+43) | |
| 182 #define WSAESOCKTNOSUPPORT (WSABASEERR+44) | |
| 183 #define WSAEOPNOTSUPP (WSABASEERR+45) | |
| 184 #define WSAEPFNOSUPPORT (WSABASEERR+46) | |
| 185 #define WSAEAFNOSUPPORT (WSABASEERR+47) | |
| 186 #define WSAEADDRINUSE (WSABASEERR+48) | |
| 187 #define WSAEADDRNOTAVAIL (WSABASEERR+49) | |
| 188 #define WSAENETDOWN (WSABASEERR+50) | |
| 189 #define WSAENETUNREACH (WSABASEERR+51) | |
| 190 #define WSAENETRESET (WSABASEERR+52) | |
| 191 #define WSAECONNABORTED (WSABASEERR+53) | |
| 192 #define WSAECONNRESET (WSABASEERR+54) | |
| 193 #define WSAENOBUFS (WSABASEERR+55) | |
| 194 #define WSAEISCONN (WSABASEERR+56) | |
| 195 #define WSAENOTCONN (WSABASEERR+57) | |
| 196 #define WSAESHUTDOWN (WSABASEERR+58) | |
| 197 #define WSAETOOMANYREFS (WSABASEERR+59) | |
| 198 #define WSAETIMEDOUT (WSABASEERR+60) | |
| 199 #define WSAECONNREFUSED (WSABASEERR+61) | |
| 200 #define WSAELOOP (WSABASEERR+62) | |
| 201 #define WSAENAMETOOLONG (WSABASEERR+63) | |
| 202 #define WSAEHOSTDOWN (WSABASEERR+64) | |
| 203 #define WSAEHOSTUNREACH (WSABASEERR+65) | |
| 204 #define WSAENOTEMPTY (WSABASEERR+66) | |
| 205 #define WSAEPROCLIM (WSABASEERR+67) | |
| 206 #define WSAEUSERS (WSABASEERR+68) | |
| 207 #define WSAEDQUOT (WSABASEERR+69) | |
| 208 #define WSAESTALE (WSABASEERR+70) | |
| 209 #define WSAEREMOTE (WSABASEERR+71) | |
| 210 | |
| 211 #define WSASYSNOTREADY (WSABASEERR+91) | |
| 212 #define WSAVERNOTSUPPORTED (WSABASEERR+92) | |
| 213 #define WSANOTINITIALISED (WSABASEERR+93) | |
| 214 | |
| 215 #define WSAEDISCON (WSABASEERR+101) | |
| 216 | |
| 217 #define WSAHOST_NOT_FOUND (WSABASEERR+1001) | |
| 218 #define WSATRY_AGAIN (WSABASEERR+1002) | |
| 219 #define WSANO_RECOVERY (WSABASEERR+1003) | |
| 220 #define WSANO_DATA (WSABASEERR+1004) | |
| 221 #endif | |
| 222 | |
| 223 #define h_errno WSAGetLastError() | |
| 224 #define HOST_NOT_FOUND WSAHOST_NOT_FOUND | |
| 225 #define TRY_AGAIN WSATRY_AGAIN | |
| 226 #define NO_RECOVERY WSANO_RECOVERY | |
| 227 #define NO_DATA WSANO_DATA | |
| 228 | |
| 229 #define WSANO_ADDRESS WSANO_DATA | |
| 230 #define NO_ADDRESS WSANO_ADDRESS | |
| 231 | |
| 232 #if 0 | |
| 233 #define EWOULDBLOCK WSAEWOULDBLOCK | |
| 234 #define EINPROGRESS WSAEINPROGRESS | |
| 235 #define EALREADY WSAEALREADY | |
| 236 #define ENOTSOCK WSAENOTSOCK | |
| 237 #define EDESTADDRREQ WSAEDESTADDRREQ | |
| 238 #define EMSGSIZE WSAEMSGSIZE | |
| 239 #define EPROTOTYPE WSAEPROTOTYPE | |
| 240 #define ENOPROTOOPT WSAENOPROTOOPT | |
| 241 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT | |
| 242 #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT | |
| 243 #define EOPNOTSUPP WSAEOPNOTSUPP | |
| 244 #define EPFNOSUPPORT WSAEPFNOSUPPORT | |
| 245 #define EAFNOSUPPORT WSAEAFNOSUPPORT | |
| 246 #define EADDRINUSE WSAEADDRINUSE | |
| 247 #define EADDRNOTAVAIL WSAEADDRNOTAVAIL | |
| 248 #define ENETDOWN WSAENETDOWN | |
| 249 #define ENETUNREACH WSAENETUNREACH | |
| 250 #define ENETRESET WSAENETRESET | |
| 251 #define ECONNABORTED WSAECONNABORTED | |
| 252 #define ECONNRESET WSAECONNRESET | |
| 253 #define ENOBUFS WSAENOBUFS | |
| 254 #define EISCONN WSAEISCONN | |
| 255 #define ENOTCONN WSAENOTCONN | |
| 256 #define ESHUTDOWN WSAESHUTDOWN | |
| 257 #define ETOOMANYREFS WSAETOOMANYREFS | |
| 258 #define ETIMEDOUT WSAETIMEDOUT | |
| 259 #define ECONNREFUSED WSAECONNREFUSED | |
| 260 #define ELOOP WSAELOOP | |
| 261 #define ENAMETOOLONG WSAENAMETOOLONG | |
| 262 #define EHOSTDOWN WSAEHOSTDOWN | |
| 263 #define EHOSTUNREACH WSAEHOSTUNREACH | |
| 264 #define ENOTEMPTY WSAENOTEMPTY | |
| 265 #define EPROCLIM WSAEPROCLIM | |
| 266 #define EUSERS WSAEUSERS | |
| 267 #define EDQUOT WSAEDQUOT | |
| 268 #define ESTALE WSAESTALE | |
| 269 #define EREMOTE WSAEREMOTE | |
| 270 #endif | |
| 271 | |
| 272 #ifdef __cplusplus | |
| 273 extern "C" { | |
| 274 #endif | |
| 275 | |
| 276 SOCKET WINAPI accept(SOCKET s,struct sockaddr *addr,int *addrlen); | |
| 277 int WINAPI bind(SOCKET s,const struct sockaddr *addr,int namelen); | |
| 278 int WINAPI closesocket(SOCKET s); | |
| 279 int WINAPI connect(SOCKET s,const struct sockaddr *name,int namelen); | |
| 280 int WINAPI ioctlsocket(SOCKET s,long cmd,u_long *argp); | |
| 281 int WINAPI getpeername(SOCKET s,struct sockaddr *name,int *namelen); | |
| 282 int WINAPI getsockname(SOCKET s,struct sockaddr *name,int *namelen); | |
| 283 int WINAPI getsockopt(SOCKET s,int level,int optname,char *optval,int *optlen); | |
| 284 u_long WINAPI htonl(u_long hostlong); | |
| 285 u_short WINAPI htons(u_short hostshort); | |
| 286 unsigned long WINAPI inet_addr(const char *cp); | |
| 287 char *WINAPI inet_ntoa(struct in_addr in); | |
| 288 int WINAPI listen(SOCKET s,int backlog); | |
| 289 u_long WINAPI ntohl(u_long netlong); | |
| 290 u_short WINAPI ntohs(u_short netshort); | |
| 291 int WINAPI recv(SOCKET s,char *buf,int len,int flags); | |
| 292 int WINAPI recvfrom(SOCKET s,char *buf,int len,int flags,struct sockaddr *from,int *fromlen); | |
| 293 int WINAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const struct timeval *timeout); | |
| 294 int WINAPI send(SOCKET s,const char *buf,int len,int flags); | |
| 295 int WINAPI sendto(SOCKET s,const char *buf,int len,int flags,const struct sockaddr *to,int tolen); | |
| 296 int WINAPI setsockopt(SOCKET s,int level,int optname,const char *optval,int optlen); | |
| 297 int WINAPI shutdown(SOCKET s,int how); | |
| 298 SOCKET WINAPI socket(int af,int type,int protocol); | |
| 299 struct hostent *WINAPI gethostbyaddr(const char *addr,int len,int type); | |
| 300 struct hostent *WINAPI gethostbyname(const char *name); | |
| 301 int WINAPI gethostname(char *name,int namelen); | |
| 302 struct servent *WINAPI getservbyport(int port,const char *proto); | |
| 303 struct servent *WINAPI getservbyname(const char *name,const char *proto); | |
| 304 struct protoent *WINAPI getprotobynumber(int proto); | |
| 305 struct protoent *WINAPI getprotobyname(const char *name); | |
| 306 int WINAPI WSAStartup(WORD wVersionRequired,LPWSADATA lpWSAData); | |
| 307 int WINAPI WSACleanup(void); | |
| 308 void WINAPI WSASetLastError(int iError); | |
| 309 int WINAPI WSAGetLastError(void); | |
| 310 WINBOOL WINAPI WSAIsBlocking(void); | |
| 311 int WINAPI WSAUnhookBlockingHook(void); | |
| 312 FARPROC WINAPI WSASetBlockingHook(FARPROC lpBlockFunc); | |
| 313 int WINAPI WSACancelBlockingCall(void); | |
| 314 HANDLE WINAPI WSAAsyncGetServByName(HWND hWnd,u_int wMsg,const char *name,const char *proto,char *buf,int buflen); | |
| 315 HANDLE WINAPI WSAAsyncGetServByPort(HWND hWnd,u_int wMsg,int port,const char *proto,char *buf,int buflen); | |
| 316 HANDLE WINAPI WSAAsyncGetProtoByName(HWND hWnd,u_int wMsg,const char *name,char *buf,int buflen); | |
| 317 HANDLE WINAPI WSAAsyncGetProtoByNumber(HWND hWnd,u_int wMsg,int number,char *buf,int buflen); | |
| 318 HANDLE WINAPI WSAAsyncGetHostByName(HWND hWnd,u_int wMsg,const char *name,char *buf,int buflen); | |
| 319 HANDLE WINAPI WSAAsyncGetHostByAddr(HWND hWnd,u_int wMsg,const char *addr,int len,int type,char *buf,int buflen); | |
| 320 int WINAPI WSACancelAsyncRequest(HANDLE hAsyncTaskHandle); | |
| 321 int WINAPI WSAAsyncSelect(SOCKET s,HWND hWnd,u_int wMsg,long lEvent); | |
| 322 int WINAPI WSARecvEx(SOCKET s,char *buf,int len,int *flags); | |
| 323 | |
| 324 typedef struct _TRANSMIT_FILE_BUFFERS { | |
| 325 PVOID Head; | |
| 326 DWORD HeadLength; | |
| 327 PVOID Tail; | |
| 328 DWORD TailLength; | |
| 329 } TRANSMIT_FILE_BUFFERS,*PTRANSMIT_FILE_BUFFERS,*LPTRANSMIT_FILE_BUFFERS; | |
| 330 | |
| 331 #define TF_DISCONNECT 0x01 | |
| 332 #define TF_REUSE_SOCKET 0x02 | |
| 333 #define TF_WRITE_BEHIND 0x04 | |
| 334 | |
| 335 WINBOOL WINAPI TransmitFile(SOCKET hSocket,HANDLE hFile,DWORD nNumberOfBytesToWrite,DWORD nNumberOfBytesPerSend,LPOVERLAPPED lpOverlapped,LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,DWORD dwReserved); | |
| 336 WINBOOL WINAPI AcceptEx(SOCKET sListenSocket,SOCKET sAcceptSocket,PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,DWORD dwRemoteAddressLength,LPDWORD lpdwBytesReceived,LPOVERLAPPED lpOverlapped); | |
| 337 VOID WINAPI GetAcceptExSockaddrs (PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,DWORD dwRemoteAddressLength,struct sockaddr **LocalSockaddr,LPINT LocalSockaddrLength,struct sockaddr **RemoteSockaddr,LPINT RemoteSockaddrLength); | |
| 338 | |
| 339 #ifdef __cplusplus | |
| 340 } | |
| 341 #endif | |
| 342 | |
| 343 typedef struct sockaddr SOCKADDR; | |
| 344 typedef struct sockaddr *PSOCKADDR; | |
| 345 typedef struct sockaddr *LPSOCKADDR; | |
| 346 typedef struct sockaddr_in SOCKADDR_IN; | |
| 347 typedef struct sockaddr_in *PSOCKADDR_IN; | |
| 348 typedef struct sockaddr_in *LPSOCKADDR_IN; | |
| 349 typedef struct linger LINGER; | |
| 350 typedef struct linger *PLINGER; | |
| 351 typedef struct linger *LPLINGER; | |
| 352 typedef struct in_addr IN_ADDR; | |
| 353 typedef struct in_addr *PIN_ADDR; | |
| 354 typedef struct in_addr *LPIN_ADDR; | |
| 355 typedef struct fd_set FD_SET; | |
| 356 typedef struct fd_set *PFD_SET; | |
| 357 typedef struct fd_set *LPFD_SET; | |
| 358 typedef struct hostent HOSTENT; | |
| 359 typedef struct hostent *PHOSTENT; | |
| 360 typedef struct hostent *LPHOSTENT; | |
| 361 typedef struct servent SERVENT; | |
| 362 typedef struct servent *PSERVENT; | |
| 363 typedef struct servent *LPSERVENT; | |
| 364 typedef struct protoent PROTOENT; | |
| 365 typedef struct protoent *PPROTOENT; | |
| 366 typedef struct protoent *LPPROTOENT; | |
| 367 typedef struct timeval TIMEVAL; | |
| 368 typedef struct timeval *PTIMEVAL; | |
| 369 typedef struct timeval *LPTIMEVAL; | |
| 370 | |
| 371 #define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error) | |
| 372 #define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error) | |
| 373 #define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam) | |
| 374 #define WSAGETASYNCERROR(lParam) HIWORD(lParam) | |
| 375 #define WSAGETSELECTEVENT(lParam) LOWORD(lParam) | |
| 376 #define WSAGETSELECTERROR(lParam) HIWORD(lParam) | |
| 377 | |
| 378 #ifdef IPV6STRICT | |
| 379 #error WINSOCK2 required. | |
| 380 #endif | |
| 381 #endif | |
| 382 #else | |
| 383 #ifndef _INC_WINSOCK_H | |
| 384 #define _INC_WINSOCK_H | |
| 385 #endif | |
| 386 #include <winsock2.h> | |
| 387 #endif |
