Commit c2028a0a c2028a0abca53318e673f331daa2e408918acdfe by Sergey Poznyakoff

(struct mh_option): Replaced `int key' with `char *longopt'.

(mh_argv_preproc): New function.
(mh_optind,mh_optarg): Globals removed.
1 parent e4921be5
...@@ -25,14 +25,20 @@ struct mh_option ...@@ -25,14 +25,20 @@ struct mh_option
25 { 25 {
26 char *opt; 26 char *opt;
27 int match_len; 27 int match_len;
28 int key; 28 char *longopt;
29 int flags; 29 int flags;
30 char *arg; 30 char *arg;
31 }; 31 };
32 32
33 extern int mh_optind; 33 struct mh_argp_data
34 extern char *mh_optarg; 34 {
35 struct mh_option *mh_option;
36 int (*handler)();
37 void *closure;
38 char *doc;
39 };
35 40
41 void mh_argv_preproc __P((int argc, char **argv, struct mh_argp_data *data));
36 int mh_getopt __P((int argc, char **argv, struct mh_option *mh_opt, 42 int mh_getopt __P((int argc, char **argv, struct mh_option *mh_opt,
37 const char *doc)); 43 const char *doc));
38 int mh_argp_parse __P((int argc, char **argv, 44 int mh_argp_parse __P((int argc, char **argv,
......