X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fgns%2Fw32nsp-resolve.c;h=3234a1ee5228962b753327cdac1034df62e97120;hb=39850a9dc3d789303b91816275314898c0ae80e2;hp=4a116f5948d496aa90f76a77b89bf1892fa82741;hpb=601e24eca9012c462021ccacb04c70dffdb31264;p=oweals%2Fgnunet.git diff --git a/src/gns/w32nsp-resolve.c b/src/gns/w32nsp-resolve.c index 4a116f594..3234a1ee5 100644 --- a/src/gns/w32nsp-resolve.c +++ b/src/gns/w32nsp-resolve.c @@ -57,7 +57,8 @@ DEFINE_GUID(SVCID_INET_HOSTADDRBYNAME, 0x0002a803, 0x0000, 0x0000, 0xc0, 0x00, 0 // to convert structures returned as BLOBs. // -VOID FixList(PCHAR ** List, PCHAR Base) +VOID +FixList(PCHAR ** List, PCHAR Base) { if(*List) { @@ -77,7 +78,8 @@ VOID FixList(PCHAR ** List, PCHAR Base) // Routine to convert a hostent returned in a BLOB to one with // usable pointers. The structure is converted in-place. // -VOID UnpackHostEnt(struct hostent * hostent) +VOID +UnpackHostEnt(struct hostent * hostent) { PCHAR pch; @@ -91,13 +93,15 @@ VOID UnpackHostEnt(struct hostent * hostent) FixList(&hostent->h_addr_list, pch); } -void + +static void print_hostent (struct hostent *he) { int i; char **pAlias; + printf("\tOfficial name: %s\n", he->h_name); - for (pAlias = he->h_aliases; *pAlias != 0; pAlias++) { + for (i=0, pAlias = he->h_aliases; *pAlias != 0; pAlias++) { printf("\tAlternate name #%d: %s\n", ++i, *pAlias); } printf("\tAddress type: "); @@ -150,6 +154,7 @@ print_hostent (struct hostent *he) } } + int main (int argc, char **argv) {