1
1
/* getopt_long and getopt_long_only entry points for GNU getopt.
2
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
2
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004
3
3
Free Software Foundation, Inc.
4
4
This file is part of the GNU C Library.
16
16
You should have received a copy of the GNU Lesser General Public
17
17
License along with the GNU C Library; if not, write to the Free
18
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
21
#ifdef HAVE_CONFIG_H
22
22
#include <config.h>
71
getopt_long (argc, argv, options, long_options, opt_index)
75
const struct option *long_options;
64
getopt_long (int argc, char *const *argv, const char *options,
65
const struct option *long_options, int *opt_index)
78
67
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
71
_getopt_long_r (int argc, char *const *argv, const char *options,
72
const struct option *long_options, int *opt_index,
73
struct _getopt_data *d)
75
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
81
79
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
82
80
If an option that starts with '-' (not '--') doesn't match a long option,
83
81
but does match a short option, it is parsed as a short option
87
getopt_long_only (argc, argv, options, long_options, opt_index)
91
const struct option *long_options;
85
getopt_long_only (int argc, char *const *argv, const char *options,
86
const struct option *long_options, int *opt_index)
94
88
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
98
libc_hidden_def (getopt_long)
99
libc_hidden_def (getopt_long_only)
92
_getopt_long_only_r (int argc, char *const *argv, const char *options,
93
const struct option *long_options, int *opt_index,
94
struct _getopt_data *d)
96
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
102
100
#endif /* Not ELIDE_CODE. */