/*
 *  DO NOT EDIT THIS FILE   (opts.h)
 *  
 *  It has been autogen-ed  Friday November  5, 1999 at 01:42:01 PM PST
 *  From the definitions    opts.def
 *  and the template file   ../autoopts/options.tpl
 */

/*
 *  This file contains the programmatic interface to the
 *  Automated Options generated for the getdefs program.
 *  These macros are documented in the AutoGen info file
 *  in the "Autoopts" chapter.  Please refer to that doc
 *  for usage help.
 */

#ifndef GETDEFS_OPTS_H
#define GETDEFS_OPTS_H

/*
 * Getdefs copyright 1999 Bruce Korb
 *
 * Getdefs is free software.
 * 
 * You may redistribute it and/or modify it under the terms of the
 * GNU General Public License, as published by the Free Software
 * Foundation; either version 2, 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 Getdefs.  See the file "COPYING".  If not,
 * write to:  The Free Software Foundation, Inc.,
 *            59 Temple Place - Suite 330,
 *            Boston,  MA  02111-1307, USA.
 */
#include <options.h>

/*
 *  Enumeration of each option:
 */
typedef enum {
        INDEX_OPT_DEFS_TO_GET      =  0,
        INDEX_OPT_ORDERING         =  1,
        INDEX_OPT_INPUT            =  2,
        INDEX_OPT_SUBBLOCK         =  3,
        INDEX_OPT_FILELIST         =  4,
        INDEX_OPT_ASSIGN           =  6,
        INDEX_OPT_COMMON_ASSIGN    =  7,
        INDEX_OPT_COPY             =  8,
        INDEX_OPT_SRCFILE          =  9,
        INDEX_OPT_LINENUM          = 10,
        INDEX_OPT_OUTPUT           = 12,
        INDEX_OPT_AUTOGEN          = 13,
        INDEX_OPT_TEMPLATE         = 14,
        INDEX_OPT_AGARG            = 15,
        INDEX_OPT_BASE_NAME        = 16,
        INDEX_OPT_VERSION          = 17,
        INDEX_OPT_HELP             = 18,
        INDEX_OPT_MORE_HELP        = 19
} teOptIndex;

#define OPTION_CT    20
#define GETDEFS_VERSION       "1"
#define GETDEFS_FULL_VERSION  "getdefs - AutoGen Definition Extraction Tool - Ver. 1"

/*
 *  Interface defines for all options.  Replace "n" with
 *  the UPPER_CASED option name (as in the teOptIndex
 *  enumeration above).  e.g. HAVE_OPT( DEFS_TO_GET )
 */
#define     DESC(n)     getdefsOptions.pOptDesc[INDEX_OPT_ ## n]
#define     HAVE_OPT(n) (! UNUSED_OPT(&DESC(n)))
#define      OPT_ARG(n) (DESC(n).pzLastArg)
#define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
#define    COUNT_OPT(n) (DESC(n).optOccCt)
#define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
#define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
#define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define    CLEAR_OPT(n) STMTS( \
                DESC(n).fOptState &= OPTST_PERSISTENT;   \
                if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
                    DESC(n).fOptState |= OPTST_DISABLED; \
                DESC(n).optCookie = (void*)NULL )

/*
 *  Interface defines for specific options.
 */
#define VALUE_OPT_DEFS_TO_GET    0
#define VALUE_OPT_ORDERING       1
#define VALUE_OPT_INPUT          2
#define VALUE_OPT_SUBBLOCK       3
#define VALUE_OPT_FILELIST       4
#define VALUE_OPT_ASSIGN         6
#define VALUE_OPT_COMMON_ASSIGN  7
#define VALUE_OPT_COPY           8
#define VALUE_OPT_SRCFILE        9
#define VALUE_OPT_LINENUM        10
#define VALUE_OPT_OUTPUT         12
#define VALUE_OPT_AUTOGEN        13
#define WHICH_OPT_AUTOGEN        (DESC(AUTOGEN).optActualValue)
#define WHICH_IDX_AUTOGEN        (DESC(AUTOGEN).optActualIndex)
#define VALUE_OPT_TEMPLATE       14
#define VALUE_OPT_AGARG          15
#define VALUE_OPT_BASE_NAME      16

#define VALUE_OPT_VERSION        INDEX_OPT_VERSION
#define VALUE_OPT_HELP           INDEX_OPT_HELP
#define VALUE_OPT_MORE_HELP      INDEX_OPT_MORE_HELP

/*
 *  Interface defines not associated with particular options
 */
#define  ERRSKIP_OPTERR STMTS( getdefsOptions.fOptSet &= ~OPTPROC_ERRSTOP )
#define  ERRSTOP_OPTERR STMTS( getdefsOptions.fOptSet |= OPTPROC_ERRSTOP )
#define  RESTART_OPT(n) STMTS( \
                getdefsOptions.curOptIdx = (n); \
                getdefsOptions.pzCurOpt  = (char*)NULL )
#define    START_OPT    RESTART_OPT(1)
#define     USAGE(c)    (*getdefsOptions.pUsageProc)( &getdefsOptions, c )

/* * * * * *
 *
 *  Declare the getdefs option descriptor.
 */
#ifdef  __cplusplus
extern "C" {
#endif

extern tOptions   getdefsOptions;

#ifdef  __cplusplus
}
#endif
#endif /* GETDEFS_OPTS_H */

