Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
451dc424d1165964c892626e67111186b9e8af97
[simgrid.git] / tools / tesh2 / w32 / include / getopt.h
1 #ifndef __GETOPT_H\r
2 #define __GETOPT_H\r
3 \r
4 #define no_argument                     0\r
5 #define required_argument       1\r
6 #define optional_argument       2\r
7 \r
8 struct option\r
9 {\r
10         const char *name;       /* name of the long option      */\r
11         \r
12         int has_arg;            /*\r
13                                                  * has_arg is : no_argument (or 0), if the option doesn't take an argument, \r
14                                                  * required_argument (or 1) if the option takes an argument,\r
15                                                  * optional_argument (or 2) if the option takes an optional argument.\r
16                                                  */\r
17         \r
18         int *flag;                      /* specify the mean used to return a result for a long option:\r
19                                                  * if flag is NULL, then getopt_long() returns val\r
20                                                  * in the other case getopt_long() returns 0, and flag points to the  \r
21                                                  * variable specified bay the content of the field val when the option \r
22                                                  * is found but it is not update if the option is not found.\r
23                                                  */\r
24                                                                                 \r
25         int val;                        /* val is the value returned by getopt_long() when the pointer flag\r
26                                                  * is NULL or the value of the variable referenced by the pointer flag\r
27                                                  * when the option is found.\r
28                                                  */\r
29 };\r
30 \r
31 extern int \r
32 optind;\r
33 \r
34 extern char* \r
35 optarg;\r
36 \r
37 extern int \r
38 opterr;\r
39 \r
40 extern int \r
41 optopt;\r
42 \r
43 \r
44 int \r
45 getopt (int argc, char * const argv[], const char *optstring);\r
46 \r
47 int\r
48 getopt_long(int argc, char * const argv[], const char *optstring, const struct option *longopts, int *longindex);\r
49 \r
50 int\r
51 getopt_long_only (int argc, char * const argv[], const char *optstring, const struct option *longopts, int *longindex);\r
52 \r
53 \r
54 #endif /* !__GETOPT_H */\r