{code}
struct hostent *gethostbyname(const char *name);
-
-// this code from MSDN. ignore PHOSTENT, and LPHOSTENT. win32 clutters
-typedef struct hostent {
- char FAR * h_name;
- char FAR FAR **h_aliases;
- short h_addrtype;
- short h_length;
- char FAR FAR **h_addr_list;
-}HOSTENT, *PHOSTENT, FAR *LPHOSTENT;
+struct hostent
+{
+ char *h_name; /* Official name of host. */
+ char **h_aliases; /* Alias list. */
+ int h_addrtype; /* Host address type. */
+ int h_length; /* Length of address. */
+ char **h_addr_list; /* List of addresses from name server. */
+#define h_addr h_addr_list[0] /* Address, for backward compatibility. */
+};
int getaddrinfo(const char *node,
const char *service,