Annotation of embedaddon/ntp/ntpdc/ntpdc-opts.h, revision 1.1.1.1
1.1 misho 1: /*
2: * EDIT THIS FILE WITH CAUTION (ntpdc-opts.h)
3: *
4: * It has been AutoGen-ed December 24, 2011 at 06:34:16 PM by AutoGen 5.12
5: * From the definitions ntpdc-opts.def
6: * and the template file options
7: *
8: * Generated from AutoOpts 35:0:10 templates.
9: *
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 ntpdc 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.
17: *
18: * This source file is copyrighted and licensed under the following terms:
19: *
20: * see html/copyright.html
21: *
22: */
23: /*
24: * This file contains the programmatic interface to the Automated
25: * Options generated for the ntpdc program.
26: * These macros are documented in the AutoGen info file in the
27: * "AutoOpts" chapter. Please refer to that doc for usage help.
28: */
29: #ifndef AUTOOPTS_NTPDC_OPTS_H_GUARD
30: #define AUTOOPTS_NTPDC_OPTS_H_GUARD 1
31: #include "config.h"
32: #include <autoopts/options.h>
33:
34: /*
35: * Ensure that the library used for compiling this generated header is at
36: * least as new as the version current when the header template was released
37: * (not counting patch version increments). Also ensure that the oldest
38: * tolerable version is at least as old as what was current when the header
39: * template was released.
40: */
41: #define AO_TEMPLATE_VERSION 143360
42: #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
43: || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
44: # error option template version mismatches autoopts/options.h header
45: Choke Me.
46: #endif
47:
48: /*
49: * Enumeration of each option:
50: */
51: typedef enum {
52: INDEX_OPT_IPV4 = 0,
53: INDEX_OPT_IPV6 = 1,
54: INDEX_OPT_COMMAND = 2,
55: INDEX_OPT_LISTPEERS = 3,
56: INDEX_OPT_PEERS = 4,
57: INDEX_OPT_SHOWPEERS = 5,
58: INDEX_OPT_INTERACTIVE = 6,
59: INDEX_OPT_DEBUG_LEVEL = 7,
60: INDEX_OPT_SET_DEBUG_LEVEL = 8,
61: INDEX_OPT_NUMERIC = 9,
62: INDEX_OPT_VERSION = 10,
63: INDEX_OPT_HELP = 11,
64: INDEX_OPT_MORE_HELP = 12,
65: INDEX_OPT_SAVE_OPTS = 13,
66: INDEX_OPT_LOAD_OPTS = 14
67: } teOptIndex;
68:
69: #define OPTION_CT 15
70: #define NTPDC_VERSION "4.2.6p5"
71: #define NTPDC_FULL_VERSION "ntpdc 4.2.6p5"
72:
73: /*
74: * Interface defines for all options. Replace "n" with the UPPER_CASED
75: * option name (as in the teOptIndex enumeration above).
76: * e.g. HAVE_OPT(IPV4)
77: */
78: #define DESC(n) (ntpdcOptions.pOptDesc[INDEX_OPT_## n])
79: #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
80: #define OPT_ARG(n) (DESC(n).optArg.argString)
81: #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
82: #define COUNT_OPT(n) (DESC(n).optOccCt)
83: #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
84: #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
85: #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
86: #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
87: #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
88: #define CLEAR_OPT(n) STMTS( \
89: DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
90: if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
91: DESC(n).fOptState |= OPTST_DISABLED; \
92: DESC(n).optCookie = NULL )
93:
94: /* * * * * *
95: *
96: * Enumeration of ntpdc exit codes
97: */
98: typedef enum {
99: NTPDC_EXIT_SUCCESS = 0,
100: NTPDC_EXIT_FAILURE = 1
101: } ntpdc_exit_code_t;
102: /*
103: * Make sure there are no #define name conflicts with the option names
104: */
105: #ifndef NO_OPTION_NAME_WARNINGS
106: # ifdef IPV4
107: # warning undefining IPV4 due to option name conflict
108: # undef IPV4
109: # endif
110: # ifdef IPV6
111: # warning undefining IPV6 due to option name conflict
112: # undef IPV6
113: # endif
114: # ifdef COMMAND
115: # warning undefining COMMAND due to option name conflict
116: # undef COMMAND
117: # endif
118: # ifdef LISTPEERS
119: # warning undefining LISTPEERS due to option name conflict
120: # undef LISTPEERS
121: # endif
122: # ifdef PEERS
123: # warning undefining PEERS due to option name conflict
124: # undef PEERS
125: # endif
126: # ifdef SHOWPEERS
127: # warning undefining SHOWPEERS due to option name conflict
128: # undef SHOWPEERS
129: # endif
130: # ifdef INTERACTIVE
131: # warning undefining INTERACTIVE due to option name conflict
132: # undef INTERACTIVE
133: # endif
134: # ifdef DEBUG_LEVEL
135: # warning undefining DEBUG_LEVEL due to option name conflict
136: # undef DEBUG_LEVEL
137: # endif
138: # ifdef SET_DEBUG_LEVEL
139: # warning undefining SET_DEBUG_LEVEL due to option name conflict
140: # undef SET_DEBUG_LEVEL
141: # endif
142: # ifdef NUMERIC
143: # warning undefining NUMERIC due to option name conflict
144: # undef NUMERIC
145: # endif
146: #else /* NO_OPTION_NAME_WARNINGS */
147: # undef IPV4
148: # undef IPV6
149: # undef COMMAND
150: # undef LISTPEERS
151: # undef PEERS
152: # undef SHOWPEERS
153: # undef INTERACTIVE
154: # undef DEBUG_LEVEL
155: # undef SET_DEBUG_LEVEL
156: # undef NUMERIC
157: #endif /* NO_OPTION_NAME_WARNINGS */
158:
159: /* * * * * *
160: *
161: * Interface defines for specific options.
162: */
163: #define VALUE_OPT_IPV4 '4'
164: #define VALUE_OPT_IPV6 '6'
165: #define VALUE_OPT_COMMAND 'c'
166: #define VALUE_OPT_LISTPEERS 'l'
167: #define VALUE_OPT_PEERS 'p'
168: #define VALUE_OPT_SHOWPEERS 's'
169: #define VALUE_OPT_INTERACTIVE 'i'
170: #define VALUE_OPT_DEBUG_LEVEL 'd'
171: #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
172: #define VALUE_OPT_NUMERIC 'n'
173: #define VALUE_OPT_HELP '?'
174: #define VALUE_OPT_MORE_HELP '!'
175: #define VALUE_OPT_VERSION INDEX_OPT_VERSION
176: #define VALUE_OPT_SAVE_OPTS '>'
177: #define VALUE_OPT_LOAD_OPTS '<'
178: #define SET_OPT_SAVE_OPTS(a) STMTS( \
179: DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
180: DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
181: DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
182: /*
183: * Interface defines not associated with particular options
184: */
185: #define ERRSKIP_OPTERR STMTS(ntpdcOptions.fOptSet &= ~OPTPROC_ERRSTOP)
186: #define ERRSTOP_OPTERR STMTS(ntpdcOptions.fOptSet |= OPTPROC_ERRSTOP)
187: #define RESTART_OPT(n) STMTS( \
188: ntpdcOptions.curOptIdx = (n); \
189: ntpdcOptions.pzCurOpt = NULL)
190: #define START_OPT RESTART_OPT(1)
191: #define USAGE(c) (*ntpdcOptions.pUsageProc)(&ntpdcOptions, c)
192: /* extracted from opthead.tlib near line 451 */
193:
194: #ifdef __cplusplus
195: extern "C" {
196: #endif
197:
198: /* * * * * *
199: *
200: * Declare the ntpdc option descriptor.
201: */
202: extern tOptions ntpdcOptions;
203:
204: #if defined(ENABLE_NLS)
205: # ifndef _
206: # include <stdio.h>
207: static inline char* aoGetsText(char const* pz) {
208: if (pz == NULL) return NULL;
209: return (char*)gettext(pz);
210: }
211: # define _(s) aoGetsText(s)
212: # endif /* _() */
213:
214: # define OPT_NO_XLAT_CFG_NAMES STMTS(ntpdcOptions.fOptSet |= \
215: OPTPROC_NXLAT_OPT_CFG;)
216: # define OPT_NO_XLAT_OPT_NAMES STMTS(ntpdcOptions.fOptSet |= \
217: OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
218:
219: # define OPT_XLAT_CFG_NAMES STMTS(ntpdcOptions.fOptSet &= \
220: ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
221: # define OPT_XLAT_OPT_NAMES STMTS(ntpdcOptions.fOptSet &= \
222: ~OPTPROC_NXLAT_OPT;)
223:
224: #else /* ENABLE_NLS */
225: # define OPT_NO_XLAT_CFG_NAMES
226: # define OPT_NO_XLAT_OPT_NAMES
227:
228: # define OPT_XLAT_CFG_NAMES
229: # define OPT_XLAT_OPT_NAMES
230:
231: # ifndef _
232: # define _(_s) _s
233: # endif
234: #endif /* ENABLE_NLS */
235:
236: #ifdef __cplusplus
237: }
238: #endif
239: #endif /* AUTOOPTS_NTPDC_OPTS_H_GUARD */
240: /* ntpdc-opts.h ends here */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>