Blame posix/bits/getopt_posix.h

Packit 6c4009
/* Declarations for getopt (POSIX compatibility shim).
Packit 6c4009
   Copyright (C) 1989-2018 Free Software Foundation, Inc.
Packit 6c4009
   Unlike the bulk of the getopt implementation, this file is NOT part
Packit 6c4009
   of gnulib.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _GETOPT_POSIX_H
Packit 6c4009
#define _GETOPT_POSIX_H 1
Packit 6c4009
Packit 6c4009
#if !defined _UNISTD_H && !defined _STDIO_H
Packit 6c4009
#error "Never include getopt_posix.h directly; use unistd.h instead."
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#include <bits/getopt_core.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
#if defined __USE_POSIX2 && !defined __USE_POSIX_IMPLICITLY \
Packit 6c4009
    && !defined __USE_GNU && !defined _GETOPT_H
Packit 6c4009
/* GNU getopt has more functionality than POSIX getopt.  When we are
Packit 6c4009
   explicitly conforming to POSIX and not GNU, and getopt.h (which is
Packit 6c4009
   not part of POSIX) has not been included, the extra functionality
Packit 6c4009
   is disabled.  */
Packit 6c4009
# ifdef __REDIRECT
Packit 6c4009
extern int __REDIRECT_NTH (getopt, (int ___argc, char *const *___argv,
Packit 6c4009
				    const char *__shortopts),
Packit 6c4009
			   __posix_getopt);
Packit 6c4009
# else
Packit 6c4009
extern int __posix_getopt (int ___argc, char *const *___argv,
Packit 6c4009
			   const char *__shortopts)
Packit 6c4009
  __THROW __nonnull ((2, 3));
Packit 6c4009
#  define getopt __posix_getopt
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* getopt_posix.h */