]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ntp/ntpd/ntpdsim-opts.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ntp / ntpd / ntpdsim-opts.h
1 /*  
2  *  EDIT THIS FILE WITH CAUTION  (ntpdsim-opts.h)
3  *  
4  *  It has been AutoGen-ed  Tuesday December  8, 2009 at 08:13:12 AM EST
5  *  From the definitions    ntpdsim-opts.def
6  *  and the template file   options
7  *
8  * Generated from AutoOpts 29:0:4 templates.
9  */
10
11 /*
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.
19  *
20  * This source file is copyrighted and licensed under the following terms:
21  *
22  * ntpdsim copyright 1970-2009 David L. Mills and/or others - all rights reserved
23  *
24  * see html/copyright.html
25  */
26 /*
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.
31  */
32 #ifndef AUTOOPTS_NTPDSIM_OPTS_H_GUARD
33 #define AUTOOPTS_NTPDSIM_OPTS_H_GUARD
34 #include "config.h"
35 #include <autoopts/options.h>
36
37 /*
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.
43  */
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
48   Choke Me.
49 #endif
50
51 /*
52  *  Enumeration of each option:
53  */
54 typedef enum {
55         INDEX_OPT_IPV4             =  0,
56         INDEX_OPT_IPV6             =  1,
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,
75         INDEX_OPT_NICE             = 20,
76         INDEX_OPT_SERVERTIME       = 21,
77         INDEX_OPT_PIDFILE          = 22,
78         INDEX_OPT_PRIORITY         = 23,
79         INDEX_OPT_QUIT             = 24,
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,
87         INDEX_OPT_USER             = 32,
88         INDEX_OPT_VAR              = 33,
89         INDEX_OPT_DVAR             = 34,
90         INDEX_OPT_SLEW             = 35,
91         INDEX_OPT_NDELAY           = 36,
92         INDEX_OPT_PDELAY           = 37,
93         INDEX_OPT_VERSION          = 38,
94         INDEX_OPT_HELP             = 39,
95         INDEX_OPT_MORE_HELP        = 40,
96         INDEX_OPT_SAVE_OPTS        = 41,
97         INDEX_OPT_LOAD_OPTS        = 42
98 } teOptIndex;
99
100 #define OPTION_CT    43
101 #define NTPDSIM_VERSION       "4.2.4p8"
102 #define NTPDSIM_FULL_VERSION  "ntpdsim - NTP daemon simulation program - Ver. 4.2.4p8"
103
104 /*
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 )
108  */
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 )
124
125 /*
126  *  Make sure there are no #define name conflicts with the option names
127  */
128 #ifndef     NO_OPTION_NAME_WARNINGS
129 # ifdef    IPV4
130 #  warning undefining IPV4 due to option name conflict
131 #  undef   IPV4
132 # endif
133 # ifdef    IPV6
134 #  warning undefining IPV6 due to option name conflict
135 #  undef   IPV6
136 # endif
137 # ifdef    AUTHREQ
138 #  warning undefining AUTHREQ due to option name conflict
139 #  undef   AUTHREQ
140 # endif
141 # ifdef    AUTHNOREQ
142 #  warning undefining AUTHNOREQ due to option name conflict
143 #  undef   AUTHNOREQ
144 # endif
145 # ifdef    BCASTSYNC
146 #  warning undefining BCASTSYNC due to option name conflict
147 #  undef   BCASTSYNC
148 # endif
149 # ifdef    SIMBROADCASTDELAY
150 #  warning undefining SIMBROADCASTDELAY due to option name conflict
151 #  undef   SIMBROADCASTDELAY
152 # endif
153 # ifdef    CONFIGFILE
154 #  warning undefining CONFIGFILE due to option name conflict
155 #  undef   CONFIGFILE
156 # endif
157 # ifdef    PHASENOISE
158 #  warning undefining PHASENOISE due to option name conflict
159 #  undef   PHASENOISE
160 # endif
161 # ifdef    DEBUG_LEVEL
162 #  warning undefining DEBUG_LEVEL due to option name conflict
163 #  undef   DEBUG_LEVEL
164 # endif
165 # ifdef    SET_DEBUG_LEVEL
166 #  warning undefining SET_DEBUG_LEVEL due to option name conflict
167 #  undef   SET_DEBUG_LEVEL
168 # endif
169 # ifdef    DRIFTFILE
170 #  warning undefining DRIFTFILE due to option name conflict
171 #  undef   DRIFTFILE
172 # endif
173 # ifdef    PANICGATE
174 #  warning undefining PANICGATE due to option name conflict
175 #  undef   PANICGATE
176 # endif
177 # ifdef    SIMSLEW
178 #  warning undefining SIMSLEW due to option name conflict
179 #  undef   SIMSLEW
180 # endif
181 # ifdef    JAILDIR
182 #  warning undefining JAILDIR due to option name conflict
183 #  undef   JAILDIR
184 # endif
185 # ifdef    INTERFACE
186 #  warning undefining INTERFACE due to option name conflict
187 #  undef   INTERFACE
188 # endif
189 # ifdef    KEYFILE
190 #  warning undefining KEYFILE due to option name conflict
191 #  undef   KEYFILE
192 # endif
193 # ifdef    LOGFILE
194 #  warning undefining LOGFILE due to option name conflict
195 #  undef   LOGFILE
196 # endif
197 # ifdef    NOVIRTUALIPS
198 #  warning undefining NOVIRTUALIPS due to option name conflict
199 #  undef   NOVIRTUALIPS
200 # endif
201 # ifdef    MODIFYMMTIMER
202 #  warning undefining MODIFYMMTIMER due to option name conflict
203 #  undef   MODIFYMMTIMER
204 # endif
205 # ifdef    NOFORK
206 #  warning undefining NOFORK due to option name conflict
207 #  undef   NOFORK
208 # endif
209 # ifdef    NICE
210 #  warning undefining NICE due to option name conflict
211 #  undef   NICE
212 # endif
213 # ifdef    SERVERTIME
214 #  warning undefining SERVERTIME due to option name conflict
215 #  undef   SERVERTIME
216 # endif
217 # ifdef    PIDFILE
218 #  warning undefining PIDFILE due to option name conflict
219 #  undef   PIDFILE
220 # endif
221 # ifdef    PRIORITY
222 #  warning undefining PRIORITY due to option name conflict
223 #  undef   PRIORITY
224 # endif
225 # ifdef    QUIT
226 #  warning undefining QUIT due to option name conflict
227 #  undef   QUIT
228 # endif
229 # ifdef    PROPAGATIONDELAY
230 #  warning undefining PROPAGATIONDELAY due to option name conflict
231 #  undef   PROPAGATIONDELAY
232 # endif
233 # ifdef    UPDATEINTERVAL
234 #  warning undefining UPDATEINTERVAL due to option name conflict
235 #  undef   UPDATEINTERVAL
236 # endif
237 # ifdef    STATSDIR
238 #  warning undefining STATSDIR due to option name conflict
239 #  undef   STATSDIR
240 # endif
241 # ifdef    ENDSIMTIME
242 #  warning undefining ENDSIMTIME due to option name conflict
243 #  undef   ENDSIMTIME
244 # endif
245 # ifdef    TRUSTEDKEY
246 #  warning undefining TRUSTEDKEY due to option name conflict
247 #  undef   TRUSTEDKEY
248 # endif
249 # ifdef    FREQERR
250 #  warning undefining FREQERR due to option name conflict
251 #  undef   FREQERR
252 # endif
253 # ifdef    WALKNOISE
254 #  warning undefining WALKNOISE due to option name conflict
255 #  undef   WALKNOISE
256 # endif
257 # ifdef    USER
258 #  warning undefining USER due to option name conflict
259 #  undef   USER
260 # endif
261 # ifdef    VAR
262 #  warning undefining VAR due to option name conflict
263 #  undef   VAR
264 # endif
265 # ifdef    DVAR
266 #  warning undefining DVAR due to option name conflict
267 #  undef   DVAR
268 # endif
269 # ifdef    SLEW
270 #  warning undefining SLEW due to option name conflict
271 #  undef   SLEW
272 # endif
273 # ifdef    NDELAY
274 #  warning undefining NDELAY due to option name conflict
275 #  undef   NDELAY
276 # endif
277 # ifdef    PDELAY
278 #  warning undefining PDELAY due to option name conflict
279 #  undef   PDELAY
280 # endif
281 #else  /* NO_OPTION_NAME_WARNINGS */
282 # undef IPV4
283 # undef IPV6
284 # undef AUTHREQ
285 # undef AUTHNOREQ
286 # undef BCASTSYNC
287 # undef SIMBROADCASTDELAY
288 # undef CONFIGFILE
289 # undef PHASENOISE
290 # undef DEBUG_LEVEL
291 # undef SET_DEBUG_LEVEL
292 # undef DRIFTFILE
293 # undef PANICGATE
294 # undef SIMSLEW
295 # undef JAILDIR
296 # undef INTERFACE
297 # undef KEYFILE
298 # undef LOGFILE
299 # undef NOVIRTUALIPS
300 # undef MODIFYMMTIMER
301 # undef NOFORK
302 # undef NICE
303 # undef SERVERTIME
304 # undef PIDFILE
305 # undef PRIORITY
306 # undef QUIT
307 # undef PROPAGATIONDELAY
308 # undef UPDATEINTERVAL
309 # undef STATSDIR
310 # undef ENDSIMTIME
311 # undef TRUSTEDKEY
312 # undef FREQERR
313 # undef WALKNOISE
314 # undef USER
315 # undef VAR
316 # undef DVAR
317 # undef SLEW
318 # undef NDELAY
319 # undef PDELAY
320 #endif  /*  NO_OPTION_NAME_WARNINGS */
321
322 /*
323  *  Interface defines for specific options.
324  */
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'
335 #ifdef DEBUG
336 #define VALUE_OPT_DEBUG_LEVEL    'd'
337 #endif /* DEBUG */
338 #ifdef DEBUG
339 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
340 #endif /* DEBUG */
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'
349 #ifdef SYS_WINNT
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'
373
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) )
383 /*
384  *  Interface defines not associated with particular options
385  */
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/autogen-5.9.1/share/autogen/opthead.tpl near line 360 */
394
395 /* * * * * *
396  *
397  *  Declare the ntpdsim option descriptor.
398  */
399 #ifdef  __cplusplus
400 extern "C" {
401 #endif
402
403 extern tOptions   ntpdsimOptions;
404
405 #ifndef _
406 #  if ENABLE_NLS
407 #    include <stdio.h>
408      static inline char* aoGetsText( char const* pz ) {
409          if (pz == NULL) return NULL;
410          return (char*)gettext( pz );
411      }
412 #    define _(s)  aoGetsText(s)
413 #  else  /* ENABLE_NLS */
414 #    define _(s)  s
415 #  endif /* ENABLE_NLS */
416 #endif
417
418 #ifdef  __cplusplus
419 }
420 #endif
421 #endif /* AUTOOPTS_NTPDSIM_OPTS_H_GUARD */
422 /* ntpdsim-opts.h ends here */