// to convert structures returned as BLOBs.
//
-VOID FixList(PCHAR ** List, PCHAR Base)
+VOID
+FixList(PCHAR ** List, PCHAR Base)
{
if(*List)
{
// 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;
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: ");
}
}
+
int
main (int argc, char **argv)
{