Macros | |
#define | PRINT_ERROR ((opterr) && (*options != ':')) |
#define | FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */ |
#define | FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */ |
#define | FLAG_LONGONLY 0x04 /* operate as getopt_long_only */ |
#define | BADCH (int)'?' |
#define | BADARG ((*options == ':') ? (int)':' : (int)'?') |
#define | INORDER (int)1 |
#define | EMSG "" |
Functions | |
static int | getopt_internal (int, char *const *, const char *, const struct option *, int *, int) |
static int | parse_long_options (char *const *, const char *, const struct option *, int *, int, int) |
static int | gcd (int, int) |
static void | permute_args (int, int, int, char *const *) |
int | getopt (int nargc, char *const *nargv, const char *options) |
int | getopt_long (int nargc, char *const *nargv, const char *options, const struct option *long_options, int *idx) |
int | getopt_long_only (int nargc, char *const *nargv, const char *options, const struct option *long_options, int *idx) |
Variables | |
int | opterr = 1 |
int | optind = 1 |
int | optopt = '?' |
int | optreset |
char * | optarg |
static char * | place = EMSG |
static int | nonopt_start = -1 |
static int | nonopt_end = -1 |
static const char | recargchar [] = "option requires an argument -- %c" |
static const char | recargstring [] = "option requires an argument -- %s" |
static const char | ambig [] = "ambiguous option -- %.*s" |
static const char | noarg [] = "option doesn't take an argument -- %.*s" |
static const char | illoptchar [] = "unknown option -- %c" |
static const char | illoptstring [] = "unknown option -- %s" |
#define BADARG ((*options == ':') ? (int)':' : (int)'?') |
#define BADCH (int)'?' |
#define EMSG "" |
#define FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */ |
#define FLAG_LONGONLY 0x04 /* operate as getopt_long_only */ |
#define FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */ |
#define INORDER (int)1 |
#define PRINT_ERROR ((opterr) && (*options != ':')) |
|
static |
int getopt | ( | int | nargc, |
char *const * | nargv, | ||
const char * | options | ||
) |
|
static |
int getopt_long | ( | int | nargc, |
char *const * | nargv, | ||
const char * | options, | ||
const struct option * | long_options, | ||
int * | idx | ||
) |
int getopt_long_only | ( | int | nargc, |
char *const * | nargv, | ||
const char * | options, | ||
const struct option * | long_options, | ||
int * | idx | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
char* optarg |
int opterr = 1 |
int optind = 1 |
int optopt = '?' |
int optreset |
|
static |
|
static |
|
static |