|
Packit |
aea12f |
/* -*- buffer-read-only: t -*- vi: set ro:
|
|
Packit |
aea12f |
*
|
|
Packit |
aea12f |
* DO NOT EDIT THIS FILE (ocsptool-args.h)
|
|
Packit |
aea12f |
*
|
|
Packit |
aea12f |
* It has been AutoGen-ed
|
|
Packit |
aea12f |
* From the definitions ocsptool-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 ocsptool 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 ocsptool 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 |
* ocsptool 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 |
* ocsptool 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 ocsptool 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_OCSPTOOL_ARGS_H_GUARD
|
|
Packit |
aea12f |
#define AUTOOPTS_OCSPTOOL_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 ocsptool
|
|
Packit |
aea12f |
*/
|
|
Packit |
aea12f |
typedef enum {
|
|
Packit |
aea12f |
INDEX_OPT_DEBUG = 0,
|
|
Packit |
aea12f |
INDEX_OPT_VERBOSE = 1,
|
|
Packit |
aea12f |
INDEX_OPT_INFILE = 2,
|
|
Packit |
aea12f |
INDEX_OPT_OUTFILE = 3,
|
|
Packit |
aea12f |
INDEX_OPT_ASK = 4,
|
|
Packit |
aea12f |
INDEX_OPT_VERIFY_RESPONSE = 5,
|
|
Packit |
aea12f |
INDEX_OPT_REQUEST_INFO = 6,
|
|
Packit |
aea12f |
INDEX_OPT_RESPONSE_INFO = 7,
|
|
Packit |
aea12f |
INDEX_OPT_GENERATE_REQUEST = 8,
|
|
Packit |
aea12f |
INDEX_OPT_NONCE = 9,
|
|
Packit |
aea12f |
INDEX_OPT_LOAD_CHAIN = 10,
|
|
Packit |
aea12f |
INDEX_OPT_LOAD_ISSUER = 11,
|
|
Packit |
aea12f |
INDEX_OPT_LOAD_CERT = 12,
|
|
Packit |
aea12f |
INDEX_OPT_LOAD_TRUST = 13,
|
|
Packit |
aea12f |
INDEX_OPT_LOAD_SIGNER = 14,
|
|
Packit |
aea12f |
INDEX_OPT_INDER = 15,
|
|
Packit |
aea12f |
INDEX_OPT_OUTDER = 16,
|
|
Packit |
aea12f |
INDEX_OPT_OUTPEM = 17,
|
|
Packit |
aea12f |
INDEX_OPT_LOAD_REQUEST = 18,
|
|
Packit |
aea12f |
INDEX_OPT_LOAD_RESPONSE = 19,
|
|
Packit |
aea12f |
INDEX_OPT_IGNORE_ERRORS = 20,
|
|
Packit |
aea12f |
INDEX_OPT_VERIFY_ALLOW_BROKEN = 21,
|
|
Packit |
aea12f |
INDEX_OPT_VERSION = 22,
|
|
Packit |
aea12f |
INDEX_OPT_HELP = 23,
|
|
Packit |
aea12f |
INDEX_OPT_MORE_HELP = 24
|
|
Packit |
aea12f |
} teOptIndex;
|
|
Packit |
aea12f |
/** count of all options for ocsptool */
|
|
Packit |
aea12f |
#define OPTION_CT 25
|
|
Packit |
aea12f |
/** ocsptool version */
|
|
Packit Service |
991b93 |
#define OCSPTOOL_VERSION "3.6.14"
|
|
Packit |
aea12f |
/** Full ocsptool version text */
|
|
Packit Service |
991b93 |
#define OCSPTOOL_FULL_VERSION "ocsptool 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) (ocsptoolOptions.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 ocsptool exit codes
|
|
Packit |
aea12f |
*/
|
|
Packit |
aea12f |
typedef enum {
|
|
Packit |
aea12f |
OCSPTOOL_EXIT_SUCCESS = 0,
|
|
Packit |
aea12f |
OCSPTOOL_EXIT_FAILURE = 1,
|
|
Packit |
aea12f |
OCSPTOOL_EXIT_USAGE_ERROR = 64,
|
|
Packit |
aea12f |
OCSPTOOL_EXIT_LIBOPTS_FAILURE = 70
|
|
Packit |
aea12f |
} ocsptool_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_VERBOSE 'V'
|
|
Packit |
aea12f |
#define VALUE_OPT_INFILE 0x1001
|
|
Packit |
aea12f |
#define VALUE_OPT_OUTFILE 0x1002
|
|
Packit |
aea12f |
#define VALUE_OPT_ASK 0x1003
|
|
Packit |
aea12f |
#define VALUE_OPT_VERIFY_RESPONSE 'e'
|
|
Packit |
aea12f |
#define VALUE_OPT_REQUEST_INFO 'i'
|
|
Packit |
aea12f |
#define VALUE_OPT_RESPONSE_INFO 'j'
|
|
Packit |
aea12f |
#define VALUE_OPT_GENERATE_REQUEST 'q'
|
|
Packit |
aea12f |
#define VALUE_OPT_NONCE 0x1004
|
|
Packit |
aea12f |
#define VALUE_OPT_LOAD_CHAIN 0x1005
|
|
Packit |
aea12f |
#define VALUE_OPT_LOAD_ISSUER 0x1006
|
|
Packit |
aea12f |
#define VALUE_OPT_LOAD_CERT 0x1007
|
|
Packit |
aea12f |
#define VALUE_OPT_LOAD_TRUST 0x1008
|
|
Packit |
aea12f |
#define VALUE_OPT_LOAD_SIGNER 0x1009
|
|
Packit |
aea12f |
#define VALUE_OPT_INDER 0x100A
|
|
Packit |
aea12f |
#define VALUE_OPT_OUTDER 0x100B
|
|
Packit |
aea12f |
#define VALUE_OPT_OUTPEM 0x100C
|
|
Packit |
aea12f |
#define VALUE_OPT_LOAD_REQUEST 'Q'
|
|
Packit |
aea12f |
#define VALUE_OPT_LOAD_RESPONSE 'S'
|
|
Packit |
aea12f |
#define VALUE_OPT_IGNORE_ERRORS 0x100D
|
|
Packit |
aea12f |
#define VALUE_OPT_VERIFY_ALLOW_BROKEN 0x100E
|
|
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(ocsptoolOptions.fOptSet &= ~OPTPROC_ERRSTOP)
|
|
Packit |
aea12f |
#define ERRSTOP_OPTERR STMTS(ocsptoolOptions.fOptSet |= OPTPROC_ERRSTOP)
|
|
Packit |
aea12f |
#define RESTART_OPT(n) STMTS( \
|
|
Packit |
aea12f |
ocsptoolOptions.curOptIdx = (n); \
|
|
Packit |
aea12f |
ocsptoolOptions.pzCurOpt = NULL )
|
|
Packit |
aea12f |
#define START_OPT RESTART_OPT(1)
|
|
Packit |
aea12f |
#define USAGE(c) (*ocsptoolOptions.pUsageProc)(&ocsptoolOptions, 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 ocsptool option descriptor.
|
|
Packit |
aea12f |
*/
|
|
Packit |
aea12f |
extern tOptions ocsptoolOptions;
|
|
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(ocsptoolOptions.fOptSet |= \
|
|
Packit |
aea12f |
OPTPROC_NXLAT_OPT_CFG;)
|
|
Packit |
aea12f |
# define OPT_NO_XLAT_OPT_NAMES STMTS(ocsptoolOptions.fOptSet |= \
|
|
Packit |
aea12f |
OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
|
|
Packit |
aea12f |
|
|
Packit |
aea12f |
# define OPT_XLAT_CFG_NAMES STMTS(ocsptoolOptions.fOptSet &= \
|
|
Packit |
aea12f |
~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
|
|
Packit |
aea12f |
# define OPT_XLAT_OPT_NAMES STMTS(ocsptoolOptions.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_OCSPTOOL_ARGS_H_GUARD */
|
|
Packit |
aea12f |
|
|
Packit |
aea12f |
/* ocsptool-args.h ends here */
|