1
/* -*- buffer-read-only: t -*- vi: set ro:
3
* DO NOT EDIT THIS FILE (ntpd-opts.h)
5
* It has been AutoGen-ed Wednesday March 7, 2007 at 06:37:35 AM EST
6
* From the definitions ntpd-opts.def
7
* and the template file options
9
* Generated from AutoOpts 27:5:3 templates.
13
* This file was produced by an AutoOpts template. AutoOpts is a
14
* copyrighted work. This header file is not encumbered by AutoOpts
15
* licensing, but is provided under the licensing terms chosen by the
16
* ntpd author or copyright holder. AutoOpts is licensed under
17
* the terms of the LGPL. The redistributable library (``libopts'') is
18
* licensed under the terms of either the LGPL or, at the users discretion,
19
* the BSD license. See the AutoOpts and/or libopts sources for details.
21
* This source file is copyrighted and licensed under the following terms:
23
* ntpd copyright 1970-2006 ntp.org - all rights reserved
25
* see html/copyright.html
28
* This file contains the programmatic interface to the Automated
29
* Options generated for the ntpd program.
30
* These macros are documented in the AutoGen info file in the
31
* "AutoOpts" chapter. Please refer to that doc for usage help.
33
#ifndef AUTOOPTS_NTPD_OPTS_H_GUARD
34
#define AUTOOPTS_NTPD_OPTS_H_GUARD
36
#include <autoopts/options.h>
39
* Ensure that the library used for compiling this generated header is at
40
* least as new as the version current when the header template was released
41
* (not counting patch version increments). Also ensure that the oldest
42
* tolerable version is at least as old as what was current when the header
43
* template was released.
45
#define AO_TEMPLATE_VERSION 110597
46
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
47
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
48
# error option template version mismatches autoopts/options.h header
53
* Enumeration of each option:
58
INDEX_OPT_AUTHREQ = 2,
59
INDEX_OPT_AUTHNOREQ = 3,
60
INDEX_OPT_BCASTSYNC = 4,
61
INDEX_OPT_CONFIGFILE = 5,
62
INDEX_OPT_DEBUG_LEVEL = 6,
63
INDEX_OPT_SET_DEBUG_LEVEL = 7,
64
INDEX_OPT_DRIFTFILE = 8,
65
INDEX_OPT_PANICGATE = 9,
66
INDEX_OPT_JAILDIR = 10,
67
INDEX_OPT_INTERFACE = 11,
68
INDEX_OPT_KEYFILE = 12,
69
INDEX_OPT_LOGFILE = 13,
70
INDEX_OPT_NOVIRTUALIPS = 14,
71
INDEX_OPT_MODIFYMMTIMER = 15,
72
INDEX_OPT_NOFORK = 16,
74
INDEX_OPT_PIDFILE = 18,
75
INDEX_OPT_PRIORITY = 19,
77
INDEX_OPT_PROPAGATIONDELAY = 21,
78
INDEX_OPT_UPDATEINTERVAL = 22,
79
INDEX_OPT_STATSDIR = 23,
80
INDEX_OPT_TRUSTEDKEY = 24,
85
INDEX_OPT_VERSION = 29,
87
INDEX_OPT_MORE_HELP = 31,
88
INDEX_OPT_SAVE_OPTS = 32,
89
INDEX_OPT_LOAD_OPTS = 33
93
#define NTPD_VERSION "4.2.4p0"
94
#define NTPD_FULL_VERSION "ntpd - NTP daemon program - Ver. 4.2.4p0"
97
* Interface defines for all options. Replace "n" with the UPPER_CASED
98
* option name (as in the teOptIndex enumeration above).
99
* e.g. HAVE_OPT( IPV4 )
101
#define DESC(n) ntpdOptions.pOptDesc[INDEX_OPT_ ## n]
102
#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
103
#define OPT_ARG(n) (DESC(n).optArg.argString)
104
#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
105
#define COUNT_OPT(n) (DESC(n).optOccCt)
106
#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
107
#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
108
#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
109
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
110
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
111
#define CLEAR_OPT(n) STMTS( \
112
DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
113
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
114
DESC(n).fOptState |= OPTST_DISABLED; \
115
DESC(n).optCookie = NULL )
118
* Make sure there are no #define name conflicts with the option names
120
#ifndef NO_OPTION_NAME_WARNINGS
122
# warning undefining IPV4 due to option name conflict
126
# warning undefining IPV6 due to option name conflict
130
# warning undefining AUTHREQ due to option name conflict
134
# warning undefining AUTHNOREQ due to option name conflict
138
# warning undefining BCASTSYNC due to option name conflict
142
# warning undefining CONFIGFILE due to option name conflict
146
# warning undefining DEBUG_LEVEL due to option name conflict
149
# ifdef SET_DEBUG_LEVEL
150
# warning undefining SET_DEBUG_LEVEL due to option name conflict
151
# undef SET_DEBUG_LEVEL
154
# warning undefining DRIFTFILE due to option name conflict
158
# warning undefining PANICGATE due to option name conflict
162
# warning undefining JAILDIR due to option name conflict
166
# warning undefining INTERFACE due to option name conflict
170
# warning undefining KEYFILE due to option name conflict
174
# warning undefining LOGFILE due to option name conflict
178
# warning undefining NOVIRTUALIPS due to option name conflict
181
# ifdef MODIFYMMTIMER
182
# warning undefining MODIFYMMTIMER due to option name conflict
183
# undef MODIFYMMTIMER
186
# warning undefining NOFORK due to option name conflict
190
# warning undefining NICE due to option name conflict
194
# warning undefining PIDFILE due to option name conflict
198
# warning undefining PRIORITY due to option name conflict
202
# warning undefining QUIT due to option name conflict
205
# ifdef PROPAGATIONDELAY
206
# warning undefining PROPAGATIONDELAY due to option name conflict
207
# undef PROPAGATIONDELAY
209
# ifdef UPDATEINTERVAL
210
# warning undefining UPDATEINTERVAL due to option name conflict
211
# undef UPDATEINTERVAL
214
# warning undefining STATSDIR due to option name conflict
218
# warning undefining TRUSTEDKEY due to option name conflict
222
# warning undefining USER due to option name conflict
226
# warning undefining VAR due to option name conflict
230
# warning undefining DVAR due to option name conflict
234
# warning undefining SLEW due to option name conflict
237
#else /* NO_OPTION_NAME_WARNINGS */
245
# undef SET_DEBUG_LEVEL
253
# undef MODIFYMMTIMER
259
# undef PROPAGATIONDELAY
260
# undef UPDATEINTERVAL
267
#endif /* NO_OPTION_NAME_WARNINGS */
270
* Interface defines for specific options.
272
#define VALUE_OPT_IPV4 '4'
273
#define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
274
#define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
275
#define VALUE_OPT_IPV6 '6'
276
#define VALUE_OPT_AUTHREQ 'a'
277
#define VALUE_OPT_AUTHNOREQ 'A'
278
#define VALUE_OPT_BCASTSYNC 'b'
279
#define VALUE_OPT_CONFIGFILE 'c'
281
#define VALUE_OPT_DEBUG_LEVEL 'd'
284
#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
286
#define VALUE_OPT_DRIFTFILE 'f'
287
#define VALUE_OPT_PANICGATE 'g'
288
#define VALUE_OPT_JAILDIR 'i'
289
#define VALUE_OPT_INTERFACE 'I'
290
#define VALUE_OPT_KEYFILE 'k'
291
#define VALUE_OPT_LOGFILE 'l'
292
#define VALUE_OPT_NOVIRTUALIPS 'L'
294
#define VALUE_OPT_MODIFYMMTIMER 'M'
295
#endif /* SYS_WINNT */
296
#define VALUE_OPT_NOFORK 'n'
297
#define VALUE_OPT_NICE 'N'
298
#define VALUE_OPT_PIDFILE 'p'
299
#define VALUE_OPT_PRIORITY 'P'
300
#define OPT_VALUE_PRIORITY (DESC(PRIORITY).optArg.argInt)
301
#define VALUE_OPT_QUIT 'q'
302
#define VALUE_OPT_PROPAGATIONDELAY 'r'
303
#define VALUE_OPT_UPDATEINTERVAL 'U'
304
#define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
305
#define VALUE_OPT_STATSDIR 's'
306
#define VALUE_OPT_TRUSTEDKEY 't'
307
#define VALUE_OPT_USER 'u'
308
#define VALUE_OPT_VAR 'v'
309
#define VALUE_OPT_DVAR 'V'
310
#define VALUE_OPT_SLEW 'x'
312
#define VALUE_OPT_VERSION 'v'
313
#define VALUE_OPT_SAVE_OPTS '>'
314
#define VALUE_OPT_LOAD_OPTS '<'
315
#define VALUE_OPT_HELP '?'
316
#define VALUE_OPT_MORE_HELP '!'
317
#define SET_OPT_SAVE_OPTS(a) STMTS( \
318
DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
319
DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
320
DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
322
* Interface defines not associated with particular options
324
#define ERRSKIP_OPTERR STMTS( ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP )
325
#define ERRSTOP_OPTERR STMTS( ntpdOptions.fOptSet |= OPTPROC_ERRSTOP )
326
#define RESTART_OPT(n) STMTS( \
327
ntpdOptions.curOptIdx = (n); \
328
ntpdOptions.pzCurOpt = NULL )
329
#define START_OPT RESTART_OPT(1)
330
#define USAGE(c) (*ntpdOptions.pUsageProc)( &ntpdOptions, c )
331
/* extracted from opthead near line 312 */
335
* Declare the ntpd option descriptor.
341
extern tOptions ntpdOptions;
346
static inline char* aoGetsText( char const* pz ) {
347
if (pz == NULL) return NULL;
348
return (char*)gettext( pz );
350
# define _(s) aoGetsText(s)
351
# else /* ENABLE_NLS */
353
# endif /* ENABLE_NLS */
359
#endif /* AUTOOPTS_NTPD_OPTS_H_GUARD */
363
* c-file-style: "stroustrup"
364
* indent-tabs-mode: nil
366
* options.h ends here */