Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / util / ntp-keygen-opts.h
blobd5235469ea6fa5a617517b1f4175fe92945a6c46
1 /* $NetBSD$ */
3 /*
4 * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h)
5 *
6 * It has been AutoGen-ed Tuesday December 8, 2009 at 08:14:55 AM EST
7 * From the definitions ntp-keygen-opts.def
8 * and the template file options
10 * Generated from AutoOpts 29:0:4 templates.
14 * This file was produced by an AutoOpts template. AutoOpts is a
15 * copyrighted work. This header file is not encumbered by AutoOpts
16 * licensing, but is provided under the licensing terms chosen by the
17 * ntp-keygen author or copyright holder. AutoOpts is licensed under
18 * the terms of the LGPL. The redistributable library (``libopts'') is
19 * licensed under the terms of either the LGPL or, at the users discretion,
20 * the BSD license. See the AutoOpts and/or libopts sources for details.
22 * This source file is copyrighted and licensed under the following terms:
24 * ntp-keygen copyright 1970-2009 David L. Mills and/or others - all rights reserved
26 * see html/copyright.html
29 * This file contains the programmatic interface to the Automated
30 * Options generated for the ntp-keygen program.
31 * These macros are documented in the AutoGen info file in the
32 * "AutoOpts" chapter. Please refer to that doc for usage help.
34 #ifndef AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD
35 #define AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD
36 #include "config.h"
37 #include <autoopts/options.h>
40 * Ensure that the library used for compiling this generated header is at
41 * least as new as the version current when the header template was released
42 * (not counting patch version increments). Also ensure that the oldest
43 * tolerable version is at least as old as what was current when the header
44 * template was released.
46 #define AO_TEMPLATE_VERSION 118784
47 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
48 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
49 # error option template version mismatches autoopts/options.h header
50 Choke Me.
51 #endif
54 * Enumeration of each option:
56 typedef enum {
57 INDEX_OPT_CERTIFICATE = 0,
58 INDEX_OPT_DEBUG_LEVEL = 1,
59 INDEX_OPT_SET_DEBUG_LEVEL = 2,
60 INDEX_OPT_ID_KEY = 3,
61 INDEX_OPT_GQ_PARAMS = 4,
62 INDEX_OPT_GQ_KEYS = 5,
63 INDEX_OPT_HOST_KEY = 6,
64 INDEX_OPT_IFFKEY = 7,
65 INDEX_OPT_ISSUER_NAME = 8,
66 INDEX_OPT_MD5KEY = 9,
67 INDEX_OPT_MODULUS = 10,
68 INDEX_OPT_PVT_CERT = 11,
69 INDEX_OPT_PVT_PASSWD = 12,
70 INDEX_OPT_GET_PVT_PASSWD = 13,
71 INDEX_OPT_SIGN_KEY = 14,
72 INDEX_OPT_SUBJECT_NAME = 15,
73 INDEX_OPT_TRUSTED_CERT = 16,
74 INDEX_OPT_MV_PARAMS = 17,
75 INDEX_OPT_MV_KEYS = 18,
76 INDEX_OPT_VERSION = 19,
77 INDEX_OPT_HELP = 20,
78 INDEX_OPT_MORE_HELP = 21,
79 INDEX_OPT_SAVE_OPTS = 22,
80 INDEX_OPT_LOAD_OPTS = 23
81 } teOptIndex;
83 #define OPTION_CT 24
84 #define NTP_KEYGEN_VERSION "4.2.4p8"
85 #define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.4p8"
88 * Interface defines for all options. Replace "n" with the UPPER_CASED
89 * option name (as in the teOptIndex enumeration above).
90 * e.g. HAVE_OPT( CERTIFICATE )
92 #define DESC(n) (ntp_keygenOptions.pOptDesc[INDEX_OPT_## n])
93 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
94 #define OPT_ARG(n) (DESC(n).optArg.argString)
95 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
96 #define COUNT_OPT(n) (DESC(n).optOccCt)
97 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
98 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
99 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
100 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
101 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
102 #define CLEAR_OPT(n) STMTS( \
103 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
104 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
105 DESC(n).fOptState |= OPTST_DISABLED; \
106 DESC(n).optCookie = NULL )
109 * Make sure there are no #define name conflicts with the option names
111 #ifndef NO_OPTION_NAME_WARNINGS
112 # ifdef CERTIFICATE
113 # warning undefining CERTIFICATE due to option name conflict
114 # undef CERTIFICATE
115 # endif
116 # ifdef DEBUG_LEVEL
117 # warning undefining DEBUG_LEVEL due to option name conflict
118 # undef DEBUG_LEVEL
119 # endif
120 # ifdef SET_DEBUG_LEVEL
121 # warning undefining SET_DEBUG_LEVEL due to option name conflict
122 # undef SET_DEBUG_LEVEL
123 # endif
124 # ifdef ID_KEY
125 # warning undefining ID_KEY due to option name conflict
126 # undef ID_KEY
127 # endif
128 # ifdef GQ_PARAMS
129 # warning undefining GQ_PARAMS due to option name conflict
130 # undef GQ_PARAMS
131 # endif
132 # ifdef GQ_KEYS
133 # warning undefining GQ_KEYS due to option name conflict
134 # undef GQ_KEYS
135 # endif
136 # ifdef HOST_KEY
137 # warning undefining HOST_KEY due to option name conflict
138 # undef HOST_KEY
139 # endif
140 # ifdef IFFKEY
141 # warning undefining IFFKEY due to option name conflict
142 # undef IFFKEY
143 # endif
144 # ifdef ISSUER_NAME
145 # warning undefining ISSUER_NAME due to option name conflict
146 # undef ISSUER_NAME
147 # endif
148 # ifdef MD5KEY
149 # warning undefining MD5KEY due to option name conflict
150 # undef MD5KEY
151 # endif
152 # ifdef MODULUS
153 # warning undefining MODULUS due to option name conflict
154 # undef MODULUS
155 # endif
156 # ifdef PVT_CERT
157 # warning undefining PVT_CERT due to option name conflict
158 # undef PVT_CERT
159 # endif
160 # ifdef PVT_PASSWD
161 # warning undefining PVT_PASSWD due to option name conflict
162 # undef PVT_PASSWD
163 # endif
164 # ifdef GET_PVT_PASSWD
165 # warning undefining GET_PVT_PASSWD due to option name conflict
166 # undef GET_PVT_PASSWD
167 # endif
168 # ifdef SIGN_KEY
169 # warning undefining SIGN_KEY due to option name conflict
170 # undef SIGN_KEY
171 # endif
172 # ifdef SUBJECT_NAME
173 # warning undefining SUBJECT_NAME due to option name conflict
174 # undef SUBJECT_NAME
175 # endif
176 # ifdef TRUSTED_CERT
177 # warning undefining TRUSTED_CERT due to option name conflict
178 # undef TRUSTED_CERT
179 # endif
180 # ifdef MV_PARAMS
181 # warning undefining MV_PARAMS due to option name conflict
182 # undef MV_PARAMS
183 # endif
184 # ifdef MV_KEYS
185 # warning undefining MV_KEYS due to option name conflict
186 # undef MV_KEYS
187 # endif
188 #else /* NO_OPTION_NAME_WARNINGS */
189 # undef CERTIFICATE
190 # undef DEBUG_LEVEL
191 # undef SET_DEBUG_LEVEL
192 # undef ID_KEY
193 # undef GQ_PARAMS
194 # undef GQ_KEYS
195 # undef HOST_KEY
196 # undef IFFKEY
197 # undef ISSUER_NAME
198 # undef MD5KEY
199 # undef MODULUS
200 # undef PVT_CERT
201 # undef PVT_PASSWD
202 # undef GET_PVT_PASSWD
203 # undef SIGN_KEY
204 # undef SUBJECT_NAME
205 # undef TRUSTED_CERT
206 # undef MV_PARAMS
207 # undef MV_KEYS
208 #endif /* NO_OPTION_NAME_WARNINGS */
211 * Interface defines for specific options.
213 #ifdef OPENSSL
214 #define VALUE_OPT_CERTIFICATE 'c'
215 #endif /* OPENSSL */
216 #ifdef DEBUG
217 #define VALUE_OPT_DEBUG_LEVEL 'd'
218 #endif /* DEBUG */
219 #ifdef DEBUG
220 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
221 #endif /* DEBUG */
222 #ifdef OPENSSL
223 #define VALUE_OPT_ID_KEY 'e'
224 #endif /* OPENSSL */
225 #ifdef OPENSSL
226 #define VALUE_OPT_GQ_PARAMS 'G'
227 #endif /* OPENSSL */
228 #ifdef OPENSSL
229 #define VALUE_OPT_GQ_KEYS 'g'
230 #endif /* OPENSSL */
231 #ifdef OPENSSL
232 #define VALUE_OPT_HOST_KEY 'H'
233 #endif /* OPENSSL */
234 #ifdef OPENSSL
235 #define VALUE_OPT_IFFKEY 'I'
236 #endif /* OPENSSL */
237 #ifdef OPENSSL
238 #define VALUE_OPT_ISSUER_NAME 'i'
239 #endif /* OPENSSL */
240 #define VALUE_OPT_MD5KEY 'M'
241 #ifdef OPENSSL
242 #define VALUE_OPT_MODULUS 'm'
243 #define OPT_VALUE_MODULUS (DESC(MODULUS).optArg.argInt)
244 #endif /* OPENSSL */
245 #ifdef OPENSSL
246 #define VALUE_OPT_PVT_CERT 'P'
247 #endif /* OPENSSL */
248 #ifdef OPENSSL
249 #define VALUE_OPT_PVT_PASSWD 'p'
250 #endif /* OPENSSL */
251 #ifdef OPENSSL
252 #define VALUE_OPT_GET_PVT_PASSWD 'q'
253 #endif /* OPENSSL */
254 #ifdef OPENSSL
255 #define VALUE_OPT_SIGN_KEY 'S'
256 #endif /* OPENSSL */
257 #ifdef OPENSSL
258 #define VALUE_OPT_SUBJECT_NAME 's'
259 #endif /* OPENSSL */
260 #ifdef OPENSSL
261 #define VALUE_OPT_TRUSTED_CERT 'T'
262 #endif /* OPENSSL */
263 #ifdef OPENSSL
264 #define VALUE_OPT_MV_PARAMS 'V'
265 #define OPT_VALUE_MV_PARAMS (DESC(MV_PARAMS).optArg.argInt)
266 #endif /* OPENSSL */
267 #ifdef OPENSSL
268 #define VALUE_OPT_MV_KEYS 'v'
269 #define OPT_VALUE_MV_KEYS (DESC(MV_KEYS).optArg.argInt)
270 #endif /* OPENSSL */
272 #define VALUE_OPT_VERSION 'v'
273 #define VALUE_OPT_HELP '?'
274 #define VALUE_OPT_MORE_HELP '!'
275 #define VALUE_OPT_SAVE_OPTS '>'
276 #define VALUE_OPT_LOAD_OPTS '<'
277 #define SET_OPT_SAVE_OPTS(a) STMTS( \
278 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
279 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
280 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
282 * Interface defines not associated with particular options
284 #define ERRSKIP_OPTERR STMTS( ntp_keygenOptions.fOptSet &= ~OPTPROC_ERRSTOP )
285 #define ERRSTOP_OPTERR STMTS( ntp_keygenOptions.fOptSet |= OPTPROC_ERRSTOP )
286 #define RESTART_OPT(n) STMTS( \
287 ntp_keygenOptions.curOptIdx = (n); \
288 ntp_keygenOptions.pzCurOpt = NULL )
289 #define START_OPT RESTART_OPT(1)
290 #define USAGE(c) (*ntp_keygenOptions.pUsageProc)( &ntp_keygenOptions, c )
291 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/opthead.tpl near line 360 */
293 /* * * * * *
295 * Declare the ntp-keygen option descriptor.
297 #ifdef __cplusplus
298 extern "C" {
299 #endif
301 extern tOptions ntp_keygenOptions;
303 #ifndef _
304 # if ENABLE_NLS
305 # include <stdio.h>
306 static inline char* aoGetsText( char const* pz ) {
307 if (pz == NULL) return NULL;
308 return (char*)gettext( pz );
310 # define _(s) aoGetsText(s)
311 # else /* ENABLE_NLS */
312 # define _(s) s
313 # endif /* ENABLE_NLS */
314 #endif
316 #ifdef __cplusplus
318 #endif
319 #endif /* AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD */
320 /* ntp-keygen-opts.h ends here */