1570af302Sopenharmony_ci#include <sys/socket.h> 2570af302Sopenharmony_ci#define T(t) (t*)0; 3570af302Sopenharmony_ci#define F(t,n) {t *y = &x.n;} 4570af302Sopenharmony_ci#define C(n) switch(n){case n:;} 5570af302Sopenharmony_cistatic void f() 6570af302Sopenharmony_ci{ 7570af302Sopenharmony_ciT(size_t) 8570af302Sopenharmony_ciT(ssize_t) 9570af302Sopenharmony_ciT(socklen_t) 10570af302Sopenharmony_ciT(sa_family_t) 11570af302Sopenharmony_ci{ 12570af302Sopenharmony_cistruct sockaddr x; 13570af302Sopenharmony_ciF(sa_family_t,sa_family) 14570af302Sopenharmony_ciF(char, sa_data[0]) 15570af302Sopenharmony_ci} 16570af302Sopenharmony_ci{ 17570af302Sopenharmony_cistruct sockaddr_storage x; 18570af302Sopenharmony_ciF(sa_family_t, ss_family) 19570af302Sopenharmony_ci} 20570af302Sopenharmony_ci{ 21570af302Sopenharmony_cistruct msghdr x; 22570af302Sopenharmony_ciF(void*,msg_name) 23570af302Sopenharmony_ciF(socklen_t,msg_namelen) 24570af302Sopenharmony_ciF(struct iovec*,msg_iov) 25570af302Sopenharmony_ciF(int,msg_iovlen) 26570af302Sopenharmony_ciF(void*,msg_control) 27570af302Sopenharmony_ciF(socklen_t,msg_controllen) 28570af302Sopenharmony_ciF(int,msg_flags) 29570af302Sopenharmony_ci} 30570af302Sopenharmony_ci{ 31570af302Sopenharmony_cistruct iovec x; 32570af302Sopenharmony_ciF(void *,iov_base) 33570af302Sopenharmony_ciF(size_t,iov_len) 34570af302Sopenharmony_ci} 35570af302Sopenharmony_ci{ 36570af302Sopenharmony_cistruct cmsghdr x; 37570af302Sopenharmony_ciF(socklen_t,cmsg_len) 38570af302Sopenharmony_ciF(int,cmsg_level) 39570af302Sopenharmony_ciF(int,cmsg_type) 40570af302Sopenharmony_ci} 41570af302Sopenharmony_ciC(SCM_RIGHTS) 42570af302Sopenharmony_ci#ifndef CMSG_DATA 43570af302Sopenharmony_ci#error no CMSG_DATA 44570af302Sopenharmony_ci#endif 45570af302Sopenharmony_ci#ifndef CMSG_NXTHDR 46570af302Sopenharmony_ci#error no CMSG_NXTHDR 47570af302Sopenharmony_ci#endif 48570af302Sopenharmony_ci#ifndef CMSG_FIRSTHDR 49570af302Sopenharmony_ci#error CMSG_FIRSTTHDR 50570af302Sopenharmony_ci#endif 51570af302Sopenharmony_ci{ 52570af302Sopenharmony_cistruct linger x; 53570af302Sopenharmony_ciF(int,l_onoff) 54570af302Sopenharmony_ciF(int,l_linger) 55570af302Sopenharmony_ci} 56570af302Sopenharmony_ciC(SOCK_DGRAM) 57570af302Sopenharmony_ciC(SOCK_RAW) 58570af302Sopenharmony_ciC(SOCK_SEQPACKET) 59570af302Sopenharmony_ciC(SOCK_STREAM) 60570af302Sopenharmony_ciC(SOL_SOCKET) 61570af302Sopenharmony_ciC(SO_ACCEPTCONN) 62570af302Sopenharmony_ciC(SO_BROADCAST) 63570af302Sopenharmony_ciC(SO_DEBUG) 64570af302Sopenharmony_ciC(SO_DONTROUTE) 65570af302Sopenharmony_ciC(SO_ERROR) 66570af302Sopenharmony_ciC(SO_KEEPALIVE) 67570af302Sopenharmony_ciC(SO_LINGER) 68570af302Sopenharmony_ciC(SO_OOBINLINE) 69570af302Sopenharmony_ciC(SO_RCVBUF) 70570af302Sopenharmony_ciC(SO_RCVLOWAT) 71570af302Sopenharmony_ciC(SO_RCVTIMEO) 72570af302Sopenharmony_ciC(SO_REUSEADDR) 73570af302Sopenharmony_ciC(SO_SNDBUF) 74570af302Sopenharmony_ciC(SO_SNDLOWAT) 75570af302Sopenharmony_ciC(SO_SNDTIMEO) 76570af302Sopenharmony_ciC(SO_TYPE) 77570af302Sopenharmony_ciC(SOMAXCONN) 78570af302Sopenharmony_ciC(MSG_CTRUNC) 79570af302Sopenharmony_ciC(MSG_DONTROUTE) 80570af302Sopenharmony_ciC(MSG_EOR) 81570af302Sopenharmony_ciC(MSG_OOB) 82570af302Sopenharmony_ciC(MSG_NOSIGNAL) 83570af302Sopenharmony_ciC(MSG_PEEK) 84570af302Sopenharmony_ciC(MSG_TRUNC) 85570af302Sopenharmony_ciC(MSG_WAITALL) 86570af302Sopenharmony_ciC(AF_INET) 87570af302Sopenharmony_ciC(AF_INET6) 88570af302Sopenharmony_ciC(AF_UNIX) 89570af302Sopenharmony_ciC(AF_UNSPEC) 90570af302Sopenharmony_ciC(SHUT_RD) 91570af302Sopenharmony_ciC(SHUT_RDWR) 92570af302Sopenharmony_ciC(SHUT_WR) 93570af302Sopenharmony_ci{int(*p)(int,struct sockaddr*restrict,socklen_t*restrict) = accept;} 94570af302Sopenharmony_ci{int(*p)(int,const struct sockaddr*,socklen_t) = bind;} 95570af302Sopenharmony_ci{int(*p)(int,const struct sockaddr*,socklen_t) = connect;} 96570af302Sopenharmony_ci{int(*p)(int,struct sockaddr*restrict,socklen_t*restrict) = getpeername;} 97570af302Sopenharmony_ci{int(*p)(int,struct sockaddr*restrict,socklen_t*restrict) = getsockname;} 98570af302Sopenharmony_ci{int(*p)(int,int,int,void*restrict,socklen_t*restrict) = getsockopt;} 99570af302Sopenharmony_ci{int(*p)(int,int) = listen;} 100570af302Sopenharmony_ci{ssize_t(*p)(int,void*,size_t,int) = recv;} 101570af302Sopenharmony_ci{ssize_t(*p)(int,void*restrict,size_t,int,struct sockaddr*restrict,socklen_t*restrict) = recvfrom;} 102570af302Sopenharmony_ci{ssize_t(*p)(int,struct msghdr*,int) = recvmsg;} 103570af302Sopenharmony_ci{ssize_t(*p)(int,const void*,size_t,int) = send;} 104570af302Sopenharmony_ci{ssize_t(*p)(int,const struct msghdr*,int) = sendmsg;} 105570af302Sopenharmony_ci{ssize_t(*p)(int,const void*,size_t,int,const struct sockaddr*,socklen_t) = sendto;} 106570af302Sopenharmony_ci{int(*p)(int,int,int,const void*,socklen_t) = setsockopt;} 107570af302Sopenharmony_ci{int(*p)(int,int) = shutdown;} 108570af302Sopenharmony_ci{int(*p)(int) = sockatmark;} 109570af302Sopenharmony_ci{int(*p)(int,int,int) = socket;} 110570af302Sopenharmony_ci{int(*p)(int,int,int,int[]) = socketpair;} 111570af302Sopenharmony_ci} 112