1 /* $NetBSD: ntpsnmpd-opts.h,v 1.1.1.2 2012/01/31 21:27:04 kardel Exp $ */ 2 3 /* 4 * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h) 5 * 6 * It has been AutoGen-ed December 24, 2011 at 06:34:36 PM by AutoGen 5.12 7 * From the definitions ntpsnmpd-opts.def 8 * and the template file options 9 * 10 * Generated from AutoOpts 35:0:10 templates. 11 * 12 * AutoOpts is a copyrighted work. This header file is not encumbered 13 * by AutoOpts licensing, but is provided under the licensing terms chosen 14 * by the ntpsnmpd author or copyright holder. AutoOpts is 15 * licensed under the terms of the LGPL. The redistributable library 16 * (``libopts'') is licensed under the terms of either the LGPL or, at the 17 * users discretion, the BSD license. See the AutoOpts and/or libopts sources 18 * for details. 19 * 20 * This source file is copyrighted and licensed under the following terms: 21 * 22 * see html/copyright.html 23 * 24 */ 25 /* 26 * This file contains the programmatic interface to the Automated 27 * Options generated for the ntpsnmpd program. 28 * These macros are documented in the AutoGen info file in the 29 * "AutoOpts" chapter. Please refer to that doc for usage help. 30 */ 31 #ifndef AUTOOPTS_NTPSNMPD_OPTS_H_GUARD 32 #define AUTOOPTS_NTPSNMPD_OPTS_H_GUARD 1 33 #include "config.h" 34 #include <autoopts/options.h> 35 36 /* 37 * Ensure that the library used for compiling this generated header is at 38 * least as new as the version current when the header template was released 39 * (not counting patch version increments). Also ensure that the oldest 40 * tolerable version is at least as old as what was current when the header 41 * template was released. 42 */ 43 #define AO_TEMPLATE_VERSION 143360 44 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ 45 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) 46 # error option template version mismatches autoopts/options.h header 47 Choke Me. 48 #endif 49 50 /* 51 * Enumeration of each option: 52 */ 53 typedef enum { 54 INDEX_OPT_NOFORK = 0, 55 INDEX_OPT_SYSLOG = 1, 56 INDEX_OPT_AGENTXSOCKET = 2, 57 INDEX_OPT_VERSION = 3, 58 INDEX_OPT_HELP = 4, 59 INDEX_OPT_MORE_HELP = 5, 60 INDEX_OPT_SAVE_OPTS = 6, 61 INDEX_OPT_LOAD_OPTS = 7 62 } teOptIndex; 63 64 #define OPTION_CT 8 65 #define NTPSNMPD_VERSION "4.2.6p5" 66 #define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.6p5" 67 68 /* 69 * Interface defines for all options. Replace "n" with the UPPER_CASED 70 * option name (as in the teOptIndex enumeration above). 71 * e.g. HAVE_OPT(NOFORK) 72 */ 73 #define DESC(n) (ntpsnmpdOptions.pOptDesc[INDEX_OPT_## n]) 74 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) 75 #define OPT_ARG(n) (DESC(n).optArg.argString) 76 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) 77 #define COUNT_OPT(n) (DESC(n).optOccCt) 78 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) 79 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) 80 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) 81 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) 82 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) 83 #define CLEAR_OPT(n) STMTS( \ 84 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ 85 if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ 86 DESC(n).fOptState |= OPTST_DISABLED; \ 87 DESC(n).optCookie = NULL ) 88 89 /* * * * * * 90 * 91 * Enumeration of ntpsnmpd exit codes 92 */ 93 typedef enum { 94 NTPSNMPD_EXIT_SUCCESS = 0, 95 NTPSNMPD_EXIT_FAILURE = 1 96 } ntpsnmpd_exit_code_t; 97 /* 98 * Make sure there are no #define name conflicts with the option names 99 */ 100 #ifndef NO_OPTION_NAME_WARNINGS 101 # ifdef NOFORK 102 # warning undefining NOFORK due to option name conflict 103 # undef NOFORK 104 # endif 105 # ifdef SYSLOG 106 # warning undefining SYSLOG due to option name conflict 107 # undef SYSLOG 108 # endif 109 # ifdef AGENTXSOCKET 110 # warning undefining AGENTXSOCKET due to option name conflict 111 # undef AGENTXSOCKET 112 # endif 113 #else /* NO_OPTION_NAME_WARNINGS */ 114 # undef NOFORK 115 # undef SYSLOG 116 # undef AGENTXSOCKET 117 #endif /* NO_OPTION_NAME_WARNINGS */ 118 119 /* * * * * * 120 * 121 * Interface defines for specific options. 122 */ 123 #define VALUE_OPT_NOFORK 'n' 124 #define VALUE_OPT_SYSLOG 'p' 125 #define VALUE_OPT_AGENTXSOCKET 2 126 #define VALUE_OPT_HELP '?' 127 #define VALUE_OPT_MORE_HELP '!' 128 #define VALUE_OPT_VERSION INDEX_OPT_VERSION 129 #define VALUE_OPT_SAVE_OPTS '>' 130 #define VALUE_OPT_LOAD_OPTS '<' 131 #define SET_OPT_SAVE_OPTS(a) STMTS( \ 132 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \ 133 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \ 134 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) ) 135 /* 136 * Interface defines not associated with particular options 137 */ 138 #define ERRSKIP_OPTERR STMTS(ntpsnmpdOptions.fOptSet &= ~OPTPROC_ERRSTOP) 139 #define ERRSTOP_OPTERR STMTS(ntpsnmpdOptions.fOptSet |= OPTPROC_ERRSTOP) 140 #define RESTART_OPT(n) STMTS( \ 141 ntpsnmpdOptions.curOptIdx = (n); \ 142 ntpsnmpdOptions.pzCurOpt = NULL) 143 #define START_OPT RESTART_OPT(1) 144 #define USAGE(c) (*ntpsnmpdOptions.pUsageProc)(&ntpsnmpdOptions, c) 145 /* extracted from opthead.tlib near line 451 */ 146 147 #ifdef __cplusplus 148 extern "C" { 149 #endif 150 151 /* * * * * * 152 * 153 * Declare the ntpsnmpd option descriptor. 154 */ 155 extern tOptions ntpsnmpdOptions; 156 157 #if defined(ENABLE_NLS) 158 # ifndef _ 159 # include <stdio.h> 160 static inline char* aoGetsText(char const* pz) { 161 if (pz == NULL) return NULL; 162 return (char*)gettext(pz); 163 } 164 # define _(s) aoGetsText(s) 165 # endif /* _() */ 166 167 # define OPT_NO_XLAT_CFG_NAMES STMTS(ntpsnmpdOptions.fOptSet |= \ 168 OPTPROC_NXLAT_OPT_CFG;) 169 # define OPT_NO_XLAT_OPT_NAMES STMTS(ntpsnmpdOptions.fOptSet |= \ 170 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) 171 172 # define OPT_XLAT_CFG_NAMES STMTS(ntpsnmpdOptions.fOptSet &= \ 173 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) 174 # define OPT_XLAT_OPT_NAMES STMTS(ntpsnmpdOptions.fOptSet &= \ 175 ~OPTPROC_NXLAT_OPT;) 176 177 #else /* ENABLE_NLS */ 178 # define OPT_NO_XLAT_CFG_NAMES 179 # define OPT_NO_XLAT_OPT_NAMES 180 181 # define OPT_XLAT_CFG_NAMES 182 # define OPT_XLAT_OPT_NAMES 183 184 # ifndef _ 185 # define _(_s) _s 186 # endif 187 #endif /* ENABLE_NLS */ 188 189 #ifdef __cplusplus 190 } 191 #endif 192 #endif /* AUTOOPTS_NTPSNMPD_OPTS_H_GUARD */ 193 /* ntpsnmpd-opts.h ends here */ 194