nico@207: nico@207:
nico@207:#include <stdio.h>
#include "getopt.h"
#include <strings.h>
Defines | |
#define | GETOPT_INTERFACE_VERSION 2 |
#define | _(msgid) (msgid) |
#define | SWAP_FLAGS(ch1, ch2) |
#define | NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') |
Enumerations | |
enum | { REQUIRE_ORDER, nico@207: PERMUTE, nico@207: RETURN_IN_ORDER nico@207: } |
Functions | |
char * | getenv () |
static char * | my_index (char *str, int chr) const |
static void | exchange (char **argv) |
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) |
int | getopt (int argc, char *const *argv, const char *optstring) |
Variables | |
char * | optarg |
int | optind = 1 |
int | __getopt_initialized |
static char * | nextchar |
int | opterr = 1 |
int | optopt = '?' |
static enum { ... } | ordering |
static char * | posixly_correct |
static int | first_nonopt |
static int | last_nonopt |
#define _ | nico@207:( | nico@207:msgid | nico@207:nico@207: | ) | nico@207:(msgid) | nico@207:
nico@207: nico@207:
#define GETOPT_INTERFACE_VERSION 2 | nico@207:
nico@207: nico@207:
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') | nico@207:
nico@207: nico@207:
#define SWAP_FLAGS | nico@207:( | nico@207:ch1, | |||
nico@207: | nico@207: | ch2 | nico@207:nico@207: | ) | nico@207:nico@207: |
nico@207: nico@207:
nico@207:
anonymous enum | nico@207:
nico@207:
static const char* _getopt_initialize | nico@207:( | nico@207:int | nico@207:argc, | nico@207:|
nico@207: | nico@207: | char *const * | nico@207:argv, | nico@207:|
nico@207: | nico@207: | const char * | nico@207:optstring | nico@207: |
nico@207: | ) | nico@207: [static] |
nico@207:
nico@207: nico@207:
int _getopt_internal | nico@207:( | nico@207:int | nico@207:argc, | nico@207:|
nico@207: | nico@207: | char *const * | nico@207:argv, | nico@207:|
nico@207: | nico@207: | const char * | nico@207:optstring, | nico@207:|
nico@207: | nico@207: | const struct option * | nico@207:longopts, | nico@207:|
nico@207: | nico@207: | int * | nico@207:longind, | nico@207:|
nico@207: | nico@207: | int | nico@207:long_only | nico@207: |
nico@207: | ) | nico@207:nico@207: |
nico@207: nico@207:
static void exchange | nico@207:( | nico@207:char ** | nico@207:argv | nico@207:) | nico@207: [static] |
nico@207:
nico@207: nico@207:
char* getenv | nico@207:( | nico@207:nico@207: | ) | nico@207:nico@207: |
nico@207: nico@207:
int getopt | nico@207:( | nico@207:int | nico@207:argc, | nico@207:|
nico@207: | nico@207: | char *const * | nico@207:argv, | nico@207:|
nico@207: | nico@207: | const char * | nico@207:optstring | nico@207: |
nico@207: | ) | nico@207:nico@207: |
nico@207: nico@207:
static char* my_index | nico@207:( | nico@207:char * | nico@207:str, | nico@207:|
nico@207: | nico@207: | int | nico@207:chr | nico@207: |
nico@207: | ) | nico@207: const [static] |
nico@207:
nico@207: nico@207:
nico@207:
int __getopt_initialized | nico@207:
nico@207: nico@207:
int first_nonopt [static] |
nico@207:
nico@207: nico@207:
int last_nonopt [static] |
nico@207:
nico@207: nico@207:
char* nextchar [static] |
nico@207:
nico@207: nico@207:
char* optarg | nico@207:
nico@207: nico@207:
int opterr = 1 | nico@207:
nico@207: nico@207:
int optind = 1 | nico@207:
nico@207: nico@207:
int optopt = '?' | nico@207:
nico@207: nico@207:
enum { ... } ordering [static] |
nico@207:
nico@207: nico@207:
char* posixly_correct [static] |
nico@207:
nico@207: nico@207:
nico@207: