blob: 6d85c0b6ba68313a5ab0760e069e56fc845253fa [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#ifndef _GETOPT_H
2#define _GETOPT_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8int getopt(int, char * const [], const char *);
9extern char *optarg;
10extern int optind, opterr, optopt;
11
Rich Felker0b44a032011-02-12 00:22:29 -050012struct option
13{
14 const char *name;
15 int has_arg;
16 int *flag;
17 int val;
18};
19
20int getopt_long(int, char *const *, const char *, const struct option *, int *);
21int getopt_long_only(int, char *const *, const char *, const struct option *, int *);
22
23#define no_argument 0
24#define required_argument 1
25#define optional_argument 2
Rich Felker0b44a032011-02-12 00:22:29 -050026
27#ifdef __cplusplus
28}
29#endif
30
31#endif