cosmopolitan/third_party/getopt/getopt.h

33 lines
831 B
C
Raw Normal View History

2020-06-15 14:18:57 +00:00
#ifndef COSMOPOLITAN_THIRD_PARTY_GETOPT_GETOPT_H_
#define COSMOPOLITAN_THIRD_PARTY_GETOPT_GETOPT_H_
2023-06-09 13:41:34 +00:00
#ifdef COSMO
#define no_argument 0
#define required_argument 1
#define optional_argument 2
2020-06-15 14:18:57 +00:00
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern char *optarg;
extern int optind, opterr, optopt, optreset;
int getopt(int, char *const[], const char *);
int getsubopt(char **, char *const *, char **);
2020-06-15 14:18:57 +00:00
struct option {
const char *name;
int has_arg;
int *flag;
int val;
};
int getopt_long(int, char *const *, const char *, const struct option *, int *);
int getopt_long_only(int, char *const *, const char *, const struct option *,
int *);
2020-06-15 14:18:57 +00:00
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
2023-06-09 13:41:34 +00:00
#endif /* COSMO */
2020-06-15 14:18:57 +00:00
#endif /* COSMOPOLITAN_THIRD_PARTY_GETOPT_GETOPT_H_ */