Avoid line length limitation from HP NonStop system header files.
[gnulib.git] / lib / arpa_inet.in.h
1 /* A GNU-like <arpa/inet.h>.
2
3    Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2, or (at your option)
8    any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software Foundation,
17    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
18
19 #ifndef _GL_ARPA_INET_H
20
21 #if __GNUC__ >= 3
22 @PRAGMA_SYSTEM_HEADER@
23 #endif
24 @PRAGMA_COLUMNS@
25
26 /* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
27    under MinGW.
28    But avoid namespace pollution on glibc systems.  */
29 #ifndef __GLIBC__
30 # include <sys/socket.h>
31 #endif
32
33 #if @HAVE_ARPA_INET_H@
34
35 /* The include_next requires a split double-inclusion guard.  */
36 # @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
37
38 #endif
39
40 #ifndef _GL_ARPA_INET_H
41 #define _GL_ARPA_INET_H
42
43 /* The definition of _GL_ARG_NONNULL is copied here.  */
44
45 /* The definition of _GL_WARN_ON_USE is copied here.  */
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 #if @GNULIB_INET_NTOP@
52 # if !@HAVE_DECL_INET_NTOP@
53 /* Converts an internet address from internal format to a printable,
54    presentable format.
55    AF is an internet address family, such as AF_INET or AF_INET6.
56    SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
57    (for AF_INET6).
58    DST points to a buffer having room for CNT bytes.
59    The printable representation of the address (in numeric form, not
60    surrounded by [...], no reverse DNS is done) is placed in DST, and
61    DST is returned.  If an error occurs, the return value is NULL and
62    errno is set.  If CNT bytes are not sufficient to hold the result,
63    the return value is NULL and errno is set to ENOSPC.  A good value
64    for CNT is 46.
65
66    For more details, see the POSIX:2001 specification
67    <http://www.opengroup.org/susv3xsh/inet_ntop.html>.  */
68 extern const char *inet_ntop (int af, const void *restrict src,
69                               char *restrict dst, socklen_t cnt)
70      _GL_ARG_NONNULL ((2, 3));
71 # endif
72 #elif defined GNULIB_POSIXCHECK
73 # undef inet_ntop
74 # if HAVE_RAW_DECL_INET_NTOP
75 _GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
76                  "use gnulib module inet_ntop for portability");
77 # endif
78 #endif
79
80 #if @GNULIB_INET_PTON@
81 # if !@HAVE_DECL_INET_PTON@
82 extern int inet_pton (int af, const char *restrict src, void *restrict dst)
83      _GL_ARG_NONNULL ((2, 3));
84 # endif
85 #elif defined GNULIB_POSIXCHECK
86 # undef inet_pton
87 # if HAVE_RAW_DECL_INET_PTON
88 _GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
89                  "use gnulib module inet_pton for portability");
90 # endif
91 #endif
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif /* _GL_ARPA_INET_H */
98 #endif /* _GL_ARPA_INET_H */