summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-04-28 17:46:07 +0200
committerSimon Josefsson <simon@josefsson.org>2008-04-28 17:46:07 +0200
commit951751b55a72e9e8669b73dfe400942d17eef529 (patch)
tree7eae043a29eb3d1850346ac9055977ae06666272 /gl
parent9aec0d80e236d00c6576405bb0749bd1cedb7cc5 (diff)
downloadgnutls-951751b55a72e9e8669b73dfe400942d17eef529.tar.gz
Update gnulib files.
Diffstat (limited to 'gl')
-rw-r--r--gl/arpa_inet.in.h24
-rw-r--r--gl/gnulib.mk4
-rw-r--r--gl/inet_ntop.c4
-rw-r--r--gl/inet_ntop.h42
-rw-r--r--gl/inet_pton.c4
-rw-r--r--gl/inet_pton.h24
-rw-r--r--gl/m4/gnulib-comp.m42
-rw-r--r--gl/m4/inet_ntop.m47
-rw-r--r--gl/m4/inet_pton.m47
9 files changed, 34 insertions, 84 deletions
diff --git a/gl/arpa_inet.in.h b/gl/arpa_inet.in.h
index ef24cd9226..89af96e50f 100644
--- a/gl/arpa_inet.in.h
+++ b/gl/arpa_inet.in.h
@@ -23,7 +23,25 @@
#include <sys/socket.h>
#if @GNULIB_INET_NTOP@
-# include <inet_ntop.h>
+# if !@HAVE_DECL_INET_NTOP@
+/* Converts an internet address from internal format to a printable,
+ presentable format.
+ AF is an internet address family, such as AF_INET or AF_INET6.
+ SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
+ (for AF_INET6).
+ DST points to a buffer having room for CNT bytes.
+ The printable representation of the address (in numeric form, not
+ surrounded by [...], no reverse DNS is done) is placed in DST, and
+ DST is returned. If an error occurs, the return value is NULL and
+ errno is set. If CNT bytes are not sufficient to hold the result,
+ the return value is NULL and errno is set to ENOSPC. A good value
+ for CNT is 46.
+
+ For more details, see the POSIX:2001 specification
+ <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
+extern const char *inet_ntop (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef inet_ntop
# define inet_ntop(af,src,dst,cnt) \
@@ -33,7 +51,9 @@
#endif
#if @GNULIB_INET_PTON@
-# include <inet_pton.h>
+# if !@HAVE_DECL_INET_PTON@
+extern int inet_pton (int af, const char *restrict src, void *restrict dst);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef inet_pton
# define inet_pton(af,src,dst) \
diff --git a/gl/gnulib.mk b/gl/gnulib.mk
index fe4f35bb7a..f3808b3a87 100644
--- a/gl/gnulib.mk
+++ b/gl/gnulib.mk
@@ -124,7 +124,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
## begin gnulib module inet_ntop
-EXTRA_DIST += inet_ntop.c inet_ntop.h
+EXTRA_DIST += inet_ntop.c
EXTRA_libgnu_la_SOURCES += inet_ntop.c
@@ -133,7 +133,7 @@ EXTRA_libgnu_la_SOURCES += inet_ntop.c
## begin gnulib module inet_pton
-EXTRA_DIST += inet_pton.c inet_pton.h
+EXTRA_DIST += inet_pton.c
EXTRA_libgnu_la_SOURCES += inet_pton.c
diff --git a/gl/inet_ntop.c b/gl/inet_ntop.c
index 3e266a273a..be091ff913 100644
--- a/gl/inet_ntop.c
+++ b/gl/inet_ntop.c
@@ -1,6 +1,6 @@
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
#include <config.h>
/* Specification. */
-#include "inet_ntop.h"
+#include <arpa/inet.h>
#include <stdio.h>
#include <string.h>
diff --git a/gl/inet_ntop.h b/gl/inet_ntop.h
deleted file mode 100644
index 2897bb4069..0000000000
--- a/gl/inet_ntop.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Convert internet address from internal to printable, presentable format.
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/* Converts an internet address from internal format to a printable,
- presentable format.
- AF is an internet address family, such as AF_INET or AF_INET6.
- SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
- (for AF_INET6).
- DST points to a buffer having room for CNT bytes.
- The printable representation of the address (in numeric form, not
- surrounded by [...], no reverse DNS is done) is placed in DST, and
- DST is returned. If an error occurs, the return value is NULL and
- errno is set. If CNT bytes are not sufficient to hold the result,
- the return value is NULL and errno is set to ENOSPC. A good value
- for CNT is 46.
-
- For more details, see the POSIX:2001 specification
- <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
-
-#if !HAVE_DECL_INET_NTOP
-extern const char *inet_ntop (int af, const void *restrict src,
- char *restrict dst, socklen_t cnt);
-#endif
diff --git a/gl/inet_pton.c b/gl/inet_pton.c
index 6cbf8cb2bd..261caf197b 100644
--- a/gl/inet_pton.c
+++ b/gl/inet_pton.c
@@ -1,6 +1,6 @@
/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@
#include <config.h>
/* Specification. */
-#include "inet_pton.h"
+#include <arpa/inet.h>
#include <ctype.h>
#include <string.h>
diff --git a/gl/inet_pton.h b/gl/inet_pton.h
deleted file mode 100644
index 3335cb8cfa..0000000000
--- a/gl/inet_pton.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Convert internet address from text to binary format.
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#if !HAVE_DECL_INET_PTON
-extern int inet_pton (int af, const char *restrict src, void *restrict dst);
-#endif
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 94b51a3e35..882a81f141 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -215,9 +215,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/getpass.c
lib/getpass.h
lib/inet_ntop.c
- lib/inet_ntop.h
lib/inet_pton.c
- lib/inet_pton.h
lib/intprops.h
lib/netinet_in.in.h
lib/progname.c
diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4
index bb02d2298b..0848c07759 100644
--- a/gl/m4/inet_ntop.m4
+++ b/gl/m4/inet_ntop.m4
@@ -1,5 +1,5 @@
-# inet_ntop.m4 serial 3
-dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+# inet_ntop.m4 serial 4
+dnl Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,9 +10,8 @@ AC_DEFUN([gl_INET_NTOP],
gl_PREREQ_INET_NTOP
])
-# Prerequisites of lib/inet_ntop.h and lib/inet_ntop.c.
+# Prerequisites of lib/inet_ntop.c.
AC_DEFUN([gl_PREREQ_INET_NTOP], [
- AC_CHECK_HEADERS_ONCE([netinet/in.h arpa/inet.h])
AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
AC_REQUIRE([gl_SOCKET_FAMILIES])
AC_REQUIRE([AC_C_RESTRICT])
diff --git a/gl/m4/inet_pton.m4 b/gl/m4/inet_pton.m4
index 85e802c8bd..58f2c31866 100644
--- a/gl/m4/inet_pton.m4
+++ b/gl/m4/inet_pton.m4
@@ -1,5 +1,5 @@
-# inet_pton.m4 serial 2
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+# inet_pton.m4 serial 3
+dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,9 +10,8 @@ AC_DEFUN([gl_INET_PTON],
gl_PREREQ_INET_PTON
])
-# Prerequisites of lib/inet_pton.h and lib/inet_pton.c.
+# Prerequisites of lib/inet_pton.c.
AC_DEFUN([gl_PREREQ_INET_PTON], [
- AC_CHECK_HEADERS_ONCE([netinet/in.h arpa/inet.h])
AC_CHECK_DECLS([inet_pton],,,[#include <arpa/inet.h>])
AC_REQUIRE([gl_SOCKET_FAMILIES])
AC_REQUIRE([AC_C_RESTRICT])