source: trunk/sys/dietlibc/include/getopt.h @ 1

Last change on this file since 1 was 1, checked in by alain, 7 years ago

First import

File size: 665 bytes
Line 
1#ifndef __GETOPT_H__
2#define __GETOPT_H__
3
4#include <unistd.h>
5
6struct option {
7  const char* name;
8  int has_arg;
9  int* flag;
10  int val;
11};
12
13#define no_argument             0
14#define required_argument       1
15#define optional_argument       2
16
17extern char *optarg;
18extern int optind, opterr, optopt;
19
20extern int getopt_long(int argc, char *const *argv,
21                       const char *shortopts, const struct option *longopts,
22                       int *longind);
23
24extern int getopt_long_only(int argc, char *const *argv,
25                            const char *shortopts, const struct option *longopts,
26                            int *longind);
27
28extern int getopt(int argc, char * const argv[], const char *optstring);
29
30#endif
Note: See TracBrowser for help on using the repository browser.