libctru  v2.4.1
inet.h
1 #pragma once
2 
3 #include <netinet/in.h>
4 #include <stdint.h>
5 
6 static inline uint32_t htonl(uint32_t hostlong)
7 {
8  return __builtin_bswap32(hostlong);
9 }
10 
11 static inline uint16_t htons(uint16_t hostshort)
12 {
13  return __builtin_bswap16(hostshort);
14 }
15 
16 static inline uint32_t ntohl(uint32_t netlong)
17 {
18  return __builtin_bswap32(netlong);
19 }
20 
21 static inline uint16_t ntohs(uint16_t netshort)
22 {
23  return __builtin_bswap16(netshort);
24 }
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30  in_addr_t inet_addr(const char *cp);
31  int inet_aton(const char *cp, struct in_addr *inp);
32  char* inet_ntoa(struct in_addr in);
33 
34  const char *inet_ntop(int af, const void * src, char * dst, socklen_t size);
35  int inet_pton(int af, const char * src, void * dst);
36 
37 #ifdef __cplusplus
38 }
39 #endif
Definition: in.h:30