4 * EDIT THIS FILE WITH CAUTION (sntp-opts.h)
6 * It has been AutoGen-ed December 10, 2009 at 05:07:29 AM by AutoGen 5.10
7 * From the definitions sntp-opts.def
8 * and the template file options
10 * Generated from AutoOpts 33:0:8 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 * sntp 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 * sntp copyright (c) 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 sntp 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_SNTP_OPTS_H_GUARD
35 #define AUTOOPTS_SNTP_OPTS_H_GUARD 1
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 135168
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
54 * Enumeration of each option:
59 INDEX_OPT_NORMALVERBOSE
= 2,
62 INDEX_OPT_FILELOG
= 5,
64 INDEX_OPT_ADJTIME
= 7,
65 INDEX_OPT_BROADCAST
= 8,
66 INDEX_OPT_TIMEOUT
= 9,
67 INDEX_OPT_AUTHENTICATION
= 10,
68 INDEX_OPT_KEYFILE
= 11,
69 INDEX_OPT_VERSION
= 12,
71 INDEX_OPT_MORE_HELP
= 14,
72 INDEX_OPT_SAVE_OPTS
= 15,
73 INDEX_OPT_LOAD_OPTS
= 16
77 #define SNTP_VERSION "4.2.6"
78 #define SNTP_FULL_VERSION "sntp - standard SNTP program - Ver. 4.2.6"
81 * Interface defines for all options. Replace "n" with the UPPER_CASED
82 * option name (as in the teOptIndex enumeration above).
83 * e.g. HAVE_OPT( IPV4 )
85 #define DESC(n) (sntpOptions.pOptDesc[INDEX_OPT_## n])
86 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
87 #define OPT_ARG(n) (DESC(n).optArg.argString)
88 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
89 #define COUNT_OPT(n) (DESC(n).optOccCt)
90 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
91 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
92 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
93 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
94 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
95 #define CLEAR_OPT(n) STMTS( \
96 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
97 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
98 DESC(n).fOptState |= OPTST_DISABLED; \
99 DESC(n).optCookie = NULL )
102 * Make sure there are no #define name conflicts with the option names
104 #ifndef NO_OPTION_NAME_WARNINGS
106 # warning undefining IPV4 due to option name conflict
110 # warning undefining IPV6 due to option name conflict
113 # ifdef NORMALVERBOSE
114 # warning undefining NORMALVERBOSE due to option name conflict
115 # undef NORMALVERBOSE
118 # warning undefining KOD due to option name conflict
122 # warning undefining SYSLOG due to option name conflict
126 # warning undefining FILELOG due to option name conflict
130 # warning undefining SETTOD due to option name conflict
134 # warning undefining ADJTIME due to option name conflict
138 # warning undefining BROADCAST due to option name conflict
142 # warning undefining TIMEOUT due to option name conflict
145 # ifdef AUTHENTICATION
146 # warning undefining AUTHENTICATION due to option name conflict
147 # undef AUTHENTICATION
150 # warning undefining KEYFILE due to option name conflict
153 #else /* NO_OPTION_NAME_WARNINGS */
156 # undef NORMALVERBOSE
164 # undef AUTHENTICATION
166 #endif /* NO_OPTION_NAME_WARNINGS */
170 * Interface defines for specific options.
172 #define VALUE_OPT_IPV4 '4'
173 #define VALUE_OPT_IPV6 '6'
174 #define VALUE_OPT_NORMALVERBOSE 'd'
175 #define VALUE_OPT_KOD 'K'
176 #define VALUE_OPT_SYSLOG 'p'
177 #define VALUE_OPT_FILELOG 'l'
178 #define VALUE_OPT_SETTOD 's'
179 #define VALUE_OPT_ADJTIME 'j'
180 #define VALUE_OPT_BROADCAST 'b'
181 #define VALUE_OPT_TIMEOUT 't'
183 #define OPT_VALUE_TIMEOUT (DESC(TIMEOUT).optArg.argInt)
184 #define VALUE_OPT_AUTHENTICATION 'a'
186 #define OPT_VALUE_AUTHENTICATION (DESC(AUTHENTICATION).optArg.argInt)
187 #define VALUE_OPT_KEYFILE 'k'
188 #define VALUE_OPT_HELP '?'
189 #define VALUE_OPT_MORE_HELP '!'
190 #define VALUE_OPT_VERSION INDEX_OPT_VERSION
191 #define VALUE_OPT_SAVE_OPTS '>'
192 #define VALUE_OPT_LOAD_OPTS '<'
193 #define SET_OPT_SAVE_OPTS(a) STMTS( \
194 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
195 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
196 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
198 * Interface defines not associated with particular options
200 #define ERRSKIP_OPTERR STMTS( sntpOptions.fOptSet &= ~OPTPROC_ERRSTOP )
201 #define ERRSTOP_OPTERR STMTS( sntpOptions.fOptSet |= OPTPROC_ERRSTOP )
202 #define RESTART_OPT(n) STMTS( \
203 sntpOptions.curOptIdx = (n); \
204 sntpOptions.pzCurOpt = NULL )
205 #define START_OPT RESTART_OPT(1)
206 #define USAGE(c) (*sntpOptions.pUsageProc)( &sntpOptions, c )
207 /* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */
211 * Declare the sntp option descriptor.
217 extern tOptions sntpOptions
;
219 #if defined(ENABLE_NLS)
222 static inline char* aoGetsText( char const* pz
) {
223 if (pz
== NULL
) return NULL
;
224 return (char*)gettext( pz
);
226 # define _(s) aoGetsText(s)
229 # define OPT_NO_XLAT_CFG_NAMES STMTS(sntpOptions.fOptSet |= \
230 OPTPROC_NXLAT_OPT_CFG;)
231 # define OPT_NO_XLAT_OPT_NAMES STMTS(sntpOptions.fOptSet |= \
232 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
234 # define OPT_XLAT_CFG_NAMES STMTS(sntpOptions.fOptSet &= \
235 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
236 # define OPT_XLAT_OPT_NAMES STMTS(sntpOptions.fOptSet &= \
239 #else /* ENABLE_NLS */
240 # define OPT_NO_XLAT_CFG_NAMES
241 # define OPT_NO_XLAT_OPT_NAMES
243 # define OPT_XLAT_CFG_NAMES
244 # define OPT_XLAT_OPT_NAMES
249 #endif /* ENABLE_NLS */
254 #endif /* AUTOOPTS_SNTP_OPTS_H_GUARD */
255 /* sntp-opts.h ends here */