/*
 *  DO NOT EDIT THIS FILE   (opts.c)
 *  
 *  It has been autogen-ed  Tuesday May 16, 2000 at 11:11:32 PM BST
 *  From the definitions    ./opts.def
 *  and the template file   ../autoopts/options.tpl
 */

static const char zCopyright[] =
       "AutoGen copyright (c) 1992-2000 Bruce Korb, all rights reserved";
static const char zCopyrightNotice[] =
       "AutoGen is free software.\n"
       "\n"
       "You may redistribute it and/or modify it under the terms of the\n"
       "GNU General Public License, as published by the Free Software\n"
       "Foundation; either version 2, or (at your option) any later version.\n"
       "\n"
       "AutoGen is distributed in the hope that it will be useful,\n"
       "but 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\n"
       "along with AutoGen.  See the file \"COPYING\".  If not,\n"
       "write to:  The Free Software Foundation, Inc.,\n"
       "           59 Temple Place - Suite 330,\n"
       "           Boston,  MA  02111-1307, USA.";
#include "opts.h"

extern tUsageProc optionUsage;

#ifndef NULL
#  define NULL 0x0
#endif

#ifndef EXIT_SUCCESS
#  define  EXIT_SUCCESS 0
#  define  EXIT_FAILURE 1
#endif

/*
 *  Templ_Dirs option description:
 */
tSCC    zTempl_DirsText[] =
       "Template search directory list";
tSCC    zTempl_Dirs_NAME[] =          "TEMPL_DIRS";
#define zNotTempl_Dirs_Pfx            (const char*)NULL
#define zNotTempl_Dirs_Name           (const char*)NULL
tSCC    zTempl_Dirs_Name[] =          "templ-dirs";

/*
 *  Override_Tpl option description:
 */
tSCC    zOverride_TplText[] =
       "Override template file";
tSCC    zOverride_Tpl_NAME[] =        "OVERRIDE_TPL";
#define zNotOverride_Tpl_Pfx          (const char*)NULL
#define zNotOverride_Tpl_Name         (const char*)NULL
tSCC    zOverride_Tpl_Name[] =        "override-tpl";

/*
 *  Base_Name option description:
 */
tSCC    zBase_NameText[] =
       "Base name for output file(s)";
tSCC    zBase_Name_NAME[] =           "BASE_NAME";
#define zNotBase_Name_Pfx             (const char*)NULL
#define zNotBase_Name_Name            (const char*)NULL
tSCC    zBase_Name_Name[] =           "base-name";

/*
 *  Skip_Suffix option description:
 */
tSCC    zSkip_SuffixText[] =
       "Omit the file with this suffix";
tSCC    zSkip_Suffix_NAME[] =         "SKIP_SUFFIX";
#define zNotSkip_Suffix_Pfx           (const char*)NULL
#define zNotSkip_Suffix_Name          (const char*)NULL
tSCC    zSkip_Suffix_Name[] =         "skip-suffix";

/*
 *  Equate option description:
 */
tSCC    zEquateText[] =
       "characters considered equivalent";
tSCC    zEquate_NAME[] =              "EQUATE";
#define zNotEquate_Pfx                (const char*)NULL
#define zNotEquate_Name               (const char*)NULL
tSCC    zEquate_Name[] =              "equate";
tSCC    zEquateDefaultArg[] =         "_-^";

/*
 *  Doc_Debug option description:
 */
tSCC    zDoc_DebugText[] =
       "The following options are often useful while debugging new templates:";

/*
 *  Loop_Limit option description:
 */
tSCC    zLoop_LimitText[] =
       "Limit on increment loops";
tSCC    zLoop_Limit_NAME[] =          "LOOP_LIMIT";
#define zNotLoop_Limit_Pfx            (const char*)NULL
#define zNotLoop_Limit_Name           (const char*)NULL
tSCC    zLoop_Limit_Name[] =          "loop-limit";

/*
 *  Timeout option description:
 */
tSCC    zTimeoutText[] =
       "Time limit for servers";
tSCC    zTimeout_NAME[] =             "TIMEOUT";
#define zNotTimeout_Pfx               (const char*)NULL
#define zNotTimeout_Name              (const char*)NULL
tSCC    zTimeout_Name[] =             "timeout";

/*
 *  Doc_Control option description:
 */
tSCC    zDoc_ControlText[] =
       "These options can be used to control what gets processed\n"
       "in the definitions files and template files.";

/*
 *  Define option description:
 */
tSCC    zDefineText[] =
       "name to add to definition list";
tSCC    zDefine_NAME[] =              "DEFINE";
#define zNotDefine_Pfx                (const char*)NULL
#define zNotDefine_Name               (const char*)NULL
tSCC    zDefine_Name[] =              "define";

/*
 *  Undefine option description:
 */
tSCC    zUndefineText[] =
       "definition list removal pattern";
tSCC    zUndefine_NAME[] =            "UNDEFINE";
#define zNotUndefine_Pfx              (const char*)NULL
#define zNotUndefine_Name             (const char*)NULL
tSCC    zUndefine_Name[] =            "undefine";
/*
 *  Help option description:
 */
tSCC zHelpText[]  = "Display usage information and exit";
tSCC zHelp_Name[] = "help";

/*
 *  More_Help option description:
 */
tSCC zMore_HelpText[]  = "Extended usage information passed thru pager";
tSCC zMore_Help_Name[] = "more-help";

/*
 *  Version option description:
 */
tSCC zVersionText[]  = "Output version information and exit";
tSCC zVersion_Name[] = "version";

/*
 *  Save_Opts option description:
 */
tSCC zSave_OptsText[]  = "Save the option state to an rc file";
tSCC zSave_Opts_Name[] = "save-opts";

/*
 *  Load_Opts option description:
 */
extern tOptProc doLoadOpt;
tSCC    zLoad_OptsText[]     = "Load options from an rc 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)
/*
 *  These are always callable, whether
 *  TEST_AUTOGEN_OPTS is defined or not
 */
static tOptProc doUsageOpt;
extern tOptProc doVersion;
extern tOptProc doPagedUsage;

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *  Define the Autogen Option Descriptions.
 */
static tOptDesc optDesc[ OPTION_CT ] = {
  {  /* entry idx, value */ 0, VALUE_OPT_TEMPL_DIRS,
     /* equiv idx, value */ 0, VALUE_OPT_TEMPL_DIRS,
     /* option argument  */ ARG_MUST,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ OPTST_STACKED | OPTST_DISABLED | OPTST_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL, (const int*)NULL,
     /* option proc      */ stackOptArg,
     /* desc, NAME, name */ zTempl_DirsText,  zTempl_Dirs_NAME,
                            zTempl_Dirs_Name,
     /* disablement strs */ zNotTempl_Dirs_Name, zNotTempl_Dirs_Pfx },

  {  /* entry idx, value */ 1, VALUE_OPT_OVERRIDE_TPL,
     /* equiv idx, value */ 1, VALUE_OPT_OVERRIDE_TPL,
     /* option argument  */ ARG_MUST,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ OPTST_DISABLED | OPTST_NO_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL, (const int*)NULL,
     /* option proc      */ (tpOptProc)NULL,
     /* desc, NAME, name */ zOverride_TplText,  zOverride_Tpl_NAME,
                            zOverride_Tpl_Name,
     /* disablement strs */ zNotOverride_Tpl_Name, zNotOverride_Tpl_Pfx },

  {  /* entry idx, value */ 2, VALUE_OPT_BASE_NAME,
     /* equiv idx, value */ 2, VALUE_OPT_BASE_NAME,
     /* option argument  */ ARG_MUST,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ OPTST_DISABLED | OPTST_NO_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL, (const int*)NULL,
     /* option proc      */ (tpOptProc)NULL,
     /* desc, NAME, name */ zBase_NameText,  zBase_Name_NAME,
                            zBase_Name_Name,
     /* disablement strs */ zNotBase_Name_Name, zNotBase_Name_Pfx },

  {  /* entry idx, value */ 3, VALUE_OPT_SKIP_SUFFIX,
     /* equiv idx, value */ 3, VALUE_OPT_SKIP_SUFFIX,
     /* option argument  */ ARG_MUST,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ OPTST_STACKED | OPTST_DISABLED | OPTST_NO_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL, (const int*)NULL,
     /* option proc      */ stackOptArg,
     /* desc, NAME, name */ zSkip_SuffixText,  zSkip_Suffix_NAME,
                            zSkip_Suffix_Name,
     /* disablement strs */ zNotSkip_Suffix_Name, zNotSkip_Suffix_Pfx },

  {  /* entry idx, value */ 4, VALUE_OPT_EQUATE,
     /* equiv idx, value */ 4, VALUE_OPT_EQUATE,
     /* option argument  */ ARG_MUST,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ OPTST_DISABLED | OPTST_INIT,
     /* last opt argumnt */ (char*)zEquateDefaultArg,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL, (const int*)NULL,
     /* option proc      */ (tpOptProc)NULL,
     /* desc, NAME, name */ zEquateText,  zEquate_NAME,
                            zEquate_Name,
     /* disablement strs */ zNotEquate_Name, zNotEquate_Pfx },

  {  /* entry idx, value */ 0, 0,
     /* equiv idx, value */ 0, 0,
     /* option argument  */ ARG_NONE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 0, 0,
     /* opt state flags  */ OPTST_DOCUMENT | OPTST_NO_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL,  (const int*)NULL,
     /* option proc      */ (tpOptProc)NULL,
     /* desc, NAME, name */ zDoc_DebugText, (const char*)NULL,
                            (const char*)NULL,
     /* disablement strs */ (const char*)NULL, (const char*)NULL },

  {  /* entry idx, value */ 6, VALUE_OPT_LOOP_LIMIT,
     /* equiv idx, value */ 6, VALUE_OPT_LOOP_LIMIT,
     /* option argument  */ ARG_MUST,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ OPTST_NUMERIC | OPTST_DISABLED | OPTST_INIT,
     /* last opt argumnt */ (char*)256,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL, (const int*)NULL,
     /* option proc      */ (tpOptProc)NULL,
     /* desc, NAME, name */ zLoop_LimitText,  zLoop_Limit_NAME,
                            zLoop_Limit_Name,
     /* disablement strs */ zNotLoop_Limit_Name, zNotLoop_Limit_Pfx },

  {  /* entry idx, value */ 7, VALUE_OPT_TIMEOUT,
     /* equiv idx, value */ 7, VALUE_OPT_TIMEOUT,
     /* option argument  */ ARG_MUST,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ OPTST_NUMERIC | OPTST_DISABLED | OPTST_INIT,
     /* last opt argumnt */ (char*)10,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL, (const int*)NULL,
     /* option proc      */ (tpOptProc)NULL,
     /* desc, NAME, name */ zTimeoutText,  zTimeout_NAME,
                            zTimeout_Name,
     /* disablement strs */ zNotTimeout_Name, zNotTimeout_Pfx },

  {  /* entry idx, value */ 0, 0,
     /* equiv idx, value */ 0, 0,
     /* option argument  */ ARG_NONE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 0, 0,
     /* opt state flags  */ OPTST_DOCUMENT | OPTST_NO_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL,  (const int*)NULL,
     /* option proc      */ (tpOptProc)NULL,
     /* desc, NAME, name */ zDoc_ControlText, (const char*)NULL,
                            (const char*)NULL,
     /* disablement strs */ (const char*)NULL, (const char*)NULL },

  {  /* entry idx, value */ 9, VALUE_OPT_DEFINE,
     /* equiv idx, value */ NO_EQUIVALENT, 0,
     /* option argument  */ ARG_MUST,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ OPTST_STACKED | OPTST_DISABLED | OPTST_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL, (const int*)NULL,
     /* option proc      */ stackOptArg,
     /* desc, NAME, name */ zDefineText,  zDefine_NAME,
                            zDefine_Name,
     /* disablement strs */ zNotDefine_Name, zNotDefine_Pfx },

  {  /* entry idx, value */ 10, VALUE_OPT_UNDEFINE,
     /* equiv idx, value */ ~0, ~0,
     /* option argument  */ ARG_MUST,
     /* equivalenced to  */ INDEX_OPT_DEFINE,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ OPTST_STACKED | OPTST_DISABLED | OPTST_NO_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL, (const int*)NULL,
     /* option proc      */ unstackOptArg,
     /* desc, NAME, name */ zUndefineText,  zUndefine_NAME,
                            zUndefine_Name,
     /* disablement strs */ zNotUndefine_Name, zNotUndefine_Pfx },

  {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
     /* equiv idx value  */ NO_EQUIVALENT, 0,
     /* option argument  */ ARG_MAY,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max act ct  */ 0, 1, 0,
     /* opt state flags  */ OPTST_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL,  (const int*)NULL,
     /* option proc      */ doVersion,
     /* desc, NAME, name */ zVersionText,      (const char*)NULL,
                            zVersion_Name,
     /* disablement strs */ (const char*)NULL, (const char*)NULL },

  {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
     /* equiv idx value  */ NO_EQUIVALENT, 0,
     /* option argument  */ ARG_NONE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max act ct  */ 0, 1, 0,
     /* opt state flags  */ OPTST_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL,  (const int*)NULL,
     /* option proc      */ doUsageOpt,
     /* desc, NAME, name */ zHelpText,         (const char*)NULL,
                            zHelp_Name,
     /* disablement strs */ (const char*)NULL, (const char*)NULL },

  {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
     /* equiv idx value  */ NO_EQUIVALENT, 0,
     /* option argument  */ ARG_NONE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max act ct  */ 0, 1, 0,
     /* opt state flags  */ OPTST_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL,  (const int*)NULL,
     /* option proc      */ doPagedUsage,
     /* desc, NAME, name */ zMore_HelpText,    (const char*)NULL,
                            zMore_Help_Name,
     /* disablement strs */ (const char*)NULL, (const char*)NULL },

  {  /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
     /* equiv idx value  */ NO_EQUIVALENT, 0,
     /* option argument  */ '?',
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max act ct  */ 0, 1, 0,
     /* opt state flags  */ OPTST_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL,  (const int*)NULL,
     /* option proc      */ (tOptProc*)NULL,
     /* desc, NAME, name */ zSave_OptsText,    (const char*)NULL,
                            zSave_Opts_Name,
     /* disablement strs */ (const char*)NULL, (const char*)NULL },

  {  /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
     /* equiv idx value  */ NO_EQUIVALENT, 0,
     /* option argument  */ ARG_MUST,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ OPTST_DISABLEOK | OPTST_DISABLED | OPTST_INIT,
     /* last opt argumnt */ (char*)NULL,
     /* arg list/cookie  */ (void*)NULL,
     /* must/cannot opts */ (const int*)NULL, (const int*)NULL,
     /* option proc      */ doLoadOpt,
     /* desc, NAME, name */ zLoad_OptsText,  zLoad_Opts_NAME,
                            zLoad_Opts_Name,
     /* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx }
};

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *  Define the Autogen Option Environment
 */
tSCC   zPROGNAME[]   = "AUTOGEN";
tSCC   zUsageTitle[] = AUTOGEN_FULL_VERSION 
    "\nUSAGE:  %s [-<flag> [<val>]]... [--<name>[{=| }<val>]]... " "[ <def-file> ]" "\n";
tSCC   zRcName[]     = ".autogenrc";
tSCC*  apzHomeList[] = {
       "$HOME",
       ".",
       (char*)NULL };
tSCC   zExplain[]    = "\n"
       "If \"<def-file>\" is \"-\" or not specified, standard in is assumed.\n"
       "The default \"base-name\" is the \"<def-file>\" with suffixes removed.\n"
       "However, the template file may specify the output file names.\n"
       "\"loop-limit\" is used in debugging to stop runaway expansions." "\n";

tSCC    zDetail[]     = "\n"
       "AutoGen is a tool designed for generating program files\n"
       "that contain repetitive text with varied substitutions.\n"
       "See the info documentation for details." "\n";

#define zDetailFile (const char*)NULL
extern  tUsageProc optionUsage;
tSCC    zFullVersion[] = AUTOGEN_FULL_VERSION;

tOptions AutoGenOptions = {
    OPTIONS_STRUCT_VERSION,
    (char*)NULL,    (char*)NULL,    zPROGNAME,
    zRcName,        zCopyright,     zCopyrightNotice,
    zFullVersion,   apzHomeList,    zUsageTitle,
    zExplain,       zDetail,        zDetailFile,
    optionUsage,
    ( OPTPROC_NONE
    + OPTPROC_ERRSTOP
    + OPTPROC_SHORTOPT
    + OPTPROC_LONGOPT
    + OPTPROC_NO_REQ_OPT
    + OPTPROC_ENVIRON ),
    0, (char*)NULL,
    { INDEX_OPT_MORE_HELP,
      INDEX_OPT_SAVE_OPTS,
      NO_EQUIVALENT /* no '-#' option */,
      NO_EQUIVALENT /* no '-#' option */ },
    OPTION_CT, 11,
    optDesc
};

/*
 *  Create the static procedure(s) declared above.
 */
    static void
doUsageOpt( tOptions*  pOpts, tOptDesc* pOD )
{
    USAGE( EXIT_SUCCESS );
}

