initial check-in, version 0.5.0
[musl] / include / getopt.h
1 #ifndef _GETOPT_H
2 #define _GETOPT_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 int getopt(int, char * const [], const char *);
9 extern char *optarg;
10 extern int optind, opterr, optopt;
11
12 #ifdef _GNU_SOURCE
13 struct option
14 {
15         const char *name;
16         int has_arg;
17         int *flag;
18         int val;
19 };
20
21 int getopt_long(int, char *const *, const char *, const struct option *, int *);
22 int 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