|
Packit |
549fdc |
/* -*- buffer-read-only: t -*- vi: set ro:
|
|
Packit |
549fdc |
*
|
|
Packit |
549fdc |
* DO NOT EDIT THIS FILE (psktool-args.h)
|
|
Packit |
549fdc |
*
|
|
Packit |
549fdc |
* It has been AutoGen-ed
|
|
Packit |
549fdc |
* From the definitions psktool-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 psktool 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 psktool 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 |
* psktool 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 |
* psktool 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 psktool 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_PSKTOOL_ARGS_H_GUARD
|
|
Packit |
549fdc |
#define AUTOOPTS_PSKTOOL_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 psktool
|
|
Packit |
549fdc |
*/
|
|
Packit |
549fdc |
typedef enum {
|
|
Packit |
549fdc |
INDEX_OPT_DEBUG = 0,
|
|
Packit |
549fdc |
INDEX_OPT_KEYSIZE = 1,
|
|
Packit |
549fdc |
INDEX_OPT_USERNAME = 2,
|
|
Packit |
549fdc |
INDEX_OPT_PSKFILE = 3,
|
|
Packit |
549fdc |
INDEX_OPT_PASSWD = 4,
|
|
Packit |
549fdc |
INDEX_OPT_VERSION = 5,
|
|
Packit |
549fdc |
INDEX_OPT_HELP = 6,
|
|
Packit |
549fdc |
INDEX_OPT_MORE_HELP = 7
|
|
Packit |
549fdc |
} teOptIndex;
|
|
Packit |
549fdc |
/** count of all options for psktool */
|
|
Packit |
549fdc |
#define OPTION_CT 8
|
|
Packit |
549fdc |
/** psktool version */
|
|
Packit |
549fdc |
#define PSKTOOL_VERSION "3.6.2"
|
|
Packit |
549fdc |
/** Full psktool version text */
|
|
Packit |
549fdc |
#define PSKTOOL_FULL_VERSION "psktool 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) (psktoolOptions.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 psktool exit codes
|
|
Packit |
549fdc |
*/
|
|
Packit |
549fdc |
typedef enum {
|
|
Packit |
549fdc |
PSKTOOL_EXIT_SUCCESS = 0,
|
|
Packit |
549fdc |
PSKTOOL_EXIT_FAILURE = 1,
|
|
Packit |
549fdc |
PSKTOOL_EXIT_USAGE_ERROR = 64,
|
|
Packit |
549fdc |
PSKTOOL_EXIT_LIBOPTS_FAILURE = 70
|
|
Packit |
549fdc |
} psktool_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_KEYSIZE 's'
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
#define OPT_VALUE_KEYSIZE (DESC(KEYSIZE).optArg.argInt)
|
|
Packit |
549fdc |
#define VALUE_OPT_USERNAME 'u'
|
|
Packit |
549fdc |
#define VALUE_OPT_PSKFILE 'p'
|
|
Packit |
549fdc |
#define VALUE_OPT_PASSWD 0x1001
|
|
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(psktoolOptions.fOptSet &= ~OPTPROC_ERRSTOP)
|
|
Packit |
549fdc |
#define ERRSTOP_OPTERR STMTS(psktoolOptions.fOptSet |= OPTPROC_ERRSTOP)
|
|
Packit |
549fdc |
#define RESTART_OPT(n) STMTS( \
|
|
Packit |
549fdc |
psktoolOptions.curOptIdx = (n); \
|
|
Packit |
549fdc |
psktoolOptions.pzCurOpt = NULL )
|
|
Packit |
549fdc |
#define START_OPT RESTART_OPT(1)
|
|
Packit |
549fdc |
#define USAGE(c) (*psktoolOptions.pUsageProc)(&psktoolOptions, 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 psktool option descriptor.
|
|
Packit |
549fdc |
*/
|
|
Packit |
549fdc |
extern tOptions psktoolOptions;
|
|
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(psktoolOptions.fOptSet |= \
|
|
Packit |
549fdc |
OPTPROC_NXLAT_OPT_CFG;)
|
|
Packit |
549fdc |
# define OPT_NO_XLAT_OPT_NAMES STMTS(psktoolOptions.fOptSet |= \
|
|
Packit |
549fdc |
OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
# define OPT_XLAT_CFG_NAMES STMTS(psktoolOptions.fOptSet &= \
|
|
Packit |
549fdc |
~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
|
|
Packit |
549fdc |
# define OPT_XLAT_OPT_NAMES STMTS(psktoolOptions.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_PSKTOOL_ARGS_H_GUARD */
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
/* psktool-args.h ends here */
|