use restrict everywhere it's required by c99 and/or posix 2008
[musl] / include / arpa / inet.h
1 #ifndef _ARPA_INET_H
2 #define _ARPA_INET_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #if __STDC_VERSION__ >= 199901L
9 #define __restrict restrict
10 #elif !defined(__GNUC__)
11 #define __restrict
12 #endif
13
14 #include <netinet/in.h>
15 #include <inttypes.h>
16
17 #define __NEED_socklen_t
18 #define __NEED_in_addr_t
19 #define __NEED_in_port_t
20 #define __NEED_uint16_t
21 #define __NEED_uint32_t
22 #define __NEED_struct_in_addr
23
24 #include <bits/alltypes.h>
25
26 uint32_t htonl(uint32_t);
27 uint16_t htons(uint16_t);
28 uint32_t ntohl(uint32_t);
29 uint16_t ntohs(uint16_t);
30
31 in_addr_t inet_addr (const char *);
32 char *inet_ntoa (struct in_addr);
33 int inet_pton (int, const char *__restrict, void *__restrict);
34 const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t);
35
36 int inet_aton (const char *, struct in_addr *); /* nonstandard but widely used */
37
38 #undef INET_ADDRSTRLEN
39 #undef INET6_ADDRSTRLEN
40 #define INET_ADDRSTRLEN  16
41 #define INET6_ADDRSTRLEN 46
42
43 #ifdef __cplusplus
44 }
45 #endif
46
47 #endif