From bb93ac335846424662212eea840859e7f0cc16b5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 21 Oct 2013 22:05:29 -0400 Subject: split inet_addr and inet_ntoa back into their own files despite being practically deprecated, these functions are still part of the standard and thus cannot reside in a file that also contains namespace pollution. this reverts some of the changes made in commit e40f48a421a9176e3e298b5bac75f0355b219e58. --- src/network/inet_addr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/network/inet_addr.c (limited to 'src/network/inet_addr.c') diff --git a/src/network/inet_addr.c b/src/network/inet_addr.c new file mode 100644 index 00000000..84137281 --- /dev/null +++ b/src/network/inet_addr.c @@ -0,0 +1,11 @@ +#include +#include +#include +#include "__dns.h" + +in_addr_t inet_addr(const char *p) +{ + struct sockaddr_in sin; + if (__ipparse(&sin, AF_INET, p)) return -1; + return sin.sin_addr.s_addr; +} -- cgit v1.2.1