Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / ntpq / ntpq-opts.h
blobbc452fe831cac25b1ef08e121e8b39ab0a7aee2d
1 /* $NetBSD$ */
3 /*
4 * EDIT THIS FILE WITH CAUTION (ntpq-opts.h)
5 *
6 * It has been AutoGen-ed Tuesday December 8, 2009 at 08:14:26 AM EST
7 * From the definitions ntpq-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 * ntpq 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 * ntpq copyright 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 ntpq 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_NTPQ_OPTS_H_GUARD
35 #define AUTOOPTS_NTPQ_OPTS_H_GUARD
36 #include "config.h"
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 118784
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
50 Choke Me.
51 #endif
54 * Enumeration of each option:
56 typedef enum {
57 INDEX_OPT_IPV4 = 0,
58 INDEX_OPT_IPV6 = 1,
59 INDEX_OPT_COMMAND = 2,
60 INDEX_OPT_DEBUG_LEVEL = 3,
61 INDEX_OPT_SET_DEBUG_LEVEL = 4,
62 INDEX_OPT_PEERS = 5,
63 INDEX_OPT_INTERACTIVE = 6,
64 INDEX_OPT_NUMERIC = 7,
65 INDEX_OPT_VERSION = 8,
66 INDEX_OPT_HELP = 9,
67 INDEX_OPT_MORE_HELP = 10,
68 INDEX_OPT_SAVE_OPTS = 11,
69 INDEX_OPT_LOAD_OPTS = 12
70 } teOptIndex;
72 #define OPTION_CT 13
73 #define NTPQ_VERSION "4.2.4p8"
74 #define NTPQ_FULL_VERSION "ntpq - standard NTP query program - Ver. 4.2.4p8"
77 * Interface defines for all options. Replace "n" with the UPPER_CASED
78 * option name (as in the teOptIndex enumeration above).
79 * e.g. HAVE_OPT( IPV4 )
81 #define DESC(n) (ntpqOptions.pOptDesc[INDEX_OPT_## n])
82 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
83 #define OPT_ARG(n) (DESC(n).optArg.argString)
84 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
85 #define COUNT_OPT(n) (DESC(n).optOccCt)
86 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
87 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
88 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
89 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
90 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
91 #define CLEAR_OPT(n) STMTS( \
92 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
93 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
94 DESC(n).fOptState |= OPTST_DISABLED; \
95 DESC(n).optCookie = NULL )
98 * Make sure there are no #define name conflicts with the option names
100 #ifndef NO_OPTION_NAME_WARNINGS
101 # ifdef IPV4
102 # warning undefining IPV4 due to option name conflict
103 # undef IPV4
104 # endif
105 # ifdef IPV6
106 # warning undefining IPV6 due to option name conflict
107 # undef IPV6
108 # endif
109 # ifdef COMMAND
110 # warning undefining COMMAND due to option name conflict
111 # undef COMMAND
112 # endif
113 # ifdef DEBUG_LEVEL
114 # warning undefining DEBUG_LEVEL due to option name conflict
115 # undef DEBUG_LEVEL
116 # endif
117 # ifdef SET_DEBUG_LEVEL
118 # warning undefining SET_DEBUG_LEVEL due to option name conflict
119 # undef SET_DEBUG_LEVEL
120 # endif
121 # ifdef PEERS
122 # warning undefining PEERS due to option name conflict
123 # undef PEERS
124 # endif
125 # ifdef INTERACTIVE
126 # warning undefining INTERACTIVE due to option name conflict
127 # undef INTERACTIVE
128 # endif
129 # ifdef NUMERIC
130 # warning undefining NUMERIC due to option name conflict
131 # undef NUMERIC
132 # endif
133 #else /* NO_OPTION_NAME_WARNINGS */
134 # undef IPV4
135 # undef IPV6
136 # undef COMMAND
137 # undef DEBUG_LEVEL
138 # undef SET_DEBUG_LEVEL
139 # undef PEERS
140 # undef INTERACTIVE
141 # undef NUMERIC
142 #endif /* NO_OPTION_NAME_WARNINGS */
145 * Interface defines for specific options.
147 #define VALUE_OPT_IPV4 '4'
148 #define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
149 #define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
150 #define VALUE_OPT_IPV6 '6'
151 #define VALUE_OPT_COMMAND 'c'
152 #ifdef DEBUG
153 #define VALUE_OPT_DEBUG_LEVEL 'd'
154 #endif /* DEBUG */
155 #ifdef DEBUG
156 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
157 #endif /* DEBUG */
158 #define VALUE_OPT_PEERS 'p'
159 #define VALUE_OPT_INTERACTIVE 'i'
160 #define VALUE_OPT_NUMERIC 'n'
162 #define VALUE_OPT_VERSION 'v'
163 #define VALUE_OPT_HELP '?'
164 #define VALUE_OPT_MORE_HELP '!'
165 #define VALUE_OPT_SAVE_OPTS '>'
166 #define VALUE_OPT_LOAD_OPTS '<'
167 #define SET_OPT_SAVE_OPTS(a) STMTS( \
168 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
169 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
170 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
172 * Interface defines not associated with particular options
174 #define ERRSKIP_OPTERR STMTS( ntpqOptions.fOptSet &= ~OPTPROC_ERRSTOP )
175 #define ERRSTOP_OPTERR STMTS( ntpqOptions.fOptSet |= OPTPROC_ERRSTOP )
176 #define RESTART_OPT(n) STMTS( \
177 ntpqOptions.curOptIdx = (n); \
178 ntpqOptions.pzCurOpt = NULL )
179 #define START_OPT RESTART_OPT(1)
180 #define USAGE(c) (*ntpqOptions.pUsageProc)( &ntpqOptions, c )
181 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/opthead.tpl near line 360 */
183 /* * * * * *
185 * Declare the ntpq option descriptor.
187 #ifdef __cplusplus
188 extern "C" {
189 #endif
191 extern tOptions ntpqOptions;
193 #ifndef _
194 # if ENABLE_NLS
195 # include <stdio.h>
196 static inline char* aoGetsText( char const* pz ) {
197 if (pz == NULL) return NULL;
198 return (char*)gettext( pz );
200 # define _(s) aoGetsText(s)
201 # else /* ENABLE_NLS */
202 # define _(s) s
203 # endif /* ENABLE_NLS */
204 #endif
206 #ifdef __cplusplus
208 #endif
209 #endif /* AUTOOPTS_NTPQ_OPTS_H_GUARD */
210 /* ntpq-opts.h ends here */