4 * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h)
6 * It has been AutoGen-ed December 10, 2009 at 05:08:20 AM by AutoGen 5.10
7 * From the definitions ntp-keygen-opts.def
8 * and the template file options
10 * Generated from AutoOpts 33:0:8 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 (c) 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 1
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 135168
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
54 * Enumeration of each option:
57 INDEX_OPT_CERTIFICATE
= 0,
58 INDEX_OPT_DEBUG_LEVEL
= 1,
59 INDEX_OPT_SET_DEBUG_LEVEL
= 2,
61 INDEX_OPT_GQ_PARAMS
= 4,
62 INDEX_OPT_HOST_KEY
= 5,
64 INDEX_OPT_ISSUER_NAME
= 7,
66 INDEX_OPT_MODULUS
= 9,
67 INDEX_OPT_PVT_CERT
= 10,
68 INDEX_OPT_PVT_PASSWD
= 11,
69 INDEX_OPT_GET_PVT_PASSWD
= 12,
70 INDEX_OPT_SIGN_KEY
= 13,
71 INDEX_OPT_SUBJECT_NAME
= 14,
72 INDEX_OPT_TRUSTED_CERT
= 15,
73 INDEX_OPT_MV_PARAMS
= 16,
74 INDEX_OPT_MV_KEYS
= 17,
75 INDEX_OPT_VERSION
= 18,
77 INDEX_OPT_MORE_HELP
= 20,
78 INDEX_OPT_SAVE_OPTS
= 21,
79 INDEX_OPT_LOAD_OPTS
= 22
83 #define NTP_KEYGEN_VERSION "4.2.6"
84 #define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.6"
87 * Interface defines for all options. Replace "n" with the UPPER_CASED
88 * option name (as in the teOptIndex enumeration above).
89 * e.g. HAVE_OPT( CERTIFICATE )
91 #define DESC(n) (ntp_keygenOptions.pOptDesc[INDEX_OPT_## n])
92 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
93 #define OPT_ARG(n) (DESC(n).optArg.argString)
94 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
95 #define COUNT_OPT(n) (DESC(n).optOccCt)
96 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
97 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
98 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
99 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
100 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
101 #define CLEAR_OPT(n) STMTS( \
102 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
103 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
104 DESC(n).fOptState |= OPTST_DISABLED; \
105 DESC(n).optCookie = NULL )
108 * Make sure there are no #define name conflicts with the option names
110 #ifndef NO_OPTION_NAME_WARNINGS
112 # warning undefining CERTIFICATE due to option name conflict
116 # warning undefining DEBUG_LEVEL due to option name conflict
119 # ifdef SET_DEBUG_LEVEL
120 # warning undefining SET_DEBUG_LEVEL due to option name conflict
121 # undef SET_DEBUG_LEVEL
124 # warning undefining ID_KEY due to option name conflict
128 # warning undefining GQ_PARAMS due to option name conflict
132 # warning undefining HOST_KEY due to option name conflict
136 # warning undefining IFFKEY due to option name conflict
140 # warning undefining ISSUER_NAME due to option name conflict
144 # warning undefining MD5KEY due to option name conflict
148 # warning undefining MODULUS due to option name conflict
152 # warning undefining PVT_CERT due to option name conflict
156 # warning undefining PVT_PASSWD due to option name conflict
159 # ifdef GET_PVT_PASSWD
160 # warning undefining GET_PVT_PASSWD due to option name conflict
161 # undef GET_PVT_PASSWD
164 # warning undefining SIGN_KEY due to option name conflict
168 # warning undefining SUBJECT_NAME due to option name conflict
172 # warning undefining TRUSTED_CERT due to option name conflict
176 # warning undefining MV_PARAMS due to option name conflict
180 # warning undefining MV_KEYS due to option name conflict
183 #else /* NO_OPTION_NAME_WARNINGS */
186 # undef SET_DEBUG_LEVEL
196 # undef GET_PVT_PASSWD
202 #endif /* NO_OPTION_NAME_WARNINGS */
206 * Interface defines for specific options.
208 #define VALUE_OPT_CERTIFICATE 'c'
209 #define VALUE_OPT_DEBUG_LEVEL 'd'
210 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
211 #define VALUE_OPT_ID_KEY 'e'
212 #define VALUE_OPT_GQ_PARAMS 'G'
213 #define VALUE_OPT_HOST_KEY 'H'
214 #define VALUE_OPT_IFFKEY 'I'
215 #define VALUE_OPT_ISSUER_NAME 'i'
216 #define VALUE_OPT_MD5KEY 'M'
217 #define VALUE_OPT_MODULUS 'm'
220 #define OPT_VALUE_MODULUS (DESC(MODULUS).optArg.argInt)
222 #define VALUE_OPT_PVT_CERT 'P'
223 #define VALUE_OPT_PVT_PASSWD 'p'
224 #define VALUE_OPT_GET_PVT_PASSWD 'q'
225 #define VALUE_OPT_SIGN_KEY 'S'
226 #define VALUE_OPT_SUBJECT_NAME 's'
227 #define VALUE_OPT_TRUSTED_CERT 'T'
228 #define VALUE_OPT_MV_PARAMS 'V'
231 #define OPT_VALUE_MV_PARAMS (DESC(MV_PARAMS).optArg.argInt)
233 #define VALUE_OPT_MV_KEYS 'v'
236 #define OPT_VALUE_MV_KEYS (DESC(MV_KEYS).optArg.argInt)
238 #define VALUE_OPT_HELP '?'
239 #define VALUE_OPT_MORE_HELP '!'
240 #define VALUE_OPT_VERSION INDEX_OPT_VERSION
241 #define VALUE_OPT_SAVE_OPTS '>'
242 #define VALUE_OPT_LOAD_OPTS '<'
243 #define SET_OPT_SAVE_OPTS(a) STMTS( \
244 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
245 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
246 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
248 * Interface defines not associated with particular options
250 #define ERRSKIP_OPTERR STMTS( ntp_keygenOptions.fOptSet &= ~OPTPROC_ERRSTOP )
251 #define ERRSTOP_OPTERR STMTS( ntp_keygenOptions.fOptSet |= OPTPROC_ERRSTOP )
252 #define RESTART_OPT(n) STMTS( \
253 ntp_keygenOptions.curOptIdx = (n); \
254 ntp_keygenOptions.pzCurOpt = NULL )
255 #define START_OPT RESTART_OPT(1)
256 #define USAGE(c) (*ntp_keygenOptions.pUsageProc)( &ntp_keygenOptions, c )
257 /* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */
261 * Declare the ntp-keygen option descriptor.
267 extern tOptions ntp_keygenOptions
;
269 #if defined(ENABLE_NLS)
272 static inline char* aoGetsText( char const* pz
) {
273 if (pz
== NULL
) return NULL
;
274 return (char*)gettext( pz
);
276 # define _(s) aoGetsText(s)
279 # define OPT_NO_XLAT_CFG_NAMES STMTS(ntp_keygenOptions.fOptSet |= \
280 OPTPROC_NXLAT_OPT_CFG;)
281 # define OPT_NO_XLAT_OPT_NAMES STMTS(ntp_keygenOptions.fOptSet |= \
282 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
284 # define OPT_XLAT_CFG_NAMES STMTS(ntp_keygenOptions.fOptSet &= \
285 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
286 # define OPT_XLAT_OPT_NAMES STMTS(ntp_keygenOptions.fOptSet &= \
289 #else /* ENABLE_NLS */
290 # define OPT_NO_XLAT_CFG_NAMES
291 # define OPT_NO_XLAT_OPT_NAMES
293 # define OPT_XLAT_CFG_NAMES
294 # define OPT_XLAT_OPT_NAMES
299 #endif /* ENABLE_NLS */
304 #endif /* AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD */
305 /* ntp-keygen-opts.h ends here */