2 * EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
4 * It has been AutoGen-ed Sunday August 17, 2008 at 05:20:09 AM EDT
5 * From the definitions ntpd-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 * ntpd 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 * ntpd 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 ntpd 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_NTPD_OPTS_H_GUARD
33 #define AUTOOPTS_NTPD_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_CONFIGFILE = 5,
61 INDEX_OPT_DEBUG_LEVEL = 6,
62 INDEX_OPT_SET_DEBUG_LEVEL = 7,
63 INDEX_OPT_DRIFTFILE = 8,
64 INDEX_OPT_PANICGATE = 9,
65 INDEX_OPT_JAILDIR = 10,
66 INDEX_OPT_INTERFACE = 11,
67 INDEX_OPT_KEYFILE = 12,
68 INDEX_OPT_LOGFILE = 13,
69 INDEX_OPT_NOVIRTUALIPS = 14,
70 INDEX_OPT_MODIFYMMTIMER = 15,
71 INDEX_OPT_NOFORK = 16,
73 INDEX_OPT_PIDFILE = 18,
74 INDEX_OPT_PRIORITY = 19,
76 INDEX_OPT_PROPAGATIONDELAY = 21,
77 INDEX_OPT_UPDATEINTERVAL = 22,
78 INDEX_OPT_STATSDIR = 23,
79 INDEX_OPT_TRUSTEDKEY = 24,
84 INDEX_OPT_VERSION = 29,
86 INDEX_OPT_MORE_HELP = 31
90 #define NTPD_VERSION "4.2.4p5"
91 #define NTPD_FULL_VERSION "ntpd - NTP daemon program - Ver. 4.2.4p5"
94 * Interface defines for all options. Replace "n" with the UPPER_CASED
95 * option name (as in the teOptIndex enumeration above).
96 * e.g. HAVE_OPT( IPV4 )
98 #define DESC(n) (ntpdOptions.pOptDesc[INDEX_OPT_## n])
99 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
100 #define OPT_ARG(n) (DESC(n).optArg.argString)
101 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
102 #define COUNT_OPT(n) (DESC(n).optOccCt)
103 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
104 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
105 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
106 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
107 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
108 #define CLEAR_OPT(n) STMTS( \
109 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
110 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
111 DESC(n).fOptState |= OPTST_DISABLED; \
112 DESC(n).optCookie = NULL )
115 * Make sure there are no #define name conflicts with the option names
117 #ifndef NO_OPTION_NAME_WARNINGS
119 # warning undefining IPV4 due to option name conflict
123 # warning undefining IPV6 due to option name conflict
127 # warning undefining AUTHREQ due to option name conflict
131 # warning undefining AUTHNOREQ due to option name conflict
135 # warning undefining BCASTSYNC due to option name conflict
139 # warning undefining CONFIGFILE due to option name conflict
143 # warning undefining DEBUG_LEVEL due to option name conflict
146 # ifdef SET_DEBUG_LEVEL
147 # warning undefining SET_DEBUG_LEVEL due to option name conflict
148 # undef SET_DEBUG_LEVEL
151 # warning undefining DRIFTFILE due to option name conflict
155 # warning undefining PANICGATE due to option name conflict
159 # warning undefining JAILDIR due to option name conflict
163 # warning undefining INTERFACE due to option name conflict
167 # warning undefining KEYFILE due to option name conflict
171 # warning undefining LOGFILE due to option name conflict
175 # warning undefining NOVIRTUALIPS due to option name conflict
178 # ifdef MODIFYMMTIMER
179 # warning undefining MODIFYMMTIMER due to option name conflict
180 # undef MODIFYMMTIMER
183 # warning undefining NOFORK due to option name conflict
187 # warning undefining NICE due to option name conflict
191 # warning undefining PIDFILE due to option name conflict
195 # warning undefining PRIORITY due to option name conflict
199 # warning undefining QUIT due to option name conflict
202 # ifdef PROPAGATIONDELAY
203 # warning undefining PROPAGATIONDELAY due to option name conflict
204 # undef PROPAGATIONDELAY
206 # ifdef UPDATEINTERVAL
207 # warning undefining UPDATEINTERVAL due to option name conflict
208 # undef UPDATEINTERVAL
211 # warning undefining STATSDIR due to option name conflict
215 # warning undefining TRUSTEDKEY due to option name conflict
219 # warning undefining USER due to option name conflict
223 # warning undefining VAR due to option name conflict
227 # warning undefining DVAR due to option name conflict
231 # warning undefining SLEW due to option name conflict
234 #else /* NO_OPTION_NAME_WARNINGS */
242 # undef SET_DEBUG_LEVEL
250 # undef MODIFYMMTIMER
256 # undef PROPAGATIONDELAY
257 # undef UPDATEINTERVAL
264 #endif /* NO_OPTION_NAME_WARNINGS */
267 * Interface defines for specific options.
269 #define VALUE_OPT_IPV4 '4'
270 #define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
271 #define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
272 #define VALUE_OPT_IPV6 '6'
273 #define VALUE_OPT_AUTHREQ 'a'
274 #define VALUE_OPT_AUTHNOREQ 'A'
275 #define VALUE_OPT_BCASTSYNC 'b'
276 #define VALUE_OPT_CONFIGFILE 'c'
278 #define VALUE_OPT_DEBUG_LEVEL 'd'
281 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
283 #define VALUE_OPT_DRIFTFILE 'f'
284 #define VALUE_OPT_PANICGATE 'g'
285 #define VALUE_OPT_JAILDIR 'i'
286 #define VALUE_OPT_INTERFACE 'I'
287 #define VALUE_OPT_KEYFILE 'k'
288 #define VALUE_OPT_LOGFILE 'l'
289 #define VALUE_OPT_NOVIRTUALIPS 'L'
291 #define VALUE_OPT_MODIFYMMTIMER 'M'
292 #endif /* SYS_WINNT */
293 #define VALUE_OPT_NOFORK 'n'
294 #define VALUE_OPT_NICE 'N'
295 #define VALUE_OPT_PIDFILE 'p'
296 #define VALUE_OPT_PRIORITY 'P'
297 #define OPT_VALUE_PRIORITY (DESC(PRIORITY).optArg.argInt)
298 #define VALUE_OPT_QUIT 'q'
299 #define VALUE_OPT_PROPAGATIONDELAY 'r'
300 #define VALUE_OPT_UPDATEINTERVAL 'U'
301 #define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
302 #define VALUE_OPT_STATSDIR 's'
303 #define VALUE_OPT_TRUSTEDKEY 't'
304 #define VALUE_OPT_USER 'u'
305 #define VALUE_OPT_VAR 'v'
306 #define VALUE_OPT_DVAR 'V'
307 #define VALUE_OPT_SLEW 'x'
309 #define VALUE_OPT_VERSION 'v'
310 #define VALUE_OPT_HELP '?'
311 #define VALUE_OPT_MORE_HELP '!'
313 * Interface defines not associated with particular options
315 #define ERRSKIP_OPTERR STMTS( ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP )
316 #define ERRSTOP_OPTERR STMTS( ntpdOptions.fOptSet |= OPTPROC_ERRSTOP )
317 #define RESTART_OPT(n) STMTS( \
318 ntpdOptions.curOptIdx = (n); \
319 ntpdOptions.pzCurOpt = NULL )
320 #define START_OPT RESTART_OPT(1)
321 #define USAGE(c) (*ntpdOptions.pUsageProc)( &ntpdOptions, c )
322 /* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
326 * Declare the ntpd option descriptor.
332 extern tOptions ntpdOptions;
337 static inline char* aoGetsText( char const* pz ) {
338 if (pz == NULL) return NULL;
339 return (char*)gettext( pz );
341 # define _(s) aoGetsText(s)
342 # else /* ENABLE_NLS */
344 # endif /* ENABLE_NLS */
350 #endif /* AUTOOPTS_NTPD_OPTS_H_GUARD */
351 /* ntpd-opts.h ends here */