Subject: Re: acountry.c sample

Re: acountry.c sample

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Tue, 11 Dec 2007 15:06:14 +0100

"Daniel Stenberg" <daniel_at_haxx.se> wrote:

> Worked nicely on my linux box after this patch:
>
> --- acountry.c.org 2007-12-10 22:43:17.000000000 +0100
> +++ acountry.c 2007-12-10 22:43:59.000000000 +0100
> @@ -35,6 +35,7 @@
> #else
> #include <arpa/inet.h>
> #include <netdb.h>
> +#define stricmp(x,z) strcasecmp(x,z)
> #endif

I'll use strcasecmp() instead.

> Oh, and a little request about the actual utility! Since c-ares can resolve
> host names, acountry would be even nicer if it was made to also accept host
> names! ;-)

Good idea. I've done that. The attached version now accepts multiple addresses
and/or hostnames on cmd-line. I'm not particularily happy about using *two*
callbacks, but I couldn't figure out a smarter way...

--gv

Received on 2007-12-11