Blame lib/arpa_inet.in.h

Packit 8f70b4
/* A GNU-like <arpa/inet.h>.
Packit 8f70b4
Packit 8f70b4
   Copyright (C) 2005-2006, 2008-2018 Free Software Foundation, Inc.
Packit 8f70b4
Packit 8f70b4
   This program is free software; you can redistribute it and/or modify
Packit 8f70b4
   it under the terms of the GNU General Public License as published by
Packit 8f70b4
   the Free Software Foundation; either version 3, or (at your option)
Packit 8f70b4
   any later version.
Packit 8f70b4
Packit 8f70b4
   This program is distributed in the hope that it will be useful,
Packit 8f70b4
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8f70b4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 8f70b4
   GNU General Public License for more details.
Packit 8f70b4
Packit 8f70b4
   You should have received a copy of the GNU General Public License
Packit 8f70b4
   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
Packit 8f70b4
Packit 8f70b4
#ifndef _@GUARD_PREFIX@_ARPA_INET_H
Packit 8f70b4
Packit 8f70b4
#if __GNUC__ >= 3
Packit 8f70b4
@PRAGMA_SYSTEM_HEADER@
Packit 8f70b4
#endif
Packit 8f70b4
@PRAGMA_COLUMNS@
Packit 8f70b4
Packit 8f70b4
#if @HAVE_FEATURES_H@
Packit 8f70b4
# include <features.h> /* for __GLIBC__ */
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* Gnulib's sys/socket.h is responsible for defining socklen_t (used below) and
Packit 8f70b4
   for pulling in winsock2.h etc. under MinGW.
Packit 8f70b4
   But avoid namespace pollution on glibc systems.  */
Packit 8f70b4
#ifndef __GLIBC__
Packit 8f70b4
# include <sys/socket.h>
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
/* On NonStop Kernel, inet_ntop and inet_pton are declared in <netdb.h>.
Packit 8f70b4
   But avoid namespace pollution on glibc systems.  */
Packit 8f70b4
#if defined __TANDEM && !defined __GLIBC__
Packit 8f70b4
# include <netdb.h>
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#if @HAVE_ARPA_INET_H@
Packit 8f70b4
Packit 8f70b4
/* The include_next requires a split double-inclusion guard.  */
Packit 8f70b4
# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
Packit 8f70b4
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#ifndef _@GUARD_PREFIX@_ARPA_INET_H
Packit 8f70b4
#define _@GUARD_PREFIX@_ARPA_INET_H
Packit 8f70b4
Packit 8f70b4
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
Packit 8f70b4
Packit 8f70b4
/* The definition of _GL_ARG_NONNULL is copied here.  */
Packit 8f70b4
Packit 8f70b4
/* The definition of _GL_WARN_ON_USE is copied here.  */
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
#if @GNULIB_INET_NTOP@
Packit 8f70b4
/* Converts an internet address from internal format to a printable,
Packit 8f70b4
   presentable format.
Packit 8f70b4
   AF is an internet address family, such as AF_INET or AF_INET6.
Packit 8f70b4
   SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
Packit 8f70b4
   (for AF_INET6).
Packit 8f70b4
   DST points to a buffer having room for CNT bytes.
Packit 8f70b4
   The printable representation of the address (in numeric form, not
Packit 8f70b4
   surrounded by [...], no reverse DNS is done) is placed in DST, and
Packit 8f70b4
   DST is returned.  If an error occurs, the return value is NULL and
Packit 8f70b4
   errno is set.  If CNT bytes are not sufficient to hold the result,
Packit 8f70b4
   the return value is NULL and errno is set to ENOSPC.  A good value
Packit 8f70b4
   for CNT is 46.
Packit 8f70b4
Packit 8f70b4
   For more details, see the POSIX:2001 specification
Packit 8f70b4
   <http://www.opengroup.org/susv3xsh/inet_ntop.html>.  */
Packit 8f70b4
# if @REPLACE_INET_NTOP@
Packit 8f70b4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 8f70b4
#   undef inet_ntop
Packit 8f70b4
#   define inet_ntop rpl_inet_ntop
Packit 8f70b4
#  endif
Packit 8f70b4
_GL_FUNCDECL_RPL (inet_ntop, const char *,
Packit 8f70b4
                  (int af, const void *restrict src,
Packit 8f70b4
                   char *restrict dst, socklen_t cnt)
Packit 8f70b4
                  _GL_ARG_NONNULL ((2, 3)));
Packit 8f70b4
_GL_CXXALIAS_RPL (inet_ntop, const char *,
Packit 8f70b4
                  (int af, const void *restrict src,
Packit 8f70b4
                   char *restrict dst, socklen_t cnt));
Packit 8f70b4
# else
Packit 8f70b4
#  if !@HAVE_DECL_INET_NTOP@
Packit 8f70b4
_GL_FUNCDECL_SYS (inet_ntop, const char *,
Packit 8f70b4
                  (int af, const void *restrict src,
Packit 8f70b4
                   char *restrict dst, socklen_t cnt)
Packit 8f70b4
                  _GL_ARG_NONNULL ((2, 3)));
Packit 8f70b4
#  endif
Packit 8f70b4
/* Need to cast, because on NonStop Kernel, the fourth parameter is
Packit 8f70b4
                                            size_t cnt.  */
Packit 8f70b4
_GL_CXXALIAS_SYS_CAST (inet_ntop, const char *,
Packit 8f70b4
                       (int af, const void *restrict src,
Packit 8f70b4
                        char *restrict dst, socklen_t cnt));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIASWARN (inet_ntop);
Packit 8f70b4
#elif defined GNULIB_POSIXCHECK
Packit 8f70b4
# undef inet_ntop
Packit 8f70b4
# if HAVE_RAW_DECL_INET_NTOP
Packit 8f70b4
_GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
Packit 8f70b4
                 "use gnulib module inet_ntop for portability");
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#if @GNULIB_INET_PTON@
Packit 8f70b4
# if @REPLACE_INET_PTON@
Packit 8f70b4
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 8f70b4
#   undef inet_pton
Packit 8f70b4
#   define inet_pton rpl_inet_pton
Packit 8f70b4
#  endif
Packit 8f70b4
_GL_FUNCDECL_RPL (inet_pton, int,
Packit 8f70b4
                  (int af, const char *restrict src, void *restrict dst)
Packit 8f70b4
                  _GL_ARG_NONNULL ((2, 3)));
Packit 8f70b4
_GL_CXXALIAS_RPL (inet_pton, int,
Packit 8f70b4
                  (int af, const char *restrict src, void *restrict dst));
Packit 8f70b4
# else
Packit 8f70b4
#  if !@HAVE_DECL_INET_PTON@
Packit 8f70b4
_GL_FUNCDECL_SYS (inet_pton, int,
Packit 8f70b4
                  (int af, const char *restrict src, void *restrict dst)
Packit 8f70b4
                  _GL_ARG_NONNULL ((2, 3)));
Packit 8f70b4
#  endif
Packit 8f70b4
_GL_CXXALIAS_SYS (inet_pton, int,
Packit 8f70b4
                  (int af, const char *restrict src, void *restrict dst));
Packit 8f70b4
# endif
Packit 8f70b4
_GL_CXXALIASWARN (inet_pton);
Packit 8f70b4
#elif defined GNULIB_POSIXCHECK
Packit 8f70b4
# undef inet_pton
Packit 8f70b4
# if HAVE_RAW_DECL_INET_PTON
Packit 8f70b4
_GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
Packit 8f70b4
                 "use gnulib module inet_pton for portability");
Packit 8f70b4
# endif
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
Packit 8f70b4
#endif /* _@GUARD_PREFIX@_ARPA_INET_H */
Packit 8f70b4
#endif /* _@GUARD_PREFIX@_ARPA_INET_H */