common/getopt.cc File Reference

#include <stdio.h>
#include "gnu_getopt.h"
#include <cstring>
#include <cstdlib>

Include dependency graph for getopt.cc:

Go to the source code of this file.

Defines

#define GNU_GETOPT_INTERFACE_VERSION   2
#define _(msgid)   (msgid)
#define NONOPTION_P   (argv[optind][0] != '-' || argv[optind][1] == '\0')

Enumerations

enum  { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER }

Functions

static void exchange (char **argv)
static const char * _getopt_initialize (int argc, char *const *argv, const char *optstring)
int gnu_getopt_internal_ (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only)

Variables

char * optarg
int optind = 1
int __getopt_initialized
static char * nextchar
int opterr = 1
int optopt = '?'
static enum { ... }  ordering
static char * posixly_correct
static int first_nonopt
static int last_nonopt


Define Documentation

#define GNU_GETOPT_INTERFACE_VERSION   2

Definition at line 36 of file getopt.cc.

#define _ ( msgid   )     (msgid)

Definition at line 58 of file getopt.cc.

#define NONOPTION_P   (argv[optind][0] != '-' || argv[optind][1] == '\0')

Referenced by gnu_getopt_internal_().


Enumeration Type Documentation

anonymous enum

Enumerator:
REQUIRE_ORDER 
PERMUTE 
RETURN_IN_ORDER 

Definition at line 156 of file getopt.cc.


Function Documentation

static void exchange ( char **  argv  )  [static]

Definition at line 193 of file getopt.cc.

References first_nonopt, last_nonopt, and optind.

Referenced by gnu_getopt_internal_().

static const char* _getopt_initialize ( int  argc,
char *const *  argv,
const char *  optstring 
) [static]

Definition at line 250 of file getopt.cc.

References first_nonopt, last_nonopt, nextchar, optind, ordering, PERMUTE, posixly_correct, REQUIRE_ORDER, and RETURN_IN_ORDER.

Referenced by gnu_getopt_internal_().

int gnu_getopt_internal_ ( int  argc,
char *const *  argv,
const char *  optstring,
const struct option longopts,
int *  longind,
int  long_only 
)

Definition at line 343 of file getopt.cc.

References __getopt_initialized, _getopt_initialize(), exchange(), first_nonopt, if(), last_nonopt, option::name, nextchar, NONOPTION_P, optarg, opterr, optind, ordering, PERMUTE, and REQUIRE_ORDER.

Referenced by gnu_getopt(), gnu_getopt_long(), and gnu_getopt_long_only().


Variable Documentation

char* optarg

Definition at line 84 of file getopt.cc.

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

int optind = 1

Definition at line 99 of file getopt.cc.

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

int __getopt_initialized

Definition at line 105 of file getopt.cc.

Referenced by gnu_getopt_internal_().

char* nextchar [static]

Definition at line 114 of file getopt.cc.

Referenced by _getopt_initialize(), and gnu_getopt_internal_().

int opterr = 1

Definition at line 119 of file getopt.cc.

Referenced by gnu_getopt_internal_().

int optopt = '?'

Definition at line 125 of file getopt.cc.

enum { ... } ordering [static]

Referenced by _getopt_initialize(), and gnu_getopt_internal_().

char* posixly_correct [static]

Definition at line 162 of file getopt.cc.

Referenced by _getopt_initialize().

int first_nonopt [static]

Definition at line 180 of file getopt.cc.

Referenced by _getopt_initialize(), exchange(), and gnu_getopt_internal_().

int last_nonopt [static]

Definition at line 181 of file getopt.cc.

Referenced by _getopt_initialize(), exchange(), and gnu_getopt_internal_().


Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.