Sync usage with man page.
[netbsd-mini2440.git] / dist / ntp / ntpd / ntpd-opts.h
blob24d95e3cd361f6d0757b9a31d42b35e87535d4bf
1 /* $NetBSD$ */
3 /*
4 * EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
5 *
6 * It has been AutoGen-ed Tuesday December 8, 2009 at 08:13:09 AM EST
7 * From the definitions ntpd-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 * ntpd 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 * ntpd 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 ntpd 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_NTPD_OPTS_H_GUARD
35 #define AUTOOPTS_NTPD_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_IPV4 = 0,
58 INDEX_OPT_IPV6 = 1,
59 INDEX_OPT_AUTHREQ = 2,
60 INDEX_OPT_AUTHNOREQ = 3,
61 INDEX_OPT_BCASTSYNC = 4,
62 INDEX_OPT_CONFIGFILE = 5,
63 INDEX_OPT_DEBUG_LEVEL = 6,
64 INDEX_OPT_SET_DEBUG_LEVEL = 7,
65 INDEX_OPT_DRIFTFILE = 8,
66 INDEX_OPT_PANICGATE = 9,
67 INDEX_OPT_JAILDIR = 10,
68 INDEX_OPT_INTERFACE = 11,
69 INDEX_OPT_KEYFILE = 12,
70 INDEX_OPT_LOGFILE = 13,
71 INDEX_OPT_NOVIRTUALIPS = 14,
72 INDEX_OPT_MODIFYMMTIMER = 15,
73 INDEX_OPT_NOFORK = 16,
74 INDEX_OPT_NICE = 17,
75 INDEX_OPT_PIDFILE = 18,
76 INDEX_OPT_PRIORITY = 19,
77 INDEX_OPT_QUIT = 20,
78 INDEX_OPT_PROPAGATIONDELAY = 21,
79 INDEX_OPT_UPDATEINTERVAL = 22,
80 INDEX_OPT_STATSDIR = 23,
81 INDEX_OPT_TRUSTEDKEY = 24,
82 INDEX_OPT_USER = 25,
83 INDEX_OPT_VAR = 26,
84 INDEX_OPT_DVAR = 27,
85 INDEX_OPT_SLEW = 28,
86 INDEX_OPT_VERSION = 29,
87 INDEX_OPT_HELP = 30,
88 INDEX_OPT_MORE_HELP = 31
89 } teOptIndex;
91 #define OPTION_CT 32
92 #define NTPD_VERSION "4.2.4p8"
93 #define NTPD_FULL_VERSION "ntpd - NTP daemon program - Ver. 4.2.4p8"
96 * Interface defines for all options. Replace "n" with the UPPER_CASED
97 * option name (as in the teOptIndex enumeration above).
98 * e.g. HAVE_OPT( IPV4 )
100 #define DESC(n) (ntpdOptions.pOptDesc[INDEX_OPT_## n])
101 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
102 #define OPT_ARG(n) (DESC(n).optArg.argString)
103 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
104 #define COUNT_OPT(n) (DESC(n).optOccCt)
105 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
106 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
107 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
108 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
109 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
110 #define CLEAR_OPT(n) STMTS( \
111 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
112 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
113 DESC(n).fOptState |= OPTST_DISABLED; \
114 DESC(n).optCookie = NULL )
117 * Make sure there are no #define name conflicts with the option names
119 #ifndef NO_OPTION_NAME_WARNINGS
120 # ifdef IPV4
121 # warning undefining IPV4 due to option name conflict
122 # undef IPV4
123 # endif
124 # ifdef IPV6
125 # warning undefining IPV6 due to option name conflict
126 # undef IPV6
127 # endif
128 # ifdef AUTHREQ
129 # warning undefining AUTHREQ due to option name conflict
130 # undef AUTHREQ
131 # endif
132 # ifdef AUTHNOREQ
133 # warning undefining AUTHNOREQ due to option name conflict
134 # undef AUTHNOREQ
135 # endif
136 # ifdef BCASTSYNC
137 # warning undefining BCASTSYNC due to option name conflict
138 # undef BCASTSYNC
139 # endif
140 # ifdef CONFIGFILE
141 # warning undefining CONFIGFILE due to option name conflict
142 # undef CONFIGFILE
143 # endif
144 # ifdef DEBUG_LEVEL
145 # warning undefining DEBUG_LEVEL due to option name conflict
146 # undef DEBUG_LEVEL
147 # endif
148 # ifdef SET_DEBUG_LEVEL
149 # warning undefining SET_DEBUG_LEVEL due to option name conflict
150 # undef SET_DEBUG_LEVEL
151 # endif
152 # ifdef DRIFTFILE
153 # warning undefining DRIFTFILE due to option name conflict
154 # undef DRIFTFILE
155 # endif
156 # ifdef PANICGATE
157 # warning undefining PANICGATE due to option name conflict
158 # undef PANICGATE
159 # endif
160 # ifdef JAILDIR
161 # warning undefining JAILDIR due to option name conflict
162 # undef JAILDIR
163 # endif
164 # ifdef INTERFACE
165 # warning undefining INTERFACE due to option name conflict
166 # undef INTERFACE
167 # endif
168 # ifdef KEYFILE
169 # warning undefining KEYFILE due to option name conflict
170 # undef KEYFILE
171 # endif
172 # ifdef LOGFILE
173 # warning undefining LOGFILE due to option name conflict
174 # undef LOGFILE
175 # endif
176 # ifdef NOVIRTUALIPS
177 # warning undefining NOVIRTUALIPS due to option name conflict
178 # undef NOVIRTUALIPS
179 # endif
180 # ifdef MODIFYMMTIMER
181 # warning undefining MODIFYMMTIMER due to option name conflict
182 # undef MODIFYMMTIMER
183 # endif
184 # ifdef NOFORK
185 # warning undefining NOFORK due to option name conflict
186 # undef NOFORK
187 # endif
188 # ifdef NICE
189 # warning undefining NICE due to option name conflict
190 # undef NICE
191 # endif
192 # ifdef PIDFILE
193 # warning undefining PIDFILE due to option name conflict
194 # undef PIDFILE
195 # endif
196 # ifdef PRIORITY
197 # warning undefining PRIORITY due to option name conflict
198 # undef PRIORITY
199 # endif
200 # ifdef QUIT
201 # warning undefining QUIT due to option name conflict
202 # undef QUIT
203 # endif
204 # ifdef PROPAGATIONDELAY
205 # warning undefining PROPAGATIONDELAY due to option name conflict
206 # undef PROPAGATIONDELAY
207 # endif
208 # ifdef UPDATEINTERVAL
209 # warning undefining UPDATEINTERVAL due to option name conflict
210 # undef UPDATEINTERVAL
211 # endif
212 # ifdef STATSDIR
213 # warning undefining STATSDIR due to option name conflict
214 # undef STATSDIR
215 # endif
216 # ifdef TRUSTEDKEY
217 # warning undefining TRUSTEDKEY due to option name conflict
218 # undef TRUSTEDKEY
219 # endif
220 # ifdef USER
221 # warning undefining USER due to option name conflict
222 # undef USER
223 # endif
224 # ifdef VAR
225 # warning undefining VAR due to option name conflict
226 # undef VAR
227 # endif
228 # ifdef DVAR
229 # warning undefining DVAR due to option name conflict
230 # undef DVAR
231 # endif
232 # ifdef SLEW
233 # warning undefining SLEW due to option name conflict
234 # undef SLEW
235 # endif
236 #else /* NO_OPTION_NAME_WARNINGS */
237 # undef IPV4
238 # undef IPV6
239 # undef AUTHREQ
240 # undef AUTHNOREQ
241 # undef BCASTSYNC
242 # undef CONFIGFILE
243 # undef DEBUG_LEVEL
244 # undef SET_DEBUG_LEVEL
245 # undef DRIFTFILE
246 # undef PANICGATE
247 # undef JAILDIR
248 # undef INTERFACE
249 # undef KEYFILE
250 # undef LOGFILE
251 # undef NOVIRTUALIPS
252 # undef MODIFYMMTIMER
253 # undef NOFORK
254 # undef NICE
255 # undef PIDFILE
256 # undef PRIORITY
257 # undef QUIT
258 # undef PROPAGATIONDELAY
259 # undef UPDATEINTERVAL
260 # undef STATSDIR
261 # undef TRUSTEDKEY
262 # undef USER
263 # undef VAR
264 # undef DVAR
265 # undef SLEW
266 #endif /* NO_OPTION_NAME_WARNINGS */
269 * Interface defines for specific options.
271 #define VALUE_OPT_IPV4 '4'
272 #define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
273 #define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
274 #define VALUE_OPT_IPV6 '6'
275 #define VALUE_OPT_AUTHREQ 'a'
276 #define VALUE_OPT_AUTHNOREQ 'A'
277 #define VALUE_OPT_BCASTSYNC 'b'
278 #define VALUE_OPT_CONFIGFILE 'c'
279 #ifdef DEBUG
280 #define VALUE_OPT_DEBUG_LEVEL 'd'
281 #endif /* DEBUG */
282 #ifdef DEBUG
283 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
284 #endif /* DEBUG */
285 #define VALUE_OPT_DRIFTFILE 'f'
286 #define VALUE_OPT_PANICGATE 'g'
287 #define VALUE_OPT_JAILDIR 'i'
288 #define VALUE_OPT_INTERFACE 'I'
289 #define VALUE_OPT_KEYFILE 'k'
290 #define VALUE_OPT_LOGFILE 'l'
291 #define VALUE_OPT_NOVIRTUALIPS 'L'
292 #ifdef SYS_WINNT
293 #define VALUE_OPT_MODIFYMMTIMER 'M'
294 #endif /* SYS_WINNT */
295 #define VALUE_OPT_NOFORK 'n'
296 #define VALUE_OPT_NICE 'N'
297 #define VALUE_OPT_PIDFILE 'p'
298 #define VALUE_OPT_PRIORITY 'P'
299 #define OPT_VALUE_PRIORITY (DESC(PRIORITY).optArg.argInt)
300 #define VALUE_OPT_QUIT 'q'
301 #define VALUE_OPT_PROPAGATIONDELAY 'r'
302 #define VALUE_OPT_UPDATEINTERVAL 'U'
303 #define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
304 #define VALUE_OPT_STATSDIR 's'
305 #define VALUE_OPT_TRUSTEDKEY 't'
306 #define VALUE_OPT_USER 'u'
307 #define VALUE_OPT_VAR 'v'
308 #define VALUE_OPT_DVAR 'V'
309 #define VALUE_OPT_SLEW 'x'
311 #define VALUE_OPT_VERSION 'v'
312 #define VALUE_OPT_HELP '?'
313 #define VALUE_OPT_MORE_HELP '!'
315 * Interface defines not associated with particular options
317 #define ERRSKIP_OPTERR STMTS( ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP )
318 #define ERRSTOP_OPTERR STMTS( ntpdOptions.fOptSet |= OPTPROC_ERRSTOP )
319 #define RESTART_OPT(n) STMTS( \
320 ntpdOptions.curOptIdx = (n); \
321 ntpdOptions.pzCurOpt = NULL )
322 #define START_OPT RESTART_OPT(1)
323 #define USAGE(c) (*ntpdOptions.pUsageProc)( &ntpdOptions, c )
324 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/opthead.tpl near line 360 */
326 /* * * * * *
328 * Declare the ntpd option descriptor.
330 #ifdef __cplusplus
331 extern "C" {
332 #endif
334 extern tOptions ntpdOptions;
336 #ifndef _
337 # if ENABLE_NLS
338 # include <stdio.h>
339 static inline char* aoGetsText( char const* pz ) {
340 if (pz == NULL) return NULL;
341 return (char*)gettext( pz );
343 # define _(s) aoGetsText(s)
344 # else /* ENABLE_NLS */
345 # define _(s) s
346 # endif /* ENABLE_NLS */
347 #endif
349 #ifdef __cplusplus
351 #endif
352 #endif /* AUTOOPTS_NTPD_OPTS_H_GUARD */
353 /* ntpd-opts.h ends here */