flockfile list corruption test
[libc-test] / src / api / netdb.c
1 #include <netdb.h>
2 #define T(t) (t*)0;
3 #define F(t,n) {t *y = &x.n;}
4 #define C(n) switch(n){case n:;}
5 static void f()
6 {
7 T(uint32_t)
8 T(socklen_t)
9 C(IPPORT_RESERVED)
10 {
11 struct hostent x;
12 F(char*, h_name)
13 F(char**, h_aliases)
14 F(int, h_addrtype)
15 F(int, h_length)
16 F(char**, h_addr_list)
17 }
18 {
19 struct netent x;
20 F(char*, n_name)
21 F(char**, n_aliases)
22 F(int, n_addrtype)
23 F(uint32_t, n_net)
24 }
25 {
26 struct protoent x;
27 F(char*, p_name)
28 F(char**, p_aliases)
29 F(int, p_proto)
30 }
31 {
32 struct servent x;
33 F(char*, s_name)
34 F(char**, s_aliases)
35 F(int, s_port)
36 F(char*, s_proto)
37 }
38 {
39 struct addrinfo x;
40 F(int, ai_flags)
41 F(int, ai_family)
42 F(int, ai_socktype)
43 F(int, ai_protocol)
44 F(socklen_t, ai_addrlen)
45 F(struct sockaddr*, ai_addr)
46 F(char*, ai_canonname)
47 F(struct addrinfo*, ai_next)
48 }
49 C(AI_PASSIVE)
50 C(AI_CANONNAME)
51 C(AI_NUMERICHOST)
52 C(AI_NUMERICSERV)
53 C(AI_V4MAPPED)
54 C(AI_ALL)
55 C(AI_ADDRCONFIG)
56 C(NI_NOFQDN)
57 C(NI_NUMERICHOST)
58 C(NI_NAMEREQD)
59 C(NI_NUMERICSERV)
60 C(NI_NUMERICSCOPE)
61 C(NI_DGRAM)
62 C(EAI_AGAIN)
63 C(EAI_BADFLAGS)
64 C(EAI_FAIL)
65 C(EAI_FAMILY)
66 C(EAI_MEMORY)
67 C(EAI_NONAME)
68 C(EAI_SERVICE)
69 C(EAI_SOCKTYPE)
70 C(EAI_SYSTEM)
71 C(EAI_OVERFLOW)
72 {void(*p)(void) = endhostent;}
73 {void(*p)(void) = endnetent;}
74 {void(*p)(void) = endprotoent;}
75 {void(*p)(void) = endservent;}
76 {const char*(*p)(int) = gai_strerror;}
77 {struct hostent*(*p)(void) = gethostent;}
78 {struct netent*(*p)(uint32_t,int) = getnetbyaddr;}
79 {struct netent*(*p)(const char*) = getnetbyname;}
80 {struct netent*(*p)(void) = getnetent;}
81 {struct protoent*(*p)(const char*) = getprotobyname;}
82 {struct protoent*(*p)(int) = getprotobynumber;}
83 {struct protoent*(*p)(void) = getprotoent;}
84 {struct servent*(*p)(const char*,const char*) = getservbyname;}
85 {struct servent*(*p)(int,const char*) = getservbyport;}
86 {struct servent*(*p)(void) = getservent;}
87 {void(*p)(int) = sethostent;}
88 {void(*p)(int) = setnetent;}
89 {void(*p)(int) = setprotoent;}
90 {void(*p)(int) = setservent;}
91 }
92 #include <sys/socket.h>
93 static void g()
94 {
95 {void(*p)(struct addrinfo*) = freeaddrinfo;}
96 {int(*p)(const char*restrict,const char*restrict,const struct addrinfo*restrict,struct addrinfo**restrict) = getaddrinfo;}
97 {int(*p)(const struct sockaddr*restrict,socklen_t,char*restrict,socklen_t,char*restrict,socklen_t,int) = getnameinfo;}
98 }