Blame lib/arpa_inet.in.h

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