X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fgns%2Fw32nsp-resolve.c;h=3234a1ee5228962b753327cdac1034df62e97120;hb=39850a9dc3d789303b91816275314898c0ae80e2;hp=884e4ba438354e32bf100878607aca9e8a4f481a;hpb=23e7a5c1060d37c45a955e4bed961661af8cafb9;p=oweals%2Fgnunet.git diff --git a/src/gns/w32nsp-resolve.c b/src/gns/w32nsp-resolve.c index 884e4ba43..3234a1ee5 100644 --- a/src/gns/w32nsp-resolve.c +++ b/src/gns/w32nsp-resolve.c @@ -1,3 +1,27 @@ +/* + This file is part of GNUnet. + (C) 2012 Christian Grothoff (and other contributing authors) + + GNUnet is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +/** + * @file gns/w32nsp-resolve.c + * @brief W32 integration for GNS + * @author LRN + */ #define INITGUID #include #include @@ -33,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) { @@ -53,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; @@ -67,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: "); @@ -126,6 +154,7 @@ print_hostent (struct hostent *he) } } + int main (int argc, char **argv) { @@ -337,4 +366,4 @@ main (int argc, char **argv) } WSACleanup(); return r; -} \ No newline at end of file +}