5 kx /* -*- buffer-read-only: t -*- vi: set ro:
5 kx *
5 kx * DO NOT EDIT THIS FILE (uuencode-opts.h)
5 kx *
5 kx * It has been AutoGen-ed
5 kx * From the definitions uuencode-opts.def
5 kx * and the template file options
5 kx *
5 kx * Generated from AutoOpts 41:1:16 templates.
5 kx *
5 kx * AutoOpts is a copyrighted work. This header file is not encumbered
5 kx * by AutoOpts licensing, but is provided under the licensing terms chosen
5 kx * by the uuencode author or copyright holder. AutoOpts is
5 kx * licensed under the terms of the LGPL. The redistributable library
5 kx * (``libopts'') is licensed under the terms of either the LGPL or, at the
5 kx * users discretion, the BSD license. See the AutoOpts and/or libopts sources
5 kx * for details.
5 kx *
5 kx * The uuencode program is copyrighted and licensed
5 kx * under the following terms:
5 kx *
5 kx * Copyright (C) 1994-2015 Free Software Foundation, Inc., all rights reserved.
5 kx * This is free software. It is licensed for use, modification and
5 kx * redistribution under the terms of the GNU General Public License,
5 kx * version 3 or later <http://gnu.org/licenses/gpl.html>
5 kx *
5 kx * uuencode is free software: you can redistribute it and/or modify it
5 kx * under the terms of the GNU General Public License as published by the
5 kx * Free Software Foundation, either version 3 of the License, or
5 kx * (at your option) any later version.
5 kx *
5 kx * uuencode is distributed in the hope that it will be useful, but
5 kx * WITHOUT ANY WARRANTY; without even the implied warranty of
5 kx * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 kx * See the GNU General Public License for more details.
5 kx *
5 kx * You should have received a copy of the GNU General Public License along
5 kx * with this program. If not, see <http://www.gnu.org/licenses/>.
5 kx */
5 kx /**
5 kx * This file contains the programmatic interface to the Automated
5 kx * Options generated for the uuencode program.
5 kx * These macros are documented in the AutoGen info file in the
5 kx * "AutoOpts" chapter. Please refer to that doc for usage help.
5 kx */
5 kx #ifndef AUTOOPTS_UUENCODE_OPTS_H_GUARD
5 kx #define AUTOOPTS_UUENCODE_OPTS_H_GUARD 1
5 kx #include "config.h"
5 kx #include <autoopts/options.h>
5 kx #include <stdarg.h>
5 kx
5 kx /**
5 kx * Ensure that the library used for compiling this generated header is at
5 kx * least as new as the version current when the header template was released
5 kx * (not counting patch version increments). Also ensure that the oldest
5 kx * tolerable version is at least as old as what was current when the header
5 kx * template was released.
5 kx */
5 kx #define AO_TEMPLATE_VERSION 167937
5 kx #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
5 kx || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
5 kx # error option template version mismatches autoopts/options.h header
5 kx Choke Me.
5 kx #endif
5 kx
5 kx /**
5 kx * Enumeration of each option type for uuencode
5 kx */
5 kx typedef enum {
5 kx INDEX_OPT_BASE64 = 0,
5 kx INDEX_OPT_ENCODE_FILE_NAME = 1,
5 kx INDEX_OPT_VERSION = 2,
5 kx INDEX_OPT_HELP = 3,
5 kx INDEX_OPT_MORE_HELP = 4,
5 kx INDEX_OPT_SAVE_OPTS = 5,
5 kx INDEX_OPT_LOAD_OPTS = 6
5 kx } teOptIndex;
5 kx /** count of all options for uuencode */
5 kx #define OPTION_CT 7
5 kx /** uuencode version */
5 kx #define UUENCODE_VERSION "4.15.2"
5 kx /** Full uuencode version text */
5 kx #define UUENCODE_FULL_VERSION "uuencode (GNU sharutils) 4.15.2"
5 kx
5 kx /**
5 kx * Interface defines for all options. Replace "n" with the UPPER_CASED
5 kx * option name (as in the teOptIndex enumeration above).
5 kx * e.g. HAVE_OPT(BASE64)
5 kx */
5 kx #define DESC(n) (uuencodeOptions.pOptDesc[INDEX_OPT_## n])
5 kx /** 'true' if an option has been specified in any way */
5 kx #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
5 kx /** The string argument to an option. The argument type must be \"string\". */
5 kx #define OPT_ARG(n) (DESC(n).optArg.argString)
5 kx /** Mask the option state revealing how an option was specified.
5 kx * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
5 kx * \a OPTST_DEFINED, \a OPTST_RESET or zero.
5 kx */
5 kx #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
5 kx /** Count of option's occurrances *on the command line*. */
5 kx #define COUNT_OPT(n) (DESC(n).optOccCt)
5 kx /** mask of \a OPTST_SET and \a OPTST_DEFINED. */
5 kx #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
5 kx /** 'true' if \a HAVE_OPT would yield 'false'. */
5 kx #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
5 kx /** 'true' if OPTST_DISABLED bit not set. */
5 kx #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
5 kx /** number of stacked option arguments.
5 kx * Valid only for stacked option arguments. */
5 kx #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
5 kx /** stacked argument vector.
5 kx * Valid only for stacked option arguments. */
5 kx #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
5 kx /** Reset an option. */
5 kx #define CLEAR_OPT(n) STMTS( \
5 kx DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
5 kx if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
5 kx DESC(n).fOptState |= OPTST_DISABLED; \
5 kx DESC(n).optCookie = NULL )
5 kx /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
5 kx /**
5 kx * Enumeration of uuencode exit codes
5 kx */
5 kx typedef enum {
5 kx UUENCODE_EXIT_SUCCESS = 0,
5 kx UUENCODE_EXIT_FAILURE = 1,
5 kx UUENCODE_EXIT_USAGE_ERROR = 64,
5 kx UUENCODE_EXIT_NO_CONFIG_INPUT = 66,
5 kx UUENCODE_EXIT_LIBOPTS_FAILURE = 70
5 kx } uuencode_exit_code_t;
5 kx /**
5 kx * Interface defines for specific options.
5 kx * @{
5 kx */
5 kx #define VALUE_OPT_BASE64 'm'
5 kx #define VALUE_OPT_ENCODE_FILE_NAME 'e'
5 kx /** option flag (value) for help-value option */
5 kx #define VALUE_OPT_HELP 'h'
5 kx /** option flag (value) for more-help-value option */
5 kx #define VALUE_OPT_MORE_HELP '!'
5 kx /** option flag (value) for version-value option */
5 kx #define VALUE_OPT_VERSION 'v'
5 kx /** option flag (value) for save-opts-value option */
5 kx #define VALUE_OPT_SAVE_OPTS 'R'
5 kx /** option flag (value) for load-opts-value option */
5 kx #define VALUE_OPT_LOAD_OPTS 'r'
5 kx #define SET_OPT_SAVE_OPTS(a) STMTS( \
5 kx DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
5 kx DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
5 kx DESC(SAVE_OPTS).optArg.argString = (char const*)(a))
5 kx /*
5 kx * Interface defines not associated with particular options
5 kx */
5 kx #define ERRSKIP_OPTERR STMTS(uuencodeOptions.fOptSet &= ~OPTPROC_ERRSTOP)
5 kx #define ERRSTOP_OPTERR STMTS(uuencodeOptions.fOptSet |= OPTPROC_ERRSTOP)
5 kx #define RESTART_OPT(n) STMTS( \
5 kx uuencodeOptions.curOptIdx = (n); \
5 kx uuencodeOptions.pzCurOpt = NULL )
5 kx #define START_OPT RESTART_OPT(1)
5 kx #define USAGE(c) (*uuencodeOptions.pUsageProc)(&uuencodeOptions, c)
5 kx
5 kx #ifdef __cplusplus
5 kx extern "C" {
5 kx #endif
5 kx /*
5 kx * global exported definitions
5 kx */
5 kx #include "local.h"
5 kx extern char const * const program_name;
5 kx
5 kx
5 kx /* * * * * *
5 kx *
5 kx * Declare the uuencode option descriptor.
5 kx */
5 kx extern tOptions uuencodeOptions;
5 kx
5 kx #if defined(ENABLE_NLS)
5 kx # ifndef _
5 kx # include <stdio.h>
5 kx # ifndef HAVE_GETTEXT
5 kx extern char * gettext(char const *);
5 kx # else
5 kx # include <libintl.h>
5 kx # endif
5 kx
5 kx # ifndef ATTRIBUTE_FORMAT_ARG
5 kx # define ATTRIBUTE_FORMAT_ARG(_a)
5 kx # endif
5 kx
5 kx static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
5 kx static inline char* aoGetsText(char const* pz) {
5 kx if (pz == NULL) return NULL;
5 kx return (char*)gettext(pz);
5 kx }
5 kx # define _(s) aoGetsText(s)
5 kx # endif /* _() */
5 kx
5 kx # define OPT_NO_XLAT_CFG_NAMES STMTS(uuencodeOptions.fOptSet |= \
5 kx OPTPROC_NXLAT_OPT_CFG;)
5 kx # define OPT_NO_XLAT_OPT_NAMES STMTS(uuencodeOptions.fOptSet |= \
5 kx OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
5 kx
5 kx # define OPT_XLAT_CFG_NAMES STMTS(uuencodeOptions.fOptSet &= \
5 kx ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
5 kx # define OPT_XLAT_OPT_NAMES STMTS(uuencodeOptions.fOptSet &= \
5 kx ~OPTPROC_NXLAT_OPT;)
5 kx
5 kx #else /* ENABLE_NLS */
5 kx # define OPT_NO_XLAT_CFG_NAMES
5 kx # define OPT_NO_XLAT_OPT_NAMES
5 kx
5 kx # define OPT_XLAT_CFG_NAMES
5 kx # define OPT_XLAT_OPT_NAMES
5 kx
5 kx # ifndef _
5 kx # define _(_s) _s
5 kx # endif
5 kx #endif /* ENABLE_NLS */
5 kx
5 kx extern void vusage_message(char const * fmt, va_list ap);
5 kx extern void usage_message(char const * fmt, ...);
5 kx extern void vdie( int exit_code, char const * fmt, va_list);
5 kx extern void die( int exit_code, char const * fmt, ...);
5 kx extern void fserr(int exit_code, char const * op, char const * fn);
5 kx #ifdef __cplusplus
5 kx }
5 kx #endif
5 kx #endif /* AUTOOPTS_UUENCODE_OPTS_H_GUARD */
5 kx
5 kx /* uuencode-opts.h ends here */