22 #ifndef XAPIAN_INCLUDED_GNU_GETOPT_H 23 #define XAPIAN_INCLUDED_GNU_GETOPT_H 29 #define GNU_GETOPT_INTERFACE_VERSION 2 30 #if defined __GLIBC__ && __GLIBC__ >= 2 31 # include <gnu-versions.h> 32 # if _GNU_GETOPT_INTERFACE_VERSION == GNU_GETOPT_INTERFACE_VERSION 33 # define USE_GLIBC_GNUGETOPT 37 #ifdef USE_GLIBC_GNUGETOPT 42 gnu_getopt(
int argc_,
char *
const *argv_,
const char *shortopts_) {
43 return getopt(argc_, argv_, shortopts_);
48 const struct option *longopts_,
int *optind_) {
49 return getopt_long(argc_, argv_, shortopts_, longopts_, optind_);
54 const struct option *longopts_,
int *optind_) {
55 return getopt_long_only(argc_, argv_, shortopts_, longopts_, optind_);
79 # define no_argument 0 80 # define required_argument 1 81 # define optional_argument 2 90 gnu_getopt(
int argc_,
char *
const *argv_,
const char *shortopts_) {
92 reinterpret_cast<const struct option *>(0),
93 reinterpret_cast<int *>(0), 0);
98 const struct option *longopts_,
int *optind_) {
104 const struct option *longopts_,
int *optind_) {
int gnu_getopt(int argc_, char *const *argv_, const char *shortopts_)
int gnu_getopt_long(int argc_, char *const *argv_, const char *shortopts_, const struct option *longopts_, int *optind_)
int gnu_getopt_long_only(int argc_, char *const *argv_, const char *shortopts_, const struct option *longopts_, int *optind_)
int gnu_getopt_internal_(int, char *const *, const char *, const struct option *, int *, int)