Fixes to improve portability (especially to OS X, Solaris, OpenBSD).
[ircu2.10.12-pk.git] / include / ircd_addrinfo.h
1 #ifndef INCLUDED_config_h
2 #include "config.h"
3 #endif
4
5 #ifndef INCLUDED_sys_types_h
6 #include <sys/types.h>
7 #define INCLUDED_sys_types_h
8 #endif
9
10 #ifndef INCLUDED_sys_socket_h
11 #include <sys/socket.h>
12 #define INCLUDED_sys_socket_h
13 #endif
14
15 #include <netdb.h>
16
17 #ifndef INCLUDED_netinet_in_h
18 #include <netinet/in.h>
19 #define INCLUDED_netinet_in_h
20 #endif
21
22 #ifdef HAVE_STDINT_H
23 #ifndef INCLUDED_stdint_h
24 #include <stdint.h>
25 #define INCLUDED_stdint_h
26 #endif
27 #endif
28
29 int irc_getaddrinfo(const char *hostname, const char *servname,
30                     const struct addrinfo *hints, struct addrinfo **res);
31 int irc_getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
32                     size_t hostlen, char *serv, size_t servlen, int flags);
33 void irc_freeaddrinfo(struct addrinfo *ai);