2 * EDIT THIS FILE WITH CAUTION (ntpdsim-opts.h)
4 * It has been AutoGen-ed Sunday August 17, 2008 at 05:20:13 AM EDT
5 * From the definitions ntpdsim-opts.def
6 * and the template file options
8 * Generated from AutoOpts 29:0:4 templates.
12 * This file was produced by an AutoOpts template. AutoOpts is a
13 * copyrighted work. This header file is not encumbered by AutoOpts
14 * licensing, but is provided under the licensing terms chosen by the
15 * ntpdsim author or copyright holder. AutoOpts is licensed under
16 * the terms of the LGPL. The redistributable library (``libopts'') is
17 * licensed under the terms of either the LGPL or, at the users discretion,
18 * the BSD license. See the AutoOpts and/or libopts sources for details.
20 * This source file is copyrighted and licensed under the following terms:
22 * ntpdsim copyright 1970-2008 David L. Mills and/or others - all rights reserved
24 * see html/copyright.html
27 * This file contains the programmatic interface to the Automated
28 * Options generated for the ntpdsim program.
29 * These macros are documented in the AutoGen info file in the
30 * "AutoOpts" chapter. Please refer to that doc for usage help.
32 #ifndef AUTOOPTS_NTPDSIM_OPTS_H_GUARD
33 #define AUTOOPTS_NTPDSIM_OPTS_H_GUARD
35 #include <autoopts/options.h>
38 * Ensure that the library used for compiling this generated header is at
39 * least as new as the version current when the header template was released
40 * (not counting patch version increments). Also ensure that the oldest
41 * tolerable version is at least as old as what was current when the header
42 * template was released.
44 #define AO_TEMPLATE_VERSION 118784
45 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
46 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
47 # error option template version mismatches autoopts/options.h header
52 * Enumeration of each option:
57 INDEX_OPT_AUTHREQ
= 2,
58 INDEX_OPT_AUTHNOREQ
= 3,
59 INDEX_OPT_BCASTSYNC
= 4,
60 INDEX_OPT_SIMBROADCASTDELAY
= 5,
61 INDEX_OPT_CONFIGFILE
= 6,
62 INDEX_OPT_PHASENOISE
= 7,
63 INDEX_OPT_DEBUG_LEVEL
= 8,
64 INDEX_OPT_SET_DEBUG_LEVEL
= 9,
65 INDEX_OPT_DRIFTFILE
= 10,
66 INDEX_OPT_PANICGATE
= 11,
67 INDEX_OPT_SIMSLEW
= 12,
68 INDEX_OPT_JAILDIR
= 13,
69 INDEX_OPT_INTERFACE
= 14,
70 INDEX_OPT_KEYFILE
= 15,
71 INDEX_OPT_LOGFILE
= 16,
72 INDEX_OPT_NOVIRTUALIPS
= 17,
73 INDEX_OPT_MODIFYMMTIMER
= 18,
74 INDEX_OPT_NOFORK
= 19,
76 INDEX_OPT_SERVERTIME
= 21,
77 INDEX_OPT_PIDFILE
= 22,
78 INDEX_OPT_PRIORITY
= 23,
80 INDEX_OPT_PROPAGATIONDELAY
= 25,
81 INDEX_OPT_UPDATEINTERVAL
= 26,
82 INDEX_OPT_STATSDIR
= 27,
83 INDEX_OPT_ENDSIMTIME
= 28,
84 INDEX_OPT_TRUSTEDKEY
= 29,
85 INDEX_OPT_FREQERR
= 30,
86 INDEX_OPT_WALKNOISE
= 31,
91 INDEX_OPT_NDELAY
= 36,
92 INDEX_OPT_PDELAY
= 37,
93 INDEX_OPT_VERSION
= 38,
95 INDEX_OPT_MORE_HELP
= 40,
96 INDEX_OPT_SAVE_OPTS
= 41,
97 INDEX_OPT_LOAD_OPTS
= 42
101 #define NTPDSIM_VERSION "4.2.4p5"
102 #define NTPDSIM_FULL_VERSION "ntpdsim - NTP daemon simulation program - Ver. 4.2.4p5"
105 * Interface defines for all options. Replace "n" with the UPPER_CASED
106 * option name (as in the teOptIndex enumeration above).
107 * e.g. HAVE_OPT( IPV4 )
109 #define DESC(n) (ntpdsimOptions.pOptDesc[INDEX_OPT_## n])
110 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
111 #define OPT_ARG(n) (DESC(n).optArg.argString)
112 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
113 #define COUNT_OPT(n) (DESC(n).optOccCt)
114 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
115 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
116 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
117 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
118 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
119 #define CLEAR_OPT(n) STMTS( \
120 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
121 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
122 DESC(n).fOptState |= OPTST_DISABLED; \
123 DESC(n).optCookie = NULL )
126 * Make sure there are no #define name conflicts with the option names
128 #ifndef NO_OPTION_NAME_WARNINGS
130 # warning undefining IPV4 due to option name conflict
134 # warning undefining IPV6 due to option name conflict
138 # warning undefining AUTHREQ due to option name conflict
142 # warning undefining AUTHNOREQ due to option name conflict
146 # warning undefining BCASTSYNC due to option name conflict
149 # ifdef SIMBROADCASTDELAY
150 # warning undefining SIMBROADCASTDELAY due to option name conflict
151 # undef SIMBROADCASTDELAY
154 # warning undefining CONFIGFILE due to option name conflict
158 # warning undefining PHASENOISE due to option name conflict
162 # warning undefining DEBUG_LEVEL due to option name conflict
165 # ifdef SET_DEBUG_LEVEL
166 # warning undefining SET_DEBUG_LEVEL due to option name conflict
167 # undef SET_DEBUG_LEVEL
170 # warning undefining DRIFTFILE due to option name conflict
174 # warning undefining PANICGATE due to option name conflict
178 # warning undefining SIMSLEW due to option name conflict
182 # warning undefining JAILDIR due to option name conflict
186 # warning undefining INTERFACE due to option name conflict
190 # warning undefining KEYFILE due to option name conflict
194 # warning undefining LOGFILE due to option name conflict
198 # warning undefining NOVIRTUALIPS due to option name conflict
201 # ifdef MODIFYMMTIMER
202 # warning undefining MODIFYMMTIMER due to option name conflict
203 # undef MODIFYMMTIMER
206 # warning undefining NOFORK due to option name conflict
210 # warning undefining NICE due to option name conflict
214 # warning undefining SERVERTIME due to option name conflict
218 # warning undefining PIDFILE due to option name conflict
222 # warning undefining PRIORITY due to option name conflict
226 # warning undefining QUIT due to option name conflict
229 # ifdef PROPAGATIONDELAY
230 # warning undefining PROPAGATIONDELAY due to option name conflict
231 # undef PROPAGATIONDELAY
233 # ifdef UPDATEINTERVAL
234 # warning undefining UPDATEINTERVAL due to option name conflict
235 # undef UPDATEINTERVAL
238 # warning undefining STATSDIR due to option name conflict
242 # warning undefining ENDSIMTIME due to option name conflict
246 # warning undefining TRUSTEDKEY due to option name conflict
250 # warning undefining FREQERR due to option name conflict
254 # warning undefining WALKNOISE due to option name conflict
258 # warning undefining USER due to option name conflict
262 # warning undefining VAR due to option name conflict
266 # warning undefining DVAR due to option name conflict
270 # warning undefining SLEW due to option name conflict
274 # warning undefining NDELAY due to option name conflict
278 # warning undefining PDELAY due to option name conflict
281 #else /* NO_OPTION_NAME_WARNINGS */
287 # undef SIMBROADCASTDELAY
291 # undef SET_DEBUG_LEVEL
300 # undef MODIFYMMTIMER
307 # undef PROPAGATIONDELAY
308 # undef UPDATEINTERVAL
320 #endif /* NO_OPTION_NAME_WARNINGS */
323 * Interface defines for specific options.
325 #define VALUE_OPT_IPV4 '4'
326 #define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
327 #define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
328 #define VALUE_OPT_IPV6 '6'
329 #define VALUE_OPT_AUTHREQ 'a'
330 #define VALUE_OPT_AUTHNOREQ 'A'
331 #define VALUE_OPT_BCASTSYNC 'b'
332 #define VALUE_OPT_SIMBROADCASTDELAY 'B'
333 #define VALUE_OPT_CONFIGFILE 'c'
334 #define VALUE_OPT_PHASENOISE 'C'
336 #define VALUE_OPT_DEBUG_LEVEL 'd'
339 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
341 #define VALUE_OPT_DRIFTFILE 'f'
342 #define VALUE_OPT_PANICGATE 'g'
343 #define VALUE_OPT_SIMSLEW 'H'
344 #define VALUE_OPT_JAILDIR 'i'
345 #define VALUE_OPT_INTERFACE 'I'
346 #define VALUE_OPT_KEYFILE 'k'
347 #define VALUE_OPT_LOGFILE 'l'
348 #define VALUE_OPT_NOVIRTUALIPS 'L'
350 #define VALUE_OPT_MODIFYMMTIMER 'M'
351 #endif /* SYS_WINNT */
352 #define VALUE_OPT_NOFORK 'n'
353 #define VALUE_OPT_NICE 'N'
354 #define VALUE_OPT_SERVERTIME 'O'
355 #define VALUE_OPT_PIDFILE 'p'
356 #define VALUE_OPT_PRIORITY 'P'
357 #define OPT_VALUE_PRIORITY (DESC(PRIORITY).optArg.argInt)
358 #define VALUE_OPT_QUIT 'q'
359 #define VALUE_OPT_PROPAGATIONDELAY 'r'
360 #define VALUE_OPT_UPDATEINTERVAL 'U'
361 #define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
362 #define VALUE_OPT_STATSDIR 's'
363 #define VALUE_OPT_ENDSIMTIME 'S'
364 #define VALUE_OPT_TRUSTEDKEY 't'
365 #define VALUE_OPT_FREQERR 'T'
366 #define VALUE_OPT_WALKNOISE 'W'
367 #define VALUE_OPT_USER 'u'
368 #define VALUE_OPT_VAR 'v'
369 #define VALUE_OPT_DVAR 'V'
370 #define VALUE_OPT_SLEW 'x'
371 #define VALUE_OPT_NDELAY 'Y'
372 #define VALUE_OPT_PDELAY 'Z'
374 #define VALUE_OPT_VERSION 'v'
375 #define VALUE_OPT_HELP '?'
376 #define VALUE_OPT_MORE_HELP '!'
377 #define VALUE_OPT_SAVE_OPTS '>'
378 #define VALUE_OPT_LOAD_OPTS '<'
379 #define SET_OPT_SAVE_OPTS(a) STMTS( \
380 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
381 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
382 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
384 * Interface defines not associated with particular options
386 #define ERRSKIP_OPTERR STMTS( ntpdsimOptions.fOptSet &= ~OPTPROC_ERRSTOP )
387 #define ERRSTOP_OPTERR STMTS( ntpdsimOptions.fOptSet |= OPTPROC_ERRSTOP )
388 #define RESTART_OPT(n) STMTS( \
389 ntpdsimOptions.curOptIdx = (n); \
390 ntpdsimOptions.pzCurOpt = NULL )
391 #define START_OPT RESTART_OPT(1)
392 #define USAGE(c) (*ntpdsimOptions.pUsageProc)( &ntpdsimOptions, c )
393 /* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
397 * Declare the ntpdsim option descriptor.
403 extern tOptions ntpdsimOptions
;
408 static inline char* aoGetsText( char const* pz
) {
409 if (pz
== NULL
) return NULL
;
410 return (char*)gettext( pz
);
412 # define _(s) aoGetsText(s)
413 # else /* ENABLE_NLS */
415 # endif /* ENABLE_NLS */
421 #endif /* AUTOOPTS_NTPDSIM_OPTS_H_GUARD */
422 /* ntpdsim-opts.h ends here */