dlvhex  2.5.0
vs12/getopt.c File Reference
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "getopt.h"
Include dependency graph for getopt.c:

Go to the source code of this file.

Defines

#define __P(x)   x
#define _DIAGASSERT(x)   assert(x)
#define BADCH   (int)'?'
#define BADARG   (int)':'
#define EMSG   ""

Functions

static char *__progname __P ((char *))
int getopt_internal __P ((int, char *const *, const char *))
static char * __progname (char *nargv0)
int getopt_internal (int nargc, char *const *nargv, const char *ostr)
int getopt_long (int nargc, char **nargv, char *options, struct option *long_options, int *index)

Variables

int opterr = 0
int optind = 1
int optopt = 0
int optreset = 0
char * optarg

Define Documentation

#define __P (   x)    x

Definition at line 46 of file getopt.c.

#define _DIAGASSERT (   x)    assert(x)

Definition at line 47 of file getopt.c.

Referenced by __progname(), getopt_internal(), and getopt_long().

#define BADARG   (int)':'

Definition at line 69 of file getopt.c.

Referenced by getopt_internal(), and getopt_long().

#define BADCH   (int)'?'

Definition at line 68 of file getopt.c.

Referenced by getopt_internal(), and getopt_long().

#define EMSG   ""

Definition at line 70 of file getopt.c.

Referenced by getopt_internal().


Function Documentation

static char* __progname __P ( (char *)  ) [static]
int getopt_internal __P ( (int, char *const *, const char *)  )
static char* __progname ( char *  nargv0) [static]

Definition at line 53 of file getopt.c.

References _DIAGASSERT.

Referenced by getopt_internal(), and getopt_long().

int getopt_internal ( int  nargc,
char * const *  nargv,
const char *  ostr 
)

Definition at line 77 of file getopt.c.

References __progname(), _DIAGASSERT, BADARG, BADCH, EMSG, optarg, opterr, optind, optopt, and optreset.

int getopt_long ( int  nargc,
char **  nargv,
char *  options,
struct option long_options,
int *  index 
)

Variable Documentation

char* optarg

Definition at line 44 of file getopt.c.

int opterr = 0

Definition at line 40 of file getopt.c.

int optind = 1

Definition at line 41 of file getopt.c.

int optopt = 0

Definition at line 42 of file getopt.c.

int optreset = 0

Definition at line 43 of file getopt.c.