#include <assert.h>
#include <errno.h>
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Defines | |
#define | IGNORE_FIRST (*options == '-' || *options == '+') |
#define | PRINT_ERROR |
#define | IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL) |
#define | PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST) |
#define | IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-') |
#define | BADCH (int)'?' |
#define | BADARG |
#define | INORDER (int)1 |
#define | EMSG "" |
Functions | |
int | getopt_long (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 |
#define BADARG |
Value:
((IGNORE_FIRST && options[1] == ':') \ || (*options == ':') ? (int)':' : (int)'?')
#define BADCH (int)'?' |
#define EMSG "" |
#define IGNORE_FIRST (*options == '-' || *options == '+') |
#define IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-') |
#define INORDER (int)1 |
#define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL) |
#define PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST) |
#define PRINT_ERROR |
Value:
((opterr) && ((*options != ':') \ || (IGNORE_FIRST && options[1] != ':')))
int getopt_long | ( | int | nargc, | |
char *const * | nargv, | |||
const char * | options, | |||
const struct option * | long_options, | |||
int * | idx | |||
) |
char* optarg |
int opterr = 1 |
int optind = 1 |
int optopt = '?' |
int optreset |