]> AND Public Git Repository - simgrid.git/blob - tools/tesh2/w32/include/getopt.h
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
version=3
[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 \rstruct option \r {
8   \rconst char *name;            /* name of the long option      */
9   \r \r int has_arg;              /*\r
10                                  * has_arg is : no_argument (or 0), if the option doesn't take an argument, \r
11                                  * required_argument (or 1) if the option takes an argument,\r
12                                  * optional_argument (or 2) if the option takes an optional argument.\r
13                                  */
14   \r \r int *flag;                /* specify the mean used to return a result for a long option:\r
15                                  * if flag is NULL, then getopt_long() returns val\r
16                                  * in the other case getopt_long() returns 0, and flag points to the  \r
17                                  * variable specified bay the content of the field val when the option \r
18                                  * is found but it is not update if the option is not found.\r
19                                  */
20   \r \r int val;                  /* val is the value returned by getopt_long() when the pointer flag\r
21                                  * is NULL or the value of the variable referenced by the pointer flag\r
22                                  * when the option is found.\r
23                                  */
24 \r};
25 \r\rextern int \r optind;
26 \r\rextern char *\r optarg;
27 \r\rextern int \r opterr;
28 \r\rextern int \r optopt;
29 \r\r\rint \r getopt(int argc, char *const argv[], const char *optstring);
30 \r\rint \r
31 getopt_long(int argc, char *const argv[], const char *optstring,
32             const struct option *longopts, int *longindex);
33 \r\rint \r getopt_long_only(int argc, char *const argv[],
34                          const char *optstring,
35                          const struct option *longopts, int *longindex);
36 \r\r\r
37 #endif  /* !__GETOPT_H */\r