xapian-core  1.4.21
Classes | Macros | Functions | Variables
gnu_getopt.h File Reference

Wrappers to allow GNU getopt to be used cleanly from C++ code. More...

#include <cctype>
+ Include dependency graph for gnu_getopt.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  option
 

Macros

#define GNU_GETOPT_INTERFACE_VERSION   2
 
#define no_argument   0
 
#define required_argument   1
 
#define optional_argument   2
 

Functions

int gnu_getopt_internal_ (int, char *const *, const char *, const struct option *, int *, int)
 
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_)
 

Variables

char * optarg
 
int optind
 
int opterr
 
int optopt
 

Detailed Description

Wrappers to allow GNU getopt to be used cleanly from C++ code.

Definition in file gnu_getopt.h.

Macro Definition Documentation

◆ GNU_GETOPT_INTERFACE_VERSION

#define GNU_GETOPT_INTERFACE_VERSION   2

Definition at line 29 of file gnu_getopt.h.

◆ no_argument

#define no_argument   0

Definition at line 79 of file gnu_getopt.h.

Referenced by main(), and test_driver::parse_command_line().

◆ optional_argument

#define optional_argument   2

Definition at line 81 of file gnu_getopt.h.

◆ required_argument

#define required_argument   1

Definition at line 80 of file gnu_getopt.h.

Referenced by main().

Function Documentation

◆ gnu_getopt()

int gnu_getopt ( int  argc_,
char *const *  argv_,
const char *  shortopts_ 
)
inline

Definition at line 90 of file gnu_getopt.h.

References gnu_getopt_internal_().

Referenced by main().

◆ gnu_getopt_internal_()

int gnu_getopt_internal_ ( int  ,
char *const *  ,
const char *  ,
const struct option ,
int *  ,
int   
)

◆ gnu_getopt_long()

int gnu_getopt_long ( int  argc_,
char *const *  argv_,
const char *  shortopts_,
const struct option longopts_,
int *  optind_ 
)
inline

Definition at line 97 of file gnu_getopt.h.

References gnu_getopt_internal_().

Referenced by main(), and test_driver::parse_command_line().

◆ gnu_getopt_long_only()

int gnu_getopt_long_only ( int  argc_,
char *const *  argv_,
const char *  shortopts_,
const struct option longopts_,
int *  optind_ 
)
inline

Definition at line 103 of file gnu_getopt.h.

References gnu_getopt_internal_().

Variable Documentation

◆ optarg

char* optarg

Definition at line 79 of file getopt.cc.

Referenced by gnu_getopt_internal_(), main(), and test_driver::parse_command_line().

◆ opterr

int opterr

Definition at line 99 of file getopt.cc.

Referenced by gnu_getopt_internal_().

◆ optind

int optind

◆ optopt

int optopt

Definition at line 105 of file getopt.cc.

Referenced by gnu_getopt_internal_().