xt_resolve_hostname(3)

NAME
xt_resolve_hostname() - Convert hostname to IP address

LIBRARY
#include <xtend/string.h>
-lxtend

SYNOPSIS
int     xt_resolve_hostname(const char *hostname, char *ip, size_t ip_buff_len)

ARGUMENTS
hostname    Name of the host to be resolved
ip          Character array to receive IP address
ip_buff_len Size of ip array including null byte

DESCRIPTION
Resolve a host name to an IP address.

RETURN VALUES
XT_OK on success, XT_FAIL otherwise

EXAMPLES
#define IP_MAX_CHARS    64
char    *hostname = "my.site.edu",
        ip[IP_MAX_CHARS + 1];
if ( xt_resolve_hostname(hostname, ip, IP_MAX_CHARS + 1) == XT_OK )
{
}

SEE ALSO
gethostbyname(3), getaddrinfo(3)