ret->error = NULL; if ( (a = inet_addr(host)) == (unsigned long) INADDR_NONE) { if ( (h = gethostbyname(host)) == NULL) {
memset(ret, 0, sizeof(struct SockAddr_tag)); ret->family = 0;		        *canonicalname = ret->realhost;      if ( (a = inet_addr(host)) == (unsigned long) INADDR_NONE) { #ifdef IPV6    typedef int (CALLBACK* FGETADDRINFO)(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res); FGETADDRINFO fGetAddrInfo = NULL;  HINSTANCE dllWSHIP6 = LoadLibrary("wship6.dll"); if (dllWSHIP6) fGetAddrInfo = (FGETADDRINFO)GetProcAddress(dllWSHIP6, "getaddrinfo");   if (fGetAddrInfo) {  if (fGetAddrInfo(host, NULL, NULL, &ret->ai) == 0) ret->family = ret->ai->ai_family; } else #endif  if (ret->family == 0) {  if (h = gethostbyname(host)) ret->family = AF_INET; }   if (ret->family == 0) {
SockAddr sk_namelookup(char *host, char **canonicalname) {    SockAddr ret = smalloc(sizeof(struct SockAddr_tag));    unsigned long a;    struct hostent *h;    ret->error = NULL;    if ( (a = inet_addr(host)) == (unsigned long) INADDR_NONE) {	if ( (h = gethostbyname(host)) == NULL) {	    DWORD err = WSAGetLastError();	    ret->error = winsock_error_string(err);	} else {	    memcpy (&a, h->h_addr, sizeof(a));	    *canonicalname = h->h_name;	}    } else {	*canonicalname = host;    }    ret->address = ntohl(a);    return ret;}