1
/* -*- buffer-read-only: t -*- vi: set ro:
3
* DO NOT EDIT THIS FILE (ntpq-opts.h)
5
* It has been AutoGen-ed Monday September 10, 2007 at 08:38:18 PM EDT
6
* From the definitions ntpq-opts.def
7
* and the template file options
9
* Generated from AutoOpts 29:0:4 templates.
13
* This file was produced by an AutoOpts template. AutoOpts is a
14
* copyrighted work. This header file is not encumbered by AutoOpts
15
* licensing, but is provided under the licensing terms chosen by the
16
* ntpq author or copyright holder. AutoOpts is licensed under
17
* the terms of the LGPL. The redistributable library (``libopts'') is
18
* licensed under the terms of either the LGPL or, at the users discretion,
19
* the BSD license. See the AutoOpts and/or libopts sources for details.
21
* This source file is copyrighted and licensed under the following terms:
23
* ntpq copyright 1970-2007 David L. Mills and/or others - all rights reserved
25
* see html/copyright.html
28
* This file contains the programmatic interface to the Automated
29
* Options generated for the ntpq program.
30
* These macros are documented in the AutoGen info file in the
31
* "AutoOpts" chapter. Please refer to that doc for usage help.
33
#ifndef AUTOOPTS_NTPQ_OPTS_H_GUARD
34
#define AUTOOPTS_NTPQ_OPTS_H_GUARD
36
#include <autoopts/options.h>
39
* Ensure that the library used for compiling this generated header is at
40
* least as new as the version current when the header template was released
41
* (not counting patch version increments). Also ensure that the oldest
42
* tolerable version is at least as old as what was current when the header
43
* template was released.
45
#define AO_TEMPLATE_VERSION 118784
46
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
47
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
48
# error option template version mismatches autoopts/options.h header
53
* Enumeration of each option:
58
INDEX_OPT_COMMAND = 2,
59
INDEX_OPT_DEBUG_LEVEL = 3,
60
INDEX_OPT_SET_DEBUG_LEVEL = 4,
62
INDEX_OPT_INTERACTIVE = 6,
63
INDEX_OPT_NUMERIC = 7,
64
INDEX_OPT_VERSION = 8,
66
INDEX_OPT_MORE_HELP = 10,
67
INDEX_OPT_SAVE_OPTS = 11,
68
INDEX_OPT_LOAD_OPTS = 12
72
#define NTPQ_VERSION "4.2.4p4"
73
#define NTPQ_FULL_VERSION "ntpq - standard NTP query program - Ver. 4.2.4p4"
76
* Interface defines for all options. Replace "n" with the UPPER_CASED
77
* option name (as in the teOptIndex enumeration above).
78
* e.g. HAVE_OPT( IPV4 )
80
#define DESC(n) (ntpqOptions.pOptDesc[INDEX_OPT_## n])
81
#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
82
#define OPT_ARG(n) (DESC(n).optArg.argString)
83
#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
84
#define COUNT_OPT(n) (DESC(n).optOccCt)
85
#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
86
#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
87
#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
88
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
89
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
90
#define CLEAR_OPT(n) STMTS( \
91
DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
92
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
93
DESC(n).fOptState |= OPTST_DISABLED; \
94
DESC(n).optCookie = NULL )
97
* Make sure there are no #define name conflicts with the option names
99
#ifndef NO_OPTION_NAME_WARNINGS
101
# warning undefining IPV4 due to option name conflict
105
# warning undefining IPV6 due to option name conflict
109
# warning undefining COMMAND due to option name conflict
113
# warning undefining DEBUG_LEVEL due to option name conflict
116
# ifdef SET_DEBUG_LEVEL
117
# warning undefining SET_DEBUG_LEVEL due to option name conflict
118
# undef SET_DEBUG_LEVEL
121
# warning undefining PEERS due to option name conflict
125
# warning undefining INTERACTIVE due to option name conflict
129
# warning undefining NUMERIC due to option name conflict
132
#else /* NO_OPTION_NAME_WARNINGS */
137
# undef SET_DEBUG_LEVEL
141
#endif /* NO_OPTION_NAME_WARNINGS */
144
* Interface defines for specific options.
146
#define VALUE_OPT_IPV4 '4'
147
#define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
148
#define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
149
#define VALUE_OPT_IPV6 '6'
150
#define VALUE_OPT_COMMAND 'c'
152
#define VALUE_OPT_DEBUG_LEVEL 'd'
155
#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
157
#define VALUE_OPT_PEERS 'p'
158
#define VALUE_OPT_INTERACTIVE 'i'
159
#define VALUE_OPT_NUMERIC 'n'
161
#define VALUE_OPT_VERSION 'v'
162
#define VALUE_OPT_HELP '?'
163
#define VALUE_OPT_MORE_HELP '!'
164
#define VALUE_OPT_SAVE_OPTS '>'
165
#define VALUE_OPT_LOAD_OPTS '<'
166
#define SET_OPT_SAVE_OPTS(a) STMTS( \
167
DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
168
DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
169
DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
171
* Interface defines not associated with particular options
173
#define ERRSKIP_OPTERR STMTS( ntpqOptions.fOptSet &= ~OPTPROC_ERRSTOP )
174
#define ERRSTOP_OPTERR STMTS( ntpqOptions.fOptSet |= OPTPROC_ERRSTOP )
175
#define RESTART_OPT(n) STMTS( \
176
ntpqOptions.curOptIdx = (n); \
177
ntpqOptions.pzCurOpt = NULL )
178
#define START_OPT RESTART_OPT(1)
179
#define USAGE(c) (*ntpqOptions.pUsageProc)( &ntpqOptions, c )
180
/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
184
* Declare the ntpq option descriptor.
190
extern tOptions ntpqOptions;
195
static inline char* aoGetsText( char const* pz ) {
196
if (pz == NULL) return NULL;
197
return (char*)gettext( pz );
199
# define _(s) aoGetsText(s)
200
# else /* ENABLE_NLS */
202
# endif /* ENABLE_NLS */
208
#endif /* AUTOOPTS_NTPQ_OPTS_H_GUARD */
209
/* ntpq-opts.h ends here */