* net.cc (cygwin_inet_aton): New function.

* cygwin.din: Export cygwin_inet_aton as inet_aton.
This commit is contained in:
Corinna Vinschen 2000-11-25 10:23:55 +00:00
parent a76857b272
commit 0bec01198b
3 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Sat Nov 25 11:07:00 2000 Corinna Vinschen <corinna@vinschen.de>
* net.cc (cygwin_inet_aton): New function.
* cygwin.din: Export cygwin_inet_aton as inet_aton.
Sat Nov 25 01:57:42 2000 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* path.cc (mount_info::read_cygdrive_info_from_registry): Read system

View File

@ -949,6 +949,7 @@ _select = cygwin_select
send = cygwin_send
socket = cygwin_socket
setsockopt = cygwin_setsockopt
inet_aton = cygwin_inet_aton
inet_ntoa = cygwin_inet_ntoa
recvfrom = cygwin_recvfrom
sendto = cygwin_sendto

View File

@ -106,7 +106,7 @@ dump_protoent (struct protoent *p)
debug_printf ("protoent %s %x %x", p->p_name, p->p_aliases, p->p_proto);
}
/* exported as inet_ntoa: standards? */
/* exported as inet_ntoa: BSD 4.3 */
extern "C" char *
cygwin_inet_ntoa (struct in_addr in)
{
@ -114,7 +114,7 @@ cygwin_inet_ntoa (struct in_addr in)
return res;
}
/* exported as inet_addr: standards? */
/* exported as inet_addr: BSD 4.3 */
extern "C" unsigned long
cygwin_inet_addr (const char *cp)
{
@ -122,6 +122,20 @@ cygwin_inet_addr (const char *cp)
return res;
}
/* exported as inet_aton: BSD 4.3
inet_aton is not exported by wsock32 and ws2_32,
so it has to be implemented here. */
extern "C" int
cygwin_inet_aton (const char *cp, struct in_addr *inp)
{
unsigned long res = inet_addr (cp);
if (res == INADDR_NONE && strcmp (cp, "255.255.255.255"))
return -1;
if (inp)
inp->s_addr = res;
return 0;
}
/* undocumented in wsock32.dll */
extern "C" unsigned int WINAPI inet_network (const char *);