/* -*- buffer-read-only: t -*- vi: set ro:
*
* DO NOT EDIT THIS FILE (opts.c)
*
* It has been AutoGen-ed Saturday July 28, 2007 at 01:03:55 PM PDT
* From the definitions ./opts.def
* and the template file options
*
* Generated from AutoOpts 30:0:5 templates.
*/
/*
* This file was produced by an AutoOpts template. AutoOpts is a
* copyrighted work. This source file is not encumbered by AutoOpts
* licensing, but is provided under the licensing terms chosen by the
* getdefs 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.
*
* This source file is copyrighted and licensed under the following terms:
*
* getdefs copyright 1999-2007 Bruce Korb - all rights reserved
*
* getdefs 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.
*
* getdefs 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 .
*/
#include
#define OPTION_CODE_COMPILE 1
#include "opts.h"
#ifdef __cplusplus
extern "C" {
#endif
tSCC zCopyright[] =
"getdefs copyright (c) 1999-2007 Bruce Korb, all rights reserved";
tSCC zCopyrightNotice[] =
"getdefs is free software: you can redistribute it and/or modify it\n\
under the terms of the GNU General Public License as published by the\n\
Free Software Foundation, either version 3 of the License, or\n\
(at your option) any later version.\n\n\
getdefs is distributed in the hope that it will be useful, but\n\
WITHOUT ANY WARRANTY; without even the implied warranty of\n\
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
See the GNU General Public License for more details.\n\n\
You should have received a copy of the GNU General Public License along\n\
with this program. If not, see .";
extern tUsageProc optionUsage;
#ifndef NULL
# define NULL 0
#endif
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
#endif
#ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
/*
* Defs_To_Get option description:
*/
tSCC zDefs_To_GetText[] =
"Regexp to look for after the \"/*=\"";
tSCC zDefs_To_Get_NAME[] = "DEFS_TO_GET";
tSCC zDefs_To_Get_Name[] = "defs-to-get";
#define DEFS_TO_GET_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Ordering option description:
*/
tSCC zOrderingText[] =
"Alphabetize or use named file";
tSCC zOrdering_NAME[] = "ORDERING";
tSCC zNotOrdering_Name[] = "no-ordering";
tSCC zNotOrdering_Pfx[] = "no";
#define zOrdering_Name (zNotOrdering_Name + 3)
#define ORDERING_FLAGS (OPTST_INITENABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL)
/*
* First_Index option description:
*/
tSCC zFirst_IndexText[] =
"The first index to apply to groups";
tSCC zFirst_Index_NAME[] = "FIRST_INDEX";
tSCC zFirst_Index_Name[] = "first-index";
#define zFirst_IndexDefaultArg ((char const*)0)
#define FIRST_INDEX_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
/*
* Input option description:
*/
tSCC zInputText[] =
"Input file to search for defs";
tSCC zInput_NAME[] = "INPUT";
tSCC zInput_Name[] = "input";
#define INPUT_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Subblock option description:
*/
tSCC zSubblockText[] =
"subblock definition names";
tSCC zSubblock_NAME[] = "SUBBLOCK";
tSCC zSubblock_Name[] = "subblock";
#define SUBBLOCK_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Listattr option description:
*/
tSCC zListattrText[] =
"attribute with list of values";
tSCC zListattr_NAME[] = "LISTATTR";
tSCC zListattr_Name[] = "listattr";
#define LISTATTR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Filelist option description:
*/
tSCC zFilelistText[] =
"Insert source file names into defs";
tSCC zFilelist_NAME[] = "FILELIST";
tSCC zFilelist_Name[] = "filelist";
#define FILELIST_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL)
/*
* Doc_Insert option description:
*/
tSCC zDoc_InsertText[] =
"Definition insertion options";
#define DOC_INSERT_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT)
/*
* Assign option description:
*/
tSCC zAssignText[] =
"Global assignments";
tSCC zAssign_NAME[] = "ASSIGN";
tSCC zAssign_Name[] = "assign";
#define ASSIGN_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Common_Assign option description:
*/
tSCC zCommon_AssignText[] =
"Assignments common to all blocks";
tSCC zCommon_Assign_NAME[] = "COMMON_ASSIGN";
tSCC zCommon_Assign_Name[] = "common-assign";
#define COMMON_ASSIGN_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Copy option description:
*/
tSCC zCopyText[] =
"File(s) to copy into definitions";
tSCC zCopy_NAME[] = "COPY";
tSCC zCopy_Name[] = "copy";
#define COPY_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Srcfile option description:
*/
tSCC zSrcfileText[] =
"Insert source file name into each def";
tSCC zSrcfile_NAME[] = "SRCFILE";
tSCC zSrcfile_Name[] = "srcfile";
#define SRCFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL)
/*
* Linenum option description:
*/
tSCC zLinenumText[] =
"Insert source line number into each def";
tSCC zLinenum_NAME[] = "LINENUM";
tSCC zLinenum_Name[] = "linenum";
#define LINENUM_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL)
/*
* Doc_Output option description:
*/
tSCC zDoc_OutputText[] =
"Definition output disposition options:";
#define DOC_OUTPUT_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT)
/*
* Output option description:
*/
tSCC zOutputText[] =
"Output file to open";
tSCC zOutput_NAME[] = "OUTPUT";
tSCC zOutput_Name[] = "output";
#define OUTPUT_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Autogen option description:
*/
tSCC zAutogenText[] =
"Invoke AutoGen with defs";
tSCC zAutogen_NAME[] = "AUTOGEN";
tSCC zNotAutogen_Name[] = "no-autogen";
tSCC zNotAutogen_Pfx[] = "no";
#define zAutogen_Name (zNotAutogen_Name + 3)
#define AUTOGEN_FLAGS (OPTST_INITENABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL)
/*
* Template option description:
*/
tSCC zTemplateText[] =
"Template Name";
tSCC zTemplate_NAME[] = "TEMPLATE";
tSCC zTemplate_Name[] = "template";
#define TEMPLATE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Agarg option description with
* "Must also have options" and "Incompatible options":
*/
tSCC zAgargText[] =
"AutoGen Argument";
tSCC zAgarg_NAME[] = "AGARG";
tSCC zAgarg_Name[] = "agarg";
static const int
aAgargCantList[] = {
INDEX_OPT_OUTPUT, NO_EQUIVALENT };
#define AGARG_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Base_Name option description with
* "Must also have options" and "Incompatible options":
*/
tSCC zBase_NameText[] =
"Base name for output file(s)";
tSCC zBase_Name_NAME[] = "BASE_NAME";
tSCC zBase_Name_Name[] = "base-name";
static const int
aBase_NameCantList[] = {
INDEX_OPT_OUTPUT, NO_EQUIVALENT };
#define BASE_NAME_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Help/More_Help/Version option descriptions:
*/
tSCC zHelpText[] = "Display usage information and exit";
tSCC zHelp_Name[] = "help";
tSCC zMore_HelpText[] = "Extended usage information passed thru pager";
tSCC zMore_Help_Name[] = "more-help";
tSCC zVersionText[] = "Output version information and exit";
tSCC zVersion_Name[] = "version";
/*
* Save/Load_Opts option description:
*/
tSCC zSave_OptsText[] = "Save the option state to a config file";
tSCC zSave_Opts_Name[] = "save-opts";
tSCC zLoad_OptsText[] = "Load options from a config file";
tSCC zLoad_Opts_NAME[] = "LOAD_OPTS";
tSCC zNotLoad_Opts_Name[] = "no-load-opts";
tSCC zNotLoad_Opts_Pfx[] = "no";
#define zLoad_Opts_Name (zNotLoad_Opts_Name + 3)
/*
* Declare option callback procedures
*/
extern tOptProc
optionNumericVal, optionPagedUsage, optionPrintVersion, optionStackArg;
static tOptProc
doUsageOpt;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Define the Getdefs Option Descriptions.
*/
static tOptDesc optDesc[ OPTION_CT ] = {
{ /* entry idx, value */ 0, VALUE_OPT_DEFS_TO_GET,
/* equiv idx, value */ 0, VALUE_OPT_DEFS_TO_GET,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ DEFS_TO_GET_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ zDefs_To_GetText, zDefs_To_Get_NAME, zDefs_To_Get_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 1, VALUE_OPT_ORDERING,
/* equiv idx, value */ 1, VALUE_OPT_ORDERING,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ ORDERING_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ zOrderingText, zOrdering_NAME, zOrdering_Name,
/* disablement strs */ zNotOrdering_Name, zNotOrdering_Pfx },
{ /* entry idx, value */ 2, VALUE_OPT_FIRST_INDEX,
/* equiv idx, value */ 2, VALUE_OPT_FIRST_INDEX,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ FIRST_INDEX_FLAGS, 0,
/* last opt argumnt */ { zFirst_IndexDefaultArg },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ optionNumericVal,
/* desc, NAME, name */ zFirst_IndexText, zFirst_Index_NAME, zFirst_Index_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 3, VALUE_OPT_INPUT,
/* equiv idx, value */ 3, VALUE_OPT_INPUT,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ INPUT_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ optionStackArg,
/* desc, NAME, name */ zInputText, zInput_NAME, zInput_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 4, VALUE_OPT_SUBBLOCK,
/* equiv idx, value */ 4, VALUE_OPT_SUBBLOCK,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ SUBBLOCK_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ optionStackArg,
/* desc, NAME, name */ zSubblockText, zSubblock_NAME, zSubblock_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 5, VALUE_OPT_LISTATTR,
/* equiv idx, value */ 5, VALUE_OPT_LISTATTR,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ LISTATTR_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ optionStackArg,
/* desc, NAME, name */ zListattrText, zListattr_NAME, zListattr_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 6, VALUE_OPT_FILELIST,
/* equiv idx, value */ 6, VALUE_OPT_FILELIST,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ FILELIST_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ zFilelistText, zFilelist_NAME, zFilelist_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 */ DOC_INSERT_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ zDoc_InsertText, NULL, NULL,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 8, VALUE_OPT_ASSIGN,
/* equiv idx, value */ 8, VALUE_OPT_ASSIGN,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ ASSIGN_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ optionStackArg,
/* desc, NAME, name */ zAssignText, zAssign_NAME, zAssign_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 9, VALUE_OPT_COMMON_ASSIGN,
/* equiv idx, value */ 9, VALUE_OPT_COMMON_ASSIGN,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ COMMON_ASSIGN_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ optionStackArg,
/* desc, NAME, name */ zCommon_AssignText, zCommon_Assign_NAME, zCommon_Assign_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 10, VALUE_OPT_COPY,
/* equiv idx, value */ 10, VALUE_OPT_COPY,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ COPY_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ optionStackArg,
/* desc, NAME, name */ zCopyText, zCopy_NAME, zCopy_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 11, VALUE_OPT_SRCFILE,
/* equiv idx, value */ 11, VALUE_OPT_SRCFILE,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ SRCFILE_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ zSrcfileText, zSrcfile_NAME, zSrcfile_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 12, VALUE_OPT_LINENUM,
/* equiv idx, value */ 12, VALUE_OPT_LINENUM,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ LINENUM_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ zLinenumText, zLinenum_NAME, zLinenum_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 */ DOC_OUTPUT_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ zDoc_OutputText, NULL, NULL,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 14, VALUE_OPT_OUTPUT,
/* equiv idx, value */ NOLIMIT, NOLIMIT,
/* equivalenced to */ INDEX_OPT_AUTOGEN,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ OUTPUT_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ zOutputText, zOutput_NAME, zOutput_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 15, VALUE_OPT_AUTOGEN,
/* equiv idx, value */ NO_EQUIVALENT, 0,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ AUTOGEN_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ zAutogenText, zAutogen_NAME, zAutogen_Name,
/* disablement strs */ zNotAutogen_Name, zNotAutogen_Pfx },
{ /* entry idx, value */ 16, VALUE_OPT_TEMPLATE,
/* equiv idx, value */ 16, VALUE_OPT_TEMPLATE,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ TEMPLATE_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ zTemplateText, zTemplate_NAME, zTemplate_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 17, VALUE_OPT_AGARG,
/* equiv idx, value */ 17, VALUE_OPT_AGARG,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ AGARG_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, aAgargCantList,
/* option proc */ optionStackArg,
/* desc, NAME, name */ zAgargText, zAgarg_NAME, zAgarg_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 18, VALUE_OPT_BASE_NAME,
/* equiv idx, value */ 18, 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 },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, aBase_NameCantList,
/* option proc */ NULL,
/* desc, NAME, name */ zBase_NameText, zBase_Name_NAME, zBase_Name_Name,
/* disablement strs */ NULL, NULL },
#ifdef NO_OPTIONAL_OPT_ARGS
# define VERSION_OPT_FLAGS OPTST_IMM | OPTST_NO_INIT
#else
# define VERSION_OPT_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
#endif
{ /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
/* equiv idx value */ NO_EQUIVALENT, 0,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ VERSION_OPT_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ optionPrintVersion,
/* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
/* disablement strs */ NULL, NULL },
#undef VERSION_OPT_FLAGS
{ /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
/* equiv idx value */ NO_EQUIVALENT, 0,
/* 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 */ zHelpText, NULL, zHelp_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
/* equiv idx value */ NO_EQUIVALENT, 0,
/* 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 */ optionPagedUsage,
/* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
/* equiv idx value */ NO_EQUIVALENT, 0,
/* 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 */ zSave_OptsText, NULL, zSave_Opts_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
/* equiv idx value */ NO_EQUIVALENT, 0,
/* 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 */ zLoad_OptsText, zLoad_Opts_NAME, zLoad_Opts_Name,
/* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx }
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Define the Getdefs Option Environment
*/
tSCC zPROGNAME[] = "GETDEFS";
tSCC zUsageTitle[] =
"getdefs (GNU AutoGen) - AutoGen Definition Extraction Tool - Ver. 1.4\n\
USAGE: %s [ [{=| }] ]...\n";
tSCC zRcName[] = ".getdefsrc";
tSCC* apzHomeList[] = {
"/dev/null",
NULL };
tSCC zBugsAddr[] = "autogen-users@lists.sourceforge.net";
tSCC zExplain[] = "\n\
If no ``input'' argument is provided or is set to simply \"-\", and if\n\
``stdin'' is not a ``tty'', then the list of input files will be\n\
read from ``stdin''.\n";
tSCC zDetail[] = "\n\
This program extracts AutoGen definitions from a list of source files.\n\
Definitions are delimited by `/*= \\n' and\n\
`=*/\\n'. From that, this program creates a definition of the\n\
following form:\n\n\
#line nnn \"source-file-name\"\n\
entry_type = {\n\
name = entry_name;\n\
...\n\
};\n\n\
The ellipsis '...' is filled in by text found between the two\n\
delimiters, with everything up through the first sequence of\n\
asterisks deleted on every line.\n\n\
There are two special ``entry types'':\n\n\
* The entry_type enclosure and the name entry will be omitted\n\
and the ellipsis will become top-level definitions.\n\n\
-- The contents of the comment must be a single getdefs option.\n\
The option name must follow the double hyphen and its argument\n\
will be everything following the name. This is intended for use\n\
with the ``subblock'' and ``listattr'' options.\n";
tSCC zFullVersion[] = GETDEFS_FULL_VERSION;
/* extracted from ../autoopts/optcode.tpl near line 428 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
static tOptionXlateProc translate_option_strings;
#else
# define OPTPROC_BASE OPTPROC_NONE
# define translate_option_strings NULL
#endif /* ENABLE_NLS */
#define getdefs_full_usage NULL
#define getdefs_short_usage NULL
tOptions getdefsOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
( OPTPROC_BASE
+ OPTPROC_ERRSTOP
+ OPTPROC_NO_REQ_OPT
+ OPTPROC_NEGATIONS
+ OPTPROC_NO_ARGS
+ OPTPROC_HAS_IMMED ),
0, NULL, /* current option index, current option */
NULL, NULL, zPROGNAME,
zRcName, zCopyright, zCopyrightNotice,
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,
INDEX_OPT_SAVE_OPTS,
NO_EQUIVALENT /* index of '-#' option */,
3 /* index of default opt */
},
24 /* full option count */, 19 /* user option count */,
getdefs_full_usage, getdefs_short_usage
};
/*
* Create the static procedure(s) declared above.
*/
static void
doUsageOpt(
tOptions* pOptions,
tOptDesc* pOptDesc )
{
USAGE( EXIT_SUCCESS );
}
/* extracted from ../autoopts/optcode.tpl near line 537 */
#if ENABLE_NLS
#include
#include
#include
#include
#include
static char* AO_gettext( char const* pz );
static void coerce_it(void** s);
static char*
AO_gettext( char const* pz )
{
char* pzRes;
if (pz == NULL)
return NULL;
pzRes = _(pz);
if (pzRes == pz)
return pzRes;
pzRes = strdup( pzRes );
if (pzRes == NULL) {
fputs( _("No memory for duping translated strings\n"), stderr );
exit( EXIT_FAILURE );
}
return pzRes;
}
static void coerce_it(void** s) { *s = AO_gettext(*s); }
#define COERSION(_f) \
coerce_it((void*)&(getdefsOptions._f))
/*
* This invokes the translation code (e.g. gettext(3)).
*/
static void
translate_option_strings( void )
{
/*
* Guard against re-translation. It won't work. The strings will have
* been changed by the first pass through this code. One shot only.
*/
if (option_usage_text.field_ct == 0)
return;
/*
* Do the translations. The first pointer follows the field count field.
* The field count field is the size of a pointer.
*/
{
char** ppz = (char**)(void*)&(option_usage_text);
int ix = option_usage_text.field_ct;
do {
ppz++;
*ppz = AO_gettext(*ppz);
} while (--ix > 0);
}
option_usage_text.field_ct = 0;
{
tOptDesc* pOD = getdefsOptions.pOptDesc;
int ix = getdefsOptions.optCt;
for (;;) {
pOD->pzText = AO_gettext(pOD->pzText);
pOD->pz_NAME = AO_gettext(pOD->pz_NAME);
pOD->pz_Name = AO_gettext(pOD->pz_Name);
pOD->pz_DisableName = AO_gettext(pOD->pz_DisableName);
pOD->pz_DisablePfx = AO_gettext(pOD->pz_DisablePfx);
if (--ix <= 0)
break;
pOD++;
}
}
COERSION(pzCopyright);
COERSION(pzCopyNotice);
COERSION(pzFullVersion);
COERSION(pzUsageTitle);
COERSION(pzExplain);
COERSION(pzDetail);
}
#endif /* ENABLE_NLS */
#ifdef __cplusplus
}
#endif
/* opts.c ends here */