diff options
Diffstat (limited to 'agen5/opts.c')
-rw-r--r-- | agen5/opts.c | 1491 |
1 files changed, 1491 insertions, 0 deletions
diff --git a/agen5/opts.c b/agen5/opts.c new file mode 100644 index 0000000..2e623f3 --- /dev/null +++ b/agen5/opts.c @@ -0,0 +1,1491 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (opts.c) + * + * It has been AutoGen-ed August 11, 2012 at 09:41:32 AM by AutoGen 5.16.2pre7 + * From the definitions opts.def + * and the template file options + * + * Generated from AutoOpts 36:5:11 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the autogen author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The autogen program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 1992-2012 Bruce Korb, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the + * GNU General Public License, version 3 or later + * <http://gnu.org/licenses/gpl.html> + * + * autogen is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * autogen is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "opts.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; + +/* TRANSLATORS: choose the translation for option names wisely because you + cannot ever change your mind. */ +#define zCopyright (autogen_opt_strs+0) +#define zLicenseDescrip (autogen_opt_strs+275) + +/* + * global included definitions + */ + +#include "autogen.h" +#ifdef HAVE_DLOPEN +# ifdef HAVE_DLFCN_H +# include <dlfcn.h> +# else + extern void* dlopen(char const*,int); +# endif + +# ifndef RTLD_GLOBAL +# define RTLD_GLOBAL 0 +# endif + +# ifndef RTLD_NOW +# ifdef RTLD_LAZY +# define RTLD_NOW DL_LAZY +# else +# define RTLD_NOW 0 +# endif +# endif +#endif + +#if HAVE_CTYPE_H +# include <ctype.h> +#else +# define isspace(_c) 0 +#endif + +typedef void (init_proc_t)(void); +char const * tpl_fname = NULL; +bool trace_is_to_pipe = false; + +#define CANNOT_LOCATE_FMT (autogen_opt_strs+878) +#define LOAD_GUILE_FILE_FMT (autogen_opt_strs+910) + +#define DLOPEN_ERROR_FMT (autogen_opt_strs+922) +#define SYM_NOT_FOUND_FMT (autogen_opt_strs+946) + +#ifndef NULL +# define NULL 0 +#endif + +/* + * autogen option static const strings + */ +static char const autogen_opt_strs[3398] = +/* 0 */ "autogen (GNU AutoGen) 5.16.2\n" + "Copyright (C) 1992-2012 Bruce Korb, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the\n" + "GNU General Public License, version 3 or later\n" + " <http://gnu.org/licenses/gpl.html>\n\0" +/* 275 */ "autogen is free software: you can redistribute it and/or modify it under\n" + "the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "autogen is distributed in the hope that it will be useful, but WITHOUT ANY\n" + "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n" + "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n" + "details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 878 */ "Cannot locate scheme file '%s'\n\0" +/* 910 */ "(load \"%s\")\0" +/* 922 */ "dlopen(%s) error %d\n" + "%s\n\0" +/* 946 */ "dlsym(scm_init) not found in %s\n" + "\tyou must initialize the library yourself\n\0" +/* 1021 */ "The following options select definitions, templates and scheme functions\n" + "to use:\0" +/* 1102 */ "Template search directory list\0" +/* 1133 */ "TEMPL_DIRS\0" +/* 1144 */ "templ-dirs\0" +/* 1155 */ "Override template file\0" +/* 1178 */ "OVERRIDE_TPL\0" +/* 1191 */ "override-tpl\0" +/* 1204 */ "Library template file\0" +/* 1226 */ "LIB_TEMPLATE\0" +/* 1239 */ "lib-template\0" +/* 1252 */ "Definitions input file\0" +/* 1275 */ "DEFINITIONS\0" +/* 1287 */ "no-definitions\0" +/* 1302 */ "no\0" +/* 1305 */ "Scheme code file to load\0" +/* 1330 */ "LOAD_SCHEME\0" +/* 1342 */ "load-scheme\0" +/* 1354 */ "Load scheme function library\0" +/* 1383 */ "LOAD_FUNCTIONS\0" +/* 1398 */ "load-functions\0" +/* 1413 */ "name or path name of shell to use\0" +/* 1447 */ "SHELL\0" +/* 1453 */ "shell\0" +/* 1459 */ "Do not use in-mem streams\0" +/* 1485 */ "NO_FMEMOPEN\0" +/* 1497 */ "no-fmemopen\0" +/* 1509 */ "characters considered equivalent\0" +/* 1542 */ "EQUATE\0" +/* 1549 */ "equate\0" +/* 1556 */ "_-^\0" +/* 1560 */ "The following options modify how output is handled:\0" +/* 1612 */ "Base name for output file(s)\0" +/* 1641 */ "BASE_NAME\0" +/* 1651 */ "base-name\0" +/* 1661 */ "set mod times to latest source\0" +/* 1692 */ "SOURCE_TIME\0" +/* 1704 */ "no-source-time\0" +/* 1719 */ "Allow output files to be writable\0" +/* 1753 */ "WRITABLE\0" +/* 1762 */ "not-writable\0" +/* 1775 */ "not\0" +/* 1779 */ "The following options are often useful while debugging new templates:\0" +/* 1849 */ "Limit on increment loops\0" +/* 1874 */ "LOOP_LIMIT\0" +/* 1885 */ "loop-limit\0" +/* 1896 */ "Time limit for server shell\0" +/* 1924 */ "TIMEOUT\0" +/* 1932 */ "timeout\0" +/* 1940 */ "tracing level of detail\0" +/* 1964 */ "TRACE\0" +/* 1970 */ "trace\0" +/* 1976 */ "tracing output file or filter\0" +/* 2006 */ "TRACE_OUT\0" +/* 2016 */ "trace-out\0" +/* 2026 */ "Show the definition tree\0" +/* 2051 */ "SHOW_DEFS\0" +/* 2061 */ "show-defs\0" +/* 2071 */ "Show the definitions used\0" +/* 2097 */ "USED_DEFINES\0" +/* 2110 */ "used-defines\0" +/* 2123 */ "Leave a core dump on a failure exit\0" +/* 2159 */ "CORE\0" +/* 2164 */ "core\0" +/* 2169 */ "These options can be used to control what gets processed in the\n" + "definitions files and template files:\0" +/* 2271 */ "Omit the file with this suffix\0" +/* 2302 */ "SKIP_SUFFIX\0" +/* 2314 */ "skip-suffix\0" +/* 2326 */ "specify this output suffix\0" +/* 2353 */ "SELECT_SUFFIX\0" +/* 2367 */ "select-suffix\0" +/* 2381 */ "name to add to definition list\0" +/* 2412 */ "DEFINE\0" +/* 2419 */ "define\0" +/* 2426 */ "definition list removal pattern\0" +/* 2458 */ "UNDEFINE\0" +/* 2467 */ "undefine\0" +/* 2476 */ "This option is used to automate dependency tracking:\0" +/* 2529 */ "emit make dependency file\0" +/* 2555 */ "MAKE_DEP\0" +/* 2564 */ "make-dep\0" +/* 2573 */ "Display extended usage information and exit\0" +/* 2617 */ "help\0" +/* 2622 */ "Extended usage information passed thru pager\0" +/* 2667 */ "more-help\0" +/* 2677 */ "Output version information and exit\0" +/* 2713 */ "version\0" +/* 2721 */ "Reset an option's state\0" +/* 2745 */ "reset-option\0" +/* 2758 */ "Abbreviated usage to stdout\0" +/* 2786 */ "usage\0" +/* 2792 */ "Save the option state to a config file\0" +/* 2831 */ "save-opts\0" +/* 2841 */ "Load options from a config file\0" +/* 2873 */ "LOAD_OPTS\0" +/* 2883 */ "no-load-opts\0" +/* 2896 */ "AUTOGEN\0" +/* 2904 */ "autogen (GNU AutoGen) - The Automated Program Generator - Ver. 5.16.2\n" + "USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ <def-file> ]\n\0" +/* 3047 */ "$HOME\0" +/* 3053 */ ".\0" +/* 3055 */ ".autogenrc\0" +/* 3066 */ "autogen-users@lists.sourceforge.net\0" +/* 3102 */ "\n" + "AutoGen creates text files from templates using external definitions.\n\0" +/* 3174 */ "\n" + "AutoGen is a tool designed for generating program files that contain\n" + "repetitive text with varied substitutions.\n\0" +/* 3288 */ "autogen (GNU AutoGen) 5.16.2\0" +/* 3317 */ "nothing\0" +/* 3325 */ "debug-message\0" +/* 3339 */ "server-shell\0" +/* 3352 */ "templates\0" +/* 3362 */ "block-macros\0" +/* 3375 */ "expressions\0" +/* 3387 */ "everything"; + +/* + * input-select option description: + */ +#define INPUT_SELECT_DESC (autogen_opt_strs+1021) +#define INPUT_SELECT_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT) + +/* + * templ-dirs option description: + */ +/* TRANSLATORS: the option argument is a file name */ +#define TEMPL_DIRS_DESC (autogen_opt_strs+1102) +#define TEMPL_DIRS_NAME (autogen_opt_strs+1133) +#define TEMPL_DIRS_name (autogen_opt_strs+1144) +#define TEMPL_DIRS_FLAGS (OPTST_DISABLED | OPTST_STACKED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * override-tpl option description: + */ +#define OVERRIDE_TPL_DESC (autogen_opt_strs+1155) +#define OVERRIDE_TPL_NAME (autogen_opt_strs+1178) +#define OVERRIDE_TPL_name (autogen_opt_strs+1191) +#define OVERRIDE_TPL_FLAGS (OPTST_DISABLED | OPTST_NO_INIT \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * lib-template option description: + */ +#define LIB_TEMPLATE_DESC (autogen_opt_strs+1204) +#define LIB_TEMPLATE_NAME (autogen_opt_strs+1226) +#define LIB_TEMPLATE_name (autogen_opt_strs+1239) +#define LIB_TEMPLATE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * definitions option description: + */ +#define DEFINITIONS_DESC (autogen_opt_strs+1252) +#define DEFINITIONS_NAME (autogen_opt_strs+1275) +#define NOT_DEFINITIONS_name (autogen_opt_strs+1287) +#define NOT_DEFINITIONS_PFX (autogen_opt_strs+1302) +#define DEFINITIONS_name (NOT_DEFINITIONS_name + 3) +#define DEFINITIONS_FLAGS (OPTST_INITENABLED | OPTST_NO_INIT \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * load-scheme option description: + */ +#define LOAD_SCHEME_DESC (autogen_opt_strs+1305) +#define LOAD_SCHEME_NAME (autogen_opt_strs+1330) +#define LOAD_SCHEME_name (autogen_opt_strs+1342) +#define LOAD_SCHEME_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * load-functions option description: + */ +#ifdef HAVE_DLOPEN +#define LOAD_FUNCTIONS_DESC (autogen_opt_strs+1354) +#define LOAD_FUNCTIONS_NAME (autogen_opt_strs+1383) +#define LOAD_FUNCTIONS_name (autogen_opt_strs+1398) +#define LOAD_FUNCTIONS_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +#else /* disable load-functions */ +#define LOAD_FUNCTIONS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#define LOAD_FUNCTIONS_NAME NULL +#define LOAD_FUNCTIONS_DESC NULL +#define LOAD_FUNCTIONS_name NULL +#endif /* HAVE_DLOPEN */ + +/* + * shell option description: + */ +#ifdef SHELL_ENABLED +#define SHELL_DESC (autogen_opt_strs+1413) +#define SHELL_NAME (autogen_opt_strs+1447) +#define SHELL_name (autogen_opt_strs+1453) +#define SHELL_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +#else /* disable shell */ +#define SHELL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#define SHELL_NAME NULL +#define SHELL_DESC NULL +#define SHELL_name NULL +#endif /* SHELL_ENABLED */ + +/* + * no-fmemopen option description: + */ +#define NO_FMEMOPEN_DESC (autogen_opt_strs+1459) +#define NO_FMEMOPEN_NAME (autogen_opt_strs+1485) +#define NO_FMEMOPEN_name (autogen_opt_strs+1497) +#define NO_FMEMOPEN_FLAGS (OPTST_DISABLED) + +/* + * equate option description: + */ +#define EQUATE_DESC (autogen_opt_strs+1509) +#define EQUATE_NAME (autogen_opt_strs+1542) +#define EQUATE_name (autogen_opt_strs+1549) +#define EQUATE_DFT_ARG (autogen_opt_strs+1556) +#define EQUATE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * out-handling option description: + */ +#define OUT_HANDLING_DESC (autogen_opt_strs+1560) +#define OUT_HANDLING_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT) + +/* + * base-name option description: + */ +#define BASE_NAME_DESC (autogen_opt_strs+1612) +#define BASE_NAME_NAME (autogen_opt_strs+1641) +#define BASE_NAME_name (autogen_opt_strs+1651) +#define BASE_NAME_FLAGS (OPTST_DISABLED | OPTST_NO_INIT \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * source-time option description: + */ +#define SOURCE_TIME_DESC (autogen_opt_strs+1661) +#define SOURCE_TIME_NAME (autogen_opt_strs+1692) +#define NOT_SOURCE_TIME_name (autogen_opt_strs+1704) +#define NOT_SOURCE_TIME_PFX (autogen_opt_strs+1302) +#define SOURCE_TIME_name (NOT_SOURCE_TIME_name + 3) +#define SOURCE_TIME_FLAGS (OPTST_DISABLED) + +/* + * writable option description: + */ +#define WRITABLE_DESC (autogen_opt_strs+1719) +#define WRITABLE_NAME (autogen_opt_strs+1753) +#define NOT_WRITABLE_name (autogen_opt_strs+1762) +#define NOT_WRITABLE_PFX (autogen_opt_strs+1775) +#define WRITABLE_name (NOT_WRITABLE_name + 4) +#define WRITABLE_FLAGS (OPTST_DISABLED) + +/* + * debug-tpl option description: + */ +#define DEBUG_TPL_DESC (autogen_opt_strs+1779) +#define DEBUG_TPL_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT) + +/* + * loop-limit option description: + */ +#define LOOP_LIMIT_DESC (autogen_opt_strs+1849) +#define LOOP_LIMIT_NAME (autogen_opt_strs+1874) +#define LOOP_LIMIT_name (autogen_opt_strs+1885) +#define LOOP_LIMIT_DFT_ARG ((char const*)256) +#define LOOP_LIMIT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC) \ + | OPTST_SCALED_NUM) + +/* + * timeout option description: + */ +#ifdef SHELL_ENABLED +#define TIMEOUT_DESC (autogen_opt_strs+1896) +#define TIMEOUT_NAME (autogen_opt_strs+1924) +#define TIMEOUT_name (autogen_opt_strs+1932) +#define TIMEOUT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +#else /* disable timeout */ +#define TIMEOUT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#define TIMEOUT_NAME NULL +#define TIMEOUT_DESC NULL +#define TIMEOUT_name NULL +#endif /* SHELL_ENABLED */ + +/* + * trace option description: + */ +#define TRACE_DESC (autogen_opt_strs+1940) +#define TRACE_NAME (autogen_opt_strs+1964) +#define TRACE_name (autogen_opt_strs+1970) +#define TRACE_DFT_ARG ((char const*)TRACE_NOTHING) +#define TRACE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_ENUMERATION)) + +/* + * trace-out option description: + */ +#define TRACE_OUT_DESC (autogen_opt_strs+1976) +#define TRACE_OUT_NAME (autogen_opt_strs+2006) +#define TRACE_OUT_name (autogen_opt_strs+2016) +#define TRACE_OUT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * show-defs option description: + */ +#ifdef DEBUG_ENABLED +#define SHOW_DEFS_DESC (autogen_opt_strs+2026) +#define SHOW_DEFS_NAME (autogen_opt_strs+2051) +#define SHOW_DEFS_name (autogen_opt_strs+2061) +#define SHOW_DEFS_FLAGS (OPTST_DISABLED | OPTST_NO_INIT) + +#else /* disable show-defs */ +#define SHOW_DEFS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#define SHOW_DEFS_NAME NULL +#define SHOW_DEFS_DESC (NULL) +#define SHOW_DEFS_name (autogen_opt_strs+2061) +#endif /* DEBUG_ENABLED */ + +/* + * used-defines option description: + */ +#define USED_DEFINES_DESC (autogen_opt_strs+2071) +#define USED_DEFINES_NAME (autogen_opt_strs+2097) +#define USED_DEFINES_name (autogen_opt_strs+2110) +#define USED_DEFINES_FLAGS (OPTST_DISABLED | OPTST_NO_INIT) + +/* + * core option description: + */ +#ifdef HAVE_SYS_RESOURCE_H +#define CORE_DESC (autogen_opt_strs+2123) +#define CORE_NAME (autogen_opt_strs+2159) +#define CORE_name (autogen_opt_strs+2164) +#define CORE_FLAGS (OPTST_DISABLED) + +#else /* disable core */ +#define CORE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#define CORE_NAME NULL +#define CORE_DESC NULL +#define CORE_name NULL +#endif /* HAVE_SYS_RESOURCE_H */ + +/* + * processing option description: + */ +#define PROCESSING_DESC (autogen_opt_strs+2169) +#define PROCESSING_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT) + +/* + * skip-suffix option description with + * "Must also have options" and "Incompatible options": + */ +#define SKIP_SUFFIX_DESC (autogen_opt_strs+2271) +#define SKIP_SUFFIX_NAME (autogen_opt_strs+2302) +#define SKIP_SUFFIX_name (autogen_opt_strs+2314) +static int const aSkip_SuffixCantList[] = { + INDEX_OPT_SELECT_SUFFIX, NO_EQUIVALENT }; +#define SKIP_SUFFIX_FLAGS (OPTST_DISABLED | OPTST_STACKED | OPTST_NO_INIT \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * select-suffix option description: + */ +#define SELECT_SUFFIX_DESC (autogen_opt_strs+2326) +#define SELECT_SUFFIX_NAME (autogen_opt_strs+2353) +#define SELECT_SUFFIX_name (autogen_opt_strs+2367) +#define SELECT_SUFFIX_FLAGS (OPTST_DISABLED | OPTST_NO_INIT \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * define option description: + */ +#define DEFINE_DESC (autogen_opt_strs+2381) +#define DEFINE_NAME (autogen_opt_strs+2412) +#define DEFINE_name (autogen_opt_strs+2419) +#define DEFINE_FLAGS (OPTST_DISABLED | OPTST_STACKED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * undefine option description: + */ +#define UNDEFINE_DESC (autogen_opt_strs+2426) +#define UNDEFINE_NAME (autogen_opt_strs+2458) +#define UNDEFINE_name (autogen_opt_strs+2467) +#define UNDEFINE_FLAGS (OPTST_DISABLED | OPTST_NO_INIT \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * dep-track option description: + */ +#define DEP_TRACK_DESC (autogen_opt_strs+2476) +#define DEP_TRACK_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT) + +/* + * make-dep option description: + */ +#define MAKE_DEP_DESC (autogen_opt_strs+2529) +#define MAKE_DEP_NAME (autogen_opt_strs+2555) +#define MAKE_DEP_name (autogen_opt_strs+2564) +#define MAKE_DEP_FLAGS (OPTST_DISABLED | OPTST_NO_INIT \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (autogen_opt_strs+2573) +#define HELP_name (autogen_opt_strs+2617) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (autogen_opt_strs+2622) +#define MORE_HELP_name (autogen_opt_strs+2667) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC NULL +#define MORE_HELP_name NULL +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (autogen_opt_strs+2677) +#define VER_name (autogen_opt_strs+2713) +#define RESET_DESC (autogen_opt_strs+2721) +#define RESET_name (autogen_opt_strs+2745) +#define RESET_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_NO_INIT) +#define USAGE_DESC (autogen_opt_strs+2758) +#define USAGE_name (autogen_opt_strs+2786) +#define SAVE_OPTS_DESC (autogen_opt_strs+2792) +#define SAVE_OPTS_name (autogen_opt_strs+2831) +#define LOAD_OPTS_DESC (autogen_opt_strs+2841) +#define LOAD_OPTS_NAME (autogen_opt_strs+2873) +#define NO_LOAD_OPTS_name (autogen_opt_strs+2883) +#define LOAD_OPTS_pfx (autogen_opt_strs+1302) +#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) +/* + * Declare option callback procedures + */ +#ifdef HAVE_DLOPEN + static tOptProc doOptLoad_Functions; +#else /* not HAVE_DLOPEN */ +# define doOptLoad_Functions NULL +#endif /* def/not HAVE_DLOPEN */ +#ifdef SHELL_ENABLED + static tOptProc doOptShell; +#else /* not SHELL_ENABLED */ +# define doOptShell NULL +#endif /* def/not SHELL_ENABLED */ +#ifdef SHELL_ENABLED + static tOptProc doOptTimeout; +#else /* not SHELL_ENABLED */ +# define doOptTimeout NULL +#endif /* def/not SHELL_ENABLED */ +extern tOptProc + config_dep, optionBooleanVal, optionNestedVal, + optionNumericVal, optionPagedUsage, optionPrintVersion, + optionResetOpt, optionStackArg, optionTimeDate, + optionTimeVal, optionUnstackArg, optionVendorOption; +static tOptProc + doOptLib_Template, doOptLoad_Scheme, doOptLoop_Limit, + doOptOverride_Tpl, doOptSelect_Suffix, doOptTrace, + doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the autogen Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the autogen program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, 0, + /* equiv idx, value */ 0, 0, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 0, 0, + /* opt state flags */ INPUT_SELECT_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INPUT_SELECT_DESC, NULL, NULL, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_TEMPL_DIRS, + /* equiv idx, value */ 1, VALUE_OPT_TEMPL_DIRS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ TEMPL_DIRS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --templ-dirs */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionStackArg, + /* desc, NAME, name */ TEMPL_DIRS_DESC, TEMPL_DIRS_NAME, TEMPL_DIRS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_OVERRIDE_TPL, + /* equiv idx, value */ 2, VALUE_OPT_OVERRIDE_TPL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OVERRIDE_TPL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --override-tpl */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptOverride_Tpl, + /* desc, NAME, name */ OVERRIDE_TPL_DESC, OVERRIDE_TPL_NAME, OVERRIDE_TPL_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_LIB_TEMPLATE, + /* equiv idx, value */ 3, VALUE_OPT_LIB_TEMPLATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ LIB_TEMPLATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --lib-template */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLib_Template, + /* desc, NAME, name */ LIB_TEMPLATE_DESC, LIB_TEMPLATE_NAME, LIB_TEMPLATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 4, VALUE_OPT_DEFINITIONS, + /* equiv idx, value */ 4, VALUE_OPT_DEFINITIONS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEFINITIONS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --definitions */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DEFINITIONS_DESC, DEFINITIONS_NAME, DEFINITIONS_name, + /* disablement strs */ NOT_DEFINITIONS_name, NOT_DEFINITIONS_PFX }, + + { /* entry idx, value */ 5, VALUE_OPT_LOAD_SCHEME, + /* equiv idx, value */ 5, VALUE_OPT_LOAD_SCHEME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_SCHEME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-scheme */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLoad_Scheme, + /* desc, NAME, name */ LOAD_SCHEME_DESC, LOAD_SCHEME_NAME, LOAD_SCHEME_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 6, VALUE_OPT_LOAD_FUNCTIONS, + /* equiv idx, value */ 6, VALUE_OPT_LOAD_FUNCTIONS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_FUNCTIONS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-functions */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLoad_Functions, + /* desc, NAME, name */ LOAD_FUNCTIONS_DESC, LOAD_FUNCTIONS_NAME, LOAD_FUNCTIONS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 7, VALUE_OPT_SHELL, + /* equiv idx, value */ 7, VALUE_OPT_SHELL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SHELL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --shell */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptShell, + /* desc, NAME, name */ SHELL_DESC, SHELL_NAME, SHELL_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 8, VALUE_OPT_NO_FMEMOPEN, + /* equiv idx, value */ 8, VALUE_OPT_NO_FMEMOPEN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ NO_FMEMOPEN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --no-fmemopen */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ NO_FMEMOPEN_DESC, NO_FMEMOPEN_NAME, NO_FMEMOPEN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 9, VALUE_OPT_EQUATE, + /* equiv idx, value */ 9, VALUE_OPT_EQUATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ EQUATE_FLAGS, 0, + /* last opt argumnt */ { EQUATE_DFT_ARG }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ EQUATE_DESC, EQUATE_NAME, EQUATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 0, 0, + /* equiv idx, value */ 0, 0, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 0, 0, + /* opt state flags */ OUT_HANDLING_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUT_HANDLING_DESC, NULL, NULL, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 11, VALUE_OPT_BASE_NAME, + /* equiv idx, value */ 11, VALUE_OPT_BASE_NAME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ BASE_NAME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --base-name */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ BASE_NAME_DESC, BASE_NAME_NAME, BASE_NAME_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 12, VALUE_OPT_SOURCE_TIME, + /* equiv idx, value */ 12, VALUE_OPT_SOURCE_TIME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SOURCE_TIME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --source-time */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SOURCE_TIME_DESC, SOURCE_TIME_NAME, SOURCE_TIME_name, + /* disablement strs */ NOT_SOURCE_TIME_name, NOT_SOURCE_TIME_PFX }, + + { /* entry idx, value */ 13, VALUE_OPT_WRITABLE, + /* equiv idx, value */ 13, VALUE_OPT_WRITABLE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ WRITABLE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --writable */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ WRITABLE_DESC, WRITABLE_NAME, WRITABLE_name, + /* disablement strs */ NOT_WRITABLE_name, NOT_WRITABLE_PFX }, + + { /* entry idx, value */ 0, 0, + /* equiv idx, value */ 0, 0, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 0, 0, + /* opt state flags */ DEBUG_TPL_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DEBUG_TPL_DESC, NULL, NULL, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 15, VALUE_OPT_LOOP_LIMIT, + /* equiv idx, value */ 15, VALUE_OPT_LOOP_LIMIT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOOP_LIMIT_FLAGS, 0, + /* last opt argumnt */ { LOOP_LIMIT_DFT_ARG }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLoop_Limit, + /* desc, NAME, name */ LOOP_LIMIT_DESC, LOOP_LIMIT_NAME, LOOP_LIMIT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 16, VALUE_OPT_TIMEOUT, + /* equiv idx, value */ 16, VALUE_OPT_TIMEOUT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TIMEOUT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --timeout */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptTimeout, + /* desc, NAME, name */ TIMEOUT_DESC, TIMEOUT_NAME, TIMEOUT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 17, VALUE_OPT_TRACE, + /* equiv idx, value */ 17, VALUE_OPT_TRACE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TRACE_FLAGS, 0, + /* last opt argumnt */ { TRACE_DFT_ARG }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptTrace, + /* desc, NAME, name */ TRACE_DESC, TRACE_NAME, TRACE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 18, VALUE_OPT_TRACE_OUT, + /* equiv idx, value */ 18, VALUE_OPT_TRACE_OUT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TRACE_OUT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --trace-out */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ TRACE_OUT_DESC, TRACE_OUT_NAME, TRACE_OUT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 19, VALUE_OPT_SHOW_DEFS, + /* equiv idx, value */ 19, VALUE_OPT_SHOW_DEFS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SHOW_DEFS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --show-defs */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SHOW_DEFS_DESC, SHOW_DEFS_NAME, SHOW_DEFS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 20, VALUE_OPT_USED_DEFINES, + /* equiv idx, value */ 20, VALUE_OPT_USED_DEFINES, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ USED_DEFINES_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --used-defines */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ USED_DEFINES_DESC, USED_DEFINES_NAME, USED_DEFINES_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 21, VALUE_OPT_CORE, + /* equiv idx, value */ 21, VALUE_OPT_CORE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CORE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --core */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CORE_DESC, CORE_NAME, CORE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 0, 0, + /* equiv idx, value */ 0, 0, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 0, 0, + /* opt state flags */ PROCESSING_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PROCESSING_DESC, NULL, NULL, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 23, VALUE_OPT_SKIP_SUFFIX, + /* equiv idx, value */ 23, VALUE_OPT_SKIP_SUFFIX, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ SKIP_SUFFIX_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --skip-suffix */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aSkip_SuffixCantList, + /* option proc */ optionStackArg, + /* desc, NAME, name */ SKIP_SUFFIX_DESC, SKIP_SUFFIX_NAME, SKIP_SUFFIX_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 24, VALUE_OPT_SELECT_SUFFIX, + /* equiv idx, value */ 24, VALUE_OPT_SELECT_SUFFIX, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ SELECT_SUFFIX_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --select-suffix */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptSelect_Suffix, + /* desc, NAME, name */ SELECT_SUFFIX_DESC, SELECT_SUFFIX_NAME, SELECT_SUFFIX_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 25, VALUE_OPT_DEFINE, + /* equiv idx, value */ 25, VALUE_OPT_DEFINE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ DEFINE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --define */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionStackArg, + /* desc, NAME, name */ DEFINE_DESC, DEFINE_NAME, DEFINE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 26, VALUE_OPT_UNDEFINE, + /* equiv idx, value */ NOLIMIT, NOLIMIT, + /* equivalenced to */ INDEX_OPT_DEFINE, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ UNDEFINE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --undefine */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionUnstackArg, + /* desc, NAME, name */ UNDEFINE_DESC, UNDEFINE_NAME, UNDEFINE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 0, 0, + /* equiv idx, value */ 0, 0, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 0, 0, + /* opt state flags */ DEP_TRACK_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DEP_TRACK_DESC, NULL, NULL, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 28, VALUE_OPT_MAKE_DEP, + /* equiv idx, value */ 28, VALUE_OPT_MAKE_DEP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ MAKE_DEP_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --make-dep */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ config_dep, + /* desc, NAME, name */ MAKE_DEP_DESC, MAKE_DEP_NAME, MAKE_DEP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_RESET_OPTION, VALUE_OPT_RESET_OPTION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_RESET_OPTION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ RESET_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionResetOpt, + /* desc, NAME, name */ RESET_DESC, NULL, RESET_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_USAGE, VALUE_OPT_USAGE, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_USAGE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ USAGE_DESC, NULL, USAGE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) + | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) + | OPTST_DISABLE_IMM, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionLoadOpt, + /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name, + /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Define the autogen Option Environment + */ +#define zPROGNAME (autogen_opt_strs+2896) +#define zUsageTitle (autogen_opt_strs+2904) +#define zRcName (autogen_opt_strs+3055) +static char const * const apzHomeList[3] = { + autogen_opt_strs+3047, + autogen_opt_strs+3053, + NULL }; +#define zBugsAddr (autogen_opt_strs+3066) +#define zExplain (autogen_opt_strs+3102) +#define zDetail (autogen_opt_strs+3174) +#define zFullVersion (autogen_opt_strs+3288) +/* extracted from optcode.tlib near line 350 */ + +#define OPTPROC_BASE OPTPROC_NONE +#define translate_option_strings NULL + +static optArgBucket_t const original_autogen_defaults[ OPTION_CT ] = { + { NULL }, /* doc opt */ + { NULL }, /* --templ-dirs */ + { NULL }, /* --override-tpl */ + { NULL }, /* --lib-template */ + { NULL }, /* --definitions */ + { NULL }, /* --load-scheme */ + { NULL }, /* --load-functions */ + { NULL }, /* --shell */ + { NULL }, /* --no-fmemopen */ + { EQUATE_DFT_ARG }, + { NULL }, /* doc opt */ + { NULL }, /* --base-name */ + { NULL }, /* --source-time */ + { NULL }, /* --writable */ + { NULL }, /* doc opt */ + { LOOP_LIMIT_DFT_ARG }, + { NULL }, /* --timeout */ + { TRACE_DFT_ARG }, + { NULL }, /* --trace-out */ + { NULL }, /* --show-defs */ + { NULL }, /* --used-defines */ + { NULL }, /* --core */ + { NULL }, /* doc opt */ + { NULL }, /* --skip-suffix */ + { NULL }, /* --select-suffix */ + { NULL }, /* --define */ + { NULL }, /* --undefine */ + { NULL }, /* doc opt */ + { NULL }, /* --make-dep */ + { NULL }, /* resettable */ + { NULL }, /* version */ + { NULL }, /* help */ + { NULL }, /* more-help */ + { NULL }, /* usage-opt */ + { NULL }, /* save-opts */ + { NULL } /* load-opts */ +}; +static void * const original_autogen_cookies[ OPTION_CT ] = { + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; + + +#define autogen_full_usage (NULL) + +#define autogen_short_usage (NULL) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param pOptions the AutoOpts option description structure + * @param pOptDesc the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) +{ + if ((pOptDesc->fOptState & OPTST_RESET) != 0) + return; + + int ex_code = (pOptDesc->optIndex == INDEX_OPT_HELP) + ? AUTOGEN_EXIT_SUCCESS : AO_EXIT_REQ_USAGE; + optionUsage(&autogenOptions, ex_code); + /* NOTREACHED */ + (void)pOptions; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the override-tpl option. + * + * @param pOptions the autogen options data structure + * @param pOptDesc the option descriptor for this option. + */ +static void +doOptOverride_Tpl(tOptions* pOptions, tOptDesc* pOptDesc) +{ + /* extracted from opts.def, line 171 */ + tpl_fname = pOptDesc->optArg.argString; + (void)pOptions; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the lib-template option. + * + * @param pOptions the autogen options data structure + * @param pOptDesc the option descriptor for this option. + */ +static void +doOptLib_Template(tOptions* pOptions, tOptDesc* pOptDesc) +{ + /* extracted from opts.def, line 192 */ + templ_t* pT; + processing_state = PROC_STATE_LIB_LOAD; + pT = tpl_load(pOptDesc->optArg.argString, NULL); + tpl_unload(pT); + processing_state = PROC_STATE_OPTIONS; + (void)pOptions; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-scheme option. + * + * @param pOptions the autogen options data structure + * @param pOptDesc the option descriptor for this option. + */ +static void +doOptLoad_Scheme(tOptions* pOptions, tOptDesc* pOptDesc) +{ + /* extracted from opts.def, line 254 */ + proc_state_t saveState = processing_state; + char* pz; + char zPath[MAXPATHLEN]; + static char const * const apzSfx[] = { "scm", NULL }; + + if (! SUCCESSFUL( + find_file(pOptDesc->optArg.argString, zPath, apzSfx, NULL))) { + + usage_message(CANNOT_LOCATE_FMT, + pOptDesc->optArg.argString); + /* NOTREACHED */ + } + + pz = aprf(LOAD_GUILE_FILE_FMT, zPath); + processing_state = PROC_STATE_GUILE_PRELOAD; + (void)ag_scm_c_eval_string_from_file_line( + pz, __FILE__, __LINE__); + free(pz); + processing_state = saveState; + (void)pOptions; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-functions option, when HAVE_DLOPEN is #define-d. + * + * @param pOptions the autogen options data structure + * @param pOptDesc the option descriptor for this option. + */ +#ifdef HAVE_DLOPEN +static void +doOptLoad_Functions(tOptions* pOptions, tOptDesc* pOptDesc) +{ + /* extracted from opts.def, line 304 */ + void* hdl = dlopen( + pOptDesc->optArg.argString, RTLD_NOW|RTLD_GLOBAL); + init_proc_t* proc; + + if (hdl == NULL) { + char const* pzErr = dlerror(); + fprintf(stderr, DLOPEN_ERROR_FMT, + pOptDesc->optArg.argString, errno, pzErr); + exit(EXIT_FAILURE); + } + proc = (init_proc_t*)dlsym(hdl, "scm_init"); + if (proc == NULL) { + fprintf(stderr, SYM_NOT_FOUND_FMT, + pOptDesc->optArg.argString); + } + else (*proc)(); + (void)pOptions; +} +#endif /* defined HAVE_DLOPEN */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the shell option, when SHELL_ENABLED is #define-d. + * + * @param pOptions the autogen options data structure + * @param pOptDesc the option descriptor for this option. + */ +#ifdef SHELL_ENABLED +static void +doOptShell(tOptions* pOptions, tOptDesc* pOptDesc) +{ + /* extracted from opts.def, line 341 */ + shell_program = pOptDesc->optArg.argString; + (void)pOptions; +} +#endif /* defined SHELL_ENABLED */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the loop-limit option. + * + * @param pOptions the autogen options data structure + * @param pOptDesc the option descriptor for this option. + */ +static void +doOptLoop_Limit(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[2] = { + { -1, LONG_MIN }, { 1, 0x1000000 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + if ((pOptDesc->fOptState & OPTST_RESET) != 0) + return; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 2; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + +emit_ranges: + optionShowRange(pOptions, pOptDesc, (void *)rng, 2); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the timeout option, when SHELL_ENABLED is #define-d. + * + * @param pOptions the autogen options data structure + * @param pOptDesc the option descriptor for this option. + */ +#ifdef SHELL_ENABLED +static void +doOptTimeout(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0, 3600 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + if ((pOptDesc->fOptState & OPTST_RESET) != 0) + return; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + +emit_ranges: + optionShowRange(pOptions, pOptDesc, (void *)rng, 1); +} +#endif /* defined SHELL_ENABLED */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the trace option. + * + * @param pOptions the autogen options data structure + * @param pOptDesc the option descriptor for this option. + */ +static void +doOptTrace(tOptions* pOptions, tOptDesc* pOptDesc) +{ + +/* extracted from optmain.tlib near line 871 */ + static char const * const azNames[7] = { + autogen_opt_strs+3317, autogen_opt_strs+3325, autogen_opt_strs+3339, + autogen_opt_strs+3352, autogen_opt_strs+3362, autogen_opt_strs+3375, + autogen_opt_strs+3387 }; + + if (pOptions <= OPTPROC_EMIT_LIMIT) { + (void) optionEnumerationVal(pOptions, pOptDesc, azNames, 7); + return; /* protect AutoOpts client code from internal callbacks */ + } + if ((pOptDesc->fOptState & OPTST_RESET) != 0) + return; + + pOptDesc->optArg.argEnum = + optionEnumerationVal(pOptions, pOptDesc, azNames, 7); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the select-suffix option. + * + * @param pOptions the autogen options data structure + * @param pOptDesc the option descriptor for this option. + */ +static void +doOptSelect_Suffix(tOptions* pOptions, tOptDesc* pOptDesc) +{ + /* extracted from opts.def, line 781 */ + char const * arg = pOptDesc->optArg.argString; + if ((arg != NULL) && (*arg != NUL)) + (void)do_suffix(arg, NULL, -1); + (void)pOptions; +} +/* extracted from optmain.tlib near line 1146 */ + +/** + * Print a usage message with a format and va_list argument. + * The optionUsage function is then invoked to print + * the error usage text (somewhat abbreviated) and then exit. + * + * @param[in] fmt the message format string + * @param[in] ap the var-arg list. + * @noreturn + */ +void +vusage_message(char const * fmt, va_list ap) +{ + char const * er_leader = _("autogen usage error:\n"); + fputs(er_leader, stderr); + vfprintf(stderr, fmt, ap); + optionUsage(&autogenOptions, AUTOGEN_EXIT_OPTION_ERROR); + /* NOTREACHED */ +} + +/** + * Print a usage message with a format and a variable argument list. + * vusage_message() is called to do the work. + * + * @param[in] fmt the message format string + * @param[in] ... the argument list for the message + * @noreturn + */ +void +usage_message(char const * fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vusage_message(fmt, ap); + /* NOTREACHED */ + va_end(ap); +} + +/** + * The directory containing the data associated with autogen. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged autogen + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define autogen_packager_info NULL +#else +static char const autogen_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport autogen bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for autogen. The one structure that + * binds them all. + */ +tOptions autogenOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NEGATIONS + + OPTPROC_ENVIRON ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + INDEX_OPT_SAVE_OPTS, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 36 /* full option count */, 29 /* user option count */, + autogen_full_usage, autogen_short_usage, + original_autogen_defaults, original_autogen_cookies, + PKGDATADIR, autogen_packager_info +}; + +#ifdef __cplusplus +} +#endif +/* opts.c ends here */ |