libextractor  1.11
About: GNU libextractor is a library used to extract meta-data from files of arbitrary type.
  Fossies Dox: libextractor-1.11.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

getopt.c File Reference
#include "config.h"
#include <stdio.h>
#include "getopt.h"
Include dependency graph for getopt.c:

Go to the source code of this file.

Macros

#define _NO_PROTO
 
#define const
 
#define GETOPT_INTERFACE_VERSION   2
 
#define _(msgid)   (msgid)
 
#define SWAP_FLAGS(ch1, ch2)
 
#define NONOPTION_P   (argv[optind][0] != '-' || argv[optind][1] == '\0')
 

Enumerations

enum  { REQUIRE_ORDER , PERMUTE , RETURN_IN_ORDER }
 

Functions

char * getenv ()
 
static char * my_index (char *str, int chr)
 
static void exchange (char **argv)
 
static char * _getopt_initialize (int argc, char **argv, char *optstring)
 
int _getopt_internal (int argc, char **argv, char *optstring, struct option *longopts, int *longind, int long_only)
 
int getopt (int argc, char **argv, char *optstring)
 

Variables

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

Macro Definition Documentation

◆ _

#define _ (   msgid)    (msgid)

Definition at line 93 of file getopt.c.

◆ _NO_PROTO

#define _NO_PROTO

Definition at line 30 of file getopt.c.

◆ const

#define const

Definition at line 39 of file getopt.c.

◆ GETOPT_INTERFACE_VERSION

#define GETOPT_INTERFACE_VERSION   2

Definition at line 53 of file getopt.c.

◆ NONOPTION_P

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

◆ SWAP_FLAGS

#define SWAP_FLAGS (   ch1,
  ch2 
)

Definition at line 295 of file getopt.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
REQUIRE_ORDER 
PERMUTE 
RETURN_IN_ORDER 

Definition at line 191 of file getopt.c.

Function Documentation

◆ _getopt_initialize()

static char* _getopt_initialize ( int  argc,
char * *  argv,
char *  optstring 
)
static

◆ _getopt_internal()

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

◆ exchange()

static void exchange ( char **  argv)
static

Definition at line 313 of file getopt.c.

References first_nonopt, last_nonopt, NULL, optind, and SWAP_FLAGS.

Referenced by _getopt_internal().

◆ getenv()

◆ getopt()

int getopt ( int  argc,
char * *  argv,
char *  optstring 
)

Definition at line 984 of file getopt.c.

References _getopt_internal().

◆ my_index()

static char* my_index ( char *  str,
int  chr 
)
static

Definition at line 214 of file getopt.c.

Referenced by _getopt_internal().

Variable Documentation

◆ __getopt_initialized

int __getopt_initialized = 0

Definition at line 140 of file getopt.c.

Referenced by _getopt_internal().

◆ first_nonopt

int first_nonopt
static

Definition at line 253 of file getopt.c.

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

◆ last_nonopt

int last_nonopt
static

Definition at line 254 of file getopt.c.

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

◆ nextchar

char* nextchar
static

Definition at line 149 of file getopt.c.

Referenced by _getopt_initialize(), and _getopt_internal().

◆ optarg

char* optarg = NULL

Definition at line 119 of file getopt.c.

Referenced by _getopt_internal(), and main().

◆ opterr

int opterr = 1

Definition at line 154 of file getopt.c.

Referenced by _getopt_internal().

◆ optind

int optind = 1

Definition at line 134 of file getopt.c.

Referenced by _getopt_initialize(), _getopt_internal(), exchange(), and main().

◆ optopt

int optopt = '?'

Definition at line 160 of file getopt.c.

Referenced by _getopt_internal().

◆ 

enum { ... } ordering

◆ posixly_correct

char* posixly_correct
static

Definition at line 197 of file getopt.c.

Referenced by _getopt_initialize(), and _getopt_internal().