Macros | Enumerations | Functions | Variables
getopt.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "getopt.h"
Include dependency graph for getopt.c:

Go to the source code of this file.

Macros

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

Enumerations

enum  { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER }
 

Functions

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

Variables

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

Macro Definition Documentation

◆ _

#define _ (   msgid)    (msgid)

Definition at line 90 of file getopt.c.

◆ _NO_PROTO

#define _NO_PROTO

Definition at line 30 of file getopt.c.

◆ GETOPT_INTERFACE_VERSION

#define GETOPT_INTERFACE_VERSION   2

Definition at line 49 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 277 of file getopt.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
REQUIRE_ORDER 
PERMUTE 
RETURN_IN_ORDER 

Definition at line 188 of file getopt.c.

Function Documentation

◆ _getopt_initialize()

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

Definition at line 378 of file getopt.c.

◆ _getopt_internal()

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

Definition at line 500 of file getopt.c.

◆ exchange()

static void exchange ( char **  argv)
static

Definition at line 294 of file getopt.c.

◆ getopt()

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

Definition at line 949 of file getopt.c.

◆ my_index()

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

Definition at line 206 of file getopt.c.

Variable Documentation

◆ __getopt_initialized

int __getopt_initialized = 0

Definition at line 137 of file getopt.c.

◆ first_nonopt

int first_nonopt
static

Definition at line 237 of file getopt.c.

◆ last_nonopt

int last_nonopt
static

Definition at line 238 of file getopt.c.

◆ nextchar

char* nextchar
static

Definition at line 146 of file getopt.c.

◆ optarg

char* optarg = NULL

Definition at line 116 of file getopt.c.

◆ opterr

int opterr = 1

Definition at line 151 of file getopt.c.

◆ optind

int optind = 1

Definition at line 131 of file getopt.c.

◆ optopt

int optopt = '?'

Definition at line 157 of file getopt.c.

◆ ordering

enum { ... } ordering

◆ posixly_correct

char* posixly_correct
static

Definition at line 194 of file getopt.c.



sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Wed Mar 2 2022 01:00:58