2 * EDIT THIS FILE WITH CAUTION (ntpdc-opts.h)
4 * It has been AutoGen-ed Sunday August 17, 2008 at 05:26:25 AM EDT
5 * From the definitions ntpdc-opts.def
6 * and the template file options
8 * Generated from AutoOpts 29:0:4 templates.
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 * ntpdc 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.
20 * This source file is copyrighted and licensed under the following terms:
22 * ntpdc copyright 1970-2008 David L. Mills and/or others - all rights reserved
24 * see html/copyright.html
27 * This file contains the programmatic interface to the Automated
28 * Options generated for the ntpdc program.
29 * These macros are documented in the AutoGen info file in the
30 * "AutoOpts" chapter. Please refer to that doc for usage help.
32 #ifndef AUTOOPTS_NTPDC_OPTS_H_GUARD
33 #define AUTOOPTS_NTPDC_OPTS_H_GUARD
35 #include <autoopts/options.h>
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.
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
52 * Enumeration of each option:
57 INDEX_OPT_COMMAND
= 2,
58 INDEX_OPT_LISTPEERS
= 3,
60 INDEX_OPT_SHOWPEERS
= 5,
61 INDEX_OPT_INTERACTIVE
= 6,
62 INDEX_OPT_DEBUG_LEVEL
= 7,
63 INDEX_OPT_SET_DEBUG_LEVEL
= 8,
64 INDEX_OPT_NUMERIC
= 9,
65 INDEX_OPT_VERSION
= 10,
67 INDEX_OPT_MORE_HELP
= 12,
68 INDEX_OPT_SAVE_OPTS
= 13,
69 INDEX_OPT_LOAD_OPTS
= 14
73 #define NTPDC_VERSION "4.2.4p5"
74 #define NTPDC_FULL_VERSION "ntpdc - vendor-specific NTP query program - Ver. 4.2.4p5"
77 * Interface defines for all options. Replace "n" with the UPPER_CASED
78 * option name (as in the teOptIndex enumeration above).
79 * e.g. HAVE_OPT( IPV4 )
81 #define DESC(n) (ntpdcOptions.pOptDesc[INDEX_OPT_## n])
82 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
83 #define OPT_ARG(n) (DESC(n).optArg.argString)
84 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
85 #define COUNT_OPT(n) (DESC(n).optOccCt)
86 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
87 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
88 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
89 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
90 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
91 #define CLEAR_OPT(n) STMTS( \
92 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
93 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
94 DESC(n).fOptState |= OPTST_DISABLED; \
95 DESC(n).optCookie = NULL )
98 * Make sure there are no #define name conflicts with the option names
100 #ifndef NO_OPTION_NAME_WARNINGS
102 # warning undefining IPV4 due to option name conflict
106 # warning undefining IPV6 due to option name conflict
110 # warning undefining COMMAND due to option name conflict
114 # warning undefining LISTPEERS due to option name conflict
118 # warning undefining PEERS due to option name conflict
122 # warning undefining SHOWPEERS due to option name conflict
126 # warning undefining INTERACTIVE due to option name conflict
130 # warning undefining DEBUG_LEVEL due to option name conflict
133 # ifdef SET_DEBUG_LEVEL
134 # warning undefining SET_DEBUG_LEVEL due to option name conflict
135 # undef SET_DEBUG_LEVEL
138 # warning undefining NUMERIC due to option name conflict
141 #else /* NO_OPTION_NAME_WARNINGS */
150 # undef SET_DEBUG_LEVEL
152 #endif /* NO_OPTION_NAME_WARNINGS */
155 * Interface defines for specific options.
157 #define VALUE_OPT_IPV4 '4'
158 #define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
159 #define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
160 #define VALUE_OPT_IPV6 '6'
161 #define VALUE_OPT_COMMAND 'c'
162 #define VALUE_OPT_LISTPEERS 'l'
163 #define VALUE_OPT_PEERS 'p'
164 #define VALUE_OPT_SHOWPEERS 's'
165 #define VALUE_OPT_INTERACTIVE 'i'
167 #define VALUE_OPT_DEBUG_LEVEL 'd'
170 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
172 #define VALUE_OPT_NUMERIC 'n'
174 #define VALUE_OPT_VERSION 'v'
175 #define VALUE_OPT_HELP '?'
176 #define VALUE_OPT_MORE_HELP '!'
177 #define VALUE_OPT_SAVE_OPTS '>'
178 #define VALUE_OPT_LOAD_OPTS '<'
179 #define SET_OPT_SAVE_OPTS(a) STMTS( \
180 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
181 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
182 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
184 * Interface defines not associated with particular options
186 #define ERRSKIP_OPTERR STMTS( ntpdcOptions.fOptSet &= ~OPTPROC_ERRSTOP )
187 #define ERRSTOP_OPTERR STMTS( ntpdcOptions.fOptSet |= OPTPROC_ERRSTOP )
188 #define RESTART_OPT(n) STMTS( \
189 ntpdcOptions.curOptIdx = (n); \
190 ntpdcOptions.pzCurOpt = NULL )
191 #define START_OPT RESTART_OPT(1)
192 #define USAGE(c) (*ntpdcOptions.pUsageProc)( &ntpdcOptions, c )
193 /* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
197 * Declare the ntpdc option descriptor.
203 extern tOptions ntpdcOptions
;
208 static inline char* aoGetsText( char const* pz
) {
209 if (pz
== NULL
) return NULL
;
210 return (char*)gettext( pz
);
212 # define _(s) aoGetsText(s)
213 # else /* ENABLE_NLS */
215 # endif /* ENABLE_NLS */
221 #endif /* AUTOOPTS_NTPDC_OPTS_H_GUARD */
222 /* ntpdc-opts.h ends here */