aboutsummaryrefslogtreecommitdiff
path: root/sntp/libopts/autoopts/options.h
diff options
context:
space:
mode:
Diffstat (limited to 'sntp/libopts/autoopts/options.h')
-rw-r--r--sntp/libopts/autoopts/options.h489
1 files changed, 289 insertions, 200 deletions
diff --git a/sntp/libopts/autoopts/options.h b/sntp/libopts/autoopts/options.h
index c2ceeb3dbb13..c2925e7999bf 100644
--- a/sntp/libopts/autoopts/options.h
+++ b/sntp/libopts/autoopts/options.h
@@ -2,34 +2,33 @@
*
* DO NOT EDIT THIS FILE (options.h)
*
- * It has been AutoGen-ed Saturday May 5, 2007 at 12:02:34 PM PDT
+ * It has been AutoGen-ed April 29, 2011 at 03:44:02 PM by AutoGen 5.11.9
* From the definitions funcs.def
* and the template file options_h
*
* This file defines all the global structures and special values
* used in the automated option processing library.
*
- * Automated Options copyright 1992-Y Bruce Korb
+ * Automated Options Copyright (C) 1992-2011 by Bruce Korb
*
- * AutoOpts is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
+ * AutoOpts is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
*
- * AutoOpts 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
- * Lesser General Public License for more details.
+ * AutoOpts 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 Lesser General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with AutoOpts. If not, write to:
- * The Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.";
+
*/
#ifndef AUTOOPTS_OPTIONS_H_GUARD
-#define AUTOOPTS_OPTIONS_H_GUARD
+#define AUTOOPTS_OPTIONS_H_GUARD 1
#include <sys/types.h>
+#include <stdio.h>
#if defined(HAVE_STDINT_H)
# include <stdint.h>
@@ -59,28 +58,33 @@
* to an option descriptor must be obtained. There are two ways:
*
* 1. inside an option processing procedure, it is the second argument,
- * conventionally "tOptDesc* pOD".
+ * conventionally "tOptDesc* pOD".
*
- * 2. Outside of an option procedure (or to reference a different option
- * descriptor), use either "&DESC( opt_name )" or "&pfx_DESC( opt_name )".
+ * 2. Outside of an option procedure (or to reference a different option
+ * descriptor), use either "&DESC( opt_name )" or "&pfx_DESC( opt_name )".
*
* See the relevant generated header file to determine which and what
* values for "opt_name" are available.
*/
-
-#define OPTIONS_STRUCT_VERSION 118784
-#define OPTIONS_VERSION_STRING "29:0:4"
+#define OPTIONS_STRUCT_VERSION 143360
+#define OPTIONS_VERSION_STRING "35:0:10"
#define OPTIONS_MINIMUM_VERSION 102400
#define OPTIONS_MIN_VER_STRING "25:0:0"
typedef enum {
- OPARG_TYPE_NONE = 0,
- OPARG_TYPE_STRING = 1, /* default type/ vanilla string */
- OPARG_TYPE_ENUMERATION = 2, /* opt arg is an enum (keyword list) */
- OPARG_TYPE_BOOLEAN = 3, /* opt arg is boolean-valued */
- OPARG_TYPE_MEMBERSHIP = 4, /* opt arg sets set membership bits */
- OPARG_TYPE_NUMERIC = 5, /* opt arg has numeric value */
- OPARG_TYPE_HIERARCHY = 6 /* option arg is hierarchical value */
+ OPARG_TYPE_NONE = 0,
+ OPARG_TYPE_STRING = 1, /* default type/ vanilla string */
+ OPARG_TYPE_ENUMERATION = 2, /* opt arg is an enum (keyword list) */
+ OPARG_TYPE_BOOLEAN = 3, /* opt arg is boolean-valued */
+ OPARG_TYPE_MEMBERSHIP = 4, /* opt arg sets set membership bits */
+ OPARG_TYPE_NUMERIC = 5, /* opt arg is a long int */
+ OPARG_TYPE_HIERARCHY = 6, /* option arg is hierarchical value */
+ OPARG_TYPE_FILE = 7, /* option arg names a file */
+ OPARG_TYPE_TIME = 8, /* opt arg is a time duration */
+ OPARG_TYPE_FLOAT = 9, /* opt arg is a floating point num */
+ OPARG_TYPE_DOUBLE = 10, /* opt arg is a double prec. float */
+ OPARG_TYPE_LONG_DOUBLE = 11, /* opt arg is a long double prec. */
+ OPARG_TYPE_LONG_LONG = 12 /* opt arg is a long long int */
} teOptArgType;
typedef struct optionValue {
@@ -96,6 +100,31 @@ typedef struct optionValue {
} v;
} tOptionValue;
+typedef enum {
+ FTYPE_MODE_MAY_EXIST = 0x00,
+ FTYPE_MODE_MUST_EXIST = 0x01,
+ FTYPE_MODE_MUST_NOT_EXIST = 0x02,
+ FTYPE_MODE_EXIST_MASK = 0x03,
+ FTYPE_MODE_NO_OPEN = 0x00,
+ FTYPE_MODE_OPEN_FD = 0x10,
+ FTYPE_MODE_FOPEN_FP = 0x20,
+ FTYPE_MODE_OPEN_MASK = 0x30
+} teOptFileType;
+
+typedef union {
+ int file_flags;
+ char const * file_mode;
+} tuFileMode;
+
+typedef struct argList tArgList;
+#define MIN_ARG_ALLOC_CT 6
+#define INCR_ARG_ALLOC_CT 8
+struct argList {
+ int useCt;
+ int allocCt;
+ char const * apzArgs[MIN_ARG_ALLOC_CT];
+};
+
/*
* Bits in the fOptState option descriptor field.
*/
@@ -103,6 +132,7 @@ typedef enum {
OPTST_SET_ID = 0, /* Set via the "SET_OPT()" macro */
OPTST_PRESET_ID = 1, /* Set via an RC/INI file */
OPTST_DEFINED_ID = 2, /* Set via a command line option */
+ OPTST_RESET_ID = 3, /* Reset via command line option */
OPTST_EQUIVALENCE_ID = 4, /* selected by equiv'ed option */
OPTST_DISABLED_ID = 5, /* option is in disabled state */
OPTST_ALLOC_ARG_ID = 6, /* pzOptArg was allocated */
@@ -121,13 +151,17 @@ typedef enum {
OPTST_MUST_SET_ID = 20, /* must be set or pre-set */
OPTST_DOCUMENT_ID = 21, /* opt is for doc only */
OPTST_TWICE_ID = 22, /* process opt twice - imm + reg */
- OPTST_DISABLE_TWICE_ID = 23 /* process disabled option twice */
+ OPTST_DISABLE_TWICE_ID = 23, /* process disabled option twice */
+ OPTST_SCALED_NUM_ID = 24, /* scaled integer value */
+ OPTST_NO_COMMAND_ID = 25, /* disable from cmd line */
+ OPTST_DEPRECATED_ID = 26 /* support is being removed */
} opt_state_enum_t;
-#define OPTST_INIT 0U
+#define OPTST_INIT 0U
#define OPTST_SET (1U << OPTST_SET_ID)
#define OPTST_PRESET (1U << OPTST_PRESET_ID)
#define OPTST_DEFINED (1U << OPTST_DEFINED_ID)
+#define OPTST_RESET (1U << OPTST_RESET_ID)
#define OPTST_EQUIVALENCE (1U << OPTST_EQUIVALENCE_ID)
#define OPTST_DISABLED (1U << OPTST_DISABLED_ID)
#define OPTST_ALLOC_ARG (1U << OPTST_ALLOC_ARG_ID)
@@ -147,30 +181,39 @@ typedef enum {
#define OPTST_DOCUMENT (1U << OPTST_DOCUMENT_ID)
#define OPTST_TWICE (1U << OPTST_TWICE_ID)
#define OPTST_DISABLE_TWICE (1U << OPTST_DISABLE_TWICE_ID)
-#define OPT_STATE_MASK 0x00FFFF77U
-
-#define OPTST_SET_MASK ( \
- OPTST_SET | \
- OPTST_PRESET | \
- OPTST_DEFINED )
-
-#define OPTST_MUTABLE_MASK ( \
- OPTST_SET | \
- OPTST_PRESET | \
- OPTST_DEFINED | \
- OPTST_EQUIVALENCE | \
- OPTST_DISABLED | \
- OPTST_ALLOC_ARG )
-
-#define OPTST_SELECTED_MASK ( \
- OPTST_SET | \
- OPTST_DEFINED )
-
-#define OPTST_ARG_TYPE_MASK ( \
- OPTST_ARG_TYPE_1 | \
- OPTST_ARG_TYPE_2 | \
- OPTST_ARG_TYPE_3 | \
- OPTST_ARG_TYPE_4 )
+#define OPTST_SCALED_NUM (1U << OPTST_SCALED_NUM_ID)
+#define OPTST_NO_COMMAND (1U << OPTST_NO_COMMAND_ID)
+#define OPTST_DEPRECATED (1U << OPTST_DEPRECATED_ID)
+#define OPT_STATE_MASK 0x07FFFF7FU
+
+#define OPTST_SET_MASK ( \
+ OPTST_DEFINED | OPTST_PRESET | OPTST_RESET | \
+ OPTST_SET \
+ /* 0x0000000FU */ )
+
+#define OPTST_MUTABLE_MASK ( \
+ OPTST_ALLOC_ARG | OPTST_DEFINED | \
+ OPTST_DISABLED | OPTST_EQUIVALENCE | \
+ OPTST_PRESET | OPTST_RESET | \
+ OPTST_SET \
+ /* 0x0000007FU */ )
+
+#define OPTST_SELECTED_MASK ( \
+ OPTST_DEFINED | OPTST_SET \
+ /* 0x00000005U */ )
+
+#define OPTST_ARG_TYPE_MASK ( \
+ OPTST_ARG_TYPE_1 | OPTST_ARG_TYPE_2 | OPTST_ARG_TYPE_3 | \
+ OPTST_ARG_TYPE_4 \
+ /* 0x0000F000U */ )
+
+#define OPTST_DO_NOT_SAVE_MASK ( \
+ OPTST_DOCUMENT | OPTST_NO_INIT | OPTST_OMITTED \
+ /* 0x00280100U */ )
+
+#define OPTST_NO_USAGE_MASK ( \
+ OPTST_DEPRECATED | OPTST_NO_COMMAND | OPTST_OMITTED \
+ /* 0x06080000U */ )
#ifdef NO_OPTIONAL_OPT_ARGS
# undef OPTST_ARG_OPTIONAL
@@ -179,13 +222,12 @@ typedef enum {
#define OPTST_PERSISTENT_MASK (~OPTST_MUTABLE_MASK)
-#define SELECTED_OPT( pod ) ((pod)->fOptState & OPTST_SELECTED_MASK)
-#define UNUSED_OPT( pod ) (((pod)->fOptState & OPTST_SET_MASK) == 0)
-#define DISABLED_OPT( pod ) ((pod)->fOptState & OPTST_DISABLED)
-#define OPTION_STATE( pod ) ((pod)->fOptState)
-
-#define OPTST_SET_ARGTYPE(n) ((n) << OPTST_ARG_TYPE_1_ID)
-#define OPTST_GET_ARGTYPE(f) (((f) & OPTST_ARG_TYPE_MASK)>>OPTST_ARG_TYPE_1_ID)
+#define SELECTED_OPT(_od) ((_od)->fOptState & OPTST_SELECTED_MASK)
+#define UNUSED_OPT( _od) (((_od)->fOptState & OPTST_SET_MASK) == 0)
+#define DISABLED_OPT(_od) ((_od)->fOptState & OPTST_DISABLED)
+#define OPTION_STATE(_od) ((_od)->fOptState)
+#define OPTST_SET_ARGTYPE(_n) ((_n) << OPTST_ARG_TYPE_1_ID)
+#define OPTST_GET_ARGTYPE(_f) (((_f)&OPTST_ARG_TYPE_MASK)>>OPTST_ARG_TYPE_1_ID)
/*
* PRIVATE INTERFACES
@@ -199,42 +241,50 @@ typedef enum {
* Define the processing state flags
*/
typedef enum {
- OPTPROC_LONGOPT_ID = 0, /* Process long style options */
- OPTPROC_SHORTOPT_ID = 1, /* Process short style "flags" */
- OPTPROC_ERRSTOP_ID = 2, /* Stop on argument errors */
- OPTPROC_DISABLEDOPT_ID = 3, /* Current option is disabled */
- OPTPROC_NO_REQ_OPT_ID = 4, /* no options are required */
- OPTPROC_NUM_OPT_ID = 5, /* there is a number option */
- OPTPROC_INITDONE_ID = 6, /* have initializations been done? */
- OPTPROC_NEGATIONS_ID = 7, /* any negation options? */
- OPTPROC_ENVIRON_ID = 8, /* check environment? */
- OPTPROC_NO_ARGS_ID = 9, /* Disallow remaining arguments */
- OPTPROC_ARGS_REQ_ID = 10, /* Require arguments after options */
- OPTPROC_REORDER_ID = 11, /* reorder operands after options */
- OPTPROC_GNUUSAGE_ID = 12, /* emit usage in GNU style */
- OPTPROC_TRANSLATE_ID = 13, /* Translate strings in tOptions */
- OPTPROC_HAS_IMMED_ID = 14, /* program defines immed options */
- OPTPROC_PRESETTING_ID = 19 /* opt processing in preset state */
+ OPTPROC_LONGOPT_ID = 0, /* Process long style options */
+ OPTPROC_SHORTOPT_ID = 1, /* Process short style "flags" */
+ OPTPROC_ERRSTOP_ID = 2, /* Stop on argument errors */
+ OPTPROC_DISABLEDOPT_ID = 3, /* Current option is disabled */
+ OPTPROC_NO_REQ_OPT_ID = 4, /* no options are required */
+ OPTPROC_NUM_OPT_ID = 5, /* there is a number option */
+ OPTPROC_INITDONE_ID = 6, /* have inits been done? */
+ OPTPROC_NEGATIONS_ID = 7, /* any negation options? */
+ OPTPROC_ENVIRON_ID = 8, /* check environment? */
+ OPTPROC_NO_ARGS_ID = 9, /* Disallow remaining arguments */
+ OPTPROC_ARGS_REQ_ID = 10, /* Require args after options */
+ OPTPROC_REORDER_ID = 11, /* reorder operands after opts */
+ OPTPROC_GNUUSAGE_ID = 12, /* emit usage in GNU style */
+ OPTPROC_TRANSLATE_ID = 13, /* Translate strings in tOptions */
+ OPTPROC_MISUSE_ID = 14, /* no usage on usage error */
+ OPTPROC_NXLAT_OPT_CFG_ID = 16, /* suppress for config only */
+ OPTPROC_NXLAT_OPT_ID = 17, /* suppress xlation always */
+ OPTPROC_PRESETTING_ID = 19 /* opt processing in preset state */
} optproc_state_enum_t;
-#define OPTPROC_NONE 0U
-#define OPTPROC_LONGOPT (1U << OPTPROC_LONGOPT_ID)
-#define OPTPROC_SHORTOPT (1U << OPTPROC_SHORTOPT_ID)
-#define OPTPROC_ERRSTOP (1U << OPTPROC_ERRSTOP_ID)
-#define OPTPROC_DISABLEDOPT (1U << OPTPROC_DISABLEDOPT_ID)
-#define OPTPROC_NO_REQ_OPT (1U << OPTPROC_NO_REQ_OPT_ID)
-#define OPTPROC_NUM_OPT (1U << OPTPROC_NUM_OPT_ID)
-#define OPTPROC_INITDONE (1U << OPTPROC_INITDONE_ID)
-#define OPTPROC_NEGATIONS (1U << OPTPROC_NEGATIONS_ID)
-#define OPTPROC_ENVIRON (1U << OPTPROC_ENVIRON_ID)
-#define OPTPROC_NO_ARGS (1U << OPTPROC_NO_ARGS_ID)
-#define OPTPROC_ARGS_REQ (1U << OPTPROC_ARGS_REQ_ID)
-#define OPTPROC_REORDER (1U << OPTPROC_REORDER_ID)
-#define OPTPROC_GNUUSAGE (1U << OPTPROC_GNUUSAGE_ID)
-#define OPTPROC_TRANSLATE (1U << OPTPROC_TRANSLATE_ID)
-#define OPTPROC_HAS_IMMED (1U << OPTPROC_HAS_IMMED_ID)
-#define OPTPROC_PRESETTING (1U << OPTPROC_PRESETTING_ID)
-#define OPTPROC_STATE_MASK 0x00087FFFU
+#define OPTPROC_NONE 0U
+#define OPTPROC_LONGOPT (1U << OPTPROC_LONGOPT_ID)
+#define OPTPROC_SHORTOPT (1U << OPTPROC_SHORTOPT_ID)
+#define OPTPROC_ERRSTOP (1U << OPTPROC_ERRSTOP_ID)
+#define OPTPROC_DISABLEDOPT (1U << OPTPROC_DISABLEDOPT_ID)
+#define OPTPROC_NO_REQ_OPT (1U << OPTPROC_NO_REQ_OPT_ID)
+#define OPTPROC_NUM_OPT (1U << OPTPROC_NUM_OPT_ID)
+#define OPTPROC_INITDONE (1U << OPTPROC_INITDONE_ID)
+#define OPTPROC_NEGATIONS (1U << OPTPROC_NEGATIONS_ID)
+#define OPTPROC_ENVIRON (1U << OPTPROC_ENVIRON_ID)
+#define OPTPROC_NO_ARGS (1U << OPTPROC_NO_ARGS_ID)
+#define OPTPROC_ARGS_REQ (1U << OPTPROC_ARGS_REQ_ID)
+#define OPTPROC_REORDER (1U << OPTPROC_REORDER_ID)
+#define OPTPROC_GNUUSAGE (1U << OPTPROC_GNUUSAGE_ID)
+#define OPTPROC_TRANSLATE (1U << OPTPROC_TRANSLATE_ID)
+#define OPTPROC_MISUSE (1U << OPTPROC_MISUSE_ID)
+#define OPTPROC_NXLAT_OPT_CFG (1U << OPTPROC_NXLAT_OPT_CFG_ID)
+#define OPTPROC_NXLAT_OPT (1U << OPTPROC_NXLAT_OPT_ID)
+#define OPTPROC_PRESETTING (1U << OPTPROC_PRESETTING_ID)
+#define OPTPROC_STATE_MASK 0x000B7FFFU
+
+#define OPTPROC_NO_XLAT_MASK ( \
+ OPTPROC_NXLAT_OPT | OPTPROC_NXLAT_OPT_CFG \
+ /* 0x00030000U */ )
#define STMTS(s) do { s; } while (0)
@@ -265,19 +315,24 @@ typedef enum { AG_FALSE = 0, AG_TRUE } ag_bool;
typedef struct options tOptions;
typedef struct optDesc tOptDesc;
typedef struct optNames tOptNames;
+#define OPTPROC_EMIT_USAGE ((tOptions *)0x01UL)
+#define OPTPROC_EMIT_SHELL ((tOptions *)0x02UL)
+#define OPTPROC_RETURN_VALNAME ((tOptions *)0x03UL)
+#define OPTPROC_EMIT_LIMIT ((tOptions *)0x0FUL)
/*
* The option procedures do the special processing for each
* option flag that needs it.
*/
-typedef void (tOptProc)( tOptions* pOpts, tOptDesc* pOptDesc );
+typedef void (tOptProc)(tOptions* pOpts, tOptDesc* pOptDesc);
typedef tOptProc* tpOptProc;
/*
* The usage procedure will never return. It calls "exit(2)"
* with the "exitCode" argument passed to it.
*/
-typedef void (tUsageProc)( tOptions* pOpts, int exitCode );
+// coverity[+kill]
+typedef void (tUsageProc)(tOptions* pOpts, int exitCode);
typedef tUsageProc* tpUsageProc;
/*
@@ -289,21 +344,6 @@ typedef tUsageProc* tpUsageProc;
#define OPTION_LIMIT SHRT_MAX
#define NO_EQUIVALENT (OPTION_LIMIT+1)
-/*
- * Special values for optValue. It must not be generatable from the
- * computation "optIndex +96". Since "optIndex" is limited to 100, ...
- */
-#define NUMBER_OPTION '#'
-
-typedef struct argList tArgList;
-#define MIN_ARG_ALLOC_CT 6
-#define INCR_ARG_ALLOC_CT 8
-struct argList {
- int useCt;
- int allocCt;
- tCC* apzArgs[ MIN_ARG_ALLOC_CT ];
-};
-
typedef union {
char const * argString;
uintptr_t argEnum;
@@ -311,8 +351,12 @@ typedef union {
long argInt;
unsigned long argUint;
unsigned int argBool;
+ FILE * argFp;
+ int argFd;
} optArgBucket_t;
+#define pzLastArg optArg.argString
+
/*
* Descriptor structure for each option.
* Only the fields marked "PUBLIC" are for public use.
@@ -331,18 +375,17 @@ struct optDesc {
tAoUI fOptState; /* PUBLIC */
tAoUI reserved;
optArgBucket_t optArg; /* PUBLIC */
-# define pzLastArg optArg.argString
void* optCookie; /* PUBLIC */
- const int * pOptMust;
- const int * pOptCant;
- tpOptProc pOptProc;
- char const* pzText;
+ int const * const pOptMust;
+ int const * const pOptCant;
+ tpOptProc const pOptProc;
+ char const* const pzText;
- char const* pz_NAME;
- char const* pz_Name;
- char const* pz_DisableName;
- char const* pz_DisablePfx;
+ char const* const pz_NAME;
+ char const* const pz_Name;
+ char const* const pz_DisableName;
+ char const* const pz_DisablePfx;
};
/*
@@ -362,6 +405,13 @@ struct optSpecIndex {
*/
typedef void (tOptionXlateProc)(void);
+/*
+ * Everything marked "PUBLIC" is also marked "const".
+ * Public access is not a license to modify. Other fields
+ * are used and modified by the library. They are also
+ * subject to change without any notice. Do not even
+ * look at these outside of libopts.
+ */
struct options {
int const structVersion;
int origArgCt;
@@ -370,32 +420,52 @@ struct options {
unsigned int curOptIdx;
char* pzCurOpt;
- char const* pzProgPath;
- char const* pzProgName;
- char const* const pzPROGNAME;
- char const* const pzRcName;
- char const* const pzCopyright;
- char const* const pzCopyNotice;
- char const* const pzFullVersion;
+ char const* const pzProgPath; /* PUBLIC */
+ char const* const pzProgName; /* PUBLIC */
+ char const* const pzPROGNAME; /* PUBLIC */
+ char const* const pzRcName; /* PUBLIC */
+ char const* const pzCopyright; /* PUBLIC */
+ char const* const pzCopyNotice; /* PUBLIC */
+ char const* const pzFullVersion; /* PUBLIC */
char const* const* const papzHomeList;
char const* const pzUsageTitle;
char const* const pzExplain;
char const* const pzDetail;
- tOptDesc* const pOptDesc;
- char const* const pzBugAddr;
+ tOptDesc* const pOptDesc; /* PUBLIC */
+ char const* const pzBugAddr; /* PUBLIC */
void* pExtensions;
void* pSavedState;
+ // coverity[+kill]
tpUsageProc pUsageProc;
tOptionXlateProc* pTransProc;
tOptSpecIndex specOptIdx;
int const optCt;
int const presetOptCt;
+ char const * pzFullUsage;
+ char const * pzShortUsage;
+ /* PUBLIC: */
+ optArgBucket_t const * const originalOptArgArray;
+ void * const * const originalOptArgCookie;
+ char const * const pzPkgDataDir;
+ char const * const pzPackager;
};
/*
+ * Versions where in various fields first appear:
+ * ($AO_CURRENT * 4096 + $AO_REVISION, but $AO_REVISION must be zero)
+ */
+#define originalOptArgArray_STRUCT_VERSION 131072 /* AO_CURRENT = 32 */
+#define HAS_originalOptArgArray(_opt) \
+ ((_opt)->structVersion >= originalOptArgArray_STRUCT_VERSION)
+
+#define pzPkgDataDir_STRUCT_VERSION 139264 /* AO_CURRENT = 34 */
+#define HAS_pzPkgDataDir(_opt) \
+ ((_opt)->structVersion >= pzPkgDataDir_STRUCT_VERSION)
+
+/*
* "token list" structure returned by "string_tokenize()"
*/
typedef struct {
@@ -437,7 +507,8 @@ typedef struct {
#define TEXT_MMAP_FAILED_ADDR(a) ((void*)(a) == (void*)MAP_FAILED)
#ifdef __cplusplus
-extern "C" {
+#define CPLUSPLUS_OPENER extern "C" {
+CPLUSPLUS_OPENER
#define CPLUSPLUS_CLOSER }
#else
#define CPLUSPLUS_CLOSER
@@ -447,7 +518,7 @@ extern "C" {
* The following routines may be coded into AutoOpts client code:
*/
-/* From: tokenize.c line 115
+/* From: tokenize.c line 166
*
* ao_string_tokenize - tokenize an input string
*
@@ -488,10 +559,10 @@ extern "C" {
* Double quote strings are formed according to the rules of string
* constants in ANSI-C programs.
*/
-extern token_list_t* ao_string_tokenize( char const* );
+extern token_list_t* ao_string_tokenize(char const*);
-/* From: configfile.c line 113
+/* From: configfile.c line 80
*
* configFileLoad - parse a configuration file
*
@@ -508,10 +579,10 @@ extern token_list_t* ao_string_tokenize( char const* );
* @code{optionGetValue()}, @code{optionNextValue()} and
* @code{optionUnloadNested()}.
*/
-extern const tOptionValue* configFileLoad( char const* );
+extern const tOptionValue* configFileLoad(char const*);
-/* From: configfile.c line 883
+/* From: configfile.c line 1059
*
* optionFileLoad - Load the locatable config files, in order
*
@@ -538,10 +609,10 @@ extern const tOptionValue* configFileLoad( char const* );
*
* Configuration files not found or not decipherable are simply ignored.
*/
-extern int optionFileLoad( tOptions*, char const* );
+extern int optionFileLoad(tOptions*, char const*);
-/* From: configfile.c line 245
+/* From: configfile.c line 212
*
* optionFindNextValue - find a hierarcicaly valued option instance
*
@@ -557,10 +628,10 @@ extern int optionFileLoad( tOptions*, char const* );
* configurable. It will search through the list and return the next entry
* that matches the criteria.
*/
-extern const tOptionValue* optionFindNextValue( const tOptDesc*, const tOptionValue*, char const*, char const* );
+extern const tOptionValue* optionFindNextValue(const tOptDesc*, const tOptionValue*, char const*, char const*);
-/* From: configfile.c line 171
+/* From: configfile.c line 138
*
* optionFindValue - find a hierarcicaly valued option instance
*
@@ -574,10 +645,10 @@ extern const tOptionValue* optionFindNextValue( const tOptDesc*, const tOptionVa
* This routine will find an entry in a nested value option or configurable.
* It will search through the list and return a matching entry.
*/
-extern const tOptionValue* optionFindValue( const tOptDesc*, char const*, char const* );
+extern const tOptionValue* optionFindValue(const tOptDesc*, char const*, char const*);
-/* From: restore.c line 188
+/* From: restore.c line 166
*
* optionFree - free allocated option processing memory
*
@@ -587,10 +658,10 @@ extern const tOptionValue* optionFindValue( const tOptDesc*, char const*, char c
* AutoOpts sometimes allocates memory and puts pointers to it in the
* option state structures. This routine deallocates all such memory.
*/
-extern void optionFree( tOptions* );
+extern void optionFree(tOptions*);
-/* From: configfile.c line 314
+/* From: configfile.c line 281
*
* optionGetValue - get a specific value from a hierarcical list
*
@@ -605,10 +676,10 @@ extern void optionFree( tOptions* );
* the first entry with a name that exactly matches the argument will be
* returned.
*/
-extern const tOptionValue* optionGetValue( const tOptionValue*, char const* );
+extern const tOptionValue* optionGetValue(const tOptionValue*, char const*);
-/* From: load.c line 521
+/* From: load.c line 478
*
* optionLoadLine - process a string for an option name and value
*
@@ -629,10 +700,10 @@ extern const tOptionValue* optionGetValue( const tOptionValue*, char const* );
* formation used in AutoGen definition files (@pxref{basic expression}),
* except that you may not use backquotes.
*/
-extern void optionLoadLine( tOptions*, char const* );
+extern void optionLoadLine(tOptions*, char const*);
-/* From: configfile.c line 373
+/* From: configfile.c line 340
*
* optionNextValue - get the next value from a hierarchical list
*
@@ -648,10 +719,10 @@ extern void optionLoadLine( tOptions*, char const* );
* The "@var{pOldValue}" must have been gotten from a prior call to this
* routine or to "@code{opitonGetValue()}".
*/
-extern const tOptionValue* optionNextValue( const tOptionValue*, const tOptionValue* );
+extern const tOptionValue* optionNextValue(const tOptionValue*, const tOptionValue*);
-/* From: usage.c line 128
+/* From: usage.c line 195
*
* optionOnlyUsage - Print usage text for just the options
*
@@ -663,10 +734,10 @@ extern const tOptionValue* optionNextValue( const tOptionValue*, const tOptionVa
* This function may be used when the emitted usage must incorporate
* information not available to AutoOpts.
*/
-extern void optionOnlyUsage( tOptions*, int );
+extern void optionOnlyUsage(tOptions*, int);
-/* From: autoopts.c line 1012
+/* From: autoopts.c line 1065
*
* optionProcess - this is the main option processing routine
*
@@ -693,10 +764,10 @@ extern void optionOnlyUsage( tOptions*, int );
* is treated as an operand. Encountering an operand stops option
* processing.
*/
-extern int optionProcess( tOptions*, int, char** );
+extern int optionProcess(tOptions*, int, char**);
-/* From: restore.c line 145
+/* From: restore.c line 123
*
* optionRestore - restore option state from memory copy
*
@@ -710,10 +781,10 @@ extern int optionProcess( tOptions*, int, char** );
* to optionProcess(3AO), then you may change the contents of the
* argc/argv parameters to optionProcess.
*/
-extern void optionRestore( tOptions* );
+extern void optionRestore(tOptions*);
-/* From: save.c line 334
+/* From: save.c line 664
*
* optionSaveFile - saves the option state to a file
*
@@ -725,12 +796,20 @@ extern void optionRestore( tOptions* );
* option, or by appending the @code{rcfile} attribute to the last
* @code{homerc} attribute. If no @code{rcfile} attribute was specified, it
* will default to @code{.@i{programname}rc}. If you wish to specify another
- * file, you should invoke the @code{SET_OPT_SAVE_OPTS( @i{filename} )} macro.
+ * file, you should invoke the @code{SET_OPT_SAVE_OPTS(@i{filename})} macro.
+ *
+ * The recommend usage is as follows:
+ * @example
+ * optionProcess(&progOptions, argc, argv);
+ * if (i_want_a_non_standard_place_for_this)
+ * SET_OPT_SAVE_OPTS("myfilename");
+ * optionSaveFile(&progOptions);
+ * @end example
*/
-extern void optionSaveFile( tOptions* );
+extern void optionSaveFile(tOptions*);
-/* From: restore.c line 93
+/* From: restore.c line 71
*
* optionSaveState - saves the option state to memory
*
@@ -749,10 +828,10 @@ extern void optionSaveFile( tOptions* );
* restoring of stacked string arguments and hierarchical values is
* disabled. The values are not saved.
*/
-extern void optionSaveState( tOptions* );
+extern void optionSaveState(tOptions*);
-/* From: nested.c line 559
+/* From: nested.c line 551
*
* optionUnloadNested - Deallocate the memory for a nested value
*
@@ -763,10 +842,10 @@ extern void optionSaveState( tOptions* );
* have been gotten from a call to @code{configFileLoad()} (See
* @pxref{libopts-configFileLoad}).
*/
-extern void optionUnloadNested( tOptionValue const * );
+extern void optionUnloadNested(tOptionValue const *);
-/* From: version.c line 58
+/* From: version.c line 31
*
* optionVersion - return the compiled AutoOpts version number
*
@@ -775,10 +854,10 @@ extern void optionUnloadNested( tOptionValue const * );
* Returns the full version string compiled into the library.
* The returned string cannot be modified.
*/
-extern char const* optionVersion( void );
+extern char const* optionVersion(void);
-/* From: ../compat/pathfind.c line 34
+/* From: ../compat/pathfind.c line 29
*
* pathfind - fild a file in a list of directories
*
@@ -818,11 +897,11 @@ extern char const* optionVersion( void );
* @end example
*/
#ifndef HAVE_PATHFIND
-extern char* pathfind( char const*, char const*, char const* );
+extern char* pathfind(char const*, char const*, char const*);
#endif /* HAVE_PATHFIND */
-/* From: streqvcmp.c line 233
+/* From: streqvcmp.c line 209
*
* strequate - map a list of characters to the same value
*
@@ -834,10 +913,10 @@ extern char* pathfind( char const*, char const*, char const* );
* This function name is mapped to option_strequate so as to not conflict
* with the POSIX name space.
*/
-extern void strequate( char const* );
+extern void strequate(char const*);
-/* From: streqvcmp.c line 143
+/* From: streqvcmp.c line 119
*
* streqvcmp - compare two strings with an equivalence mapping
*
@@ -853,10 +932,10 @@ extern void strequate( char const* );
* This function name is mapped to option_streqvcmp so as to not conflict
* with the POSIX name space.
*/
-extern int streqvcmp( char const*, char const* );
+extern int streqvcmp(char const*, char const*);
-/* From: streqvcmp.c line 180
+/* From: streqvcmp.c line 156
*
* streqvmap - Set the character mappings for the streqv functions
*
@@ -872,7 +951,7 @@ extern int streqvcmp( char const*, char const* );
* are incremented and the process repeated until @code{ct} entries have been
* set. For example,
* @example
- * streqvmap( 'a', 'A', 26 );
+ * streqvmap('a', 'A', 26);
* @end example
* @noindent
* will alter the mapping so that all English lower case letters
@@ -881,10 +960,10 @@ extern int streqvcmp( char const*, char const* );
* This function name is mapped to option_streqvmap so as to not conflict
* with the POSIX name space.
*/
-extern void streqvmap( char, char, int );
+extern void streqvmap(char, char, int);
-/* From: streqvcmp.c line 102
+/* From: streqvcmp.c line 78
*
* strneqvcmp - compare two strings with an equivalence mapping
*
@@ -902,10 +981,10 @@ extern void streqvmap( char, char, int );
* This function name is mapped to option_strneqvcmp so as to not conflict
* with the POSIX name space.
*/
-extern int strneqvcmp( char const*, char const*, int );
+extern int strneqvcmp(char const*, char const*, int);
-/* From: streqvcmp.c line 259
+/* From: streqvcmp.c line 235
*
* strtransform - convert a string into its mapped-to value
*
@@ -917,55 +996,65 @@ extern int strneqvcmp( char const*, char const*, int );
* character is put into the output.
* This function name is mapped to option_strtransform so as to not conflict
* with the POSIX name space.
+ *
+ * The source and destination may be the same.
*/
-extern void strtransform( char*, char const* );
+extern void strtransform(char*, char const*);
/* AutoOpts PRIVATE FUNCTIONS: */
tOptProc optionStackArg, optionUnstackArg, optionBooleanVal, optionNumericVal;
-extern char* ao_string_cook( char*, int* );
+extern char* ao_string_cook(char*, int*);
+
+extern unsigned int ao_string_cook_escape_char(char const*, char*, unsigned int);
+
+extern void genshelloptUsage(tOptions*, int);
+
+extern void optionBooleanVal(tOptions*, tOptDesc*);
+
+extern uintptr_t optionEnumerationVal(tOptions*, tOptDesc*, char const * const *, unsigned int);
-extern unsigned int ao_string_cook_escape_char( char const*, char*, unsigned int );
+extern void optionFileCheck(tOptions*, tOptDesc*, teOptFileType, tuFileMode);
-extern void export_options_to_guile( tOptions* );
+extern char const * optionKeywordName(tOptDesc*, unsigned int);
-extern void genshelloptUsage( tOptions*, int );
+extern void optionLoadOpt(tOptions*, tOptDesc*);
-extern void optionBooleanVal( tOptions*, tOptDesc* );
+extern ag_bool optionMakePath(char*, int, char const*, char const*);
-extern uintptr_t optionEnumerationVal( tOptions*, tOptDesc*, char const * const *, unsigned int );
+extern void optionNestedVal(tOptions*, tOptDesc*);
-extern char const* optionKeywordName( tOptDesc*, unsigned int );
+extern void optionNumericVal(tOptions*, tOptDesc*);
-extern void optionLoadOpt( tOptions*, tOptDesc* );
+extern void optionPagedUsage(tOptions*, tOptDesc*);
-extern ag_bool optionMakePath( char*, int, char const*, char const* );
+extern void optionParseShell(tOptions*);
-extern void optionNestedVal( tOptions*, tOptDesc* );
+extern void optionPrintVersion(tOptions*, tOptDesc*);
-extern void optionNumericVal( tOptions*, tOptDesc* );
+extern void optionPutShell(tOptions*);
-extern void optionPagedUsage( tOptions*, tOptDesc* );
+extern void optionResetOpt(tOptions*, tOptDesc*);
-extern void optionParseShell( tOptions* );
+extern void optionSetMembers(tOptions*, tOptDesc*, char const * const *, unsigned int);
-extern void optionPrintVersion( tOptions*, tOptDesc* );
+extern void optionShowRange(tOptions*, tOptDesc*, void *, int);
-extern void optionPutShell( tOptions* );
+extern void optionStackArg(tOptions*, tOptDesc*);
-extern void optionSetMembers( tOptions*, tOptDesc*, char const * const *, unsigned int );
+extern void optionTimeDate(tOptions*, tOptDesc*);
-extern void optionStackArg( tOptions*, tOptDesc* );
+extern void optionTimeVal(tOptions*, tOptDesc*);
-extern void optionUnstackArg( tOptions*, tOptDesc* );
+extern void optionUnstackArg(tOptions*, tOptDesc*);
-extern void optionUsage( tOptions*, int );
+extern void optionUsage(tOptions*, int);
-extern void optionVersionStderr( tOptions*, tOptDesc* );
+extern void optionVersionStderr(tOptions*, tOptDesc*);
-extern void* text_mmap( char const*, int, int, tmap_info_t* );
+extern void* text_mmap(char const*, int, int, tmap_info_t*);
-extern int text_munmap( tmap_info_t* );
+extern int text_munmap(tmap_info_t*);
CPLUSPLUS_CLOSER
#endif /* AUTOOPTS_OPTIONS_H_GUARD */