Blame src/systemkey-args.h.bak

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