it not addrinfo as don know if it is _binary_ compatible with it struc

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// it's not `addrinfo` as I don't know if it is _binary_ compatible with it.
struct wee_addrinfo
{
int ai_flags; /* Input flags. */
int ai_family; /* Protocol family for socket. */
int ai_socktype; /* Socket type. */
int ai_protocol; /* Protocol for socket. */
socklen_t ai_addrlen; /* Length of socket address. */
struct sockaddr *ai_addr; /* Socket address for socket. */
char *ai_canonname; /* Canonical name for service location. */
struct wee_addrinfo *ai_next; /* Pointer to next in list. */
};
// struct addrinfo *res will be freed when callback returns
// errno is set to the value getaddrinfo set
typedef void (*cb_getaddrinfo)(int retval, struct wee_addrinfo *res, void *cb_arg);
BEGIN_CDECL
int wee_getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints,
cb_getaddrinfo cb, void *cb_arg);
END_CDECL