[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: arpa_inet_h: new module, replaces inet_ntop
From: |
Simon Josefsson |
Subject: |
Re: arpa_inet_h: new module, replaces inet_ntop |
Date: |
Sat, 17 Jun 2006 20:44:38 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> Simon Josefsson wrote:
>> It would replace the
>> inet_ntop module, and lib/inet_ntop.h would be removed.
>>
>> With this, files only need to #include <arpa/inet.h> for inet_ntop or
>> inet_pton, just like it should be.
>
> How would this work on platforms which have an <arpa/inet.h> already
> but don't have and don't declare the inet_ntop() function? Such as
> Solaris 7 and many other platforms.
Ah, good catch.
So perhaps we should have two modules here:
"arpa_inet": Provides an arpa/inet.h on systems that lack it. The
header is needed on mingw to provide declarations for ntohl, ntohs,
etc (by depending on and including sys/socket, which includes
winsock2.h). It would also help remove #if HAVE_ARPA_INET_H tests.
"inet": Implements inet_?to? and has a header file inet.h that
applications should include.
Thoughts?
One question here is whether arpa_inet should depend on inet? Then
the arpa_inet module would provide the inet_ntop/inet_pton functions
when necessary, which arguable (?) should be provided when arpa/inet.h
is provided.
The disadvantage is, of course, that applications that depend on
arpa_inet and need inet_?to? will have to include both arpa/inet.h and
inet.h to make sure they get the inet_?to? declarations. So there
isn't really a need for "arpa_inet" to explicitly depend on "inet",
the user of these modules will have to make sure he's using both
manually anyway.
I think I'll start working on this approach. Whether the dependency
is there explicitly or not can be decided later.
/Simon