Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / ntp / dist / ntpsnmpd / ntpsnmpd-opts.h
blob055b902143f7ba0cd9485b5b7fbda33e9327b0e3
1 /* $NetBSD$ */
3 /*
4 * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h)
5 *
6 * It has been AutoGen-ed December 10, 2009 at 05:03:45 AM by AutoGen 5.10
7 * From the definitions ntpsnmpd-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 * ntpsnmpd 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 * ntpsnmpd 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 ntpsnmpd 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_NTPSNMPD_OPTS_H_GUARD
35 #define AUTOOPTS_NTPSNMPD_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_NOFORK = 0,
58 INDEX_OPT_SYSLOG = 1,
59 INDEX_OPT_VERSION = 2,
60 INDEX_OPT_HELP = 3,
61 INDEX_OPT_MORE_HELP = 4,
62 INDEX_OPT_SAVE_OPTS = 5,
63 INDEX_OPT_LOAD_OPTS = 6
64 } teOptIndex;
66 #define OPTION_CT 7
67 #define NTPSNMPD_VERSION "4.2.6"
68 #define NTPSNMPD_FULL_VERSION "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.6"
71 * Interface defines for all options. Replace "n" with the UPPER_CASED
72 * option name (as in the teOptIndex enumeration above).
73 * e.g. HAVE_OPT( NOFORK )
75 #define DESC(n) (ntpsnmpdOptions.pOptDesc[INDEX_OPT_## n])
76 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
77 #define OPT_ARG(n) (DESC(n).optArg.argString)
78 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
79 #define COUNT_OPT(n) (DESC(n).optOccCt)
80 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
81 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
82 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
83 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
84 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
85 #define CLEAR_OPT(n) STMTS( \
86 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
87 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
88 DESC(n).fOptState |= OPTST_DISABLED; \
89 DESC(n).optCookie = NULL )
92 * Make sure there are no #define name conflicts with the option names
94 #ifndef NO_OPTION_NAME_WARNINGS
95 # ifdef NOFORK
96 # warning undefining NOFORK due to option name conflict
97 # undef NOFORK
98 # endif
99 # ifdef SYSLOG
100 # warning undefining SYSLOG due to option name conflict
101 # undef SYSLOG
102 # endif
103 #else /* NO_OPTION_NAME_WARNINGS */
104 # undef NOFORK
105 # undef SYSLOG
106 #endif /* NO_OPTION_NAME_WARNINGS */
108 /* * * * * *
110 * Interface defines for specific options.
112 #define VALUE_OPT_NOFORK 'n'
113 #define VALUE_OPT_SYSLOG 'p'
114 #define VALUE_OPT_HELP '?'
115 #define VALUE_OPT_MORE_HELP '!'
116 #define VALUE_OPT_VERSION INDEX_OPT_VERSION
117 #define VALUE_OPT_SAVE_OPTS '>'
118 #define VALUE_OPT_LOAD_OPTS '<'
119 #define SET_OPT_SAVE_OPTS(a) STMTS( \
120 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
121 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
122 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
124 * Interface defines not associated with particular options
126 #define ERRSKIP_OPTERR STMTS( ntpsnmpdOptions.fOptSet &= ~OPTPROC_ERRSTOP )
127 #define ERRSTOP_OPTERR STMTS( ntpsnmpdOptions.fOptSet |= OPTPROC_ERRSTOP )
128 #define RESTART_OPT(n) STMTS( \
129 ntpsnmpdOptions.curOptIdx = (n); \
130 ntpsnmpdOptions.pzCurOpt = NULL )
131 #define START_OPT RESTART_OPT(1)
132 #define USAGE(c) (*ntpsnmpdOptions.pUsageProc)( &ntpsnmpdOptions, c )
133 /* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */
135 /* * * * * *
137 * Declare the ntpsnmpd option descriptor.
139 #ifdef __cplusplus
140 extern "C" {
141 #endif
143 extern tOptions ntpsnmpdOptions;
145 #if defined(ENABLE_NLS)
146 # ifndef _
147 # include <stdio.h>
148 static inline char* aoGetsText( char const* pz ) {
149 if (pz == NULL) return NULL;
150 return (char*)gettext( pz );
152 # define _(s) aoGetsText(s)
153 # endif /* _() */
155 # define OPT_NO_XLAT_CFG_NAMES STMTS(ntpsnmpdOptions.fOptSet |= \
156 OPTPROC_NXLAT_OPT_CFG;)
157 # define OPT_NO_XLAT_OPT_NAMES STMTS(ntpsnmpdOptions.fOptSet |= \
158 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
160 # define OPT_XLAT_CFG_NAMES STMTS(ntpsnmpdOptions.fOptSet &= \
161 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
162 # define OPT_XLAT_OPT_NAMES STMTS(ntpsnmpdOptions.fOptSet &= \
163 ~OPTPROC_NXLAT_OPT;)
165 #else /* ENABLE_NLS */
166 # define OPT_NO_XLAT_CFG_NAMES
167 # define OPT_NO_XLAT_OPT_NAMES
169 # define OPT_XLAT_CFG_NAMES
170 # define OPT_XLAT_OPT_NAMES
172 # ifndef _
173 # define _(_s) _s
174 # endif
175 #endif /* ENABLE_NLS */
177 #ifdef __cplusplus
179 #endif
180 #endif /* AUTOOPTS_NTPSNMPD_OPTS_H_GUARD */
181 /* ntpsnmpd-opts.h ends here */