mh_getopt.h
4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2002, 2005, 2007, 2009, 2010 Free Software Foundation,
Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Mailutils is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. */
#include <mailutils/nls.h>
#include "argp.h"
#include "mailutils/libargp.h"
#define MH_OPT_BOOL 1
#define MH_OPT_ARG 2
struct mh_option
{
char *opt;
int match_len;
int flags;
char *arg;
};
struct mh_argp_data
{
struct mh_option *mh_option;
argp_parser_t handler;
int errind;
void *closure;
char *doc;
};
enum mh_arg {
ARG_ADD = 256,
ARG_AFTER,
ARG_ALIAS,
ARG_ALL,
ARG_AND,
ARG_ANNOTATE,
ARG_AUDIT,
ARG_AUTO,
ARG_BEFORE,
ARG_BELL,
ARG_BUILD,
ARG_CC,
ARG_CFLAGS,
ARG_CHANGECUR,
ARG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ZERO,
ARG_NUMFIELD,
ARG_OR,
ARG_PACK,
ARG_PART,
ARG_PATTERN,
ARG_PAUSE,
ARG_POP,
ARG_PRESERVE,
ARG_PRINT,
ARG_PROMPT,
ARG_PUBLIC,
ARG_PUSH,
ARG_QUERY,
ARG_QUIET,
ARG_RBRACE,
ARG_REALSIZE,
ARG_RECURSIVE,
ARG_REORDER,
ARG_REVERSE,
ARG_SEQUENCE,
ARG_SERIALONLY,
ARG_SHOW,
ARG_SOURCE,
ARG_SPLIT,
ARG_STORE,
ARG_SUBJECT,
ARG_TEXT,
ARG_TEXTFIELD,
ARG_TO,
ARG_TOTAL,
ARG_TRUNCATE,
ARG_TYPE,
ARG_USE,
ARG_USER,
ARG_VERBOSE,
ARG_WATCH,
ARG_WHATNOWPROC,
ARG_WIDTH,
ARG_ZERO
};
extern void (*mh_help_hook) (void);
void mh_argp_init (void);
void mh_argv_preproc (int argc, char **argv, struct mh_argp_data *data);
int mh_getopt (int argc, char **argv, struct mh_option *mh_opt, const char *doc);
int mh_argp_parse (int *argc, char **argv[],
int flags,
struct argp_option *option,
struct mh_option *mh_option,
char *argp_doc, char *doc,
argp_parser_t handler,
void *closure, int *index);
void mh_help (struct mh_option *mh_option, const char *doc);
void mh_license (const char *name);
void mh_opt_notimpl (const char *name);
void mh_opt_notimpl_warning (const char *name);