#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <stdarg.h>
#include <stdio.h>
Go to the source code of this file.
Defines |
| #define | REPLACE_GETOPT |
| #define | _DIAGASSERT(x) do {} while (0) |
| #define | __progname __argv[0] |
| #define | IGNORE_FIRST (*options == '-' || *options == '+') |
| #define | PRINT_ERROR ((opterr) && ((*options != ':') || (IGNORE_FIRST && options[1] != ':'))) |
| #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 ((IGNORE_FIRST && options[1] == ':') || (*options == ':') ? (int)':' : (int)'?') |
| #define | INORDER (int)1 |
Functions |
| static int | getopt_internal (int, char *const *, const char *) |
| static int | gcd (int, int) |
| static void | permute_args (int, int, int, char *const *) |
| static void | _vwarnx (const char *fmt, va_list ap) |
| static void | warnx (const char *fmt,...) |
| 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) |
Variables |
| int | opterr = 1 |
| int | optind = 1 |
| int | optopt = '?' |
| int | optreset |
| char * | optarg |
| static char | EMSG [1] |
| 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" |