2 * EDIT THIS FILE WITH CAUTION (sntp-opts.h)
4 * It has been AutoGen-ed Tuesday December 8, 2009 at 08:14:49 AM EST
5 * From the definitions sntp-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 * sntp 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 * sntp copyright 1970-2006 ntp.org - all rights reserved
24 * General Public Licence for the software known as MSNTP
25 * ------------------------------------------------------
27 * (c) Copyright, N.M. Maclaren, 1996, 1997, 2000
28 * (c) Copyright, University of Cambridge, 1996, 1997, 2000
32 * Free use of MSNTP in source and binary forms is permitted, provided that this
33 * entire licence is duplicated in all copies, and that any documentation,
34 * announcements, and other materials related to use acknowledge that the software
35 * was developed by N.M. Maclaren (hereafter refered to as the Author) at the
36 * University of Cambridge. Neither the name of the Author nor the University of
37 * Cambridge may be used to endorse or promote products derived from this material
38 * without specific prior written permission.
40 * The Author and the University of Cambridge retain the copyright and all other
41 * legal rights to the software and make it available non-exclusively. All users
42 * must ensure that the software in all its derivations carries a copyright notice
44 * (c) Copyright N.M. Maclaren,
45 * (c) Copyright University of Cambridge.
51 * Because the MSNTP software is licensed free of charge, the Author and the
52 * University of Cambridge provide absolutely no warranty, either expressed or
53 * implied, including, but not limited to, the implied warranties of
54 * merchantability and fitness for a particular purpose. The entire risk as to
55 * the quality and performance of the MSNTP software is with you. Should MSNTP
56 * prove defective, you assume the cost of all necessary servicing or repair.
58 * In no event, unless required by law, will the Author or the University of
59 * Cambridge, or any other party who may modify and redistribute this software as
60 * permitted in accordance with the provisions below, be liable for damages for
61 * any losses whatsoever, including but not limited to lost profits, lost monies,
62 * lost or corrupted data, or other special, incidental or consequential losses
63 * that may arise out of the use or inability to use the MSNTP software.
69 * Permission is hereby granted for copying and distribution of copies of the
70 * MSNTP source and binary files, and of any part thereof, subject to the
71 * following licence conditions:
73 * 1. You may distribute MSNTP or components of MSNTP, with or without additions
74 * developed by you or by others. No charge, other than an "at-cost" distribution
75 * fee, may be charged for copies, derivations, or distributions of this material
76 * without the express written consent of the copyright holders.
78 * 2. You may also distribute MSNTP along with any other product for sale,
79 * provided that the cost of the bundled package is the same regardless of whether
80 * MSNTP is included or not, and provided that those interested only in MSNTP must
81 * be notified that it is a product freely available from the University of
84 * 3. If you distribute MSNTP software or parts of MSNTP, with or without
85 * additions developed by you or others, then you must either make available the
86 * source to all portions of the MSNTP system (exclusive of any additions made by
87 * you or by others) upon request, or instead you may notify anyone requesting
88 * source that it is freely available from the University of Cambridge.
90 * 4. You may not omit any of the copyright notices on either the source files,
91 * the executable files, or the documentation.
93 * 5. You may not omit transmission of this License agreement with whatever
94 * portions of MSNTP that are distributed.
96 * 6. Any users of this software must be notified that it is without warranty or
97 * guarantee of any nature, express or implied, nor is there any fitness for use
106 * This file contains the programmatic interface to the Automated
107 * Options generated for the sntp program.
108 * These macros are documented in the AutoGen info file in the
109 * "AutoOpts" chapter. Please refer to that doc for usage help.
111 #ifndef AUTOOPTS_SNTP_OPTS_H_GUARD
112 #define AUTOOPTS_SNTP_OPTS_H_GUARD
114 #include <autoopts/options.h>
117 * Ensure that the library used for compiling this generated header is at
118 * least as new as the version current when the header template was released
119 * (not counting patch version increments). Also ensure that the oldest
120 * tolerable version is at least as old as what was current when the header
121 * template was released.
123 #define AO_TEMPLATE_VERSION 118784
124 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
125 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
126 # error option template version mismatches autoopts/options.h header
131 * Enumeration of each option:
136 INDEX_OPT_UNPRIVPORT = 2,
137 INDEX_OPT_NORMALVERBOSE = 3,
138 INDEX_OPT_EXTRAVERBOSE = 4,
139 INDEX_OPT_MEGAVERBOSE = 5,
140 INDEX_OPT_SETTIMEOFDAY = 6,
141 INDEX_OPT_ADJTIME = 7,
142 INDEX_OPT_VERSION = 8,
144 INDEX_OPT_MORE_HELP = 10,
145 INDEX_OPT_SAVE_OPTS = 11,
146 INDEX_OPT_LOAD_OPTS = 12
150 #define SNTP_VERSION "4.2.4p8"
151 #define SNTP_FULL_VERSION "sntp - standard SNTP program - Ver. 4.2.4p8"
154 * Interface defines for all options. Replace "n" with the UPPER_CASED
155 * option name (as in the teOptIndex enumeration above).
156 * e.g. HAVE_OPT( IPV4 )
158 #define DESC(n) (sntpOptions.pOptDesc[INDEX_OPT_## n])
159 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
160 #define OPT_ARG(n) (DESC(n).optArg.argString)
161 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
162 #define COUNT_OPT(n) (DESC(n).optOccCt)
163 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
164 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
165 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
166 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
167 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
168 #define CLEAR_OPT(n) STMTS( \
169 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
170 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
171 DESC(n).fOptState |= OPTST_DISABLED; \
172 DESC(n).optCookie = NULL )
175 * Make sure there are no #define name conflicts with the option names
177 #ifndef NO_OPTION_NAME_WARNINGS
179 # warning undefining IPV4 due to option name conflict
183 # warning undefining IPV6 due to option name conflict
187 # warning undefining UNPRIVPORT due to option name conflict
190 # ifdef NORMALVERBOSE
191 # warning undefining NORMALVERBOSE due to option name conflict
192 # undef NORMALVERBOSE
195 # warning undefining EXTRAVERBOSE due to option name conflict
199 # warning undefining MEGAVERBOSE due to option name conflict
203 # warning undefining SETTIMEOFDAY due to option name conflict
207 # warning undefining ADJTIME due to option name conflict
210 #else /* NO_OPTION_NAME_WARNINGS */
214 # undef NORMALVERBOSE
219 #endif /* NO_OPTION_NAME_WARNINGS */
222 * Interface defines for specific options.
224 #define VALUE_OPT_IPV4 '4'
225 #define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
226 #define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
227 #define VALUE_OPT_IPV6 '6'
228 #define VALUE_OPT_UNPRIVPORT 'u'
229 #define VALUE_OPT_NORMALVERBOSE 'v'
230 #define VALUE_OPT_EXTRAVERBOSE 'V'
231 #define VALUE_OPT_MEGAVERBOSE 'W'
232 #define VALUE_OPT_SETTIMEOFDAY 'r'
233 #define VALUE_OPT_ADJTIME 'a'
235 #define VALUE_OPT_VERSION 'v'
236 #define VALUE_OPT_HELP '?'
237 #define VALUE_OPT_MORE_HELP '!'
238 #define VALUE_OPT_SAVE_OPTS '>'
239 #define VALUE_OPT_LOAD_OPTS '<'
240 #define SET_OPT_SAVE_OPTS(a) STMTS( \
241 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
242 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
243 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
245 * Interface defines not associated with particular options
247 #define ERRSKIP_OPTERR STMTS( sntpOptions.fOptSet &= ~OPTPROC_ERRSTOP )
248 #define ERRSTOP_OPTERR STMTS( sntpOptions.fOptSet |= OPTPROC_ERRSTOP )
249 #define RESTART_OPT(n) STMTS( \
250 sntpOptions.curOptIdx = (n); \
251 sntpOptions.pzCurOpt = NULL )
252 #define START_OPT RESTART_OPT(1)
253 #define USAGE(c) (*sntpOptions.pUsageProc)( &sntpOptions, c )
254 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/opthead.tpl near line 360 */
258 * Declare the sntp option descriptor.
264 extern tOptions sntpOptions;
269 static inline char* aoGetsText( char const* pz ) {
270 if (pz == NULL) return NULL;
271 return (char*)gettext( pz );
273 # define _(s) aoGetsText(s)
274 # else /* ENABLE_NLS */
276 # endif /* ENABLE_NLS */
282 #endif /* AUTOOPTS_SNTP_OPTS_H_GUARD */
283 /* sntp-opts.h ends here */