diff options
Diffstat (limited to 'autoopts/autoopts')
-rw-r--r-- | autoopts/autoopts/options.h | 1110 | ||||
-rw-r--r-- | autoopts/autoopts/usage-txt.h | 435 |
2 files changed, 1545 insertions, 0 deletions
diff --git a/autoopts/autoopts/options.h b/autoopts/autoopts/options.h new file mode 100644 index 0000000..c16d91b --- /dev/null +++ b/autoopts/autoopts/options.h @@ -0,0 +1,1110 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (options.h) + * + * It has been AutoGen-ed August 11, 2012 at 09:41:18 AM by AutoGen 5.16.2pre7 + * 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 (C) 1992-2012 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 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. + * + * 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 1 +#include <sys/types.h> +#include <stdio.h> + +#ifndef COMPAT_H_GUARD +/* + * This is needed for test compilations where the "compat.h" + * header is not usually available. + */ +# if defined(HAVE_STDINT_H) +# include <stdint.h> +# elif defined(HAVE_INTTYPES_H) +# include <inttypes.h> +# endif /* HAVE_STDINT/INTTYPES_H */ + +# if defined(HAVE_LIMITS_H) +# include <limits.h> +# elif defined(HAVE_SYS_LIMITS_H) +# include <sys/limits.h> +# endif /* HAVE_LIMITS/SYS_LIMITS_H */ + +# if defined(HAVE_SYSEXITS_H) +# include <sysexits.h> +# endif /* HAVE_SYSEXITS_H */ + +# if defined(HAVE_STDBOOL_H) +# include <stdbool.h> +# else + typedef enum { false = 0, true = 1 } _Bool; +# define bool _Bool + + /* The other macros must be usable in preprocessor directives. */ +# define false 0 +# define true 1 +# endif /* HAVE_SYSEXITS_H */ +#endif /* COMPAT_H_GUARD */ +// END-CONFIGURED-HEADERS + +/** + * Defined to normal value of EX_USAGE. Used to indicate that paged usage + * was requested. It is used to distinguish a --usage from a --help request. + * --usage is abbreviated and --help gives as much help as possible. + */ +#define AO_EXIT_REQ_USAGE 64 + +/* + * PUBLIC DEFINES + * + * The following defines may be used in applications that need to test the + * state of an option. To test against these masks and values, a pointer + * 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". + * + * 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 147461 +#define OPTIONS_VERSION_STRING "36:5:11" +#define OPTIONS_MINIMUM_VERSION 102400 +#define OPTIONS_MIN_VER_STRING "25:0:0" +#define OPTIONS_VER_TO_NUM(_v, _r) (((_v) * 4096) + (_r)) + +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 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 { + teOptArgType valType; + char* pzName; + union { + char strVal[1]; /* OPARG_TYPE_STRING */ + unsigned int enumVal; /* OPARG_TYPE_ENUMERATION */ + unsigned int boolVal; /* OPARG_TYPE_BOOLEAN */ + unsigned long setVal; /* OPARG_TYPE_MEMBERSHIP */ + long longVal; /* OPARG_TYPE_NUMERIC */ + void* nestVal; /* OPARG_TYPE_HIERARCHY */ + } 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. + */ +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 */ + OPTST_NO_INIT_ID = 8, /* option cannot be preset */ + OPTST_NUMBER_OPT_ID = 9, /* opt value (flag) is any digit */ + OPTST_STACKED_ID = 10, /* opt uses optionStackArg proc */ + OPTST_INITENABLED_ID = 11, /* option defaults to enabled */ + OPTST_ARG_TYPE_1_ID = 12, /* bit 1 of arg type enum */ + OPTST_ARG_TYPE_2_ID = 13, /* bit 2 of arg type enum */ + OPTST_ARG_TYPE_3_ID = 14, /* bit 3 of arg type enum */ + OPTST_ARG_TYPE_4_ID = 15, /* bit 4 of arg type enum */ + OPTST_ARG_OPTIONAL_ID = 16, /* the option arg not required */ + OPTST_IMM_ID = 17, /* process opt on first pass */ + OPTST_DISABLE_IMM_ID = 18, /* process disablement immed. */ + OPTST_OMITTED_ID = 19, /* compiled out of program */ + 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_SCALED_NUM_ID = 24, /* scaled integer value */ + OPTST_NO_COMMAND_ID = 25, /* disable from cmd line */ + OPTST_DEPRECATED_ID = 26, /* support is being removed */ + OPTST_ALIAS_ID = 27 /* alias for other option */ +} opt_state_enum_t; + +#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) +#define OPTST_NO_INIT (1U << OPTST_NO_INIT_ID) +#define OPTST_NUMBER_OPT (1U << OPTST_NUMBER_OPT_ID) +#define OPTST_STACKED (1U << OPTST_STACKED_ID) +#define OPTST_INITENABLED (1U << OPTST_INITENABLED_ID) +#define OPTST_ARG_TYPE_1 (1U << OPTST_ARG_TYPE_1_ID) +#define OPTST_ARG_TYPE_2 (1U << OPTST_ARG_TYPE_2_ID) +#define OPTST_ARG_TYPE_3 (1U << OPTST_ARG_TYPE_3_ID) +#define OPTST_ARG_TYPE_4 (1U << OPTST_ARG_TYPE_4_ID) +#define OPTST_ARG_OPTIONAL (1U << OPTST_ARG_OPTIONAL_ID) +#define OPTST_IMM (1U << OPTST_IMM_ID) +#define OPTST_DISABLE_IMM (1U << OPTST_DISABLE_IMM_ID) +#define OPTST_OMITTED (1U << OPTST_OMITTED_ID) +#define OPTST_MUST_SET (1U << OPTST_MUST_SET_ID) +#define OPTST_DOCUMENT (1U << OPTST_DOCUMENT_ID) +#define OPTST_TWICE (1U << OPTST_TWICE_ID) +#define OPTST_DISABLE_TWICE (1U << OPTST_DISABLE_TWICE_ID) +#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 OPTST_ALIAS (1U << OPTST_ALIAS_ID) +#define OPT_STATE_MASK 0x0FFFFF7FU + +#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_NO_USAGE_MASK ( \ + OPTST_DEPRECATED | OPTST_NO_COMMAND | OPTST_OMITTED \ + /* 0x06080000U */ ) + +#define OPTST_IMMUTABLE_MASK ( \ + OPTST_DOCUMENT | OPTST_OMITTED \ + /* 0x00280000U */ ) + +#define OPTST_DO_NOT_SAVE_MASK ( \ + OPTST_DOCUMENT | OPTST_NO_INIT | OPTST_OMITTED \ + /* 0x00280100U */ ) + +#define OPTST_NO_OUTPUT_MASK ( \ + OPTST_ALIAS | OPTST_DOCUMENT | OPTST_OMITTED \ + /* 0x08280000U */ ) + +#ifdef NO_OPTIONAL_OPT_ARGS +# undef OPTST_ARG_OPTIONAL +# define OPTST_ARG_OPTIONAL 0 +#endif + +#define VENDOR_OPTION_VALUE 'W' + +#define OPTST_PERSISTENT_MASK (~OPTST_MUTABLE_MASK) + +#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 + * + * The following values are used in the generated code to communicate + * with the option library procedures. They are not for public use + * and may be subject to change. + */ + +/* + * 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 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_IMMEDIATE_ID = 15, /* immediate options active */ + OPTPROC_NXLAT_OPT_CFG_ID = 16, /* suppress for config only */ + OPTPROC_NXLAT_OPT_ID = 17, /* suppress xlation always */ + OPTPROC_VENDOR_OPT_ID = 18, /* vendor options active */ + 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_MISUSE (1U << OPTPROC_MISUSE_ID) +#define OPTPROC_IMMEDIATE (1U << OPTPROC_IMMEDIATE_ID) +#define OPTPROC_NXLAT_OPT_CFG (1U << OPTPROC_NXLAT_OPT_CFG_ID) +#define OPTPROC_NXLAT_OPT (1U << OPTPROC_NXLAT_OPT_ID) +#define OPTPROC_VENDOR_OPT (1U << OPTPROC_VENDOR_OPT_ID) +#define OPTPROC_PRESETTING (1U << OPTPROC_PRESETTING_ID) +#define OPTPROC_STATE_MASK 0x000FFFFFU + +#define OPTPROC_NO_XLAT_MASK ( \ + OPTPROC_NXLAT_OPT | OPTPROC_NXLAT_OPT_CFG \ + /* 0x00030000U */ ) + +#define STMTS(s) do { s; } while (false) + +/* + * The following must be #defined instead of typedef-ed + * because "static const" cannot both be applied to a type, + * tho each individually can...so they all are + */ +#define tSCC static char const +#define tCC char const +#define tAoSC static char +#define tAoUC unsigned char +#define tAoUI unsigned int +#define tAoUL unsigned long +#define tAoUS unsigned short + +/* + * It is so disgusting that there must be so many ways + * of specifying TRUE and FALSE. + */ +typedef enum { AG_FALSE = 0, AG_TRUE } ag_bool; + +/* + * Define a structure that describes each option and + * a pointer to the procedure that handles it. + * The argument is the count of this flag previously seen. + */ +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 tOptProc* tpOptProc; + +/* + * The usage procedure will never return. It calls "exit(2)" + * with the "exitCode" argument passed to it. + */ +// coverity[+kill] +typedef void (tUsageProc)(tOptions* pOpts, int exitCode); +typedef tUsageProc * tpUsageProc; + +/* + * Special definitions. "NOLIMIT" is the 'max' value to use when + * a flag may appear multiple times without limit. "NO_EQUIVALENT" + * is an illegal value for 'optIndex' (option description index). + */ +#define NOLIMIT USHRT_MAX +#define OPTION_LIMIT SHRT_MAX +#define NO_EQUIVALENT (OPTION_LIMIT+1) + +typedef union { + char const * argString; + uintptr_t argEnum; + uintptr_t argIntptr; + 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. + */ +struct optDesc { + tAoUS const optIndex; /* PUBLIC */ + tAoUS const optValue; /* PUBLIC */ + tAoUS optActualIndex; /* PUBLIC */ + tAoUS optActualValue; /* PUBLIC */ + + tAoUS const optEquivIndex; /* PUBLIC */ + tAoUS const optMinCt; + tAoUS const optMaxCt; + tAoUS optOccCt; /* PUBLIC */ + + tAoUI fOptState; /* PUBLIC */ + tAoUI reserved; + optArgBucket_t optArg; /* PUBLIC */ + void* optCookie; /* PUBLIC */ + + int const * const pOptMust; + int const * const pOptCant; + tpOptProc const pOptProc; + char const* const pzText; + + char const* const pz_NAME; + char const* const pz_Name; + char const* const pz_DisableName; + char const* const pz_DisablePfx; +}; + +/* + * Some options need special processing, so we store their + * indexes in a known place: + */ +typedef struct optSpecIndex tOptSpecIndex; +struct optSpecIndex { + const tAoUS more_help; + const tAoUS save_opts; + const tAoUS number_option; + const tAoUS default_opt; +}; + +/* + * The procedure generated for translating option text + */ +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; + unsigned int origArgCt; + char** origArgVect; + unsigned int fOptSet; + unsigned int curOptIdx; + char* pzCurOpt; + + 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; /* 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 { + unsigned long tkn_ct; + unsigned char* tkn_list[1]; +} token_list_t; + +/* + * Hide the interface - it pollutes a POSIX claim, but leave it for + * anyone #include-ing this header + */ +#define strneqvcmp option_strneqvcmp +#define streqvcmp option_streqvcmp +#define streqvmap option_streqvmap +#define strequate option_strequate +#define strtransform option_strtransform + +/** + * Everything needed to be known about an mmap-ed file. + * + * This is an output only structure used by text_mmap and text_munmap. + * Clients must not alter the contents and must provide it to both + * the text_mmap and text_munmap procedures. BE ADVISED: if you are + * mapping the file with PROT_WRITE the NUL byte at the end MIGHT NOT + * BE WRITABLE. In any event, that byte is not be written back + * to the source file. ALSO: if "txt_data" is valid and "txt_errno" + * is not zero, then there *may* not be a terminating NUL. + */ +typedef struct { + void * txt_data; /*@< text file data */ + size_t txt_size; /*@< actual file size */ + size_t txt_full_size; /*@< mmaped mem size */ + int txt_fd; /*@< file descriptor */ + int txt_zero_fd; /*@< fd for /dev/zero */ + int txt_errno; /*@< warning code */ + int txt_prot; /*@< "prot" flags */ + int txt_flags; /*@< mapping type */ +} tmap_info_t; + +#define TEXT_MMAP_FAILED_ADDR(a) ((void*)(a) == (void*)MAP_FAILED) + +#ifdef __cplusplus +#define CPLUSPLUS_OPENER extern "C" { +CPLUSPLUS_OPENER +#define CPLUSPLUS_CLOSER } +#else +#define CPLUSPLUS_CLOSER +#endif + +/* + * The following routines may be coded into AutoOpts client code: + */ + +/* From: tokenize.c line 164 + * + * ao_string_tokenize - tokenize an input string + * + * Arguments: + * string string to be tokenized + * + * Returns: token_list_t* - pointer to a structure that lists each token + * + * This function will convert one input string into a list of strings. + * The list of strings is derived by separating the input based on + * white space separation. However, if the input contains either single + * or double quote characters, then the text after that character up to + * a matching quote will become the string in the list. + * + * The returned pointer should be deallocated with @code{free(3C)} when + * are done using the data. The data are placed in a single block of + * allocated memory. Do not deallocate individual token/strings. + * + * The structure pointed to will contain at least these two fields: + * @table @samp + * @item tkn_ct + * The number of tokens found in the input string. + * @item tok_list + * An array of @code{tkn_ct + 1} pointers to substring tokens, with + * the last pointer set to NULL. + * @end table + * + * There are two types of quoted strings: single quoted (@code{'}) and + * double quoted (@code{"}). Singly quoted strings are fairly raw in that + * escape characters (@code{\\}) are simply another character, except when + * preceding the following characters: + * @example + * @code{\\} double backslashes reduce to one + * @code{'} incorporates the single quote into the string + * @code{\n} suppresses both the backslash and newline character + * @end example + * + * 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*); + + +/* From: configfile.c line 77 + * + * configFileLoad - parse a configuration file + * + * Arguments: + * pzFile the file to load + * + * Returns: const tOptionValue* - An allocated, compound value structure + * + * This routine will load a named configuration file and parse the + * text as a hierarchically valued option. The option descriptor + * created from an option definition file is not used via this interface. + * The returned value is "named" with the input file name and is of + * type "@code{OPARG_TYPE_HIERARCHY}". It may be used in calls to + * @code{optionGetValue()}, @code{optionNextValue()} and + * @code{optionUnloadNested()}. + */ +extern const tOptionValue* configFileLoad(char const*); + + +/* From: configfile.c line 1066 + * + * optionFileLoad - Load the locatable config files, in order + * + * Arguments: + * pOpts program options descriptor + * pzProg program name + * + * Returns: int - 0 -> SUCCESS, -1 -> FAILURE + * + * This function looks in all the specified directories for a configuration + * file ("rc" file or "ini" file) and processes any found twice. The first + * time through, they are processed in reverse order (last file first). At + * that time, only "immediate action" configurables are processed. For + * example, if the last named file specifies not processing any more + * configuration files, then no more configuration files will be processed. + * Such an option in the @strong{first} named directory will have no effect. + * + * Once the immediate action configurables have been handled, then the + * directories are handled in normal, forward order. In that way, later + * config files can override the settings of earlier config files. + * + * See the AutoOpts documentation for a thorough discussion of the + * config file format. + * + * Configuration files not found or not decipherable are simply ignored. + */ +extern int optionFileLoad(tOptions*, char const*); + + +/* From: configfile.c line 211 + * + * optionFindNextValue - find a hierarcicaly valued option instance + * + * Arguments: + * pOptDesc an option with a nested arg type + * pPrevVal the last entry + * name name of value to find + * value the matching value + * + * Returns: const tOptionValue* - a compound value structure + * + * This routine will find the next entry in a nested value option or + * 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*); + + +/* From: configfile.c line 137 + * + * optionFindValue - find a hierarcicaly valued option instance + * + * Arguments: + * pOptDesc an option with a nested arg type + * name name of value to find + * value the matching value + * + * Returns: const tOptionValue* - a compound value structure + * + * 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*); + + +/* From: restore.c line 166 + * + * optionFree - free allocated option processing memory + * + * Arguments: + * pOpts program options descriptor + * + * AutoOpts sometimes allocates memory and puts pointers to it in the + * option state structures. This routine deallocates all such memory. + */ +extern void optionFree(tOptions*); + + +/* From: configfile.c line 280 + * + * optionGetValue - get a specific value from a hierarcical list + * + * Arguments: + * pOptValue a hierarchcal value + * valueName name of value to get + * + * Returns: const tOptionValue* - a compound value structure + * + * This routine will find an entry in a nested value option or configurable. + * If "valueName" is NULL, then the first entry is returned. Otherwise, + * the first entry with a name that exactly matches the argument will be + * returned. If there is no matching value, NULL is returned and errno is + * set to ENOENT. If the provided option value is not a hierarchical value, + * NULL is also returned and errno is set to EINVAL. + */ +extern const tOptionValue* optionGetValue(const tOptionValue*, char const*); + + +/* From: load.c line 478 + * + * optionLoadLine - process a string for an option name and value + * + * Arguments: + * opts program options descriptor + * line NUL-terminated text + * + * This is a client program callable routine for setting options from, for + * example, the contents of a file that they read in. Only one option may + * appear in the text. It will be treated as a normal (non-preset) option. + * + * When passed a pointer to the option struct and a string, it will find + * the option named by the first token on the string and set the option + * argument to the remainder of the string. The caller must NUL terminate + * the string. The caller need not skip over any introductory hyphens. + * Any embedded new lines will be included in the option + * argument. If the input looks like one or more quoted strings, then the + * input will be "cooked". The "cooking" is identical to the string + * formation used in AutoGen definition files (@pxref{basic expression}), + * except that you may not use backquotes. + */ +extern void optionLoadLine(tOptions*, char const*); + + +/* From: configfile.c line 340 + * + * optionNextValue - get the next value from a hierarchical list + * + * Arguments: + * pOptValue a hierarchcal list value + * pOldValue a value from this list + * + * Returns: const tOptionValue* - a compound value structure + * + * This routine will return the next entry after the entry passed in. At the + * end of the list, NULL will be returned. If the entry is not found on the + * list, NULL will be returned and "@var{errno}" will be set to EINVAL. + * 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*); + + +/* From: usage.c line 201 + * + * optionOnlyUsage - Print usage text for just the options + * + * Arguments: + * pOpts program options descriptor + * ex_code exit code for calling exit(3) + * + * This routine will print only the usage for each option. + * This function may be used when the emitted usage must incorporate + * information not available to AutoOpts. + */ +extern void optionOnlyUsage(tOptions*, int); + + +/* From: autoopts.c line 607 + * + * optionProcess - this is the main option processing routine + * + * Arguments: + * pOpts program options descriptor + * argc program arg count + * argv program arg vector + * + * Returns: int - the count of the arguments processed + * + * This is the main entry point for processing options. It is intended + * that this procedure be called once at the beginning of the execution of + * a program. Depending on options selected earlier, it is sometimes + * necessary to stop and restart option processing, or to select completely + * different sets of options. This can be done easily, but you generally + * do not want to do this. + * + * The number of arguments processed always includes the program name. + * If one of the arguments is "--", then it is counted and the processing + * stops. If an error was encountered and errors are to be tolerated, then + * the returned value is the index of the argument causing the error. + * A hyphen by itself ("-") will also cause processing to stop and will + * @emph{not} be counted among the processed arguments. A hyphen by itself + * is treated as an operand. Encountering an operand stops option + * processing. + */ +extern int optionProcess(tOptions*, int, char**); + + +/* From: restore.c line 123 + * + * optionRestore - restore option state from memory copy + * + * Arguments: + * pOpts program options descriptor + * + * Copy back the option state from saved memory. + * The allocated memory is left intact, so this routine can be + * called repeatedly without having to call optionSaveState again. + * If you are restoring a state that was saved before the first call + * to optionProcess(3AO), then you may change the contents of the + * argc/argv parameters to optionProcess. + */ +extern void optionRestore(tOptions*); + + +/* From: save.c line 648 + * + * optionSaveFile - saves the option state to a file + * + * Arguments: + * pOpts program options descriptor + * + * This routine will save the state of option processing to a file. The name + * of that file can be specified with the argument to the @code{--save-opts} + * 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. + * + * 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*); + + +/* From: restore.c line 71 + * + * optionSaveState - saves the option state to memory + * + * Arguments: + * pOpts program options descriptor + * + * This routine will allocate enough memory to save the current option + * processing state. If this routine has been called before, that memory + * will be reused. You may only save one copy of the option state. This + * routine may be called before optionProcess(3AO). If you do call it + * before the first call to optionProcess, then you may also change the + * contents of argc/argv after you call optionRestore(3AO) + * + * In fact, more strongly put: it is safest to only use this function + * before having processed any options. In particular, the saving and + * restoring of stacked string arguments and hierarchical values is + * disabled. The values are not saved. + */ +extern void optionSaveState(tOptions*); + + +/* From: nested.c line 563 + * + * optionUnloadNested - Deallocate the memory for a nested value + * + * Arguments: + * pOptVal the hierarchical value + * + * A nested value needs to be deallocated. The pointer passed in should + * have been gotten from a call to @code{configFileLoad()} (See + * @pxref{libopts-configFileLoad}). + */ +extern void optionUnloadNested(tOptionValue const *); + + +/* From: version.c line 31 + * + * optionVersion - return the compiled AutoOpts version number + * + * Returns: char const* - the version string in constant memory + * + * Returns the full version string compiled into the library. + * The returned string cannot be modified. + */ +extern char const* optionVersion(void); + + +/* From: ../compat/pathfind.c line 29 + * + * pathfind - fild a file in a list of directories + * + * Arguments: + * path colon separated list of search directories + * file the name of the file to look for + * mode the mode bits that must be set to match + * + * Returns: char* - the path to the located file + * + * the pathfind function is available only if HAVE_PATHFIND is not defined + * + * pathfind looks for a a file with name "FILE" and "MODE" access + * along colon delimited "PATH", and returns the full pathname as a + * string, or NULL if not found. If "FILE" contains a slash, then + * it is treated as a relative or absolute path and "PATH" is ignored. + * + * @strong{NOTE}: this function is compiled into @file{libopts} only if + * it is not natively supplied. + * + * The "MODE" argument is a string of option letters chosen from the + * list below: + * @example + * Letter Meaning + * r readable + * w writable + * x executable + * f normal file (NOT IMPLEMENTED) + * b block special (NOT IMPLEMENTED) + * c character special (NOT IMPLEMENTED) + * d directory (NOT IMPLEMENTED) + * p FIFO (pipe) (NOT IMPLEMENTED) + * u set user ID bit (NOT IMPLEMENTED) + * g set group ID bit (NOT IMPLEMENTED) + * k sticky bit (NOT IMPLEMENTED) + * s size nonzero (NOT IMPLEMENTED) + * @end example + */ +#ifndef HAVE_PATHFIND +extern char* pathfind(char const*, char const*, char const*); +#endif /* HAVE_PATHFIND */ + + +/* From: streqvcmp.c line 209 + * + * strequate - map a list of characters to the same value + * + * Arguments: + * ch_list characters to equivalence + * + * Each character in the input string get mapped to the first character + * in the string. + * This function name is mapped to option_strequate so as to not conflict + * with the POSIX name space. + */ +extern void strequate(char const*); + + +/* From: streqvcmp.c line 119 + * + * streqvcmp - compare two strings with an equivalence mapping + * + * Arguments: + * str1 first string + * str2 second string + * + * Returns: int - the difference between two differing characters + * + * Using a character mapping, two strings are compared for "equivalence". + * Each input character is mapped to a comparison character and the + * mapped-to characters are compared for the two NUL terminated input strings. + * 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*); + + +/* From: streqvcmp.c line 156 + * + * streqvmap - Set the character mappings for the streqv functions + * + * Arguments: + * From Input character + * To Mapped-to character + * ct compare length + * + * Set the character mapping. If the count (@code{ct}) is set to zero, then + * the map is cleared by setting all entries in the map to their index + * value. Otherwise, the "@code{From}" character is mapped to the "@code{To}" + * character. If @code{ct} is greater than 1, then @code{From} and @code{To} + * are incremented and the process repeated until @code{ct} entries have been + * set. For example, + * @example + * streqvmap('a', 'A', 26); + * @end example + * @noindent + * will alter the mapping so that all English lower case letters + * will map to upper case. + * + * This function name is mapped to option_streqvmap so as to not conflict + * with the POSIX name space. + */ +extern void streqvmap(char, char, int); + + +/* From: streqvcmp.c line 78 + * + * strneqvcmp - compare two strings with an equivalence mapping + * + * Arguments: + * str1 first string + * str2 second string + * ct compare length + * + * Returns: int - the difference between two differing characters + * + * Using a character mapping, two strings are compared for "equivalence". + * Each input character is mapped to a comparison character and the + * mapped-to characters are compared for the two NUL terminated input strings. + * The comparison is limited to @code{ct} bytes. + * 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); + + +/* From: streqvcmp.c line 235 + * + * strtransform - convert a string into its mapped-to value + * + * Arguments: + * dest output string + * src input string + * + * Each character in the input string is mapped and the mapped-to + * 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*); + +/* AutoOpts PRIVATE FUNCTIONS: */ +tOptProc optionStackArg, optionUnstackArg, optionBooleanVal, optionNumericVal; + +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 int optionAlias(tOptions*, tOptDesc*, unsigned int); + +extern void optionBooleanVal(tOptions*, tOptDesc*); + +extern uintptr_t optionEnumerationVal(tOptions*, tOptDesc*, char const * const *, unsigned int); + +extern void optionFileCheck(tOptions*, tOptDesc*, teOptFileType, tuFileMode); + +extern char const * optionKeywordName(tOptDesc*, unsigned int); + +extern void optionLoadOpt(tOptions*, tOptDesc*); + +extern bool optionMakePath(char*, int, char const*, char const*); + +extern void optionNestedVal(tOptions*, tOptDesc*); + +extern void optionNumericVal(tOptions*, tOptDesc*); + +extern void optionPagedUsage(tOptions*, tOptDesc*); + +extern void optionParseShell(tOptions*); + +extern void optionPrintVersion(tOptions*, tOptDesc*); + +extern void optionPutShell(tOptions*); + +extern void optionResetOpt(tOptions*, tOptDesc*); + +extern void optionSetMembers(tOptions*, tOptDesc*, char const * const *, unsigned int); + +extern void optionShowRange(tOptions*, tOptDesc*, void *, int); + +extern void optionStackArg(tOptions*, tOptDesc*); + +extern void optionTimeDate(tOptions*, tOptDesc*); + +extern void optionTimeVal(tOptions*, tOptDesc*); + +extern void optionUnstackArg(tOptions*, tOptDesc*); + +extern void optionUsage(tOptions*, int); + +extern void optionVendorOption(tOptions *, tOptDesc *); + +extern void optionVersionStderr(tOptions*, tOptDesc*); + +extern void* text_mmap(char const*, int, int, tmap_info_t*); + +extern int text_munmap(tmap_info_t*); + +CPLUSPLUS_CLOSER +#endif /* AUTOOPTS_OPTIONS_H_GUARD */ +/* + * Local Variables: + * c-file-style: "stroustrup" + * indent-tabs-mode: nil + * End: + * options.h ends here */ diff --git a/autoopts/autoopts/usage-txt.h b/autoopts/autoopts/usage-txt.h new file mode 100644 index 0000000..0200b84 --- /dev/null +++ b/autoopts/autoopts/usage-txt.h @@ -0,0 +1,435 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (usage-txt.h) + * + * It has been AutoGen-ed August 11, 2012 at 09:41:15 AM by AutoGen 5.16.2pre7 + * From the definitions usage-txt.def + * and the template file usage-txt.tpl + * + * This file handles all the bookkeeping required for tracking all the little + * tiny strings used by the AutoOpts library. There are 146 + * of them. This is not versioned because it is entirely internal to the + * library and accessed by client code only in a very well-controlled way: + * they may substitute translated strings using a procedure that steps through + * all the string pointers. + * + * Copyright (C) 1992-2012 Bruce Korb, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the + * GNU Lesser General Public License, version 3 or later + * <http://gnu.org/licenses/lgpl.html> + * + * 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. + * + * 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_USAGE_TXT_H_GUARD +#define AUTOOPTS_USAGE_TXT_H_GUARD 1 + +#undef cch_t +#define cch_t char const + +/* + * One structure to hold all the pointers to all the stringlets. + */ +typedef struct { + int field_ct; + char* utpz_GnuBoolArg; + char* utpz_GnuKeyArg; + char* utpz_GnuFileArg; + char* utpz_GnuKeyLArg; + char* utpz_GnuTimeArg; + char* utpz_GnuNumArg; + char* utpz_GnuStrArg; + cch_t* apz_str[ 139 ]; +} usage_text_t; + +/* + * Declare the global structure with all the pointers to translated + * strings. This is then used by the usage generation procedure. + */ +extern usage_text_t option_usage_text; + +#if defined(AUTOOPTS_INTERNAL) /* DEFINE ALL THE STRINGS = = = = = */ +/* + * Provide a mapping from a short name to fields in this structure. + */ +#define zAO_Alloc (option_usage_text.apz_str[ 0]) +#define zAO_Bad (option_usage_text.apz_str[ 1]) +#define zAO_Big (option_usage_text.apz_str[ 2]) +#define zAO_Err (option_usage_text.apz_str[ 3]) +#define zAO_Realloc (option_usage_text.apz_str[ 4]) +#define zAO_Sml (option_usage_text.apz_str[ 5]) +#define zAO_Strdup (option_usage_text.apz_str[ 6]) +#define zAO_Ver (option_usage_text.apz_str[ 7]) +#define zAO_Woops (option_usage_text.apz_str[ 8]) +#define zAliasRange (option_usage_text.apz_str[ 9]) +#define zAll (option_usage_text.apz_str[ 10]) +#define zAlt (option_usage_text.apz_str[ 11]) +#define zAmbigKey (option_usage_text.apz_str[ 12]) +#define zAmbigList (option_usage_text.apz_str[ 13]) +#define zAmbigOptStr (option_usage_text.apz_str[ 14]) +#define zAmbiguous (option_usage_text.apz_str[ 15]) +#define zArgsMust (option_usage_text.apz_str[ 16]) +#define zAtMost (option_usage_text.apz_str[ 17]) +#define zAuto (option_usage_text.apz_str[ 18]) +#define zBadPipe (option_usage_text.apz_str[ 19]) +#define zBadVerArg (option_usage_text.apz_str[ 20]) +#define zCantFmt (option_usage_text.apz_str[ 21]) +#define zCantSave (option_usage_text.apz_str[ 22]) +#define zCfgAO_Flags (option_usage_text.apz_str[ 23]) +#define zCfgProg (option_usage_text.apz_str[ 24]) +#define zDefaultOpt (option_usage_text.apz_str[ 25]) +#define zDis (option_usage_text.apz_str[ 26]) +#define zDisabledErr (option_usage_text.apz_str[ 27]) +#define zDisabledOpt (option_usage_text.apz_str[ 28]) +#define zDisabledWhy (option_usage_text.apz_str[ 29]) +#define zEnab (option_usage_text.apz_str[ 30]) +#define zEquiv (option_usage_text.apz_str[ 31]) +#define zErrOnly (option_usage_text.apz_str[ 32]) +#define zExamineFmt (option_usage_text.apz_str[ 33]) +#define zFiveSpaces (option_usage_text.apz_str[ 34]) +#define zFlagOkay (option_usage_text.apz_str[ 35]) +#define zFmtFmt (option_usage_text.apz_str[ 36]) +#define zForkFail (option_usage_text.apz_str[ 37]) +#define zFreopenFail (option_usage_text.apz_str[ 38]) +#define zFSErrOptLoad (option_usage_text.apz_str[ 39]) +#define zFSErrReadFile (option_usage_text.apz_str[ 40]) +#define zFSOptError (option_usage_text.apz_str[ 41]) +#define zFSOptErrMayExist (option_usage_text.apz_str[ 42]) +#define zFSOptErrMustExist (option_usage_text.apz_str[ 43]) +#define zFSOptErrNoExist (option_usage_text.apz_str[ 44]) +#define zFSOptErrOpen (option_usage_text.apz_str[ 45]) +#define zFSOptErrFopen (option_usage_text.apz_str[ 46]) +#define zFileCannotExist (option_usage_text.apz_str[ 47]) +#define zFileMustExist (option_usage_text.apz_str[ 48]) +#define zGenshell (option_usage_text.apz_str[ 49]) +#define zGnuBoolArg (option_usage_text.utpz_GnuBoolArg) +#define zGnuBreak (option_usage_text.apz_str[ 50]) +#define zGnuKeyArg (option_usage_text.utpz_GnuKeyArg) +#define zGnuFileArg (option_usage_text.utpz_GnuFileArg) +#define zGnuKeyLArg (option_usage_text.utpz_GnuKeyLArg) +#define zGnuTimeArg (option_usage_text.utpz_GnuTimeArg) +#define zGnuNestArg (option_usage_text.apz_str[ 51]) +#define zGnuNumArg (option_usage_text.utpz_GnuNumArg) +#define zGnuOptArg (option_usage_text.apz_str[ 52]) +#define zGnuOptFmt (option_usage_text.apz_str[ 53]) +#define zGnuStrArg (option_usage_text.utpz_GnuStrArg) +#define zIllOptChr (option_usage_text.apz_str[ 54]) +#define zIllOptStr (option_usage_text.apz_str[ 55]) +#define zIllVendOptStr (option_usage_text.apz_str[ 56]) +#define zIntRange (option_usage_text.apz_str[ 57]) +#define zInvalOptDesc (option_usage_text.apz_str[ 58]) +#define zInvalOptName (option_usage_text.apz_str[ 59]) +#define zLowerBits (option_usage_text.apz_str[ 60]) +#define zMembers (option_usage_text.apz_str[ 61]) +#define zMisArg (option_usage_text.apz_str[ 62]) +#define zMultiEquiv (option_usage_text.apz_str[ 63]) +#define zMust (option_usage_text.apz_str[ 64]) +#define zNeedOne (option_usage_text.apz_str[ 65]) +#define zNoArg (option_usage_text.apz_str[ 66]) +#define zNoArgs (option_usage_text.apz_str[ 67]) +#define zNoCreat (option_usage_text.apz_str[ 68]) +#define zNoFlags (option_usage_text.apz_str[ 69]) +#define zNoKey (option_usage_text.apz_str[ 70]) +#define zNoLim (option_usage_text.apz_str[ 71]) +#define zNoPreset (option_usage_text.apz_str[ 72]) +#define zNoResetArg (option_usage_text.apz_str[ 73]) +#define zNoRq_NoShrtTtl (option_usage_text.apz_str[ 74]) +#define zNoRq_ShrtTtl (option_usage_text.apz_str[ 75]) +#define zNoStat (option_usage_text.apz_str[ 76]) +#define zNoState (option_usage_text.apz_str[ 77]) +#define zNone (option_usage_text.apz_str[ 78]) +#define zNotDef (option_usage_text.apz_str[ 79]) +#define zNotCmdOpt (option_usage_text.apz_str[ 80]) +#define zNotEnough (option_usage_text.apz_str[ 81]) +#define zNotFile (option_usage_text.apz_str[ 82]) +#define zNotNumber (option_usage_text.apz_str[ 83]) +#define zNotDate (option_usage_text.apz_str[ 84]) +#define zNotDuration (option_usage_text.apz_str[ 85]) +#define zNrmOptFmt (option_usage_text.apz_str[ 86]) +#define zNumberOpt (option_usage_text.apz_str[ 87]) +#define zOnlyOne (option_usage_text.apz_str[ 88]) +#define zOptsOnly (option_usage_text.apz_str[ 89]) +#define zOutputFail (option_usage_text.apz_str[ 90]) +#define zPathFmt (option_usage_text.apz_str[ 91]) +#define zPlsSendBugs (option_usage_text.apz_str[ 92]) +#define zPreset (option_usage_text.apz_str[ 93]) +#define zPresetFile (option_usage_text.apz_str[ 94]) +#define zPresetIntro (option_usage_text.apz_str[ 95]) +#define zProhib (option_usage_text.apz_str[ 96]) +#define zReorder (option_usage_text.apz_str[ 97]) +#define zRange (option_usage_text.apz_str[ 98]) +#define zRangeAbove (option_usage_text.apz_str[ 99]) +#define zRangeLie (option_usage_text.apz_str[100]) +#define zRangeOnly (option_usage_text.apz_str[101]) +#define zRangeOr (option_usage_text.apz_str[102]) +#define zRangeErr (option_usage_text.apz_str[103]) +#define zRangeExact (option_usage_text.apz_str[104]) +#define zRangeScaled (option_usage_text.apz_str[105]) +#define zRangeUpto (option_usage_text.apz_str[106]) +#define zResetNotConfig (option_usage_text.apz_str[107]) +#define zReqFmt (option_usage_text.apz_str[108]) +#define zReqOptFmt (option_usage_text.apz_str[109]) +#define zReqThese (option_usage_text.apz_str[110]) +#define zReq_NoShrtTtl (option_usage_text.apz_str[111]) +#define zReq_ShrtTtl (option_usage_text.apz_str[112]) +#define zSepChars (option_usage_text.apz_str[113]) +#define zSetMemberSettings (option_usage_text.apz_str[114]) +#define zShrtGnuOptFmt (option_usage_text.apz_str[115]) +#define zSixSpaces (option_usage_text.apz_str[116]) +#define zStdBoolArg (option_usage_text.apz_str[117]) +#define zStdBreak (option_usage_text.apz_str[118]) +#define zStdFileArg (option_usage_text.apz_str[119]) +#define zStdKeyArg (option_usage_text.apz_str[120]) +#define zStdKeyLArg (option_usage_text.apz_str[121]) +#define zStdTimeArg (option_usage_text.apz_str[122]) +#define zStdNestArg (option_usage_text.apz_str[123]) +#define zStdNoArg (option_usage_text.apz_str[124]) +#define zStdNumArg (option_usage_text.apz_str[125]) +#define zStdOptArg (option_usage_text.apz_str[126]) +#define zStdReqArg (option_usage_text.apz_str[127]) +#define zStdStrArg (option_usage_text.apz_str[128]) +#define zTabHyp (option_usage_text.apz_str[129]) +#define zTabHypAnd (option_usage_text.apz_str[130]) +#define zTabout (option_usage_text.apz_str[131]) +#define zThreeSpaces (option_usage_text.apz_str[132]) +#define zTooLarge (option_usage_text.apz_str[133]) +#define zTwoSpaces (option_usage_text.apz_str[134]) +#define zUpTo (option_usage_text.apz_str[135]) +#define zValidKeys (option_usage_text.apz_str[136]) +#define zVendOptsAre (option_usage_text.apz_str[137]) +#define zVendIntro (option_usage_text.apz_str[138]) + + /* + * First, set up the strings. Some of these are writable. These are all in + * English. This gets compiled into libopts and is distributed here so that + * xgettext (or equivalents) can extract these strings for translation. + */ + + static char eng_zGnuBoolArg[] = "=T/F"; + static char eng_zGnuKeyArg[] = "=KWd"; + static char eng_zGnuFileArg[] = "=file"; + static char eng_zGnuKeyLArg[] = "=Mbr"; + static char eng_zGnuTimeArg[] = "=Tim"; + static char eng_zGnuNumArg[] = "=num"; + static char eng_zGnuStrArg[] = "=str"; +static char const usage_txt[4660] = +/* 0 */ "malloc of %d bytes failed\n\0" +/* 27 */ "AutoOpts function called without option descriptor\n\0" +/* 79 */ "\tThis exceeds the compiled library version: \0" +/* 125 */ "Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n\0" +/* 224 */ "realloc of %d bytes at 0x%p failed\n\0" +/* 260 */ "\tThis is less than the minimum library version: \0" +/* 310 */ "strdup of %d byte string failed\n\0" +/* 343 */ "Automated Options version %s\n" + "\tcopyright (c) 1999-2012 by Bruce Korb - all rights reserved\n\0" +/* 434 */ "AutoOpts lib error: defaulted to option with optional arg\n\0" +/* 493 */ "(AutoOpts bug): Aliasing option is out of range.\0" +/* 543 */ "all\0" +/* 547 */ "\t\t\t\t- an alternate for %s\n\0" +/* 574 */ "%s error: the keyword `%s' is ambiguous for %s\n\0" +/* 623 */ " The following options match:\n\0" +/* 655 */ "%s: ambiguous option name: %s (matches %d options)\n\0" +/* 707 */ " %s%s\n\0" +/* 715 */ "%s: Command line arguments required\n\0" +/* 752 */ "%d %s%s options allowed\n\0" +/* 777 */ "version, usage and configuration options:\0" +/* 819 */ "Error %d (%s) from the pipe(2) syscall\n\0" +/* 859 */ "ERROR: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and copyright notice\n\0" +/* 996 */ "ERROR: %s option conflicts with the %s option\n\0" +/* 1044 */ "%s(optionSaveState): error: cannot allocate %d bytes\n\0" +/* 1098 */ "auto-options\0" +/* 1111 */ "program\0" +/* 1119 */ "\t\t\t\t- default option for unnamed options\n\0" +/* 1161 */ "\t\t\t\t- disabled as --%s\n\0" +/* 1185 */ "%s: The ``%s'' option has been disabled\0" +/* 1225 */ " --- %-14s %s\n\0" +/* 1240 */ "This option has been disabled\0" +/* 1270 */ "\t\t\t\t- enabled by default\n\0" +/* 1296 */ "-equivalence\0" +/* 1309 */ "ERROR: only \0" +/* 1323 */ " - examining environment variables named %s_*\n\0" +/* 1370 */ " \0" +/* 1376 */ "Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n\0" +/* 1479 */ "%%-%ds %%s\n\0" +/* 1491 */ "fs error %d (%s) on fork - cannot obtain %s usage\n\0" +/* 1542 */ "fs error %d (%s) on freopen\n\0" +/* 1571 */ "File error %d (%s) opening %s for loading options\n\0" +/* 1622 */ "fs error %d (%s) reading file %s\n\0" +/* 1656 */ "fs error %d (%s) on %s %s for option %s\n\0" +/* 1697 */ "stat-ing for directory\0" +/* 1720 */ "stat-ing for regular file\0" +/* 1746 */ "stat-ing for non-existant file\0" +/* 1777 */ "open-ing file\0" +/* 1791 */ "fopen-ing file\0" +/* 1806 */ "\t\t\t\t- file must not pre-exist\n\0" +/* 1837 */ "\t\t\t\t- file must pre-exist\n\0" +/* 1864 */ "\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n\0" +/* 1970 */ "\n" + "%s\n\n\0" +/* 1976 */ "=Cplx\0" +/* 1982 */ "[=arg]\0" +/* 1989 */ "--%2$s%1$s\0" +/* 2000 */ "%s: illegal option -- %c\n\0" +/* 2026 */ "%s: illegal option -- %s\n\0" +/* 2052 */ "%s: unknown vendor extension option -- %s\n\0" +/* 2095 */ " or an integer from %d through %d\n\0" +/* 2131 */ "AutoOpts ERROR: invalid option descriptor for %s\n\0" +/* 2182 */ "%s: invalid option name: %s\n\0" +/* 2211 */ " or an integer mask with any of the lower %d bits set\n\0" +/* 2267 */ "\t\t\t\t- is a set membership option\n\0" +/* 2301 */ "%s: option `%s' requires an argument\n\0" +/* 2339 */ "Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'\0" +/* 2404 */ "\t\t\t\t- must appear between %d and %d times\n\0" +/* 2447 */ "ERROR: The %s option is required\n\0" +/* 2482 */ "%s: option `%s' cannot have an argument\n\0" +/* 2523 */ "%s: Command line arguments not allowed\n\0" +/* 2563 */ "error %d (%s) creating %s\n\0" +/* 2590 */ "Options are specified by single or double hyphens and their name.\n\0" +/* 2657 */ "%s error: `%s' does not match any %s keywords\n\0" +/* 2705 */ "\t\t\t\t- may appear multiple times\n\0" +/* 2738 */ "\t\t\t\t- may not be preset\n\0" +/* 2763 */ "The 'reset-option' option requires an argument\n\0" +/* 2811 */ " Arg Option-Name Description\n\0" +/* 2846 */ " Flg Arg Option-Name Description\n\0" +/* 2884 */ "error %d (%s) stat-ing %s\n\0" +/* 2911 */ "%s(optionRestore): error: no saved option state\n\0" +/* 2960 */ "none\0" +/* 2965 */ "'%s' not defined\n\0" +/* 2983 */ "'%s' is not a command line option\n\0" +/* 3018 */ "ERROR: The %s option must appear %d times\n\0" +/* 3062 */ "error: cannot load options from non-regular file %s\n\0" +/* 3116 */ "%s error: `%s' is not a recognizable number\n\0" +/* 3162 */ "%s error: `%s' is not a recognizable date/time\n\0" +/* 3211 */ "%s error: `%s' is not a recognizable time duration\n\0" +/* 3264 */ " %3s %s\0" +/* 3272 */ "The '-#<number>' option may omit the hash char\n\0" +/* 3320 */ "one %s%s option allowed\n\0" +/* 3345 */ "All arguments are named options.\n\0" +/* 3379 */ "Write failure to output file\0" +/* 3408 */ " - reading file %s\0" +/* 3427 */ "\n" + "please send bug reports to: %s\n\0" +/* 3461 */ "\t\t\t\t- may NOT appear - preset only\n\0" +/* 3497 */ "# preset/initialization file\n" + "# %s#\n\0" +/* 3535 */ "\n" + "The following option preset mechanisms are supported:\n\0" +/* 3591 */ "prohibits these options:\n\0" +/* 3617 */ "Operands and options may be intermixed. They will be reordered.\n\0" +/* 3683 */ "%s%ld to %ld\0" +/* 3696 */ "%sgreater than or equal to %ld\0" +/* 3727 */ "%sIt must lie in one of the ranges:\n\0" +/* 3764 */ "%sIt must be in the range:\n\0" +/* 3792 */ ", or\n\0" +/* 3798 */ "%s error: %s option value %ld is out of range.\n\0" +/* 3847 */ "%s%ld exactly\0" +/* 3861 */ "%sis scalable with a suffix: k/K/m/M/g/G/t/T\n\0" +/* 3907 */ "%sless than or equal to %ld\0" +/* 3935 */ "The --reset-option has not been configured.\n\0" +/* 3980 */ "ERROR: %s option requires the %s option\n\0" +/* 4022 */ " %3s %-14s %s\0" +/* 4036 */ "requires these options:\n\0" +/* 4061 */ " Arg Option-Name Req? Description\n\0" +/* 4101 */ " Flg Arg Option-Name Req? Description\n\0" +/* 4144 */ "-_^\0" +/* 4148 */ "or you may use a numeric representation. Preceding these with a '!' will\n" + "clear the bits, specifying 'none' will clear all bits, and 'all' will set them\n" + "all. Multiple entries may be passed as an option argument list.\n\0" +/* 4367 */ "%s\0" +/* 4370 */ " \0" +/* 4377 */ "T/F\0" +/* 4381 */ "\n" + "%s\n\n" + "%s\0" +/* 4389 */ "Fil\0" +/* 4393 */ "KWd\0" +/* 4397 */ "Mbr\0" +/* 4401 */ "Tim\0" +/* 4405 */ "Cpx\0" +/* 4409 */ "no \0" +/* 4413 */ "Num\0" +/* 4417 */ "opt\0" +/* 4421 */ "YES\0" +/* 4425 */ "Str\0" +/* 4429 */ "\t\t\t\t- \0" +/* 4436 */ "\t\t\t\t-- and \0" +/* 4448 */ "\t\t\t\t%s\n\0" +/* 4456 */ " \0" +/* 4460 */ "%s error: %s exceeds %s keyword count\n\0" +/* 4500 */ " \0" +/* 4503 */ "\t\t\t\t- may appear up to %d times\n\0" +/* 4536 */ "The valid \"%s\" option keywords are:\n\0" +/* 4573 */ "These additional options are:\0" +/* 4603 */ "The next option supports vendor supported extra options:"; + + + /* + * Now, define (and initialize) the structure that contains + * the pointers to all these strings. + * Aren't you glad you don't maintain this by hand? + */ + usage_text_t option_usage_text = { + 146, + eng_zGnuBoolArg, eng_zGnuKeyArg, eng_zGnuFileArg, eng_zGnuKeyLArg, + eng_zGnuTimeArg, eng_zGnuNumArg, eng_zGnuStrArg, + { + usage_txt + 0, usage_txt + 27, usage_txt + 79, usage_txt + 125, + usage_txt + 224, usage_txt + 260, usage_txt + 310, usage_txt + 343, + usage_txt + 434, usage_txt + 493, usage_txt + 543, usage_txt + 547, + usage_txt + 574, usage_txt + 623, usage_txt + 655, usage_txt + 707, + usage_txt + 715, usage_txt + 752, usage_txt + 777, usage_txt + 819, + usage_txt + 859, usage_txt + 996, usage_txt +1044, usage_txt +1098, + usage_txt +1111, usage_txt +1119, usage_txt +1161, usage_txt +1185, + usage_txt +1225, usage_txt +1240, usage_txt +1270, usage_txt +1296, + usage_txt +1309, usage_txt +1323, usage_txt +1370, usage_txt +1376, + usage_txt +1479, usage_txt +1491, usage_txt +1542, usage_txt +1571, + usage_txt +1622, usage_txt +1656, usage_txt +1697, usage_txt +1720, + usage_txt +1746, usage_txt +1777, usage_txt +1791, usage_txt +1806, + usage_txt +1837, usage_txt +1864, usage_txt +1970, usage_txt +1976, + usage_txt +1982, usage_txt +1989, usage_txt +2000, usage_txt +2026, + usage_txt +2052, usage_txt +2095, usage_txt +2131, usage_txt +2182, + usage_txt +2211, usage_txt +2267, usage_txt +2301, usage_txt +2339, + usage_txt +2404, usage_txt +2447, usage_txt +2482, usage_txt +2523, + usage_txt +2563, usage_txt +2590, usage_txt +2657, usage_txt +2705, + usage_txt +2738, usage_txt +2763, usage_txt +2811, usage_txt +2846, + usage_txt +2884, usage_txt +2911, usage_txt +2960, usage_txt +2965, + usage_txt +2983, usage_txt +3018, usage_txt +3062, usage_txt +3116, + usage_txt +3162, usage_txt +3211, usage_txt +3264, usage_txt +3272, + usage_txt +3320, usage_txt +3345, usage_txt +3379, usage_txt +3408, + usage_txt +3427, usage_txt +3461, usage_txt +3497, usage_txt +3535, + usage_txt +3591, usage_txt +3617, usage_txt +3683, usage_txt +3696, + usage_txt +3727, usage_txt +3764, usage_txt +3792, usage_txt +3798, + usage_txt +3847, usage_txt +3861, usage_txt +3907, usage_txt +3935, + usage_txt +3980, usage_txt +4022, usage_txt +4036, usage_txt +4061, + usage_txt +4101, usage_txt +4144, usage_txt +4148, usage_txt +4367, + usage_txt +4370, usage_txt +4377, usage_txt +4381, usage_txt +4389, + usage_txt +4393, usage_txt +4397, usage_txt +4401, usage_txt +4405, + usage_txt +4409, usage_txt +4413, usage_txt +4417, usage_txt +4421, + usage_txt +4425, usage_txt +4429, usage_txt +4436, usage_txt +4448, + usage_txt +4456, usage_txt +4460, usage_txt +4500, usage_txt +4503, + usage_txt +4536, usage_txt +4573, usage_txt +4603 + } + }; + +#endif /* DO_TRANSLATIONS */ +#endif /* AUTOOPTS_USAGE_TXT_H_GUARD */ |