1 /* -*- buffer-read-only: t -*- vi: set ro:
3 * DO NOT EDIT THIS FILE (genshell.h)
5 * It has been AutoGen-ed May 6, 2012 at 04:20:59 PM by AutoGen 5.16pre36
6 * From the definitions genshell.def
7 * and the template file options
9 * Generated from AutoOpts 36:4:11 templates.
11 * AutoOpts is a copyrighted work. This header file is not encumbered
12 * by AutoOpts licensing, but is provided under the licensing terms chosen
13 * by the genshellopt author or copyright holder. AutoOpts is
14 * licensed under the terms of the LGPL. The redistributable library
15 * (``libopts'') is licensed under the terms of either the LGPL or, at the
16 * users discretion, the BSD license. See the AutoOpts and/or libopts sources
19 * The genshellopt program is copyrighted and licensed
20 * under the following terms:
22 * Copyright (C) 1999-2012 Bruce Korb, all rights reserved.
23 * This is free software. It is licensed for use, modification and
24 * redistribution under the terms of the
25 * GNU General Public License, version 3 or later
26 * <http://gnu.org/licenses/gpl.html>
28 * genshellopt is free software: you can redistribute it and/or modify it
29 * under the terms of the GNU General Public License as published by the
30 * Free Software Foundation, either version 3 of the License, or
31 * (at your option) any later version.
33 * genshellopt is distributed in the hope that it will be useful, but
34 * WITHOUT ANY WARRANTY; without even the implied warranty of
35 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36 * See the GNU General Public License for more details.
38 * You should have received a copy of the GNU General Public License along
39 * with this program. If not, see <http://www.gnu.org/licenses/>.
42 * This file contains the programmatic interface to the Automated
43 * Options generated for the genshellopt program.
44 * These macros are documented in the AutoGen info file in the
45 * "AutoOpts" chapter. Please refer to that doc for usage help.
47 #ifndef AUTOOPTS_GENSHELL_H_GUARD
48 #define AUTOOPTS_GENSHELL_H_GUARD 1
49 #include <autoopts/options.h>
52 * Ensure that the library used for compiling this generated header is at
53 * least as new as the version current when the header template was released
54 * (not counting patch version increments). Also ensure that the oldest
55 * tolerable version is at least as old as what was current when the header
56 * template was released.
58 #define AO_TEMPLATE_VERSION 147460
59 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
60 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
61 # error option template version mismatches autoopts/options.h header
66 * Enumeration of each option:
69 INDEX_GENSHELL_OPT_SCRIPT
= 0,
70 INDEX_GENSHELL_OPT_SHELL
= 1,
71 INDEX_GENSHELL_OPT_VERSION
= 2,
72 INDEX_GENSHELL_OPT_HELP
= 3,
73 INDEX_GENSHELL_OPT_MORE_HELP
= 4
74 } teGenshell_OptIndex
;
76 #define GENSHELL_OPTION_CT 5
77 #define GENSHELLOPT_VERSION "1"
78 #define GENSHELLOPT_FULL_VERSION "genshellopt 1"
81 * Interface defines for all options. Replace "n" with the UPPER_CASED
82 * option name (as in the teGenshell_OptIndex enumeration above).
83 * e.g. HAVE_GENSHELL_OPT(SCRIPT)
85 #define GENSHELL_DESC(n) (genshelloptOptions.pOptDesc[INDEX_GENSHELL_OPT_## n])
86 #define HAVE_GENSHELL_OPT(n) (! UNUSED_OPT(& GENSHELL_DESC(n)))
87 #define GENSHELL_OPT_ARG(n) (GENSHELL_DESC(n).optArg.argString)
88 #define STATE_GENSHELL_OPT(n) (GENSHELL_DESC(n).fOptState & OPTST_SET_MASK)
89 #define COUNT_GENSHELL_OPT(n) (GENSHELL_DESC(n).optOccCt)
90 #define ISSEL_GENSHELL_OPT(n) (SELECTED_OPT(&GENSHELL_DESC(n)))
91 #define ISUNUSED_GENSHELL_OPT(n) (UNUSED_OPT(& GENSHELL_DESC(n)))
92 #define ENABLED_GENSHELL_OPT(n) (! DISABLED_OPT(& GENSHELL_DESC(n)))
93 #define STACKCT_GENSHELL_OPT(n) (((tArgList*)(GENSHELL_DESC(n).optCookie))->useCt)
94 #define STACKLST_GENSHELL_OPT(n) (((tArgList*)(GENSHELL_DESC(n).optCookie))->apzArgs)
95 #define CLEAR_GENSHELL_OPT(n) STMTS( \
96 GENSHELL_DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
97 if ((GENSHELL_DESC(n).fOptState & OPTST_INITENABLED) == 0) \
98 GENSHELL_DESC(n).fOptState |= OPTST_DISABLED; \
99 GENSHELL_DESC(n).optCookie = NULL )
103 * Enumeration of genshellopt exit codes
106 GENSHELLOPT_EXIT_SUCCESS
= 0,
107 GENSHELLOPT_EXIT_FAILURE
= 1,
108 GENSHELLOPT_EXIT_LIBOPTS_FAILURE
= 70
109 } genshellopt_exit_code_t
;
112 * Interface defines for specific options.
114 #define VALUE_GENSHELL_OPT_SCRIPT 'o'
115 #define VALUE_GENSHELL_OPT_SHELL 's'
116 #define VALUE_GENSHELL_OPT_HELP '?'
117 #define VALUE_GENSHELL_OPT_MORE_HELP '!'
118 #define VALUE_GENSHELL_OPT_VERSION 'v'
120 * Interface defines not associated with particular options
122 #define ERRSKIP_GENSHELL_OPTERR STMTS(genshelloptOptions.fOptSet &= ~OPTPROC_ERRSTOP)
123 #define ERRSTOP_GENSHELL_OPTERR STMTS(genshelloptOptions.fOptSet |= OPTPROC_ERRSTOP)
124 #define RESTART_GENSHELL_OPT(n) STMTS( \
125 genshelloptOptions.curOptIdx = (n); \
126 genshelloptOptions.pzCurOpt = NULL )
127 #define START_GENSHELL_OPT RESTART_GENSHELL_OPT(1)
128 #define GENSHELL_USAGE(c) (*genshelloptOptions.pUsageProc)(&genshelloptOptions, c)
129 /* extracted from opthead.tlib near line 484 */
138 * Declare the genshellopt option descriptor.
140 extern tOptions genshelloptOptions
;
142 #if defined(ENABLE_NLS)
145 static inline char* aoGetsText(char const* pz
) {
146 if (pz
== NULL
) return NULL
;
147 return (char*)gettext(pz
);
149 # define _(s) aoGetsText(s)
152 # define OPT_NO_XLAT_CFG_NAMES STMTS(genshelloptOptions.fOptSet |= \
153 OPTPROC_NXLAT_OPT_CFG;)
154 # define OPT_NO_XLAT_OPT_NAMES STMTS(genshelloptOptions.fOptSet |= \
155 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
157 # define OPT_XLAT_CFG_NAMES STMTS(genshelloptOptions.fOptSet &= \
158 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
159 # define OPT_XLAT_OPT_NAMES STMTS(genshelloptOptions.fOptSet &= \
162 #else /* ENABLE_NLS */
163 # define OPT_NO_XLAT_CFG_NAMES
164 # define OPT_NO_XLAT_OPT_NAMES
166 # define OPT_XLAT_CFG_NAMES
167 # define OPT_XLAT_OPT_NAMES
172 #endif /* ENABLE_NLS */
177 #endif /* AUTOOPTS_GENSHELL_H_GUARD */
178 /* genshell.h ends here */