Blame src/tpmtool-args.h.bak

Packit 549fdc
/*   -*- buffer-read-only: t -*- vi: set ro:
Packit 549fdc
 *
Packit 549fdc
 *  DO NOT EDIT THIS FILE   (tpmtool-args.h)
Packit 549fdc
 *
Packit 549fdc
 *  It has been AutoGen-ed
Packit 549fdc
 *  From the definitions    tpmtool-args.def
Packit 549fdc
 *  and the template file   options
Packit 549fdc
 *
Packit 549fdc
 * Generated from AutoOpts 41:1:16 templates.
Packit 549fdc
 *
Packit 549fdc
 *  AutoOpts is a copyrighted work.  This header file is not encumbered
Packit 549fdc
 *  by AutoOpts licensing, but is provided under the licensing terms chosen
Packit 549fdc
 *  by the tpmtool author or copyright holder.  AutoOpts is
Packit 549fdc
 *  licensed under the terms of the LGPL.  The redistributable library
Packit 549fdc
 *  (``libopts'') is licensed under the terms of either the LGPL or, at the
Packit 549fdc
 *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
Packit 549fdc
 *  for details.
Packit 549fdc
 *
Packit 549fdc
 * The tpmtool program is copyrighted and licensed
Packit 549fdc
 * under the following terms:
Packit 549fdc
 *
Packit 549fdc
 *  Copyright (C) 2000-2018 Free Software Foundation, and others, all rights reserved.
Packit 549fdc
 *  This is free software. It is licensed for use, modification and
Packit 549fdc
 *  redistribution under the terms of the GNU General Public License,
Packit 549fdc
 *  version 3 or later <http://gnu.org/licenses/gpl.html>
Packit 549fdc
 *
Packit 549fdc
 *  tpmtool is free software: you can redistribute it and/or modify it
Packit 549fdc
 *  under the terms of the GNU General Public License as published by the
Packit 549fdc
 *  Free Software Foundation, either version 3 of the License, or
Packit 549fdc
 *  (at your option) any later version.
Packit 549fdc
 *
Packit 549fdc
 *  tpmtool is distributed in the hope that it will be useful, but
Packit 549fdc
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 549fdc
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit 549fdc
 *  See the GNU General Public License for more details.
Packit 549fdc
 *
Packit 549fdc
 *  You should have received a copy of the GNU General Public License along
Packit 549fdc
 *  with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 549fdc
 */
Packit 549fdc
/**
Packit 549fdc
 *  This file contains the programmatic interface to the Automated
Packit 549fdc
 *  Options generated for the tpmtool program.
Packit 549fdc
 *  These macros are documented in the AutoGen info file in the
Packit 549fdc
 *  "AutoOpts" chapter.  Please refer to that doc for usage help.
Packit 549fdc
 */
Packit 549fdc
#ifndef AUTOOPTS_TPMTOOL_ARGS_H_GUARD
Packit 549fdc
#define AUTOOPTS_TPMTOOL_ARGS_H_GUARD 1
Packit 549fdc
#include "config.h"
Packit 549fdc
#include <autoopts/options.h>
Packit 549fdc
Packit 549fdc
/**
Packit 549fdc
 *  Ensure that the library used for compiling this generated header is at
Packit 549fdc
 *  least as new as the version current when the header template was released
Packit 549fdc
 *  (not counting patch version increments).  Also ensure that the oldest
Packit 549fdc
 *  tolerable version is at least as old as what was current when the header
Packit 549fdc
 *  template was released.
Packit 549fdc
 */
Packit 549fdc
#define AO_TEMPLATE_VERSION 167937
Packit 549fdc
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
Packit 549fdc
 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
Packit 549fdc
# error option template version mismatches autoopts/options.h header
Packit 549fdc
  Choke Me.
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
/**
Packit 549fdc
 *  Enumeration of each option type for tpmtool
Packit 549fdc
 */
Packit 549fdc
typedef enum {
Packit 549fdc
    INDEX_OPT_DEBUG         =  0,
Packit 549fdc
    INDEX_OPT_INFILE        =  1,
Packit 549fdc
    INDEX_OPT_OUTFILE       =  2,
Packit 549fdc
    INDEX_OPT_GENERATE_RSA  =  3,
Packit 549fdc
    INDEX_OPT_REGISTER      =  4,
Packit 549fdc
    INDEX_OPT_SIGNING       =  5,
Packit 549fdc
    INDEX_OPT_LEGACY        =  6,
Packit 549fdc
    INDEX_OPT_USER          =  7,
Packit 549fdc
    INDEX_OPT_SYSTEM        =  8,
Packit 549fdc
    INDEX_OPT_PUBKEY        =  9,
Packit 549fdc
    INDEX_OPT_LIST          = 10,
Packit 549fdc
    INDEX_OPT_DELETE        = 11,
Packit 549fdc
    INDEX_OPT_TEST_SIGN     = 12,
Packit 549fdc
    INDEX_OPT_SEC_PARAM     = 13,
Packit 549fdc
    INDEX_OPT_BITS          = 14,
Packit 549fdc
    INDEX_OPT_INDER         = 15,
Packit 549fdc
    INDEX_OPT_OUTDER        = 16,
Packit 549fdc
    INDEX_OPT_VERSION       = 17,
Packit 549fdc
    INDEX_OPT_HELP          = 18,
Packit 549fdc
    INDEX_OPT_MORE_HELP     = 19
Packit 549fdc
} teOptIndex;
Packit 549fdc
/** count of all options for tpmtool */
Packit 549fdc
#define OPTION_CT    20
Packit 549fdc
/** tpmtool version */
Packit 549fdc
#define TPMTOOL_VERSION       "3.6.2"
Packit 549fdc
/** Full tpmtool version text */
Packit 549fdc
#define TPMTOOL_FULL_VERSION  "tpmtool 3.6.2"
Packit 549fdc
Packit 549fdc
/**
Packit 549fdc
 *  Interface defines for all options.  Replace "n" with the UPPER_CASED
Packit 549fdc
 *  option name (as in the teOptIndex enumeration above).
Packit 549fdc
 *  e.g. HAVE_OPT(DEBUG)
Packit 549fdc
 */
Packit 549fdc
#define         DESC(n) (tpmtoolOptions.pOptDesc[INDEX_OPT_## n])
Packit 549fdc
/** 'true' if an option has been specified in any way */
Packit 549fdc
#define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
Packit 549fdc
/** The string argument to an option. The argument type must be \"string\". */
Packit 549fdc
#define      OPT_ARG(n) (DESC(n).optArg.argString)
Packit 549fdc
/** Mask the option state revealing how an option was specified.
Packit 549fdc
 *  It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
Packit 549fdc
 * \a OPTST_DEFINED, \a OPTST_RESET or zero.
Packit 549fdc
 */
Packit 549fdc
#define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
Packit 549fdc
/** Count of option's occurrances *on the command line*. */
Packit 549fdc
#define    COUNT_OPT(n) (DESC(n).optOccCt)
Packit 549fdc
/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
Packit 549fdc
#define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
Packit 549fdc
/** 'true' if \a HAVE_OPT would yield 'false'. */
Packit 549fdc
#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
Packit 549fdc
/** 'true' if OPTST_DISABLED bit not set. */
Packit 549fdc
#define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
Packit 549fdc
/** number of stacked option arguments.
Packit 549fdc
 *  Valid only for stacked option arguments. */
Packit 549fdc
#define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
Packit 549fdc
/** stacked argument vector.
Packit 549fdc
 *  Valid only for stacked option arguments. */
Packit 549fdc
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
Packit 549fdc
/** Reset an option. */
Packit 549fdc
#define    CLEAR_OPT(n) STMTS( \
Packit 549fdc
                DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
Packit 549fdc
                if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
Packit 549fdc
                    DESC(n).fOptState |= OPTST_DISABLED; \
Packit 549fdc
                DESC(n).optCookie = NULL )
Packit 549fdc
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Packit 549fdc
/**
Packit 549fdc
 *  Enumeration of tpmtool exit codes
Packit 549fdc
 */
Packit 549fdc
typedef enum {
Packit 549fdc
    TPMTOOL_EXIT_SUCCESS         = 0,
Packit 549fdc
    TPMTOOL_EXIT_FAILURE         = 1,
Packit 549fdc
    TPMTOOL_EXIT_USAGE_ERROR     = 64,
Packit 549fdc
    TPMTOOL_EXIT_LIBOPTS_FAILURE = 70
Packit 549fdc
}   tpmtool_exit_code_t;
Packit 549fdc
/**
Packit 549fdc
 *  Interface defines for specific options.
Packit 549fdc
 * @{
Packit 549fdc
 */
Packit 549fdc
#define VALUE_OPT_DEBUG          'd'
Packit 549fdc
Packit 549fdc
#define OPT_VALUE_DEBUG          (DESC(DEBUG).optArg.argInt)
Packit 549fdc
#define VALUE_OPT_INFILE         0x1001
Packit 549fdc
#define VALUE_OPT_OUTFILE        0x1002
Packit 549fdc
#define VALUE_OPT_GENERATE_RSA   0x1003
Packit 549fdc
#define VALUE_OPT_REGISTER       0x1004
Packit 549fdc
#define VALUE_OPT_SIGNING        0x1005
Packit 549fdc
#define VALUE_OPT_LEGACY         0x1006
Packit 549fdc
#define VALUE_OPT_USER           0x1007
Packit 549fdc
#define VALUE_OPT_SYSTEM         0x1008
Packit 549fdc
#define VALUE_OPT_PUBKEY         0x1009
Packit 549fdc
#define VALUE_OPT_LIST           0x100A
Packit 549fdc
#define VALUE_OPT_DELETE         0x100B
Packit 549fdc
#define VALUE_OPT_TEST_SIGN      0x100C
Packit 549fdc
#define VALUE_OPT_SEC_PARAM      0x100D
Packit 549fdc
#define VALUE_OPT_BITS           0x100E
Packit 549fdc
Packit 549fdc
#define OPT_VALUE_BITS           (DESC(BITS).optArg.argInt)
Packit 549fdc
#define VALUE_OPT_INDER          0x100F
Packit 549fdc
#define VALUE_OPT_OUTDER         0x1010
Packit 549fdc
/** option flag (value) for help-value option */
Packit 549fdc
#define VALUE_OPT_HELP          'h'
Packit 549fdc
/** option flag (value) for more-help-value option */
Packit 549fdc
#define VALUE_OPT_MORE_HELP     '!'
Packit 549fdc
/** option flag (value) for version-value option */
Packit 549fdc
#define VALUE_OPT_VERSION       'v'
Packit 549fdc
/*
Packit 549fdc
 *  Interface defines not associated with particular options
Packit 549fdc
 */
Packit 549fdc
#define ERRSKIP_OPTERR  STMTS(tpmtoolOptions.fOptSet &= ~OPTPROC_ERRSTOP)
Packit 549fdc
#define ERRSTOP_OPTERR  STMTS(tpmtoolOptions.fOptSet |= OPTPROC_ERRSTOP)
Packit 549fdc
#define RESTART_OPT(n)  STMTS( \
Packit 549fdc
                tpmtoolOptions.curOptIdx = (n); \
Packit 549fdc
                tpmtoolOptions.pzCurOpt  = NULL )
Packit 549fdc
#define START_OPT       RESTART_OPT(1)
Packit 549fdc
#define USAGE(c)        (*tpmtoolOptions.pUsageProc)(&tpmtoolOptions, c)
Packit 549fdc
Packit 549fdc
#ifdef  __cplusplus
Packit 549fdc
extern "C" {
Packit 549fdc
#endif
Packit 549fdc
/*
Packit 549fdc
 *  global exported definitions
Packit 549fdc
 */
Packit 549fdc
#include <gettext.h>
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* * * * * *
Packit 549fdc
 *
Packit 549fdc
 *  Declare the tpmtool option descriptor.
Packit 549fdc
 */
Packit 549fdc
extern tOptions tpmtoolOptions;
Packit 549fdc
Packit 549fdc
#if defined(ENABLE_NLS)
Packit 549fdc
# ifndef _
Packit 549fdc
#   include <stdio.h>
Packit 549fdc
#   ifndef HAVE_GETTEXT
Packit 549fdc
      extern char * gettext(char const *);
Packit 549fdc
#   else
Packit 549fdc
#     include <libintl.h>
Packit 549fdc
#   endif
Packit 549fdc
Packit 549fdc
# ifndef ATTRIBUTE_FORMAT_ARG
Packit 549fdc
#   define ATTRIBUTE_FORMAT_ARG(_a)
Packit 549fdc
# endif
Packit 549fdc
Packit 549fdc
static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
Packit 549fdc
static inline char* aoGetsText(char const* pz) {
Packit 549fdc
    if (pz == NULL) return NULL;
Packit 549fdc
    return (char*)gettext(pz);
Packit 549fdc
}
Packit 549fdc
#   define _(s)  aoGetsText(s)
Packit 549fdc
# endif /* _() */
Packit 549fdc
Packit 549fdc
# define OPT_NO_XLAT_CFG_NAMES  STMTS(tpmtoolOptions.fOptSet |= \
Packit 549fdc
                                    OPTPROC_NXLAT_OPT_CFG;)
Packit 549fdc
# define OPT_NO_XLAT_OPT_NAMES  STMTS(tpmtoolOptions.fOptSet |= \
Packit 549fdc
                                    OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
Packit 549fdc
Packit 549fdc
# define OPT_XLAT_CFG_NAMES     STMTS(tpmtoolOptions.fOptSet &= \
Packit 549fdc
                                  ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
Packit 549fdc
# define OPT_XLAT_OPT_NAMES     STMTS(tpmtoolOptions.fOptSet &= \
Packit 549fdc
                                  ~OPTPROC_NXLAT_OPT;)
Packit 549fdc
Packit 549fdc
#else   /* ENABLE_NLS */
Packit 549fdc
# define OPT_NO_XLAT_CFG_NAMES
Packit 549fdc
# define OPT_NO_XLAT_OPT_NAMES
Packit 549fdc
Packit 549fdc
# define OPT_XLAT_CFG_NAMES
Packit 549fdc
# define OPT_XLAT_OPT_NAMES
Packit 549fdc
Packit 549fdc
# ifndef _
Packit 549fdc
#   define _(_s)  _s
Packit 549fdc
# endif
Packit 549fdc
#endif  /* ENABLE_NLS */
Packit 549fdc
Packit 549fdc
#ifdef  __cplusplus
Packit 549fdc
}
Packit 549fdc
#endif
Packit 549fdc
#endif /* AUTOOPTS_TPMTOOL_ARGS_H_GUARD */
Packit 549fdc
Packit 549fdc
/* tpmtool-args.h ends here */