Blame gnulib-tests/arpa_inet.in.h

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