ntpd-opts.h revision 182007
1/*
2 *  EDIT THIS FILE WITH CAUTION  (ntpd-opts.h)
3 *
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
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 *  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.
19 *
20 * This source file is copyrighted and licensed under the following terms:
21 *
22 * ntpd copyright 1970-2008 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 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.
31 */
32#ifndef AUTOOPTS_NTPD_OPTS_H_GUARD
33#define AUTOOPTS_NTPD_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 */
54typedef 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_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,
72        INDEX_OPT_NICE             = 17,
73        INDEX_OPT_PIDFILE          = 18,
74        INDEX_OPT_PRIORITY         = 19,
75        INDEX_OPT_QUIT             = 20,
76        INDEX_OPT_PROPAGATIONDELAY = 21,
77        INDEX_OPT_UPDATEINTERVAL   = 22,
78        INDEX_OPT_STATSDIR         = 23,
79        INDEX_OPT_TRUSTEDKEY       = 24,
80        INDEX_OPT_USER             = 25,
81        INDEX_OPT_VAR              = 26,
82        INDEX_OPT_DVAR             = 27,
83        INDEX_OPT_SLEW             = 28,
84        INDEX_OPT_VERSION          = 29,
85        INDEX_OPT_HELP             = 30,
86        INDEX_OPT_MORE_HELP        = 31
87} teOptIndex;
88
89#define OPTION_CT    32
90#define NTPD_VERSION       "4.2.4p5"
91#define NTPD_FULL_VERSION  "ntpd - NTP daemon program - Ver. 4.2.4p5"
92
93/*
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 )
97 */
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 )
113
114/*
115 *  Make sure there are no #define name conflicts with the option names
116 */
117#ifndef     NO_OPTION_NAME_WARNINGS
118# ifdef    IPV4
119#  warning undefining IPV4 due to option name conflict
120#  undef   IPV4
121# endif
122# ifdef    IPV6
123#  warning undefining IPV6 due to option name conflict
124#  undef   IPV6
125# endif
126# ifdef    AUTHREQ
127#  warning undefining AUTHREQ due to option name conflict
128#  undef   AUTHREQ
129# endif
130# ifdef    AUTHNOREQ
131#  warning undefining AUTHNOREQ due to option name conflict
132#  undef   AUTHNOREQ
133# endif
134# ifdef    BCASTSYNC
135#  warning undefining BCASTSYNC due to option name conflict
136#  undef   BCASTSYNC
137# endif
138# ifdef    CONFIGFILE
139#  warning undefining CONFIGFILE due to option name conflict
140#  undef   CONFIGFILE
141# endif
142# ifdef    DEBUG_LEVEL
143#  warning undefining DEBUG_LEVEL due to option name conflict
144#  undef   DEBUG_LEVEL
145# endif
146# ifdef    SET_DEBUG_LEVEL
147#  warning undefining SET_DEBUG_LEVEL due to option name conflict
148#  undef   SET_DEBUG_LEVEL
149# endif
150# ifdef    DRIFTFILE
151#  warning undefining DRIFTFILE due to option name conflict
152#  undef   DRIFTFILE
153# endif
154# ifdef    PANICGATE
155#  warning undefining PANICGATE due to option name conflict
156#  undef   PANICGATE
157# endif
158# ifdef    JAILDIR
159#  warning undefining JAILDIR due to option name conflict
160#  undef   JAILDIR
161# endif
162# ifdef    INTERFACE
163#  warning undefining INTERFACE due to option name conflict
164#  undef   INTERFACE
165# endif
166# ifdef    KEYFILE
167#  warning undefining KEYFILE due to option name conflict
168#  undef   KEYFILE
169# endif
170# ifdef    LOGFILE
171#  warning undefining LOGFILE due to option name conflict
172#  undef   LOGFILE
173# endif
174# ifdef    NOVIRTUALIPS
175#  warning undefining NOVIRTUALIPS due to option name conflict
176#  undef   NOVIRTUALIPS
177# endif
178# ifdef    MODIFYMMTIMER
179#  warning undefining MODIFYMMTIMER due to option name conflict
180#  undef   MODIFYMMTIMER
181# endif
182# ifdef    NOFORK
183#  warning undefining NOFORK due to option name conflict
184#  undef   NOFORK
185# endif
186# ifdef    NICE
187#  warning undefining NICE due to option name conflict
188#  undef   NICE
189# endif
190# ifdef    PIDFILE
191#  warning undefining PIDFILE due to option name conflict
192#  undef   PIDFILE
193# endif
194# ifdef    PRIORITY
195#  warning undefining PRIORITY due to option name conflict
196#  undef   PRIORITY
197# endif
198# ifdef    QUIT
199#  warning undefining QUIT due to option name conflict
200#  undef   QUIT
201# endif
202# ifdef    PROPAGATIONDELAY
203#  warning undefining PROPAGATIONDELAY due to option name conflict
204#  undef   PROPAGATIONDELAY
205# endif
206# ifdef    UPDATEINTERVAL
207#  warning undefining UPDATEINTERVAL due to option name conflict
208#  undef   UPDATEINTERVAL
209# endif
210# ifdef    STATSDIR
211#  warning undefining STATSDIR due to option name conflict
212#  undef   STATSDIR
213# endif
214# ifdef    TRUSTEDKEY
215#  warning undefining TRUSTEDKEY due to option name conflict
216#  undef   TRUSTEDKEY
217# endif
218# ifdef    USER
219#  warning undefining USER due to option name conflict
220#  undef   USER
221# endif
222# ifdef    VAR
223#  warning undefining VAR due to option name conflict
224#  undef   VAR
225# endif
226# ifdef    DVAR
227#  warning undefining DVAR due to option name conflict
228#  undef   DVAR
229# endif
230# ifdef    SLEW
231#  warning undefining SLEW due to option name conflict
232#  undef   SLEW
233# endif
234#else  /* NO_OPTION_NAME_WARNINGS */
235# undef IPV4
236# undef IPV6
237# undef AUTHREQ
238# undef AUTHNOREQ
239# undef BCASTSYNC
240# undef CONFIGFILE
241# undef DEBUG_LEVEL
242# undef SET_DEBUG_LEVEL
243# undef DRIFTFILE
244# undef PANICGATE
245# undef JAILDIR
246# undef INTERFACE
247# undef KEYFILE
248# undef LOGFILE
249# undef NOVIRTUALIPS
250# undef MODIFYMMTIMER
251# undef NOFORK
252# undef NICE
253# undef PIDFILE
254# undef PRIORITY
255# undef QUIT
256# undef PROPAGATIONDELAY
257# undef UPDATEINTERVAL
258# undef STATSDIR
259# undef TRUSTEDKEY
260# undef USER
261# undef VAR
262# undef DVAR
263# undef SLEW
264#endif  /*  NO_OPTION_NAME_WARNINGS */
265
266/*
267 *  Interface defines for specific options.
268 */
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'
277#ifdef DEBUG
278#define VALUE_OPT_DEBUG_LEVEL    'd'
279#endif /* DEBUG */
280#ifdef DEBUG
281#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
282#endif /* DEBUG */
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'
290#ifdef SYS_WINNT
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'
308
309#define VALUE_OPT_VERSION       'v'
310#define VALUE_OPT_HELP          '?'
311#define VALUE_OPT_MORE_HELP     '!'
312/*
313 *  Interface defines not associated with particular options
314 */
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 */
323
324/* * * * * *
325 *
326 *  Declare the ntpd option descriptor.
327 */
328#ifdef  __cplusplus
329extern "C" {
330#endif
331
332extern tOptions   ntpdOptions;
333
334#ifndef _
335#  if ENABLE_NLS
336#    include <stdio.h>
337     static inline char* aoGetsText( char const* pz ) {
338         if (pz == NULL) return NULL;
339         return (char*)gettext( pz );
340     }
341#    define _(s)  aoGetsText(s)
342#  else  /* ENABLE_NLS */
343#    define _(s)  s
344#  endif /* ENABLE_NLS */
345#endif
346
347#ifdef  __cplusplus
348}
349#endif
350#endif /* AUTOOPTS_NTPD_OPTS_H_GUARD */
351/* ntpd-opts.h ends here */
352