Deleted Added
full compact
sntp-opts.h (302408) sntp-opts.h (181834)
1/*
1/*
2 * EDIT THIS FILE WITH CAUTION (sntp-opts.h)
2 * EDIT THIS FILE WITH CAUTION (sntp-opts.h)
3 *
4 * It has been AutoGen-ed June 2, 2016 at 07:18:40 AM by AutoGen 5.18.5
3 *
4 * It has been AutoGen-ed Sunday August 17, 2008 at 05:27:23 AM EDT
5 * From the definitions sntp-opts.def
6 * and the template file options
7 *
5 * From the definitions sntp-opts.def
6 * and the template file options
7 *
8 * Generated from AutoOpts 41:0:16 templates.
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 * 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.
9 *
19 *
10 * AutoOpts is a copyrighted work. This header file is not encumbered
11 * by AutoOpts licensing, but is provided under the licensing terms chosen
12 * by the sntp author or copyright holder. AutoOpts is
13 * licensed under the terms of the LGPL. The redistributable library
14 * (``libopts'') is licensed under the terms of either the LGPL or, at the
15 * users discretion, the BSD license. See the AutoOpts and/or libopts sources
16 * for details.
20 * This source file is copyrighted and licensed under the following terms:
17 *
21 *
18 * The sntp program is copyrighted and licensed
19 * under the following terms:
22 * sntp copyright 1970-2006 ntp.org - all rights reserved
20 *
23 *
21 * Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation, all rights reserved.
22 * This is free software. It is licensed for use, modification and
23 * redistribution under the terms of the NTP License, copies of which
24 * can be seen at:
25 * <http://ntp.org/license>
26 * <http://opensource.org/licenses/ntp-license.php>
27 *
28 * Permission to use, copy, modify, and distribute this software and its
29 * documentation for any purpose with or without fee is hereby granted,
30 * provided that the above copyright notice appears in all copies and that
31 * both the copyright notice and this permission notice appear in
32 * supporting documentation, and that the name The University of Delaware not be used in
33 * advertising or publicity pertaining to distribution of the software
34 * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
35 * representations about the suitability this software for any purpose. It
36 * is provided "as is" without express or implied warranty.
24 * General Public Licence for the software known as MSNTP
25 * ------------------------------------------------------
26 *
27 * (c) Copyright, N.M. Maclaren, 1996, 1997, 2000
28 * (c) Copyright, University of Cambridge, 1996, 1997, 2000
29 *
30 *
31 *
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.
39 *
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
43 * in the form:
44 * (c) Copyright N.M. Maclaren,
45 * (c) Copyright University of Cambridge.
46 *
47 *
48 *
49 * NO WARRANTY
50 *
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.
57 *
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.
64 *
65 *
66 *
67 * COPYING POLICY
68 *
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:
72 *
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.
77 *
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
82 * Cambridge.
83 *
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.
89 *
90 * 4. You may not omit any of the copyright notices on either the source files,
91 * the executable files, or the documentation.
92 *
93 * 5. You may not omit transmission of this License agreement with whatever
94 * portions of MSNTP that are distributed.
95 *
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
98 * represented.
99 *
100 *
101 * October 1996
102 * April 1997
103 * October 2000
37 */
104 */
38/**
105/*
39 * This file contains the programmatic interface to the Automated
40 * Options generated for the sntp program.
41 * These macros are documented in the AutoGen info file in the
42 * "AutoOpts" chapter. Please refer to that doc for usage help.
43 */
44#ifndef AUTOOPTS_SNTP_OPTS_H_GUARD
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.
110 */
111#ifndef AUTOOPTS_SNTP_OPTS_H_GUARD
45#define AUTOOPTS_SNTP_OPTS_H_GUARD 1
112#define AUTOOPTS_SNTP_OPTS_H_GUARD
46#include "config.h"
47#include <autoopts/options.h>
48
113#include "config.h"
114#include <autoopts/options.h>
115
49/**
116/*
50 * Ensure that the library used for compiling this generated header is at
51 * least as new as the version current when the header template was released
52 * (not counting patch version increments). Also ensure that the oldest
53 * tolerable version is at least as old as what was current when the header
54 * template was released.
55 */
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.
122 */
56#define AO_TEMPLATE_VERSION 167936
123#define AO_TEMPLATE_VERSION 118784
57#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
58 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
59# error option template version mismatches autoopts/options.h header
60 Choke Me.
61#endif
62
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
127 Choke Me.
128#endif
129
63/**
64 * Enumeration of each option type for sntp
130/*
131 * Enumeration of each option:
65 */
66typedef enum {
132 */
133typedef enum {
67 INDEX_OPT_IPV4 = 0,
68 INDEX_OPT_IPV6 = 1,
69 INDEX_OPT_AUTHENTICATION = 2,
70 INDEX_OPT_BROADCAST = 3,
71 INDEX_OPT_CONCURRENT = 4,
72 INDEX_OPT_DEBUG_LEVEL = 5,
73 INDEX_OPT_SET_DEBUG_LEVEL = 6,
74 INDEX_OPT_GAP = 7,
75 INDEX_OPT_KOD = 8,
76 INDEX_OPT_KEYFILE = 9,
77 INDEX_OPT_LOGFILE = 10,
78 INDEX_OPT_STEPLIMIT = 11,
79 INDEX_OPT_NTPVERSION = 12,
80 INDEX_OPT_USERESERVEDPORT = 13,
81 INDEX_OPT_STEP = 14,
82 INDEX_OPT_SLEW = 15,
83 INDEX_OPT_TIMEOUT = 16,
84 INDEX_OPT_WAIT = 17,
85 INDEX_OPT_VERSION = 18,
86 INDEX_OPT_HELP = 19,
87 INDEX_OPT_MORE_HELP = 20,
88 INDEX_OPT_SAVE_OPTS = 21,
89 INDEX_OPT_LOAD_OPTS = 22
134 INDEX_OPT_IPV4 = 0,
135 INDEX_OPT_IPV6 = 1,
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,
143 INDEX_OPT_HELP = 9,
144 INDEX_OPT_MORE_HELP = 10,
145 INDEX_OPT_SAVE_OPTS = 11,
146 INDEX_OPT_LOAD_OPTS = 12
90} teOptIndex;
147} teOptIndex;
91/** count of all options for sntp */
92#define OPTION_CT 23
93/** sntp version */
94#define SNTP_VERSION "4.2.8p8"
95/** Full sntp version text */
96#define SNTP_FULL_VERSION "sntp 4.2.8p8"
97
148
98/**
149#define OPTION_CT 13
150#define SNTP_VERSION "4.2.4p5"
151#define SNTP_FULL_VERSION "sntp - standard SNTP program - Ver. 4.2.4p5"
152
153/*
99 * Interface defines for all options. Replace "n" with the UPPER_CASED
100 * option name (as in the teOptIndex enumeration above).
154 * Interface defines for all options. Replace "n" with the UPPER_CASED
155 * option name (as in the teOptIndex enumeration above).
101 * e.g. HAVE_OPT(IPV4)
156 * e.g. HAVE_OPT( IPV4 )
102 */
103#define DESC(n) (sntpOptions.pOptDesc[INDEX_OPT_## n])
157 */
158#define DESC(n) (sntpOptions.pOptDesc[INDEX_OPT_## n])
104/** 'true' if an option has been specified in any way */
105#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
159#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
106/** The string argument to an option. The argument type must be \"string\". */
107#define OPT_ARG(n) (DESC(n).optArg.argString)
160#define OPT_ARG(n) (DESC(n).optArg.argString)
108/** Mask the option state revealing how an option was specified.
109 * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
110 * \a OPTST_DEFINED, \a OPTST_RESET or zero.
111 */
112#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
161#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
113/** Count of option's occurrances *on the command line*. */
114#define COUNT_OPT(n) (DESC(n).optOccCt)
162#define COUNT_OPT(n) (DESC(n).optOccCt)
115/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
116#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
163#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
117/** 'true' if \a HAVE_OPT would yield 'false'. */
118#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
164#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
119/** 'true' if OPTST_DISABLED bit not set. */
120#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
165#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
121/** number of stacked option arguments.
122 * Valid only for stacked option arguments. */
123#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
166#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
124/** stacked argument vector.
125 * Valid only for stacked option arguments. */
126#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
167#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
127/** Reset an option. */
128#define CLEAR_OPT(n) STMTS( \
129 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
168#define CLEAR_OPT(n) STMTS( \
169 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
130 if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
170 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
131 DESC(n).fOptState |= OPTST_DISABLED; \
132 DESC(n).optCookie = NULL )
171 DESC(n).fOptState |= OPTST_DISABLED; \
172 DESC(n).optCookie = NULL )
133/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
134/**
135 * Enumeration of sntp exit codes
136 */
137typedef enum {
138 SNTP_EXIT_SUCCESS = 0,
139 SNTP_EXIT_FAILURE = 1,
140 SNTP_EXIT_USAGE_ERROR = 64,
141 SNTP_EXIT_NO_CONFIG_INPUT = 66,
142 SNTP_EXIT_LIBOPTS_FAILURE = 70
143} sntp_exit_code_t;
144/** @} */
145/**
173
174/*
146 * Make sure there are no #define name conflicts with the option names
147 */
148#ifndef NO_OPTION_NAME_WARNINGS
149# ifdef IPV4
150# warning undefining IPV4 due to option name conflict
151# undef IPV4
152# endif
153# ifdef IPV6
154# warning undefining IPV6 due to option name conflict
155# undef IPV6
156# endif
175 * Make sure there are no #define name conflicts with the option names
176 */
177#ifndef NO_OPTION_NAME_WARNINGS
178# ifdef IPV4
179# warning undefining IPV4 due to option name conflict
180# undef IPV4
181# endif
182# ifdef IPV6
183# warning undefining IPV6 due to option name conflict
184# undef IPV6
185# endif
157# ifdef AUTHENTICATION
158# warning undefining AUTHENTICATION due to option name conflict
159# undef AUTHENTICATION
186# ifdef UNPRIVPORT
187# warning undefining UNPRIVPORT due to option name conflict
188# undef UNPRIVPORT
160# endif
189# endif
161# ifdef BROADCAST
162# warning undefining BROADCAST due to option name conflict
163# undef BROADCAST
190# ifdef NORMALVERBOSE
191# warning undefining NORMALVERBOSE due to option name conflict
192# undef NORMALVERBOSE
164# endif
193# endif
165# ifdef CONCURRENT
166# warning undefining CONCURRENT due to option name conflict
167# undef CONCURRENT
194# ifdef EXTRAVERBOSE
195# warning undefining EXTRAVERBOSE due to option name conflict
196# undef EXTRAVERBOSE
168# endif
197# endif
169# ifdef DEBUG_LEVEL
170# warning undefining DEBUG_LEVEL due to option name conflict
171# undef DEBUG_LEVEL
198# ifdef MEGAVERBOSE
199# warning undefining MEGAVERBOSE due to option name conflict
200# undef MEGAVERBOSE
172# endif
201# endif
173# ifdef SET_DEBUG_LEVEL
174# warning undefining SET_DEBUG_LEVEL due to option name conflict
175# undef SET_DEBUG_LEVEL
202# ifdef SETTIMEOFDAY
203# warning undefining SETTIMEOFDAY due to option name conflict
204# undef SETTIMEOFDAY
176# endif
205# endif
177# ifdef GAP
178# warning undefining GAP due to option name conflict
179# undef GAP
206# ifdef ADJTIME
207# warning undefining ADJTIME due to option name conflict
208# undef ADJTIME
180# endif
209# endif
181# ifdef KOD
182# warning undefining KOD due to option name conflict
183# undef KOD
184# endif
185# ifdef KEYFILE
186# warning undefining KEYFILE due to option name conflict
187# undef KEYFILE
188# endif
189# ifdef LOGFILE
190# warning undefining LOGFILE due to option name conflict
191# undef LOGFILE
192# endif
193# ifdef STEPLIMIT
194# warning undefining STEPLIMIT due to option name conflict
195# undef STEPLIMIT
196# endif
197# ifdef NTPVERSION
198# warning undefining NTPVERSION due to option name conflict
199# undef NTPVERSION
200# endif
201# ifdef USERESERVEDPORT
202# warning undefining USERESERVEDPORT due to option name conflict
203# undef USERESERVEDPORT
204# endif
205# ifdef STEP
206# warning undefining STEP due to option name conflict
207# undef STEP
208# endif
209# ifdef SLEW
210# warning undefining SLEW due to option name conflict
211# undef SLEW
212# endif
213# ifdef TIMEOUT
214# warning undefining TIMEOUT due to option name conflict
215# undef TIMEOUT
216# endif
217# ifdef WAIT
218# warning undefining WAIT due to option name conflict
219# undef WAIT
220# endif
221#else /* NO_OPTION_NAME_WARNINGS */
222# undef IPV4
223# undef IPV6
210#else /* NO_OPTION_NAME_WARNINGS */
211# undef IPV4
212# undef IPV6
224# undef AUTHENTICATION
225# undef BROADCAST
226# undef CONCURRENT
227# undef DEBUG_LEVEL
228# undef SET_DEBUG_LEVEL
229# undef GAP
230# undef KOD
231# undef KEYFILE
232# undef LOGFILE
233# undef STEPLIMIT
234# undef NTPVERSION
235# undef USERESERVEDPORT
236# undef STEP
237# undef SLEW
238# undef TIMEOUT
239# undef WAIT
213# undef UNPRIVPORT
214# undef NORMALVERBOSE
215# undef EXTRAVERBOSE
216# undef MEGAVERBOSE
217# undef SETTIMEOFDAY
218# undef ADJTIME
240#endif /* NO_OPTION_NAME_WARNINGS */
241
219#endif /* NO_OPTION_NAME_WARNINGS */
220
242/**
221/*
243 * Interface defines for specific options.
222 * Interface defines for specific options.
244 * @{
245 */
246#define VALUE_OPT_IPV4 '4'
223 */
224#define VALUE_OPT_IPV4 '4'
225#define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
226#define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
247#define VALUE_OPT_IPV6 '6'
227#define VALUE_OPT_IPV6 '6'
248#define VALUE_OPT_AUTHENTICATION 'a'
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'
249
234
250#define OPT_VALUE_AUTHENTICATION (DESC(AUTHENTICATION).optArg.argInt)
251#define VALUE_OPT_BROADCAST 'b'
252#define VALUE_OPT_CONCURRENT 'c'
253#define VALUE_OPT_DEBUG_LEVEL 'd'
254#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
255
256#define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
257#define VALUE_OPT_GAP 'g'
258
259#define OPT_VALUE_GAP (DESC(GAP).optArg.argInt)
260#define VALUE_OPT_KOD 'K'
261#define VALUE_OPT_KEYFILE 'k'
262#define VALUE_OPT_LOGFILE 'l'
263#define VALUE_OPT_STEPLIMIT 'M'
264
265#define OPT_VALUE_STEPLIMIT (DESC(STEPLIMIT).optArg.argInt)
266#define VALUE_OPT_NTPVERSION 'o'
267
268#define OPT_VALUE_NTPVERSION (DESC(NTPVERSION).optArg.argInt)
269#define VALUE_OPT_USERESERVEDPORT 'r'
270#define VALUE_OPT_STEP 'S'
271#define VALUE_OPT_SLEW 's'
272#define VALUE_OPT_TIMEOUT 't'
273
274#define OPT_VALUE_TIMEOUT (DESC(TIMEOUT).optArg.argInt)
275#define VALUE_OPT_WAIT 0x1001
276
277#define SET_OPT_WAIT STMTS( \
278 DESC(WAIT).optActualIndex = 17; \
279 DESC(WAIT).optActualValue = VALUE_OPT_WAIT; \
280 DESC(WAIT).fOptState &= OPTST_PERSISTENT_MASK; \
281 DESC(WAIT).fOptState |= OPTST_SET )
282#define DISABLE_OPT_WAIT STMTS( \
283 DESC(WAIT).fOptState &= OPTST_PERSISTENT_MASK; \
284 DESC(WAIT).fOptState |= OPTST_SET | OPTST_DISABLED; \
285 DESC(WAIT).optArg.argString = NULL )
286/** option flag (value) for help-value option */
235#define VALUE_OPT_VERSION 'v'
287#define VALUE_OPT_HELP '?'
236#define VALUE_OPT_HELP '?'
288/** option flag (value) for more-help-value option */
289#define VALUE_OPT_MORE_HELP '!'
237#define VALUE_OPT_MORE_HELP '!'
290/** option flag (value) for version-value option */
291#define VALUE_OPT_VERSION 0x1002
292/** option flag (value) for save-opts-value option */
293#define VALUE_OPT_SAVE_OPTS '>'
238#define VALUE_OPT_SAVE_OPTS '>'
294/** option flag (value) for load-opts-value option */
295#define VALUE_OPT_LOAD_OPTS '<'
296#define SET_OPT_SAVE_OPTS(a) STMTS( \
297 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
298 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
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; \
299 DESC(SAVE_OPTS).optArg.argString = (char const*)(a))
243 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
300/*
301 * Interface defines not associated with particular options
302 */
244/*
245 * Interface defines not associated with particular options
246 */
303#define ERRSKIP_OPTERR STMTS(sntpOptions.fOptSet &= ~OPTPROC_ERRSTOP)
304#define ERRSTOP_OPTERR STMTS(sntpOptions.fOptSet |= OPTPROC_ERRSTOP)
247#define ERRSKIP_OPTERR STMTS( sntpOptions.fOptSet &= ~OPTPROC_ERRSTOP )
248#define ERRSTOP_OPTERR STMTS( sntpOptions.fOptSet |= OPTPROC_ERRSTOP )
305#define RESTART_OPT(n) STMTS( \
306 sntpOptions.curOptIdx = (n); \
307 sntpOptions.pzCurOpt = NULL )
308#define START_OPT RESTART_OPT(1)
249#define RESTART_OPT(n) STMTS( \
250 sntpOptions.curOptIdx = (n); \
251 sntpOptions.pzCurOpt = NULL )
252#define START_OPT RESTART_OPT(1)
309#define USAGE(c) (*sntpOptions.pUsageProc)(&sntpOptions, c)
253#define USAGE(c) (*sntpOptions.pUsageProc)( &sntpOptions, c )
254/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
310
255
311#ifdef __cplusplus
312extern "C" {
313#endif
314
315
316/* * * * * *
317 *
318 * Declare the sntp option descriptor.
319 */
256/* * * * * *
257 *
258 * Declare the sntp option descriptor.
259 */
320extern tOptions sntpOptions;
260#ifdef __cplusplus
261extern "C" {
262#endif
321
263
322#if defined(ENABLE_NLS)
323# ifndef _
324# include <stdio.h>
325# ifndef HAVE_GETTEXT
326 extern char * gettext(char const *);
327# else
328# include <libintl.h>
329# endif
264extern tOptions sntpOptions;
330
265
331# ifndef ATTRIBUTE_FORMAT_ARG
332# define ATTRIBUTE_FORMAT_ARG(_a)
333# endif
266#ifndef _
267# if ENABLE_NLS
268# include <stdio.h>
269 static inline char* aoGetsText( char const* pz ) {
270 if (pz == NULL) return NULL;
271 return (char*)gettext( pz );
272 }
273# define _(s) aoGetsText(s)
274# else /* ENABLE_NLS */
275# define _(s) s
276# endif /* ENABLE_NLS */
277#endif
334
278
335static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
336static inline char* aoGetsText(char const* pz) {
337 if (pz == NULL) return NULL;
338 return (char*)gettext(pz);
339}
340# define _(s) aoGetsText(s)
341# endif /* _() */
342
343# define OPT_NO_XLAT_CFG_NAMES STMTS(sntpOptions.fOptSet |= \
344 OPTPROC_NXLAT_OPT_CFG;)
345# define OPT_NO_XLAT_OPT_NAMES STMTS(sntpOptions.fOptSet |= \
346 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
347
348# define OPT_XLAT_CFG_NAMES STMTS(sntpOptions.fOptSet &= \
349 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
350# define OPT_XLAT_OPT_NAMES STMTS(sntpOptions.fOptSet &= \
351 ~OPTPROC_NXLAT_OPT;)
352
353#else /* ENABLE_NLS */
354# define OPT_NO_XLAT_CFG_NAMES
355# define OPT_NO_XLAT_OPT_NAMES
356
357# define OPT_XLAT_CFG_NAMES
358# define OPT_XLAT_OPT_NAMES
359
360# ifndef _
361# define _(_s) _s
362# endif
363#endif /* ENABLE_NLS */
364
365#ifdef __cplusplus
366}
367#endif
368#endif /* AUTOOPTS_SNTP_OPTS_H_GUARD */
279#ifdef __cplusplus
280}
281#endif
282#endif /* AUTOOPTS_SNTP_OPTS_H_GUARD */
369
370/* sntp-opts.h ends here */
283/* sntp-opts.h ends here */