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