blob: 0de05aefbd0b92668e82a8605426f7918b574135 [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
12#ifdef _GNU_SOURCE
13struct option
14{
15 const char *name;
16 int has_arg;
17 int *flag;
18 int val;
19};
20
21int getopt_long(int, char *const *, const char *, const struct option *, int *);
22int getopt_long_only(int, char *const *, const char *, const struct option *, int *);
23
24#define no_argument 0
25#define required_argument 1
26#define optional_argument 2
27#endif
28
29#ifdef __cplusplus
30}
31#endif
32
33#endif