1/* 2 * EDIT THIS FILE WITH CAUTION (ntpdc-opts.h) 3 * 4 * It has been AutoGen-ed December 10, 2009 at 05:02:36 AM by AutoGen 5.10 5 * From the definitions ntpdc-opts.def 6 * and the template file options 7 * 8 * Generated from AutoOpts 33:0:8 templates. 9 */ 10 11/* 12 * This file was produced by an AutoOpts template. AutoOpts is a 13 * copyrighted work. This header file is not encumbered by AutoOpts 14 * licensing, but is provided under the licensing terms chosen by the 15 * ntpdc author or copyright holder. AutoOpts is licensed under 16 * the terms of the LGPL. The redistributable library (``libopts'') is 17 * licensed under the terms of either the LGPL or, at the users discretion, 18 * the BSD license. See the AutoOpts and/or libopts sources for details. 19 * 20 * This source file is copyrighted and licensed under the following terms: 21 * 22 * ntpdc copyright (c) 1970-2009 David L. Mills and/or others - all rights reserved 23 * 24 * see html/copyright.html 25 */ 26/* 27 * This file contains the programmatic interface to the Automated 28 * Options generated for the ntpdc program. 29 * These macros are documented in the AutoGen info file in the 30 * "AutoOpts" chapter. Please refer to that doc for usage help. 31 */ 32#ifndef AUTOOPTS_NTPDC_OPTS_H_GUARD 33#define AUTOOPTS_NTPDC_OPTS_H_GUARD 1 34#include "config.h" 35#include <autoopts/options.h> 36 37/* 38 * Ensure that the library used for compiling this generated header is at 39 * least as new as the version current when the header template was released 40 * (not counting patch version increments). Also ensure that the oldest 41 * tolerable version is at least as old as what was current when the header 42 * template was released. 43 */ 44#define AO_TEMPLATE_VERSION 135168 45#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ 46 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) 47# error option template version mismatches autoopts/options.h header 48 Choke Me. 49#endif 50 51/* 52 * Enumeration of each option: 53 */ 54typedef enum { 55 INDEX_OPT_IPV4 = 0, 56 INDEX_OPT_IPV6 = 1, 57 INDEX_OPT_COMMAND = 2, 58 INDEX_OPT_LISTPEERS = 3, 59 INDEX_OPT_PEERS = 4, 60 INDEX_OPT_SHOWPEERS = 5, 61 INDEX_OPT_INTERACTIVE = 6, 62 INDEX_OPT_DEBUG_LEVEL = 7, 63 INDEX_OPT_SET_DEBUG_LEVEL = 8, 64 INDEX_OPT_NUMERIC = 9, 65 INDEX_OPT_VERSION = 10, 66 INDEX_OPT_HELP = 11, 67 INDEX_OPT_MORE_HELP = 12, 68 INDEX_OPT_SAVE_OPTS = 13, 69 INDEX_OPT_LOAD_OPTS = 14 70} teOptIndex; 71 72#define OPTION_CT 15 73#define NTPDC_VERSION "4.2.6" 74#define NTPDC_FULL_VERSION "ntpdc - vendor-specific NTP query program - Ver. 4.2.6" 75 76/* 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 ) 80 */ 81#define DESC(n) (ntpdcOptions.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 ) 96 97/* 98 * Make sure there are no #define name conflicts with the option names 99 */ 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 LISTPEERS 114# warning undefining LISTPEERS due to option name conflict 115# undef LISTPEERS 116# endif 117# ifdef PEERS 118# warning undefining PEERS due to option name conflict 119# undef PEERS 120# endif 121# ifdef SHOWPEERS 122# warning undefining SHOWPEERS due to option name conflict 123# undef SHOWPEERS 124# endif 125# ifdef INTERACTIVE 126# warning undefining INTERACTIVE due to option name conflict 127# undef INTERACTIVE 128# endif 129# ifdef DEBUG_LEVEL 130# warning undefining DEBUG_LEVEL due to option name conflict 131# undef DEBUG_LEVEL 132# endif 133# ifdef SET_DEBUG_LEVEL 134# warning undefining SET_DEBUG_LEVEL due to option name conflict 135# undef SET_DEBUG_LEVEL 136# endif 137# ifdef NUMERIC 138# warning undefining NUMERIC due to option name conflict 139# undef NUMERIC 140# endif 141#else /* NO_OPTION_NAME_WARNINGS */ 142# undef IPV4 143# undef IPV6 144# undef COMMAND 145# undef LISTPEERS 146# undef PEERS 147# undef SHOWPEERS 148# undef INTERACTIVE 149# undef DEBUG_LEVEL 150# undef SET_DEBUG_LEVEL 151# undef NUMERIC 152#endif /* NO_OPTION_NAME_WARNINGS */ 153 154/* * * * * * 155 * 156 * Interface defines for specific options. 157 */ 158#define VALUE_OPT_IPV4 '4' 159#define VALUE_OPT_IPV6 '6' 160#define VALUE_OPT_COMMAND 'c' 161#define VALUE_OPT_LISTPEERS 'l' 162#define VALUE_OPT_PEERS 'p' 163#define VALUE_OPT_SHOWPEERS 's' 164#define VALUE_OPT_INTERACTIVE 'i' 165#define VALUE_OPT_DEBUG_LEVEL 'd' 166#define VALUE_OPT_SET_DEBUG_LEVEL 'D' 167#define VALUE_OPT_NUMERIC 'n' 168#define VALUE_OPT_HELP '?' 169#define VALUE_OPT_MORE_HELP '!' 170#define VALUE_OPT_VERSION INDEX_OPT_VERSION 171#define VALUE_OPT_SAVE_OPTS '>' 172#define VALUE_OPT_LOAD_OPTS '<' 173#define SET_OPT_SAVE_OPTS(a) STMTS( \ 174 DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \ 175 DESC(SAVE_OPTS).fOptState |= OPTST_SET; \ 176 DESC(SAVE_OPTS).optArg.argString = (char const*)(a) ) 177/* 178 * Interface defines not associated with particular options 179 */ 180#define ERRSKIP_OPTERR STMTS( ntpdcOptions.fOptSet &= ~OPTPROC_ERRSTOP ) 181#define ERRSTOP_OPTERR STMTS( ntpdcOptions.fOptSet |= OPTPROC_ERRSTOP ) 182#define RESTART_OPT(n) STMTS( \ 183 ntpdcOptions.curOptIdx = (n); \ 184 ntpdcOptions.pzCurOpt = NULL ) 185#define START_OPT RESTART_OPT(1) 186#define USAGE(c) (*ntpdcOptions.pUsageProc)( &ntpdcOptions, c ) 187/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */ 188 189/* * * * * * 190 * 191 * Declare the ntpdc option descriptor. 192 */ 193#ifdef __cplusplus 194extern "C" { 195#endif 196 197extern tOptions ntpdcOptions; 198 199#if defined(ENABLE_NLS) 200# ifndef _ 201# include <stdio.h> 202 static inline char* aoGetsText( char const* pz ) { 203 if (pz == NULL) return NULL; 204 return (char*)gettext( pz ); 205 } 206# define _(s) aoGetsText(s) 207# endif /* _() */ 208 209# define OPT_NO_XLAT_CFG_NAMES STMTS(ntpdcOptions.fOptSet |= \ 210 OPTPROC_NXLAT_OPT_CFG;) 211# define OPT_NO_XLAT_OPT_NAMES STMTS(ntpdcOptions.fOptSet |= \ 212 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) 213 214# define OPT_XLAT_CFG_NAMES STMTS(ntpdcOptions.fOptSet &= \ 215 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) 216# define OPT_XLAT_OPT_NAMES STMTS(ntpdcOptions.fOptSet &= \ 217 ~OPTPROC_NXLAT_OPT;) 218 219#else /* ENABLE_NLS */ 220# define OPT_NO_XLAT_CFG_NAMES 221# define OPT_NO_XLAT_OPT_NAMES 222 223# define OPT_XLAT_CFG_NAMES 224# define OPT_XLAT_OPT_NAMES 225 226# ifndef _ 227# define _(_s) _s 228# endif 229#endif /* ENABLE_NLS */ 230 231#ifdef __cplusplus 232} 233#endif 234#endif /* AUTOOPTS_NTPDC_OPTS_H_GUARD */ 235/* ntpdc-opts.h ends here */ 236