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