Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / ntpd / ntpdsim-opts.h
blobe3b7bbe5eb32db520f7d2db3c717921f2fb9563b
1 /* $NetBSD$ */
3 /*
4 * EDIT THIS FILE WITH CAUTION (ntpdsim-opts.h)
5 *
6 * It has been AutoGen-ed Tuesday December 8, 2009 at 08:13:12 AM EST
7 * From the definitions ntpdsim-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 * ntpdsim 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 * ntpdsim 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 ntpdsim 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_NTPDSIM_OPTS_H_GUARD
35 #define AUTOOPTS_NTPDSIM_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_SIMBROADCASTDELAY = 5,
63 INDEX_OPT_CONFIGFILE = 6,
64 INDEX_OPT_PHASENOISE = 7,
65 INDEX_OPT_DEBUG_LEVEL = 8,
66 INDEX_OPT_SET_DEBUG_LEVEL = 9,
67 INDEX_OPT_DRIFTFILE = 10,
68 INDEX_OPT_PANICGATE = 11,
69 INDEX_OPT_SIMSLEW = 12,
70 INDEX_OPT_JAILDIR = 13,
71 INDEX_OPT_INTERFACE = 14,
72 INDEX_OPT_KEYFILE = 15,
73 INDEX_OPT_LOGFILE = 16,
74 INDEX_OPT_NOVIRTUALIPS = 17,
75 INDEX_OPT_MODIFYMMTIMER = 18,
76 INDEX_OPT_NOFORK = 19,
77 INDEX_OPT_NICE = 20,
78 INDEX_OPT_SERVERTIME = 21,
79 INDEX_OPT_PIDFILE = 22,
80 INDEX_OPT_PRIORITY = 23,
81 INDEX_OPT_QUIT = 24,
82 INDEX_OPT_PROPAGATIONDELAY = 25,
83 INDEX_OPT_UPDATEINTERVAL = 26,
84 INDEX_OPT_STATSDIR = 27,
85 INDEX_OPT_ENDSIMTIME = 28,
86 INDEX_OPT_TRUSTEDKEY = 29,
87 INDEX_OPT_FREQERR = 30,
88 INDEX_OPT_WALKNOISE = 31,
89 INDEX_OPT_USER = 32,
90 INDEX_OPT_VAR = 33,
91 INDEX_OPT_DVAR = 34,
92 INDEX_OPT_SLEW = 35,
93 INDEX_OPT_NDELAY = 36,
94 INDEX_OPT_PDELAY = 37,
95 INDEX_OPT_VERSION = 38,
96 INDEX_OPT_HELP = 39,
97 INDEX_OPT_MORE_HELP = 40,
98 INDEX_OPT_SAVE_OPTS = 41,
99 INDEX_OPT_LOAD_OPTS = 42
100 } teOptIndex;
102 #define OPTION_CT 43
103 #define NTPDSIM_VERSION "4.2.4p8"
104 #define NTPDSIM_FULL_VERSION "ntpdsim - NTP daemon simulation program - Ver. 4.2.4p8"
107 * Interface defines for all options. Replace "n" with the UPPER_CASED
108 * option name (as in the teOptIndex enumeration above).
109 * e.g. HAVE_OPT( IPV4 )
111 #define DESC(n) (ntpdsimOptions.pOptDesc[INDEX_OPT_## n])
112 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
113 #define OPT_ARG(n) (DESC(n).optArg.argString)
114 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
115 #define COUNT_OPT(n) (DESC(n).optOccCt)
116 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
117 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
118 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
119 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
120 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
121 #define CLEAR_OPT(n) STMTS( \
122 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
123 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
124 DESC(n).fOptState |= OPTST_DISABLED; \
125 DESC(n).optCookie = NULL )
128 * Make sure there are no #define name conflicts with the option names
130 #ifndef NO_OPTION_NAME_WARNINGS
131 # ifdef IPV4
132 # warning undefining IPV4 due to option name conflict
133 # undef IPV4
134 # endif
135 # ifdef IPV6
136 # warning undefining IPV6 due to option name conflict
137 # undef IPV6
138 # endif
139 # ifdef AUTHREQ
140 # warning undefining AUTHREQ due to option name conflict
141 # undef AUTHREQ
142 # endif
143 # ifdef AUTHNOREQ
144 # warning undefining AUTHNOREQ due to option name conflict
145 # undef AUTHNOREQ
146 # endif
147 # ifdef BCASTSYNC
148 # warning undefining BCASTSYNC due to option name conflict
149 # undef BCASTSYNC
150 # endif
151 # ifdef SIMBROADCASTDELAY
152 # warning undefining SIMBROADCASTDELAY due to option name conflict
153 # undef SIMBROADCASTDELAY
154 # endif
155 # ifdef CONFIGFILE
156 # warning undefining CONFIGFILE due to option name conflict
157 # undef CONFIGFILE
158 # endif
159 # ifdef PHASENOISE
160 # warning undefining PHASENOISE due to option name conflict
161 # undef PHASENOISE
162 # endif
163 # ifdef DEBUG_LEVEL
164 # warning undefining DEBUG_LEVEL due to option name conflict
165 # undef DEBUG_LEVEL
166 # endif
167 # ifdef SET_DEBUG_LEVEL
168 # warning undefining SET_DEBUG_LEVEL due to option name conflict
169 # undef SET_DEBUG_LEVEL
170 # endif
171 # ifdef DRIFTFILE
172 # warning undefining DRIFTFILE due to option name conflict
173 # undef DRIFTFILE
174 # endif
175 # ifdef PANICGATE
176 # warning undefining PANICGATE due to option name conflict
177 # undef PANICGATE
178 # endif
179 # ifdef SIMSLEW
180 # warning undefining SIMSLEW due to option name conflict
181 # undef SIMSLEW
182 # endif
183 # ifdef JAILDIR
184 # warning undefining JAILDIR due to option name conflict
185 # undef JAILDIR
186 # endif
187 # ifdef INTERFACE
188 # warning undefining INTERFACE due to option name conflict
189 # undef INTERFACE
190 # endif
191 # ifdef KEYFILE
192 # warning undefining KEYFILE due to option name conflict
193 # undef KEYFILE
194 # endif
195 # ifdef LOGFILE
196 # warning undefining LOGFILE due to option name conflict
197 # undef LOGFILE
198 # endif
199 # ifdef NOVIRTUALIPS
200 # warning undefining NOVIRTUALIPS due to option name conflict
201 # undef NOVIRTUALIPS
202 # endif
203 # ifdef MODIFYMMTIMER
204 # warning undefining MODIFYMMTIMER due to option name conflict
205 # undef MODIFYMMTIMER
206 # endif
207 # ifdef NOFORK
208 # warning undefining NOFORK due to option name conflict
209 # undef NOFORK
210 # endif
211 # ifdef NICE
212 # warning undefining NICE due to option name conflict
213 # undef NICE
214 # endif
215 # ifdef SERVERTIME
216 # warning undefining SERVERTIME due to option name conflict
217 # undef SERVERTIME
218 # endif
219 # ifdef PIDFILE
220 # warning undefining PIDFILE due to option name conflict
221 # undef PIDFILE
222 # endif
223 # ifdef PRIORITY
224 # warning undefining PRIORITY due to option name conflict
225 # undef PRIORITY
226 # endif
227 # ifdef QUIT
228 # warning undefining QUIT due to option name conflict
229 # undef QUIT
230 # endif
231 # ifdef PROPAGATIONDELAY
232 # warning undefining PROPAGATIONDELAY due to option name conflict
233 # undef PROPAGATIONDELAY
234 # endif
235 # ifdef UPDATEINTERVAL
236 # warning undefining UPDATEINTERVAL due to option name conflict
237 # undef UPDATEINTERVAL
238 # endif
239 # ifdef STATSDIR
240 # warning undefining STATSDIR due to option name conflict
241 # undef STATSDIR
242 # endif
243 # ifdef ENDSIMTIME
244 # warning undefining ENDSIMTIME due to option name conflict
245 # undef ENDSIMTIME
246 # endif
247 # ifdef TRUSTEDKEY
248 # warning undefining TRUSTEDKEY due to option name conflict
249 # undef TRUSTEDKEY
250 # endif
251 # ifdef FREQERR
252 # warning undefining FREQERR due to option name conflict
253 # undef FREQERR
254 # endif
255 # ifdef WALKNOISE
256 # warning undefining WALKNOISE due to option name conflict
257 # undef WALKNOISE
258 # endif
259 # ifdef USER
260 # warning undefining USER due to option name conflict
261 # undef USER
262 # endif
263 # ifdef VAR
264 # warning undefining VAR due to option name conflict
265 # undef VAR
266 # endif
267 # ifdef DVAR
268 # warning undefining DVAR due to option name conflict
269 # undef DVAR
270 # endif
271 # ifdef SLEW
272 # warning undefining SLEW due to option name conflict
273 # undef SLEW
274 # endif
275 # ifdef NDELAY
276 # warning undefining NDELAY due to option name conflict
277 # undef NDELAY
278 # endif
279 # ifdef PDELAY
280 # warning undefining PDELAY due to option name conflict
281 # undef PDELAY
282 # endif
283 #else /* NO_OPTION_NAME_WARNINGS */
284 # undef IPV4
285 # undef IPV6
286 # undef AUTHREQ
287 # undef AUTHNOREQ
288 # undef BCASTSYNC
289 # undef SIMBROADCASTDELAY
290 # undef CONFIGFILE
291 # undef PHASENOISE
292 # undef DEBUG_LEVEL
293 # undef SET_DEBUG_LEVEL
294 # undef DRIFTFILE
295 # undef PANICGATE
296 # undef SIMSLEW
297 # undef JAILDIR
298 # undef INTERFACE
299 # undef KEYFILE
300 # undef LOGFILE
301 # undef NOVIRTUALIPS
302 # undef MODIFYMMTIMER
303 # undef NOFORK
304 # undef NICE
305 # undef SERVERTIME
306 # undef PIDFILE
307 # undef PRIORITY
308 # undef QUIT
309 # undef PROPAGATIONDELAY
310 # undef UPDATEINTERVAL
311 # undef STATSDIR
312 # undef ENDSIMTIME
313 # undef TRUSTEDKEY
314 # undef FREQERR
315 # undef WALKNOISE
316 # undef USER
317 # undef VAR
318 # undef DVAR
319 # undef SLEW
320 # undef NDELAY
321 # undef PDELAY
322 #endif /* NO_OPTION_NAME_WARNINGS */
325 * Interface defines for specific options.
327 #define VALUE_OPT_IPV4 '4'
328 #define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
329 #define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
330 #define VALUE_OPT_IPV6 '6'
331 #define VALUE_OPT_AUTHREQ 'a'
332 #define VALUE_OPT_AUTHNOREQ 'A'
333 #define VALUE_OPT_BCASTSYNC 'b'
334 #define VALUE_OPT_SIMBROADCASTDELAY 'B'
335 #define VALUE_OPT_CONFIGFILE 'c'
336 #define VALUE_OPT_PHASENOISE 'C'
337 #ifdef DEBUG
338 #define VALUE_OPT_DEBUG_LEVEL 'd'
339 #endif /* DEBUG */
340 #ifdef DEBUG
341 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
342 #endif /* DEBUG */
343 #define VALUE_OPT_DRIFTFILE 'f'
344 #define VALUE_OPT_PANICGATE 'g'
345 #define VALUE_OPT_SIMSLEW 'H'
346 #define VALUE_OPT_JAILDIR 'i'
347 #define VALUE_OPT_INTERFACE 'I'
348 #define VALUE_OPT_KEYFILE 'k'
349 #define VALUE_OPT_LOGFILE 'l'
350 #define VALUE_OPT_NOVIRTUALIPS 'L'
351 #ifdef SYS_WINNT
352 #define VALUE_OPT_MODIFYMMTIMER 'M'
353 #endif /* SYS_WINNT */
354 #define VALUE_OPT_NOFORK 'n'
355 #define VALUE_OPT_NICE 'N'
356 #define VALUE_OPT_SERVERTIME 'O'
357 #define VALUE_OPT_PIDFILE 'p'
358 #define VALUE_OPT_PRIORITY 'P'
359 #define OPT_VALUE_PRIORITY (DESC(PRIORITY).optArg.argInt)
360 #define VALUE_OPT_QUIT 'q'
361 #define VALUE_OPT_PROPAGATIONDELAY 'r'
362 #define VALUE_OPT_UPDATEINTERVAL 'U'
363 #define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
364 #define VALUE_OPT_STATSDIR 's'
365 #define VALUE_OPT_ENDSIMTIME 'S'
366 #define VALUE_OPT_TRUSTEDKEY 't'
367 #define VALUE_OPT_FREQERR 'T'
368 #define VALUE_OPT_WALKNOISE 'W'
369 #define VALUE_OPT_USER 'u'
370 #define VALUE_OPT_VAR 'v'
371 #define VALUE_OPT_DVAR 'V'
372 #define VALUE_OPT_SLEW 'x'
373 #define VALUE_OPT_NDELAY 'Y'
374 #define VALUE_OPT_PDELAY 'Z'
376 #define VALUE_OPT_VERSION 'v'
377 #define VALUE_OPT_HELP '?'
378 #define VALUE_OPT_MORE_HELP '!'
379 #define VALUE_OPT_SAVE_OPTS '>'
380 #define VALUE_OPT_LOAD_OPTS '<'
381 #define SET_OPT_SAVE_OPTS(a) STMTS( \
382 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
383 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
384 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
386 * Interface defines not associated with particular options
388 #define ERRSKIP_OPTERR STMTS( ntpdsimOptions.fOptSet &= ~OPTPROC_ERRSTOP )
389 #define ERRSTOP_OPTERR STMTS( ntpdsimOptions.fOptSet |= OPTPROC_ERRSTOP )
390 #define RESTART_OPT(n) STMTS( \
391 ntpdsimOptions.curOptIdx = (n); \
392 ntpdsimOptions.pzCurOpt = NULL )
393 #define START_OPT RESTART_OPT(1)
394 #define USAGE(c) (*ntpdsimOptions.pUsageProc)( &ntpdsimOptions, c )
395 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/opthead.tpl near line 360 */
397 /* * * * * *
399 * Declare the ntpdsim option descriptor.
401 #ifdef __cplusplus
402 extern "C" {
403 #endif
405 extern tOptions ntpdsimOptions;
407 #ifndef _
408 # if ENABLE_NLS
409 # include <stdio.h>
410 static inline char* aoGetsText( char const* pz ) {
411 if (pz == NULL) return NULL;
412 return (char*)gettext( pz );
414 # define _(s) aoGetsText(s)
415 # else /* ENABLE_NLS */
416 # define _(s) s
417 # endif /* ENABLE_NLS */
418 #endif
420 #ifdef __cplusplus
422 #endif
423 #endif /* AUTOOPTS_NTPDSIM_OPTS_H_GUARD */
424 /* ntpdsim-opts.h ends here */