Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / ntp / dist / ntpdc / ntpdc-opts.h
blob34719bca2074e0460ad2248b36345c672576abcf
1 /* $NetBSD$ */
3 /*
4 * EDIT THIS FILE WITH CAUTION (ntpdc-opts.h)
5 *
6 * It has been AutoGen-ed December 10, 2009 at 05:02:36 AM by AutoGen 5.10
7 * From the definitions ntpdc-opts.def
8 * and the template file options
10 * Generated from AutoOpts 33:0:8 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 * ntpdc 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 * ntpdc copyright (c) 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 ntpdc 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_NTPDC_OPTS_H_GUARD
35 #define AUTOOPTS_NTPDC_OPTS_H_GUARD 1
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 135168
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_LISTPEERS = 3,
61 INDEX_OPT_PEERS = 4,
62 INDEX_OPT_SHOWPEERS = 5,
63 INDEX_OPT_INTERACTIVE = 6,
64 INDEX_OPT_DEBUG_LEVEL = 7,
65 INDEX_OPT_SET_DEBUG_LEVEL = 8,
66 INDEX_OPT_NUMERIC = 9,
67 INDEX_OPT_VERSION = 10,
68 INDEX_OPT_HELP = 11,
69 INDEX_OPT_MORE_HELP = 12,
70 INDEX_OPT_SAVE_OPTS = 13,
71 INDEX_OPT_LOAD_OPTS = 14
72 } teOptIndex;
74 #define OPTION_CT 15
75 #define NTPDC_VERSION "4.2.6"
76 #define NTPDC_FULL_VERSION "ntpdc - vendor-specific NTP query program - Ver. 4.2.6"
79 * Interface defines for all options. Replace "n" with the UPPER_CASED
80 * option name (as in the teOptIndex enumeration above).
81 * e.g. HAVE_OPT( IPV4 )
83 #define DESC(n) (ntpdcOptions.pOptDesc[INDEX_OPT_## n])
84 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
85 #define OPT_ARG(n) (DESC(n).optArg.argString)
86 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
87 #define COUNT_OPT(n) (DESC(n).optOccCt)
88 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
89 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
90 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
91 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
92 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
93 #define CLEAR_OPT(n) STMTS( \
94 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
95 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
96 DESC(n).fOptState |= OPTST_DISABLED; \
97 DESC(n).optCookie = NULL )
100 * Make sure there are no #define name conflicts with the option names
102 #ifndef NO_OPTION_NAME_WARNINGS
103 # ifdef IPV4
104 # warning undefining IPV4 due to option name conflict
105 # undef IPV4
106 # endif
107 # ifdef IPV6
108 # warning undefining IPV6 due to option name conflict
109 # undef IPV6
110 # endif
111 # ifdef COMMAND
112 # warning undefining COMMAND due to option name conflict
113 # undef COMMAND
114 # endif
115 # ifdef LISTPEERS
116 # warning undefining LISTPEERS due to option name conflict
117 # undef LISTPEERS
118 # endif
119 # ifdef PEERS
120 # warning undefining PEERS due to option name conflict
121 # undef PEERS
122 # endif
123 # ifdef SHOWPEERS
124 # warning undefining SHOWPEERS due to option name conflict
125 # undef SHOWPEERS
126 # endif
127 # ifdef INTERACTIVE
128 # warning undefining INTERACTIVE due to option name conflict
129 # undef INTERACTIVE
130 # endif
131 # ifdef DEBUG_LEVEL
132 # warning undefining DEBUG_LEVEL due to option name conflict
133 # undef DEBUG_LEVEL
134 # endif
135 # ifdef SET_DEBUG_LEVEL
136 # warning undefining SET_DEBUG_LEVEL due to option name conflict
137 # undef SET_DEBUG_LEVEL
138 # endif
139 # ifdef NUMERIC
140 # warning undefining NUMERIC due to option name conflict
141 # undef NUMERIC
142 # endif
143 #else /* NO_OPTION_NAME_WARNINGS */
144 # undef IPV4
145 # undef IPV6
146 # undef COMMAND
147 # undef LISTPEERS
148 # undef PEERS
149 # undef SHOWPEERS
150 # undef INTERACTIVE
151 # undef DEBUG_LEVEL
152 # undef SET_DEBUG_LEVEL
153 # undef NUMERIC
154 #endif /* NO_OPTION_NAME_WARNINGS */
156 /* * * * * *
158 * Interface defines for specific options.
160 #define VALUE_OPT_IPV4 '4'
161 #define VALUE_OPT_IPV6 '6'
162 #define VALUE_OPT_COMMAND 'c'
163 #define VALUE_OPT_LISTPEERS 'l'
164 #define VALUE_OPT_PEERS 'p'
165 #define VALUE_OPT_SHOWPEERS 's'
166 #define VALUE_OPT_INTERACTIVE 'i'
167 #define VALUE_OPT_DEBUG_LEVEL 'd'
168 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
169 #define VALUE_OPT_NUMERIC 'n'
170 #define VALUE_OPT_HELP '?'
171 #define VALUE_OPT_MORE_HELP '!'
172 #define VALUE_OPT_VERSION INDEX_OPT_VERSION
173 #define VALUE_OPT_SAVE_OPTS '>'
174 #define VALUE_OPT_LOAD_OPTS '<'
175 #define SET_OPT_SAVE_OPTS(a) STMTS( \
176 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
177 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
178 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
180 * Interface defines not associated with particular options
182 #define ERRSKIP_OPTERR STMTS( ntpdcOptions.fOptSet &= ~OPTPROC_ERRSTOP )
183 #define ERRSTOP_OPTERR STMTS( ntpdcOptions.fOptSet |= OPTPROC_ERRSTOP )
184 #define RESTART_OPT(n) STMTS( \
185 ntpdcOptions.curOptIdx = (n); \
186 ntpdcOptions.pzCurOpt = NULL )
187 #define START_OPT RESTART_OPT(1)
188 #define USAGE(c) (*ntpdcOptions.pUsageProc)( &ntpdcOptions, c )
189 /* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */
191 /* * * * * *
193 * Declare the ntpdc option descriptor.
195 #ifdef __cplusplus
196 extern "C" {
197 #endif
199 extern tOptions ntpdcOptions;
201 #if defined(ENABLE_NLS)
202 # ifndef _
203 # include <stdio.h>
204 static inline char* aoGetsText( char const* pz ) {
205 if (pz == NULL) return NULL;
206 return (char*)gettext( pz );
208 # define _(s) aoGetsText(s)
209 # endif /* _() */
211 # define OPT_NO_XLAT_CFG_NAMES STMTS(ntpdcOptions.fOptSet |= \
212 OPTPROC_NXLAT_OPT_CFG;)
213 # define OPT_NO_XLAT_OPT_NAMES STMTS(ntpdcOptions.fOptSet |= \
214 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
216 # define OPT_XLAT_CFG_NAMES STMTS(ntpdcOptions.fOptSet &= \
217 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
218 # define OPT_XLAT_OPT_NAMES STMTS(ntpdcOptions.fOptSet &= \
219 ~OPTPROC_NXLAT_OPT;)
221 #else /* ENABLE_NLS */
222 # define OPT_NO_XLAT_CFG_NAMES
223 # define OPT_NO_XLAT_OPT_NAMES
225 # define OPT_XLAT_CFG_NAMES
226 # define OPT_XLAT_OPT_NAMES
228 # ifndef _
229 # define _(_s) _s
230 # endif
231 #endif /* ENABLE_NLS */
233 #ifdef __cplusplus
235 #endif
236 #endif /* AUTOOPTS_NTPDC_OPTS_H_GUARD */
237 /* ntpdc-opts.h ends here */