3 /* -*- buffer-read-only: t -*- vi: set ro:
5 * DO NOT EDIT THIS FILE (genshell.h)
7 * It has been AutoGen-ed November 8, 2009 at 08:41:09 AM by AutoGen 5.9.10pre13
8 * From the definitions genshell.def
9 * and the template file options
11 * Generated from AutoOpts @AO_CURRENT@:@AO_REVISION@:@AO_AGE@ templates.
15 * This file was produced by an AutoOpts template. AutoOpts is a
16 * copyrighted work. This header file is not encumbered by AutoOpts
17 * licensing, but is provided under the licensing terms chosen by the
18 * genshellopt author or copyright holder. AutoOpts is licensed under
19 * the terms of the LGPL. The redistributable library (``libopts'') is
20 * licensed under the terms of either the LGPL or, at the users discretion,
21 * the BSD license. See the AutoOpts and/or libopts sources for details.
23 * This source file is copyrighted and licensed under the following terms:
25 * genshellopt copyright (c) 1999-2009 Bruce Korb - all rights reserved
27 * genshellopt is free software: you can redistribute it and/or modify it
28 * under the terms of the GNU General Public License as published by the
29 * Free Software Foundation, either version 3 of the License, or
30 * (at your option) any later version.
32 * genshellopt is distributed in the hope that it will be useful, but
33 * WITHOUT ANY WARRANTY; without even the implied warranty of
34 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
35 * See the GNU General Public License for more details.
37 * You should have received a copy of the GNU General Public License along
38 * with this program. If not, see <http://www.gnu.org/licenses/>.
41 * This file contains the programmatic interface to the Automated
42 * Options generated for the genshellopt program.
43 * These macros are documented in the AutoGen info file in the
44 * "AutoOpts" chapter. Please refer to that doc for usage help.
46 #ifndef AUTOOPTS_GENSHELL_H_GUARD
47 #define AUTOOPTS_GENSHELL_H_GUARD 1
48 #include <autoopts/options.h>
51 * Ensure that the library used for compiling this generated header is at
52 * least as new as the version current when the header template was released
53 * (not counting patch version increments). Also ensure that the oldest
54 * tolerable version is at least as old as what was current when the header
55 * template was released.
57 #define AO_TEMPLATE_VERSION 135168
58 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
59 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
60 # error option template version mismatches autoopts/options.h header
65 * Enumeration of each option:
70 INDEX_OPT_VERSION
= 2,
72 INDEX_OPT_MORE_HELP
= 4
76 #define GENSHELLOPT_VERSION "1"
77 #define GENSHELLOPT_FULL_VERSION "genshellopt - Generate Shell Option Processing Script - Ver. 1"
80 * Interface defines for all options. Replace "n" with the UPPER_CASED
81 * option name (as in the teOptIndex enumeration above).
82 * e.g. HAVE_OPT( SCRIPT )
84 #define DESC(n) (genshelloptOptions.pOptDesc[INDEX_OPT_## n])
85 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
86 #define OPT_ARG(n) (DESC(n).optArg.argString)
87 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
88 #define COUNT_OPT(n) (DESC(n).optOccCt)
89 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
90 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
91 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
92 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
93 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
94 #define CLEAR_OPT(n) STMTS( \
95 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
96 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
97 DESC(n).fOptState |= OPTST_DISABLED; \
98 DESC(n).optCookie = NULL )
102 * Interface defines for specific options.
104 #define VALUE_OPT_SCRIPT 'o'
105 #define VALUE_OPT_SHELL 's'
106 #define VALUE_OPT_HELP '?'
107 #define VALUE_OPT_MORE_HELP '!'
108 #define VALUE_OPT_VERSION 'v'
110 * Interface defines not associated with particular options
112 #define ERRSKIP_OPTERR STMTS( genshelloptOptions.fOptSet &= ~OPTPROC_ERRSTOP )
113 #define ERRSTOP_OPTERR STMTS( genshelloptOptions.fOptSet |= OPTPROC_ERRSTOP )
114 #define RESTART_OPT(n) STMTS( \
115 genshelloptOptions.curOptIdx = (n); \
116 genshelloptOptions.pzCurOpt = NULL )
117 #define START_OPT RESTART_OPT(1)
118 #define USAGE(c) (*genshelloptOptions.pUsageProc)( &genshelloptOptions, c )
119 /* extracted from opthead.tpl near line 409 */
123 * Declare the genshellopt option descriptor.
129 extern tOptions genshelloptOptions
;
131 #if defined(ENABLE_NLS)
134 static inline char* aoGetsText( char const* pz
) {
135 if (pz
== NULL
) return NULL
;
136 return (char*)gettext( pz
);
138 # define _(s) aoGetsText(s)
141 # define OPT_NO_XLAT_CFG_NAMES STMTS(genshelloptOptions.fOptSet |= \
142 OPTPROC_NXLAT_OPT_CFG;)
143 # define OPT_NO_XLAT_OPT_NAMES STMTS(genshelloptOptions.fOptSet |= \
144 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
146 # define OPT_XLAT_CFG_NAMES STMTS(genshelloptOptions.fOptSet &= \
147 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
148 # define OPT_XLAT_OPT_NAMES STMTS(genshelloptOptions.fOptSet &= \
151 #else /* ENABLE_NLS */
152 # define OPT_NO_XLAT_CFG_NAMES
153 # define OPT_NO_XLAT_OPT_NAMES
155 # define OPT_XLAT_CFG_NAMES
156 # define OPT_XLAT_OPT_NAMES
161 #endif /* ENABLE_NLS */
166 #endif /* AUTOOPTS_GENSHELL_H_GUARD */
167 /* genshell.h ends here */