lib_LTLIBRARIES = libopts.la
libopts_la_SOURCES = libopts.c
libopts_la_CPPFLAGS = -I$(top_srcdir)
-libopts_la_LDFLAGS = -version-info 27:3:2
+libopts_la_LDFLAGS = -version-info 27:4:2
EXTRA_DIST = \
- COPYING.lgpl COPYING.mbsd MakeDefs.inc \
- README autoopts/options.h autoopts/usage-txt.h \
- autoopts.c autoopts.h boolean.c \
- compat/compat.h compat/pathfind.c compat/snprintf.c \
- compat/strdup.c compat/strchr.c configfile.c \
- cook.c enumeration.c environment.c \
- genshell.c genshell.h load.c \
- m4/libopts.m4 m4/liboptschk.m4 makeshell.c \
- nested.c numeric.c pgusage.c \
- proto.h putshell.c restore.c \
- save.c sort.c stack.c \
- streqvcmp.c text_mmap.c tokenize.c \
- usage.c version.c
+ COPYING.lgpl COPYING.mbsd MakeDefs.inc \
+ README autoopts/options.h autoopts/usage-txt.h \
+ autoopts.c autoopts.h boolean.c \
+ compat/windows-config.h compat/compat.h compat/pathfind.c \
+ compat/snprintf.c compat/strdup.c compat/strchr.c \
+ configfile.c cook.c enumeration.c \
+ environment.c genshell.c genshell.h \
+ load.c m4/libopts.m4 m4/liboptschk.m4 \
+ makeshell.c nested.c numeric.c \
+ pgusage.c proto.h putshell.c \
+ restore.c save.c sort.c \
+ stack.c streqvcmp.c text_mmap.c \
+ tokenize.c usage.c version.c
/*
- * $Id: autoopts.c,v 4.20 2006/06/24 23:34:51 bkorb Exp $
- * Time-stamp: "2006-07-01 14:41:46 bkorb"
+ * $Id: autoopts.c,v 4.22 2006/07/15 22:10:21 bkorb Exp $
+ * Time-stamp: "2006-07-15 13:54:08 bkorb"
*
* This file contains all of the routines that must be linked into
* an executable to use the generated option processing. The optional
# include "compat/pathfind.c"
#endif
-#ifndef HAVE_LIBSNPRINTFV
-# ifndef HAVE_SNPRINTF
-# include "compat/snprintf.c"
-# endif
+#ifndef HAVE_SNPRINTF
+# include "compat/snprintf.c"
+#endif
-# ifndef HAVE_STRDUP
-# include "compat/strdup.c"
-# endif
+#ifndef HAVE_STRDUP
+# include "compat/strdup.c"
#endif
#ifndef HAVE_STRCHR
/*
- * Time-stamp: "2006-07-01 14:40:47 bkorb"
+ * Time-stamp: "2006-07-15 13:52:50 bkorb"
*
- * autoopts.h $Id: autoopts.h,v 4.22 2006/06/24 23:34:51 bkorb Exp $
+ * autoopts.h $Id: autoopts.h,v 4.25 2006/07/15 22:10:21 bkorb Exp $
* Time-stamp: "2005-02-14 05:59:50 bkorb"
*
* This file defines all the global structures and special values
#undef EXPORT
#define EXPORT
-#if defined(_WIN32)
-# define DIRch '\\'
+#if defined(_WIN32) && !defined(__CYGWIN__)
+# define DIRCH '\\'
#else
# define DIRCH '/'
#endif
* USAGE: define procedures to return "tSuccess". Test their results
* with the SUCCEEDED, FAILED and HADGLITCH macros.
*/
+#undef SUCCESS
#define SUCCESS ((tSuccess) 0)
+#undef FAILURE
#define FAILURE ((tSuccess)-1)
+#undef PROBLEM
#define PROBLEM ((tSuccess) 1)
typedef int tSuccess;
# define AGDUPSTR( p, s, w ) p = strdup( s )
# define TAGMEM( m, t )
-#ifdef AUTOGEN_BUILD
-# include <snprintfv/printf.h>
-#endif /* AUTOGEN_BUILD */
-
/*
* DO option handling?
*
*
* DO NOT EDIT THIS FILE (options.h)
*
- * It has been AutoGen-ed Sunday April 9, 2006 at 11:49:19 AM PDT
+ * It has been AutoGen-ed Saturday July 22, 2006 at 08:36:53 AM PDT
* From the definitions funcs.def
* and the template file options_h
*
/*
* Bits in the fOptState option descriptor field.
*/
-#define OPTST_INIT 0x0000000 /* Initial compiled value */
-#define OPTST_SET 0x0000001 /* Set via the "SET_OPT()" macro */
-#define OPTST_PRESET 0x0000002 /* Set via an RC/INI file */
-#define OPTST_DEFINED 0x0000004 /* Set via a command line option */
+#define OPTST_INIT 0x0000000U /* Initial compiled value */
+#define OPTST_SET 0x0000001U /* Set via the "SET_OPT()" macro */
+#define OPTST_PRESET 0x0000002U /* Set via an RC/INI file */
+#define OPTST_DEFINED 0x0000004U /* Set via a command line option */
-#define OPTST_SET_MASK 0x0000007 /* mask of flags that show set state */
+#define OPTST_SET_MASK 0x0000007U /* mask of flags that show set state */
-#define OPTST_EQUIVALENCE 0x0000010 /* selected by equiv'ed option */
-#define OPTST_DISABLED 0x0000020 /* option is in disabled state */
+#define OPTST_EQUIVALENCE 0x0000010U /* selected by equiv'ed option */
+#define OPTST_DISABLED 0x0000020U /* option is in disabled state */
-#define OPTST_NO_INIT 0x0000100 /* option cannot be preset */
-#define OPTST_NUMBER_OPT 0x0000200 /* opt value (flag) is any digit */
-#define OPTST_STACKED 0x0000400 /* opt uses optionStackArg procedure */
-#define OPTST_INITENABLED 0x0000800 /* option defaults to enabled */
-#define OPTST_ARG_TYPE_MASK 0x000F000 /* bits used to specify opt arg type */
-#define OPTST_ARG_OPTIONAL 0x0010000 /* the option argument not required */
-#define OPTST_IMM 0x0020000 /* process option on first pass */
-#define OPTST_DISABLE_IMM 0x0040000 /* process disablement on first pass */
-#define OPTST_OMITTED 0x0080000 /* compiled out of program */
-#define OPTST_MUST_SET 0x0100000 /* must be set or pre-set */
-#define OPTST_DOCUMENT 0x0200000 /* opt is for documentation only */
-#define OPTST_TWICE 0x0400000 /* process option twice - imm + reg */
-#define OPTST_DISABLE_TWICE 0x0800000 /* process disabled option twice */
+#define OPTST_NO_INIT 0x0000100U /* option cannot be preset */
+#define OPTST_NUMBER_OPT 0x0000200U /* opt value (flag) is any digit */
+#define OPTST_STACKED 0x0000400U /* opt uses optionStackArg procedure */
+#define OPTST_INITENABLED 0x0000800U /* option defaults to enabled */
+#define OPTST_ARG_TYPE_MASK 0x000F000U /* bits used to specify opt arg type */
+#define OPTST_ARG_OPTIONAL 0x0010000U /* the option argument not required */
+#define OPTST_IMM 0x0020000U /* process option on first pass */
+#define OPTST_DISABLE_IMM 0x0040000U /* process disablement on first pass */
+#define OPTST_OMITTED 0x0080000U /* compiled out of program */
+#define OPTST_MUST_SET 0x0100000U /* must be set or pre-set */
+#define OPTST_DOCUMENT 0x0200000U /* opt is for documentation only */
+#define OPTST_TWICE 0x0400000U /* process option twice - imm + reg */
+#define OPTST_DISABLE_TWICE 0x0800000U /* process disabled option twice */
-#define OPTST_PERSISTENT 0xFFFFF00 /* mask of flags that do not change */
+#define OPTST_PERSISTENT 0xFFFFF00U /* mask of flags that do not change */
#define SELECTED_OPT( pod ) ( (pod)->fOptState & (OPTST_SET | OPTST_DEFINED))
#define UNUSED_OPT( pod ) (((pod)->fOptState & OPTST_SET_MASK) == 0)
*/
typedef struct optSpecIndex tOptSpecIndex;
struct optSpecIndex {
- tAoUS more_help;
- tAoUS save_opts;
- tAoUS number_option;
- tAoUS default_opt;
+ const tAoUS more_help;
+ const tAoUS save_opts;
+ const tAoUS number_option;
+ const tAoUS default_opt;
};
#define OPTIONS_STRUCT_VERSION 110594
-#define OPTIONS_VERSION_STRING "27:1:2"
+#define OPTIONS_VERSION_STRING "27:4:2"
#define OPTIONS_MINIMUM_VERSION 102400
#define OPTIONS_MIN_VER_STRING "25:0:0"
typedef void (tOptionXlateProc)(void);
struct options {
- const int structVersion;
- int origArgCt;
- char** origArgVect;
- unsigned int fOptSet;
- unsigned int curOptIdx;
- char* pzCurOpt;
-
- const char* pzProgPath;
- const char* pzProgName;
- const char* pzPROGNAME;
- const char* pzRcName;
- const char* pzCopyright;
- const char* pzCopyNotice;
- const char* pzFullVersion;
- const char** papzHomeList;
- const char* pzUsageTitle;
- const char* pzExplain;
- const char* pzDetail;
- tOptDesc* pOptDesc;
- const char* pzBugAddr;
-
- void* pExtensions;
- void* pSavedState;
-
- tpUsageProc pUsageProc;
- tOptionXlateProc* pTransProc;
-
- tOptSpecIndex specOptIdx;
- const int optCt;
- const int presetOptCt;
+ const int structVersion;
+ int origArgCt;
+ char** origArgVect;
+ unsigned int fOptSet;
+ unsigned int curOptIdx;
+ char* pzCurOpt;
+
+ const char* pzProgPath;
+ const char* pzProgName;
+ const char* const pzPROGNAME;
+ const char* const pzRcName;
+ const char* const pzCopyright;
+ const char* const pzCopyNotice;
+ const char* const pzFullVersion;
+ const char* const* papzHomeList;
+ const char* const pzUsageTitle;
+ const char* const pzExplain;
+ const char* const pzDetail;
+ tOptDesc* const pOptDesc;
+ const char* const pzBugAddr;
+
+ void* pExtensions;
+ void* pSavedState;
+
+ tpUsageProc pUsageProc;
+ tOptionXlateProc* pTransProc;
+
+ tOptSpecIndex specOptIdx;
+ const int optCt;
+ const int presetOptCt;
};
/*
extern void optionOnlyUsage( tOptions*, int );
-/* From: autoopts.c line 934
+/* From: autoopts.c line 936
*
* optionProcess - this is the main option processing routine
*
extern const char* optionVersion( void );
-/* From: ../compat/pathfind.c line 24
+/* From: ../compat/pathfind.c line 33
*
* pathfind - fild a file in a list of directories
*
extern unsigned int ao_string_cook_escape_char( const char*, char*, u_int );
+extern void export_options_to_guile( tOptions* );
+
extern void genshelloptUsage( tOptions*, int );
extern void optionBooleanVal( tOptions*, tOptDesc* );
*
* DO NOT EDIT THIS FILE (usage-txt.h)
*
- * It has been AutoGen-ed Sunday April 9, 2006 at 11:49:19 AM PDT
+ * It has been AutoGen-ed Saturday July 22, 2006 at 08:36:51 AM PDT
* 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 114
+ * tiny strings used by the AutoOpts library. There are 113
* 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
char* utpz_GnuKeyLArg;
char* utpz_GnuNumArg;
char* utpz_GnuStrArg;
- cch_t* apz_str[ 109 ];
+ cch_t* apz_str[ 108 ];
} usage_text_t;
/*
/*
* Provide a mapping from a short name to fields in this structure.
*/
-#define zAO_Bad (option_usage_text.apz_str[0])
-#define zAO_Big (option_usage_text.apz_str[1])
-#define zAO_Err (option_usage_text.apz_str[2])
-#define zAO_Sml (option_usage_text.apz_str[3])
-#define zAll (option_usage_text.apz_str[4])
-#define zAlt (option_usage_text.apz_str[5])
-#define zAmbigKey (option_usage_text.apz_str[6])
-#define zAmbiguous (option_usage_text.apz_str[7])
-#define zArgsMust (option_usage_text.apz_str[8])
-#define zAtMost (option_usage_text.apz_str[9])
-#define zAuto (option_usage_text.apz_str[10])
-#define zBadPipe (option_usage_text.apz_str[11])
-#define zBadVerArg (option_usage_text.apz_str[12])
-#define zCantFmt (option_usage_text.apz_str[13])
-#define zCantSave (option_usage_text.apz_str[14])
-#define zDefaultOpt (option_usage_text.apz_str[15])
-#define zDis (option_usage_text.apz_str[16])
-#define zEnab (option_usage_text.apz_str[17])
-#define zEquiv (option_usage_text.apz_str[18])
-#define zErrOnly (option_usage_text.apz_str[19])
-#define zExamineFmt (option_usage_text.apz_str[20])
-#define zFiveSpaces (option_usage_text.apz_str[21])
-#define zFlagOkay (option_usage_text.apz_str[22])
-#define zFmtFmt (option_usage_text.apz_str[23])
-#define zForkFail (option_usage_text.apz_str[24])
-#define zFSErrOptLoad (option_usage_text.apz_str[25])
-#define zFSErrReadFile (option_usage_text.apz_str[26])
-#define zGenshell (option_usage_text.apz_str[27])
+#define zAO_Bad (option_usage_text.apz_str[ 0])
+#define zAO_Big (option_usage_text.apz_str[ 1])
+#define zAO_Err (option_usage_text.apz_str[ 2])
+#define zAO_Sml (option_usage_text.apz_str[ 3])
+#define zAll (option_usage_text.apz_str[ 4])
+#define zAlt (option_usage_text.apz_str[ 5])
+#define zAmbigKey (option_usage_text.apz_str[ 6])
+#define zAmbiguous (option_usage_text.apz_str[ 7])
+#define zArgsMust (option_usage_text.apz_str[ 8])
+#define zAtMost (option_usage_text.apz_str[ 9])
+#define zAuto (option_usage_text.apz_str[ 10])
+#define zBadPipe (option_usage_text.apz_str[ 11])
+#define zBadVerArg (option_usage_text.apz_str[ 12])
+#define zCantFmt (option_usage_text.apz_str[ 13])
+#define zCantSave (option_usage_text.apz_str[ 14])
+#define zDefaultOpt (option_usage_text.apz_str[ 15])
+#define zDis (option_usage_text.apz_str[ 16])
+#define zEnab (option_usage_text.apz_str[ 17])
+#define zEquiv (option_usage_text.apz_str[ 18])
+#define zErrOnly (option_usage_text.apz_str[ 19])
+#define zExamineFmt (option_usage_text.apz_str[ 20])
+#define zFiveSpaces (option_usage_text.apz_str[ 21])
+#define zFlagOkay (option_usage_text.apz_str[ 22])
+#define zFmtFmt (option_usage_text.apz_str[ 23])
+#define zForkFail (option_usage_text.apz_str[ 24])
+#define zFSErrOptLoad (option_usage_text.apz_str[ 25])
+#define zFSErrReadFile (option_usage_text.apz_str[ 26])
+#define zGenshell (option_usage_text.apz_str[ 27])
#define zGnuBoolArg (option_usage_text.utpz_GnuBoolArg)
-#define zGnuBreak (option_usage_text.apz_str[28])
+#define zGnuBreak (option_usage_text.apz_str[ 28])
#define zGnuKeyArg (option_usage_text.utpz_GnuKeyArg)
#define zGnuKeyLArg (option_usage_text.utpz_GnuKeyLArg)
-#define zGnuNestArg (option_usage_text.apz_str[29])
+#define zGnuNestArg (option_usage_text.apz_str[ 29])
#define zGnuNumArg (option_usage_text.utpz_GnuNumArg)
-#define zGnuOptArg (option_usage_text.apz_str[30])
-#define zGnuOptFmt (option_usage_text.apz_str[31])
+#define zGnuOptArg (option_usage_text.apz_str[ 30])
+#define zGnuOptFmt (option_usage_text.apz_str[ 31])
#define zGnuStrArg (option_usage_text.utpz_GnuStrArg)
-#define zHomePath (option_usage_text.apz_str[32])
-#define zIllOptChr (option_usage_text.apz_str[33])
-#define zIllOptStr (option_usage_text.apz_str[34])
-#define zIllegal (option_usage_text.apz_str[35])
-#define zInvalOptDesc (option_usage_text.apz_str[36])
-#define zKeyWords (option_usage_text.apz_str[37])
-#define zLoadCooked (option_usage_text.apz_str[38])
-#define zLoadKeep (option_usage_text.apz_str[39])
-#define zLoadType (option_usage_text.apz_str[40])
-#define zLoadUncooked (option_usage_text.apz_str[41])
-#define zLtypeInteger (option_usage_text.apz_str[42])
-#define zLtypeNest (option_usage_text.apz_str[43])
-#define zLtypeString (option_usage_text.apz_str[44])
-#define zLtypeBool (option_usage_text.apz_str[45])
-#define zLtypeKeyword (option_usage_text.apz_str[46])
-#define zLtypeSetMembership (option_usage_text.apz_str[47])
-#define zMembers (option_usage_text.apz_str[48])
-#define zMisArg (option_usage_text.apz_str[49])
-#define zMultiEquiv (option_usage_text.apz_str[50])
-#define zMust (option_usage_text.apz_str[51])
-#define zNeedOne (option_usage_text.apz_str[52])
-#define zNoArg (option_usage_text.apz_str[53])
-#define zNoArgs (option_usage_text.apz_str[54])
-#define zNoCreat (option_usage_text.apz_str[55])
-#define zNoFlags (option_usage_text.apz_str[56])
-#define zNoKey (option_usage_text.apz_str[57])
-#define zNoLim (option_usage_text.apz_str[58])
-#define zNoPreset (option_usage_text.apz_str[59])
-#define zNoRq_NoShrtTtl (option_usage_text.apz_str[60])
-#define zNoRq_ShrtTtl (option_usage_text.apz_str[61])
-#define zNoStat (option_usage_text.apz_str[62])
-#define zNoState (option_usage_text.apz_str[63])
-#define zNone (option_usage_text.apz_str[64])
-#define zNotDef (option_usage_text.apz_str[65])
-#define zNotEnough (option_usage_text.apz_str[66])
-#define zNotFile (option_usage_text.apz_str[67])
-#define zNotNumber (option_usage_text.apz_str[68])
-#define zNrmOptFmt (option_usage_text.apz_str[69])
-#define zNumberOpt (option_usage_text.apz_str[70])
-#define zOneSpace (option_usage_text.apz_str[71])
-#define zOnlyOne (option_usage_text.apz_str[72])
-#define zOptsOnly (option_usage_text.apz_str[73])
-#define zPathFmt (option_usage_text.apz_str[74])
-#define zPlsSendBugs (option_usage_text.apz_str[75])
-#define zPreset (option_usage_text.apz_str[76])
-#define zPresetFile (option_usage_text.apz_str[77])
-#define zPresetIntro (option_usage_text.apz_str[78])
-#define zProg (option_usage_text.apz_str[79])
-#define zProhib (option_usage_text.apz_str[80])
-#define zReorder (option_usage_text.apz_str[81])
-#define zReqFmt (option_usage_text.apz_str[82])
-#define zReqOptFmt (option_usage_text.apz_str[83])
-#define zReqThese (option_usage_text.apz_str[84])
-#define zReq_NoShrtTtl (option_usage_text.apz_str[85])
-#define zReq_ShrtTtl (option_usage_text.apz_str[86])
-#define zSepChars (option_usage_text.apz_str[87])
-#define zSetMembers (option_usage_text.apz_str[88])
-#define zSetMemberSettings (option_usage_text.apz_str[89])
-#define zShrtGnuOptFmt (option_usage_text.apz_str[90])
-#define zSixSpaces (option_usage_text.apz_str[91])
-#define zStdBoolArg (option_usage_text.apz_str[92])
-#define zStdBreak (option_usage_text.apz_str[93])
-#define zStdKeyArg (option_usage_text.apz_str[94])
-#define zStdKeyLArg (option_usage_text.apz_str[95])
-#define zStdNestArg (option_usage_text.apz_str[96])
-#define zStdNoArg (option_usage_text.apz_str[97])
-#define zStdNumArg (option_usage_text.apz_str[98])
-#define zStdOptArg (option_usage_text.apz_str[99])
-#define zStdReqArg (option_usage_text.apz_str[100])
-#define zStdStrArg (option_usage_text.apz_str[101])
-#define zTabHyp (option_usage_text.apz_str[102])
-#define zTabHypAnd (option_usage_text.apz_str[103])
-#define zTabout (option_usage_text.apz_str[104])
-#define zThreeSpaces (option_usage_text.apz_str[105])
-#define zTwoSpaces (option_usage_text.apz_str[106])
-#define zUpTo (option_usage_text.apz_str[107])
-#define zValidKeys (option_usage_text.apz_str[108])
+#define zIllOptChr (option_usage_text.apz_str[ 32])
+#define zIllOptStr (option_usage_text.apz_str[ 33])
+#define zIllegal (option_usage_text.apz_str[ 34])
+#define zInvalOptDesc (option_usage_text.apz_str[ 35])
+#define zKeyWords (option_usage_text.apz_str[ 36])
+#define zLoadCooked (option_usage_text.apz_str[ 37])
+#define zLoadKeep (option_usage_text.apz_str[ 38])
+#define zLoadType (option_usage_text.apz_str[ 39])
+#define zLoadUncooked (option_usage_text.apz_str[ 40])
+#define zLtypeInteger (option_usage_text.apz_str[ 41])
+#define zLtypeNest (option_usage_text.apz_str[ 42])
+#define zLtypeString (option_usage_text.apz_str[ 43])
+#define zLtypeBool (option_usage_text.apz_str[ 44])
+#define zLtypeKeyword (option_usage_text.apz_str[ 45])
+#define zLtypeSetMembership (option_usage_text.apz_str[ 46])
+#define zMembers (option_usage_text.apz_str[ 47])
+#define zMisArg (option_usage_text.apz_str[ 48])
+#define zMultiEquiv (option_usage_text.apz_str[ 49])
+#define zMust (option_usage_text.apz_str[ 50])
+#define zNeedOne (option_usage_text.apz_str[ 51])
+#define zNoArg (option_usage_text.apz_str[ 52])
+#define zNoArgs (option_usage_text.apz_str[ 53])
+#define zNoCreat (option_usage_text.apz_str[ 54])
+#define zNoFlags (option_usage_text.apz_str[ 55])
+#define zNoKey (option_usage_text.apz_str[ 56])
+#define zNoLim (option_usage_text.apz_str[ 57])
+#define zNoPreset (option_usage_text.apz_str[ 58])
+#define zNoRq_NoShrtTtl (option_usage_text.apz_str[ 59])
+#define zNoRq_ShrtTtl (option_usage_text.apz_str[ 60])
+#define zNoStat (option_usage_text.apz_str[ 61])
+#define zNoState (option_usage_text.apz_str[ 62])
+#define zNone (option_usage_text.apz_str[ 63])
+#define zNotDef (option_usage_text.apz_str[ 64])
+#define zNotEnough (option_usage_text.apz_str[ 65])
+#define zNotFile (option_usage_text.apz_str[ 66])
+#define zNotNumber (option_usage_text.apz_str[ 67])
+#define zNrmOptFmt (option_usage_text.apz_str[ 68])
+#define zNumberOpt (option_usage_text.apz_str[ 69])
+#define zOneSpace (option_usage_text.apz_str[ 70])
+#define zOnlyOne (option_usage_text.apz_str[ 71])
+#define zOptsOnly (option_usage_text.apz_str[ 72])
+#define zPathFmt (option_usage_text.apz_str[ 73])
+#define zPlsSendBugs (option_usage_text.apz_str[ 74])
+#define zPreset (option_usage_text.apz_str[ 75])
+#define zPresetFile (option_usage_text.apz_str[ 76])
+#define zPresetIntro (option_usage_text.apz_str[ 77])
+#define zProg (option_usage_text.apz_str[ 78])
+#define zProhib (option_usage_text.apz_str[ 79])
+#define zReorder (option_usage_text.apz_str[ 80])
+#define zReqFmt (option_usage_text.apz_str[ 81])
+#define zReqOptFmt (option_usage_text.apz_str[ 82])
+#define zReqThese (option_usage_text.apz_str[ 83])
+#define zReq_NoShrtTtl (option_usage_text.apz_str[ 84])
+#define zReq_ShrtTtl (option_usage_text.apz_str[ 85])
+#define zSepChars (option_usage_text.apz_str[ 86])
+#define zSetMembers (option_usage_text.apz_str[ 87])
+#define zSetMemberSettings (option_usage_text.apz_str[ 88])
+#define zShrtGnuOptFmt (option_usage_text.apz_str[ 89])
+#define zSixSpaces (option_usage_text.apz_str[ 90])
+#define zStdBoolArg (option_usage_text.apz_str[ 91])
+#define zStdBreak (option_usage_text.apz_str[ 92])
+#define zStdKeyArg (option_usage_text.apz_str[ 93])
+#define zStdKeyLArg (option_usage_text.apz_str[ 94])
+#define zStdNestArg (option_usage_text.apz_str[ 95])
+#define zStdNoArg (option_usage_text.apz_str[ 96])
+#define zStdNumArg (option_usage_text.apz_str[ 97])
+#define zStdOptArg (option_usage_text.apz_str[ 98])
+#define zStdReqArg (option_usage_text.apz_str[ 99])
+#define zStdStrArg (option_usage_text.apz_str[100])
+#define zTabHyp (option_usage_text.apz_str[101])
+#define zTabHypAnd (option_usage_text.apz_str[102])
+#define zTabout (option_usage_text.apz_str[103])
+#define zThreeSpaces (option_usage_text.apz_str[104])
+#define zTwoSpaces (option_usage_text.apz_str[105])
+#define zUpTo (option_usage_text.apz_str[106])
+#define zValidKeys (option_usage_text.apz_str[107])
/*
* First, set up the strings. Some of these are writable. These are all in
* xgettext (or equivalents) can extract these strings for translation.
*/
- static cch_t eng_zAO_Bad[] =
- "AutoOpts function called without option descriptor\n";
- static cch_t eng_zAO_Big[] =
- "\tThis exceeds the compiled library version: ";
- static cch_t eng_zAO_Err[] =
- "Automated Options Processing Error!\n\
-\t%s called AutoOpts function with structure version %d:%d:%d.\n";
- static cch_t eng_zAO_Sml[] =
- "\tThis is less than the minimum library version: ";
- static cch_t eng_zAll[] =
- "all";
- static cch_t eng_zAlt[] =
- "\t\t\t\t- an alternate for %s\n";
- static cch_t eng_zAmbigKey[] =
- "%s error: the keyword `%s' is ambiguous\n";
- static cch_t eng_zAmbiguous[] =
- "ambiguous";
- static cch_t eng_zArgsMust[] =
- "%s: Command line arguments required\n";
- static cch_t eng_zAtMost[] =
- "%4$d %1$s%s options allowed\n";
- static cch_t eng_zAuto[] =
- "version and help options:";
- static cch_t eng_zBadPipe[] =
- "Error %d (%s) from the pipe(2) syscall\n";
- static cch_t eng_zBadVerArg[] =
- "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";
- static cch_t eng_zCantFmt[] =
- "ERROR: %s option conflicts with the %s option\n";
- static cch_t eng_zCantSave[] =
- "%s(optionSaveState): error: cannot allocate %d bytes\n";
- static cch_t eng_zDefaultOpt[] =
- "\t\t\t\t- default option for unnamed options\n";
- static cch_t eng_zDis[] =
- "\t\t\t\t- disabled as --%s\n";
- static cch_t eng_zEnab[] =
- "\t\t\t\t- enabled by default\n";
- static cch_t eng_zEquiv[] =
- "-equivalence";
- static cch_t eng_zErrOnly[] =
- "ERROR: only ";
- static cch_t eng_zExamineFmt[] =
- " - examining environment variables named %s_*\n";
- static cch_t eng_zFiveSpaces[] =
- " ";
- static cch_t eng_zFlagOkay[] =
- "Options are specified by doubled hyphens and their name\n\
-or by a single hyphen and the flag character.\n";
- static cch_t eng_zFmtFmt[] =
- "%%-%ds %%s\n";
- static cch_t eng_zForkFail[] =
- "fs error %d (%s) on fork - cannot obtain %s usage\n";
- static cch_t eng_zFSErrOptLoad[] =
- "File error %d (%s) opening %s for loading options\n";
- static cch_t eng_zFSErrReadFile[] =
- "fs error %d (%s) reading file %s\n";
- static cch_t eng_zGenshell[] =
- "\n\
-= = = = = = = =\n\n\
-This incarnation of genshell will produce\n\
-a shell script to parse the options for %s:\n\n";
- static char eng_zGnuBoolArg[] =
- "=T/F";
- static cch_t eng_zGnuBreak[] =
- "\n\
-%s\n\n";
- static char eng_zGnuKeyArg[] =
- "=KWd";
- static char eng_zGnuKeyLArg[] =
- "=Mbr";
- static cch_t eng_zGnuNestArg[] =
- "=Cplx";
- static char eng_zGnuNumArg[] =
- "=num";
- static cch_t eng_zGnuOptArg[] =
- "[=arg]";
- static cch_t eng_zGnuOptFmt[] =
- "--%2$s%1$s";
- static char eng_zGnuStrArg[] =
- "=str";
- static cch_t eng_zHomePath[] =
- " - reading file /... %s's exe directory .../%s \n";
- static cch_t eng_zIllOptChr[] =
- "%s: illegal option -- %c\n";
- static cch_t eng_zIllOptStr[] =
- "%s: %s option -- %s\n";
- static cch_t eng_zIllegal[] =
- "illegal";
- static cch_t eng_zInvalOptDesc[] =
- "AutoOpts ERROR: invalid option descriptor for %s\n";
- static cch_t eng_zKeyWords[] =
- "words=";
- static cch_t eng_zLoadCooked[] =
- "cooked";
- static cch_t eng_zLoadKeep[] =
- "keep";
- static cch_t eng_zLoadType[] =
- "type=";
- static cch_t eng_zLoadUncooked[] =
- "uncooked";
- static cch_t eng_zLtypeInteger[] =
- "integer";
- static cch_t eng_zLtypeNest[] =
- "nested";
- static cch_t eng_zLtypeString[] =
- "string";
- static cch_t eng_zLtypeBool[] =
- "bool";
- static cch_t eng_zLtypeKeyword[] =
- "keyword";
- static cch_t eng_zLtypeSetMembership[] =
- "set";
- static cch_t eng_zMembers[] =
- "\t\t\t\t- is a set membership option\n";
- static cch_t eng_zMisArg[] =
- "%s: option `%s' requires an argument\n";
- static cch_t eng_zMultiEquiv[] =
- "Equivalenced option '%s' was equivalenced to both\n\
-\t'%s' and '%s'";
- static cch_t eng_zMust[] =
- "\t\t\t\t- must appear between %d and %d times\n";
- static cch_t eng_zNeedOne[] =
- "ERROR: The %s option is required\n";
- static cch_t eng_zNoArg[] =
- "%s: option `%s' cannot have an argument\n";
- static cch_t eng_zNoArgs[] =
- "%s: Command line arguments not allowed\n";
- static cch_t eng_zNoCreat[] =
- "error %d (%s) creating %s\n";
- static cch_t eng_zNoFlags[] =
- "Options are specified by single or double hyphens and their name.\n";
- static cch_t eng_zNoKey[] =
- "%s error: `%s' does not match any keywords\n";
- static cch_t eng_zNoLim[] =
- "\t\t\t\t- may appear multiple times\n";
- static cch_t eng_zNoPreset[] =
- "\t\t\t\t- may not be preset\n";
- static cch_t eng_zNoRq_NoShrtTtl[] =
- " Arg Option-Name Description\n";
- static cch_t eng_zNoRq_ShrtTtl[] =
- " Flg Arg Option-Name Description\n";
- static cch_t eng_zNoStat[] =
- "error %d (%s) stat-ing %s\n";
- static cch_t eng_zNoState[] =
- "%s(optionRestore): error: no saved option state\n";
- static cch_t eng_zNone[] =
- "none";
- static cch_t eng_zNotDef[] =
- "'%s' not defined\n";
- static cch_t eng_zNotEnough[] =
- "ERROR: The %s option must appear %d times\n";
- static cch_t eng_zNotFile[] =
- "error: cannot load options from non-regular file %s\n";
- static cch_t eng_zNotNumber[] =
- "%s error: `%s' is not a recognizable number\n";
- static cch_t eng_zNrmOptFmt[] =
- " %3s %s";
- static cch_t eng_zNumberOpt[] =
- "The '-#<number>' option may omit the hash char\n";
- static cch_t eng_zOneSpace[] =
- " ";
- static cch_t eng_zOnlyOne[] =
- "one %s%s option allowed\n";
- static cch_t eng_zOptsOnly[] =
- "All arguments are named options.\n";
- static cch_t eng_zPathFmt[] =
- " - reading file %s";
- static cch_t eng_zPlsSendBugs[] =
- "\n\
-please send bug reports to: %s\n";
- static cch_t eng_zPreset[] =
- "\t\t\t\t- may NOT appear - preset only\n";
- static cch_t eng_zPresetFile[] =
- "# preset/initialization file\n\
-# %s#\n";
- static cch_t eng_zPresetIntro[] =
- "\n\
-The following option preset mechanisms are supported:\n";
- static cch_t eng_zProg[] =
- "program";
- static cch_t eng_zProhib[] =
- "prohibits these options:\n";
- static cch_t eng_zReorder[] =
- "Operands and options may be intermixed. They will be reordered.\n";
- static cch_t eng_zReqFmt[] =
- "ERROR: %s option requires the %s option\n";
- static cch_t eng_zReqOptFmt[] =
- " %3s %-14s %s";
- static cch_t eng_zReqThese[] =
- "requires these options:\n";
- static cch_t eng_zReq_NoShrtTtl[] =
- " Arg Option-Name Req? Description\n";
- static cch_t eng_zReq_ShrtTtl[] =
- " Flg Arg Option-Name Req? Description\n";
- static cch_t eng_zSepChars[] =
- "-_^";
- static cch_t eng_zSetMembers[] =
- "members=";
- static cch_t eng_zSetMemberSettings[] =
- "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";
- static cch_t eng_zShrtGnuOptFmt[] =
- "%s";
- static cch_t eng_zSixSpaces[] =
- " ";
- static cch_t eng_zStdBoolArg[] =
- "T/F";
- static cch_t eng_zStdBreak[] =
- "\n\
-%s\n\n\
-%s";
- static cch_t eng_zStdKeyArg[] =
- "KWd";
- static cch_t eng_zStdKeyLArg[] =
- "Mbr";
- static cch_t eng_zStdNestArg[] =
- "Cpx";
- static cch_t eng_zStdNoArg[] =
- "no ";
- static cch_t eng_zStdNumArg[] =
- "Num";
- static cch_t eng_zStdOptArg[] =
- "opt";
- static cch_t eng_zStdReqArg[] =
- "YES";
- static cch_t eng_zStdStrArg[] =
- "Str";
- static cch_t eng_zTabHyp[] =
- "\t\t\t\t- ";
- static cch_t eng_zTabHypAnd[] =
- "\t\t\t\t-- and ";
- static cch_t eng_zTabout[] =
- "\t\t\t\t%s\n";
- static cch_t eng_zThreeSpaces[] =
- " ";
- static cch_t eng_zTwoSpaces[] =
- " ";
- static cch_t eng_zUpTo[] =
- "\t\t\t\t- may appear up to %d times\n";
- static cch_t eng_zValidKeys[] =
- "The valid \"%s\" option keywords are:\n";
+ static char eng_zGnuBoolArg[] = "=T/F";
+ static char eng_zGnuKeyArg[] = "=KWd";
+ static char eng_zGnuKeyLArg[] = "=Mbr";
+ static char eng_zGnuNumArg[] = "=num";
+ static char eng_zGnuStrArg[] = "=str";
+static const char usage_txt[3202] =
+ "AutoOpts function called without option descriptor\n\0"
+ "\tThis exceeds the compiled library version: \0"
+ "Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n\0"
+ "\tThis is less than the minimum library version: \0"
+ "all\0"
+ "\t\t\t\t- an alternate for %s\n\0"
+ "%s error: the keyword `%s' is ambiguous\n\0"
+ "ambiguous\0"
+ "%s: Command line arguments required\n\0"
+ "%4$d %1$s%s options allowed\n\0"
+ "version and help options:\0"
+ "Error %d (%s) from the pipe(2) syscall\n\0"
+ "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"
+ "ERROR: %s option conflicts with the %s option\n\0"
+ "%s(optionSaveState): error: cannot allocate %d bytes\n\0"
+ "\t\t\t\t- default option for unnamed options\n\0"
+ "\t\t\t\t- disabled as --%s\n\0"
+ "\t\t\t\t- enabled by default\n\0"
+ "-equivalence\0"
+ "ERROR: only \0"
+ " - examining environment variables named %s_*\n\0"
+ " \0"
+ "Options are specified by doubled hyphens and their name\n"
+ "or by a single hyphen and the flag character.\n\0"
+ "%%-%ds %%s\n\0"
+ "fs error %d (%s) on fork - cannot obtain %s usage\n\0"
+ "File error %d (%s) opening %s for loading options\n\0"
+ "fs error %d (%s) reading file %s\n\0"
+ "\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n\0"
+ "\n"
+ "%s\n\n\0"
+ "=Cplx\0"
+ "[=arg]\0"
+ "--%2$s%1$s\0"
+ "%s: illegal option -- %c\n\0"
+ "%s: %s option -- %s\n\0"
+ "illegal\0"
+ "AutoOpts ERROR: invalid option descriptor for %s\n\0"
+ "words=\0"
+ "cooked\0"
+ "keep\0"
+ "type=\0"
+ "uncooked\0"
+ "integer\0"
+ "nested\0"
+ "string\0"
+ "bool\0"
+ "keyword\0"
+ "set\0"
+ "\t\t\t\t- is a set membership option\n\0"
+ "%s: option `%s' requires an argument\n\0"
+ "Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'\0"
+ "\t\t\t\t- must appear between %d and %d times\n\0"
+ "ERROR: The %s option is required\n\0"
+ "%s: option `%s' cannot have an argument\n\0"
+ "%s: Command line arguments not allowed\n\0"
+ "error %d (%s) creating %s\n\0"
+ "Options are specified by single or double hyphens and their name.\n\0"
+ "%s error: `%s' does not match any keywords\n\0"
+ "\t\t\t\t- may appear multiple times\n\0"
+ "\t\t\t\t- may not be preset\n\0"
+ " Arg Option-Name Description\n\0"
+ " Flg Arg Option-Name Description\n\0"
+ "error %d (%s) stat-ing %s\n\0"
+ "%s(optionRestore): error: no saved option state\n\0"
+ "none\0"
+ "'%s' not defined\n\0"
+ "ERROR: The %s option must appear %d times\n\0"
+ "error: cannot load options from non-regular file %s\n\0"
+ "%s error: `%s' is not a recognizable number\n\0"
+ " %3s %s\0"
+ "The '-#<number>' option may omit the hash char\n\0"
+ " \0"
+ "one %s%s option allowed\n\0"
+ "All arguments are named options.\n\0"
+ " - reading file %s\0"
+ "\n"
+ "please send bug reports to: %s\n\0"
+ "\t\t\t\t- may NOT appear - preset only\n\0"
+ "# preset/initialization file\n"
+ "# %s#\n\0"
+ "\n"
+ "The following option preset mechanisms are supported:\n\0"
+ "program\0"
+ "prohibits these options:\n\0"
+ "Operands and options may be intermixed. They will be reordered.\n\0"
+ "ERROR: %s option requires the %s option\n\0"
+ " %3s %-14s %s\0"
+ "requires these options:\n\0"
+ " Arg Option-Name Req? Description\n\0"
+ " Flg Arg Option-Name Req? Description\n\0"
+ "-_^\0"
+ "members=\0"
+ "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"
+ "%s\0"
+ " \0"
+ "T/F\0"
+ "\n"
+ "%s\n\n"
+ "%s\0"
+ "KWd\0"
+ "Mbr\0"
+ "Cpx\0"
+ "no \0"
+ "Num\0"
+ "opt\0"
+ "YES\0"
+ "Str\0"
+ "\t\t\t\t- \0"
+ "\t\t\t\t-- and \0"
+ "\t\t\t\t%s\n\0"
+ " \0"
+ " \0"
+ "\t\t\t\t- may appear up to %d times\n\0"
+ "The valid \"%s\" option keywords are:\n\0";
+
/*
* Now, define (and initialize) the structure that contains
* Aren't you glad you don't maintain this by hand?
*/
usage_text_t option_usage_text = {
- 114,
+ 113,
eng_zGnuBoolArg, eng_zGnuKeyArg, eng_zGnuKeyLArg, eng_zGnuNumArg,
eng_zGnuStrArg,
{
- eng_zAO_Bad, eng_zAO_Big, eng_zAO_Err,
- eng_zAO_Sml, eng_zAll, eng_zAlt,
- eng_zAmbigKey, eng_zAmbiguous, eng_zArgsMust,
- eng_zAtMost, eng_zAuto, eng_zBadPipe,
- eng_zBadVerArg, eng_zCantFmt, eng_zCantSave,
- eng_zDefaultOpt, eng_zDis, eng_zEnab,
- eng_zEquiv, eng_zErrOnly, eng_zExamineFmt,
- eng_zFiveSpaces, eng_zFlagOkay, eng_zFmtFmt,
- eng_zForkFail, eng_zFSErrOptLoad, eng_zFSErrReadFile,
- eng_zGenshell, eng_zGnuBreak, eng_zGnuNestArg,
- eng_zGnuOptArg, eng_zGnuOptFmt, eng_zHomePath,
- eng_zIllOptChr, eng_zIllOptStr, eng_zIllegal,
- eng_zInvalOptDesc, eng_zKeyWords, eng_zLoadCooked,
- eng_zLoadKeep, eng_zLoadType, eng_zLoadUncooked,
- eng_zLtypeInteger, eng_zLtypeNest, eng_zLtypeString,
- eng_zLtypeBool, eng_zLtypeKeyword, eng_zLtypeSetMembership,
- eng_zMembers, eng_zMisArg, eng_zMultiEquiv,
- eng_zMust, eng_zNeedOne, eng_zNoArg,
- eng_zNoArgs, eng_zNoCreat, eng_zNoFlags,
- eng_zNoKey, eng_zNoLim, eng_zNoPreset,
- eng_zNoRq_NoShrtTtl, eng_zNoRq_ShrtTtl, eng_zNoStat,
- eng_zNoState, eng_zNone, eng_zNotDef,
- eng_zNotEnough, eng_zNotFile, eng_zNotNumber,
- eng_zNrmOptFmt, eng_zNumberOpt, eng_zOneSpace,
- eng_zOnlyOne, eng_zOptsOnly, eng_zPathFmt,
- eng_zPlsSendBugs, eng_zPreset, eng_zPresetFile,
- eng_zPresetIntro, eng_zProg, eng_zProhib,
- eng_zReorder, eng_zReqFmt, eng_zReqOptFmt,
- eng_zReqThese, eng_zReq_NoShrtTtl, eng_zReq_ShrtTtl,
- eng_zSepChars, eng_zSetMembers, eng_zSetMemberSettings,
- eng_zShrtGnuOptFmt, eng_zSixSpaces, eng_zStdBoolArg,
- eng_zStdBreak, eng_zStdKeyArg, eng_zStdKeyLArg,
- eng_zStdNestArg, eng_zStdNoArg, eng_zStdNumArg,
- eng_zStdOptArg, eng_zStdReqArg, eng_zStdStrArg,
- eng_zTabHyp, eng_zTabHypAnd, eng_zTabout,
- eng_zThreeSpaces, eng_zTwoSpaces, eng_zUpTo,
- eng_zValidKeys
+ usage_txt + 0, usage_txt + 52, usage_txt + 98, usage_txt + 197,
+ usage_txt + 247, usage_txt + 251, usage_txt + 278, usage_txt + 320,
+ usage_txt + 330, usage_txt + 367, usage_txt + 396, usage_txt + 422,
+ usage_txt + 462, usage_txt + 599, usage_txt + 647, usage_txt + 701,
+ usage_txt + 743, usage_txt + 767, usage_txt + 793, usage_txt + 806,
+ usage_txt + 820, usage_txt + 867, usage_txt + 873, usage_txt + 976,
+ usage_txt + 988, usage_txt +1039, usage_txt +1090, usage_txt +1124,
+ usage_txt +1230, usage_txt +1236, usage_txt +1242, usage_txt +1249,
+ usage_txt +1260, usage_txt +1286, usage_txt +1307, usage_txt +1315,
+ usage_txt +1366, usage_txt +1373, usage_txt +1380, usage_txt +1385,
+ usage_txt +1391, usage_txt +1400, usage_txt +1408, usage_txt +1415,
+ usage_txt +1422, usage_txt +1427, usage_txt +1435, usage_txt +1439,
+ usage_txt +1473, usage_txt +1511, usage_txt +1576, usage_txt +1619,
+ usage_txt +1654, usage_txt +1695, usage_txt +1735, usage_txt +1762,
+ usage_txt +1829, usage_txt +1874, usage_txt +1907, usage_txt +1932,
+ usage_txt +1967, usage_txt +2005, usage_txt +2032, usage_txt +2081,
+ usage_txt +2086, usage_txt +2104, usage_txt +2148, usage_txt +2202,
+ usage_txt +2248, usage_txt +2256, usage_txt +2304, usage_txt +2306,
+ usage_txt +2331, usage_txt +2365, usage_txt +2384, usage_txt +2418,
+ usage_txt +2454, usage_txt +2492, usage_txt +2548, usage_txt +2556,
+ usage_txt +2582, usage_txt +2648, usage_txt +2690, usage_txt +2704,
+ usage_txt +2729, usage_txt +2769, usage_txt +2812, usage_txt +2816,
+ usage_txt +2825, usage_txt +3044, usage_txt +3047, usage_txt +3054,
+ usage_txt +3058, usage_txt +3066, usage_txt +3070, usage_txt +3074,
+ usage_txt +3078, usage_txt +3082, usage_txt +3086, usage_txt +3090,
+ usage_txt +3094, usage_txt +3098, usage_txt +3105, usage_txt +3117,
+ usage_txt +3125, usage_txt +3129, usage_txt +3132, usage_txt +3165
}
};
/* --- fake the preprocessor into handlng portability */
/*
- * Time-stamp: "2006-06-24 10:57:22 bkorb"
+ * Time-stamp: "2006-07-15 08:27:23 bkorb"
*
* Author: Gary V Vaughan <gvaughan@oranda.demon.co.uk>
* Created: Mon Jun 30 15:54:46 1997
*
- * $Id: compat.h,v 4.8 2006/06/24 23:34:51 bkorb Exp $
+ * $Id: compat.h,v 4.10 2006/07/15 22:10:21 bkorb Exp $
*/
-#ifndef COMPAT_H
-#define COMPAT_H 1
+#ifndef COMPAT_H_GUARD
+#define COMPAT_H_GUARD 1
-#ifndef HAVE_CONFIG_H
+#if defined(HAVE_CONFIG_H)
+# include <config.h>
+
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+# include "windows-config.h"
+
+#else
# error "compat.h" requires "config.h"
+ choke me.
#endif
-#include <config.h>
#ifndef HAVE_STRSIGNAL
char * strsignal( int signo );
# if ! defined(HAVE_SYS_POLL_H) && ! defined(HAVE_SYS_SELECT_H)
# error This system cannot support daemon processing
+ Choke Me.
# endif
# if HAVE_SYS_POLL_H
# include <libgen.h>
#endif
-#include <limits.h>
+#if defined(HAVE_LIMITS_H) /* this is also in options.h */
+# include <limits.h>
+#elif defined(HAVE_SYS_LIMITS_H)
+# include <sys/limits.h>
+#endif /* HAVE_LIMITS/SYS_LIMITS_H */
+
#include <memory.h>
#include <setjmp.h>
#include <signal.h>
#include <string.h>
#include <time.h>
-#include <utime.h>
+
+#ifndef __windows__
+# include <utime.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
typedef unsigned long uint32_t;
# else
# error Cannot create a uint32_t type.
+ Choke Me.
# endif
#endif
#define WORD_MIN INT_MIN
#endif
-#endif /* COMPAT_H */
+#endif /* COMPAT_H_GUARD */
/*
* Local Variables:
/*
* Author: Gary V Vaughan <gvaughan@oranda.demon.co.uk>
* Created: Tue Jun 24 15:07:31 1997
- * Last Modified: $Date: 2005/09/04 21:13:39 $
+ * Last Modified: $Date: 2006/07/15 22:10:21 $
* by: bkorb
*
- * $Id: pathfind.c,v 4.4 2005/09/04 21:13:39 bkorb Exp $
+ * $Id: pathfind.c,v 4.6 2006/07/15 22:10:21 bkorb Exp $
*/
/* Code: */
#include "compat.h"
#ifndef HAVE_PATHFIND
+#if defined(__windows__) && !defined(__CYGWIN__)
+char*
+pathfind( const char* path,
+ const char* fileName,
+ const char* mode )
+{
+ return NULL;
+}
+#else
static char* make_absolute( const char *string, const char *dot_path );
static char* canonicalize_pathname( char *path );
*p_index = ix;
return pzDir;
}
-
+#endif /* __windows__ / __CYGWIN__ */
#endif /* HAVE_PATHFIND */
/*
--- /dev/null
+#ifndef WINDOWS_CONFIG_HACKERY
+#define WINDOWS_CONFIG_HACKERY 1
+
+/*
+ * The definitions below have been stolen from NTP's config.h for Windows.
+ * However, they may be kept here in order to keep libopts independent from
+ * the NTP project.
+ */
+#ifndef __windows__
+# define __windows__ 4
+#endif
+
+/*
+ * Miscellaneous functions that Microsoft maps
+ * to other names
+ *
+ * #define inline __inline
+ * #define vsnprintf _vsnprintf
+ */
+#define snprintf _snprintf
+/*
+ * #define stricmp _stricmp
+ * #define strcasecmp _stricmp
+ * #define isascii __isascii
+ * #define finite _finite
+ * #define random rand
+ * #define srandom srand
+ */
+
+#define SIZEOF_INT 4
+
+/*
+ * # define HAVE_NET_IF_H
+ * # define QSORT_USES_VOID_P
+ * # define HAVE_SETVBUF
+ * # define HAVE_VSPRINTF
+ * # define HAVE_SNPRINTF
+ * # define HAVE_VSNPRINTF
+ * # define HAVE_PROTOTYPES /* from ntpq.mak * /
+ * # define HAVE_MEMMOVE
+ * # define HAVE_TERMIOS_H
+ * # define HAVE_ERRNO_H
+ * # define HAVE_STDARG_H
+ * # define HAVE_NO_NICE
+ * # define HAVE_MKTIME
+ * # define TIME_WITH_SYS_TIME
+ * # define HAVE_IO_COMPLETION_PORT
+ * # define ISC_PLATFORM_NEEDNTOP
+ * # define ISC_PLATFORM_NEEDPTON
+ * # define NEED_S_CHAR_TYPEDEF
+ * # define USE_PROTOTYPES /* for ntp_types.h * /
+ *
+ * #define ULONG_CONST(a) a ## UL
+ */
+
+#define HAVE_LIMITS_H 1
+#define HAVE_STRDUP 1
+#define HAVE_STRCHR 1
+#define HAVE_FCNTL_H 1
+
+/*
+ * VS.NET's version of wspiapi.h has a bug in it
+ * where it assigns a value to a variable inside
+ * an if statement. It should be comparing them.
+ * We prevent inclusion since we are not using this
+ * code so we don't have to see the warning messages
+ */
+#ifndef _WSPIAPI_H_
+#define _WSPIAPI_H_
+#endif
+
+/* Prevent inclusion of winsock.h in windows.h */
+#ifndef _WINSOCKAPI_
+#define _WINSOCKAPI_
+#endif
+
+#ifndef __RPCASYNC_H__
+#define __RPCASYNC_H__
+#endif
+
+/* Include Windows headers */
+#include <windows.h>
+#include <winsock2.h>
+
+/*
+ * Compatibility declarations for Windows, assuming SYS_WINNT
+ * has been defined.
+ */
+#define strdup _strdup
+#define stat _stat /* struct stat from <sys/stat.h> */
+#define unlink _unlink
+#define fchmod( _x, _y );
+#define ssize_t SSIZE_T
+
+#include <io.h>
+#define open _open
+#define close _close
+#define read _read
+#define write _write
+#define lseek _lseek
+#define pipe _pipe
+#define dup2 _dup2
+
+#define O_RDWR _O_RDWR
+#define O_RDONLY _O_RDONLY
+#define O_EXCL _O_EXCL
+
+#ifndef S_ISREG
+# define S_IFREG _S_IFREG
+# define S_ISREG(mode) (((mode) & S_IFREG) == S_IFREG)
+#endif
+
+#ifndef S_ISDIR
+# define S_IFDIR _S_IFDIR
+# define S_ISDIR(mode) (((mode) & S_IFDIR) == S_IFDIR)
+#endif
+
+#endif /* WINDOWS_CONFIG_HACKERY */
/*
- * $Id: configfile.c,v 4.22 2006/06/24 23:34:51 bkorb Exp $
+ * $Id: configfile.c,v 4.23 2006/07/01 21:57:23 bkorb Exp $
* Time-stamp: "2006-07-01 12:46:31 bkorb"
*
* configuration/rc/ini file handling.
*
* DO NOT EDIT THIS FILE (genshell.c)
*
- * It has been AutoGen-ed Sunday April 9, 2006 at 11:49:19 AM PDT
+ * It has been AutoGen-ed Saturday July 22, 2006 at 08:36:53 AM PDT
* From the definitions genshell.def
* and the template file options
*/
+/*
+ * This file was produced by an AutoOpts template. AutoOpts is a
+ * copyrighted work. This source file is not encumbered by AutoOpts
+ * licensing, but is provided under the licensing terms chosen by the
+ * genshellopt author or copyright holder. AutoOpts is licensed under
+ * the terms of the LGPL. The redistributable library (``libopts'') is
+ * licensed under the terms of either the LGPL or, at the users discretion,
+ * the BSD license. See the AutoOpts and/or libopts sources for details.
+ *
+ * This source file is copyrighted and licensed under the following terms:
+ *
+ * genshellopt copyright 1999-2006 Bruce Korb - all rights reserved
+ *
+ * genshellopt 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.
+ *
+ * genshellopt 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 genshellopt. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+
#define OPTION_CODE_COMPILE 1
#include "genshell.h"
#define zRcName NULL
#define apzHomeList NULL
-tSCC zBugsAddr[] = "autogen-users@lists.sf.net";
+tSCC zBugsAddr[] = "autogen-users@lists.sourceforge.net";
tSCC zExplain[] = "\n\
Note that `shell' is only useful if the output file does not already\n\
exist. If it does, then the shell name and optional first argument\n\
text, the second line of the file through the ending tag will be replaced\n\
by the newly generated text. The first `#!' line will be regenerated.\n";
tSCC zFullVersion[] = GENSHELLOPT_FULL_VERSION;
-/* extracted from optcode near line 321 */
+/* extracted from optcode near line 368 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
{
USAGE( EXIT_SUCCESS );
}
-/* extracted from optcode near line 418 */
+/* extracted from optcode near line 465 */
#if ENABLE_NLS
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <autoopts/usage-txt.h>
+static char* AO_gettext( const char* pz );
+static void coerce_it(void** s);
+
static char*
AO_gettext( const char* pz )
{
return pzRes;
}
+static void coerce_it(void** s) { *s = AO_gettext(*s); }
+#define COERSION(_f) \
+ coerce_it((void*)&(genshelloptOptions._f))
+
/*
* This invokes the translation code (e.g. gettext(3)).
*/
pOD++;
}
}
- genshelloptOptions.pzCopyright = AO_gettext(genshelloptOptions.pzCopyright);
- genshelloptOptions.pzCopyNotice = AO_gettext(genshelloptOptions.pzCopyNotice);
- genshelloptOptions.pzFullVersion = AO_gettext(genshelloptOptions.pzFullVersion);
- genshelloptOptions.pzUsageTitle = AO_gettext(genshelloptOptions.pzUsageTitle);
- genshelloptOptions.pzExplain = AO_gettext(genshelloptOptions.pzExplain);
- genshelloptOptions.pzDetail = AO_gettext(genshelloptOptions.pzDetail);
+ COERSION(pzCopyright);
+ COERSION(pzCopyNotice);
+ COERSION(pzFullVersion);
+ COERSION(pzUsageTitle);
+ COERSION(pzExplain);
+ COERSION(pzDetail);
}
#endif /* ENABLE_NLS */
*
* DO NOT EDIT THIS FILE (genshell.h)
*
- * It has been AutoGen-ed Sunday April 9, 2006 at 11:49:19 AM PDT
+ * It has been AutoGen-ed Saturday July 22, 2006 at 08:36:53 AM PDT
* From the definitions genshell.def
* and the template file options
*/
-/*
- * This file contains the programmatic interface to the Automated
- * Options generated for the genshellopt program.
- * These macros are documented in the AutoGen info file in the
- * "AutoOpts" chapter. Please refer to that doc for usage help.
- */
-#ifndef AUTOOPTS_GENSHELL_H_GUARD
-#define AUTOOPTS_GENSHELL_H_GUARD
/*
+ * This file was produced by an AutoOpts template. AutoOpts is a
+ * copyrighted work. This header file is not encumbered by AutoOpts
+ * licensing, but is provided under the licensing terms chosen by the
+ * genshellopt author or copyright holder. AutoOpts is licensed under
+ * the terms of the LGPL. The redistributable library (``libopts'') is
+ * licensed under the terms of either the LGPL or, at the users discretion,
+ * the BSD license. See the AutoOpts and/or libopts sources for details.
+ *
+ * This source file is copyrighted and licensed under the following terms:
+ *
* genshellopt copyright 1999-2006 Bruce Korb - all rights reserved
*
* genshellopt is free software; you can redistribute it and/or
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301, USA.
*/
+/*
+ * This file contains the programmatic interface to the Automated
+ * Options generated for the genshellopt program.
+ * These macros are documented in the AutoGen info file in the
+ * "AutoOpts" chapter. Please refer to that doc for usage help.
+ */
+#ifndef AUTOOPTS_GENSHELL_H_GUARD
+#define AUTOOPTS_GENSHELL_H_GUARD
#include <autoopts/options.h>
/*
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
+ Choke Me.
#endif
/*
genshelloptOptions.pzCurOpt = NULL )
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*genshelloptOptions.pUsageProc)( &genshelloptOptions, c )
-/* extracted from opthead near line 289 */
+/* extracted from opthead near line 288 */
/* * * * * *
*
#define AUTOOPTS_INTERNAL
#include "compat/compat.h"
-#define HAVE_LIBSNPRINTFV
#define LOCAL static
#include "autoopts/options.h"
#include "autoopts/usage-txt.h"
/*
- * $Id: load.c,v 4.22 2006/06/24 23:34:51 bkorb Exp $
+ * $Id: load.c,v 4.23 2006/07/01 21:57:23 bkorb Exp $
* Time-stamp: "2006-07-01 12:43:03 bkorb"
*
* This file contains the routines that deal with processing text strings
dnl
dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed Saturday July 1, 2006 at 02:52:02 PM PDT
+dnl It has been AutoGen-ed Saturday July 22, 2006 at 08:36:51 AM PDT
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
/*
- * $Id: makeshell.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
- * Time-stamp: "2006-06-24 10:47:07 bkorb"
+ * $Id: makeshell.c,v 4.13 2006/07/15 22:10:21 bkorb Exp $
+ * Time-stamp: "2006-07-15 08:18:01 bkorb"
*
* This module will interpret the options set in the tOptions
* structure and create a Bourne shell script capable of parsing them.
static void
textToVariable( tOptions* pOpts, teTextTo whichVar, tOptDesc* pOD )
{
+#if defined(__windows__) && !defined(__CYGWIN__)
+ printf( "%1$s_%2$s_TEXT='no %2$s text'\n",
+ pOpts->pzPROGNAME, apzTTNames[ whichVar ]);
+#else
int nlHoldCt = 0;
int pipeFd[2];
FILE* fp;
fputs( "'\n\n", stdout );
close( pipeFd[0] );
+#endif
}
void
genshelloptUsage( tOptions* pOpts, int exitCode )
{
+#if defined(__windows__) && !defined(__CYGWIN__)
+ optionUsage( pOpts, exitCode );
+#else
/*
* IF not EXIT_SUCCESS,
* THEN emit the short form of usage.
}
exit( EXIT_SUCCESS );
+#endif
}
/*
/*
- * $Id: pgusage.c,v 4.9 2006/06/24 23:34:51 bkorb Exp $
- * Time-stamp: "2006-06-24 10:48:00 bkorb"
+ * $Id: pgusage.c,v 4.12 2006/07/16 15:27:50 bkorb Exp $
+ * Time-stamp: "2006-07-16 08:13:26 bkorb"
*
* Automated Options Paged Usage module.
*
void
optionPagedUsage( tOptions* pOptions, tOptDesc* pOD )
{
+#if defined(__windows__) && !defined(__CYGWIN__)
+ (*pOptions->pUsageProc)( pOptions, EXIT_SUCCESS );
+#else
static pid_t my_pid;
char zPageUsage[ 1024 ];
fclose( stderr );
dup2( STDOUT_FILENO, STDERR_FILENO );
- system( zPageUsage );
+ (void)system( zPageUsage );
}
case PAGER_STATE_CHILD:
*/
break;
}
+#endif
}
/*
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Sat Jul 1 14:52:42 PDT 2006
+ * Generated Sat Jul 22 08:37:30 PDT 2006
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1
/*
- * $Id: putshell.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
- * Time-stamp: "2006-06-24 14:29:07 bkorb"
+ * $Id: putshell.c,v 4.12 2006/07/16 15:27:50 bkorb Exp $
+ * Time-stamp: "2006-07-16 08:13:24 bkorb"
*
* This module will interpret the options set in the tOptions
* structure and print them to standard out in a fashion that
/*
* Emit the string up to the single quote (apostrophe) we just found.
*/
- fwrite( pzStr, (unsigned)(pz - pzStr), 1, stdout );
+ (void)fwrite( pzStr, (unsigned)(pz - pzStr), 1, stdout );
fputc( '\'', stdout );
pzStr = pz;
/*
- * save.c $Id: save.c,v 4.14 2006/06/24 23:34:51 bkorb Exp $
- * Time-stamp: "2006-07-01 12:41:27 bkorb"
+ * save.c $Id: save.c,v 4.16 2006/07/16 15:27:50 bkorb Exp $
+ * Time-stamp: "2006-07-16 08:13:22 bkorb"
*
* This module's routines will take the currently set options and
* store them into an ".rc" file for re-interpretation the next
/*
* Print the continuation and the text from the current line
*/
- fwrite( pzLA, (unsigned)(pzNl - pzLA), 1, fp );
+ (void)fwrite( pzLA, (unsigned)(pzNl - pzLA), 1, fp );
pzLA = pzNl+1; /* advance the Last Arg pointer */
fputs( "\\\n", fp );
}
/*
* stack.c
- * $Id: stack.c,v 4.8 2006/03/25 19:23:28 bkorb Exp $
- * Time-stamp: "2006-07-01 14:35:13 bkorb"
+ * $Id: stack.c,v 4.10 2006/07/14 04:20:17 bkorb Exp $
+ * Time-stamp: "2006-07-13 21:11:29 bkorb"
*
* This is a special option processing routine that will save the
* argument to an option in a FIFO queue.
* If you do not wish that, delete this exception notice.
*/
-#include REGEX_HEADER
+#ifdef WITH_LIBREGEX
+# include REGEX_HEADER
+#endif
/*=export_func optionUnstackArg
* private:
/*
- * usage.c $Id: usage.c,v 4.13 2006/06/24 23:34:51 bkorb Exp $
+ * usage.c $Id: usage.c,v 4.14 2006/07/01 21:57:23 bkorb Exp $
* Time-stamp: "2006-07-01 12:41:02 bkorb"
*
* This module implements the default usage procedure for
lib_LTLIBRARIES = libopts.la
libopts_la_SOURCES = libopts.c
libopts_la_CPPFLAGS = -I$(top_srcdir)
-libopts_la_LDFLAGS = -version-info 27:3:2
+libopts_la_LDFLAGS = -version-info 27:4:2
EXTRA_DIST = \
- COPYING.lgpl COPYING.mbsd MakeDefs.inc \
- README autoopts/options.h autoopts/usage-txt.h \
- autoopts.c autoopts.h boolean.c \
- compat/compat.h compat/pathfind.c compat/snprintf.c \
- compat/strdup.c compat/strchr.c configfile.c \
- cook.c enumeration.c environment.c \
- genshell.c genshell.h load.c \
- m4/libopts.m4 m4/liboptschk.m4 makeshell.c \
- nested.c numeric.c pgusage.c \
- proto.h putshell.c restore.c \
- save.c sort.c stack.c \
- streqvcmp.c text_mmap.c tokenize.c \
- usage.c version.c
+ COPYING.lgpl COPYING.mbsd MakeDefs.inc \
+ README autoopts/options.h autoopts/usage-txt.h \
+ autoopts.c autoopts.h boolean.c \
+ compat/windows-config.h compat/compat.h compat/pathfind.c \
+ compat/snprintf.c compat/strdup.c compat/strchr.c \
+ configfile.c cook.c enumeration.c \
+ environment.c genshell.c genshell.h \
+ load.c m4/libopts.m4 m4/liboptschk.m4 \
+ makeshell.c nested.c numeric.c \
+ pgusage.c proto.h putshell.c \
+ restore.c save.c sort.c \
+ stack.c streqvcmp.c text_mmap.c \
+ tokenize.c usage.c version.c
/*
- * $Id: autoopts.c,v 4.20 2006/06/24 23:34:51 bkorb Exp $
- * Time-stamp: "2006-07-01 14:41:46 bkorb"
+ * $Id: autoopts.c,v 4.22 2006/07/15 22:10:21 bkorb Exp $
+ * Time-stamp: "2006-07-15 13:54:08 bkorb"
*
* This file contains all of the routines that must be linked into
* an executable to use the generated option processing. The optional
# include "compat/pathfind.c"
#endif
-#ifndef HAVE_LIBSNPRINTFV
-# ifndef HAVE_SNPRINTF
-# include "compat/snprintf.c"
-# endif
+#ifndef HAVE_SNPRINTF
+# include "compat/snprintf.c"
+#endif
-# ifndef HAVE_STRDUP
-# include "compat/strdup.c"
-# endif
+#ifndef HAVE_STRDUP
+# include "compat/strdup.c"
#endif
#ifndef HAVE_STRCHR
/*
- * Time-stamp: "2006-07-01 14:40:47 bkorb"
+ * Time-stamp: "2006-07-15 13:52:50 bkorb"
*
- * autoopts.h $Id: autoopts.h,v 4.22 2006/06/24 23:34:51 bkorb Exp $
+ * autoopts.h $Id: autoopts.h,v 4.25 2006/07/15 22:10:21 bkorb Exp $
* Time-stamp: "2005-02-14 05:59:50 bkorb"
*
* This file defines all the global structures and special values
#undef EXPORT
#define EXPORT
-#if defined(_WIN32)
-# define DIRch '\\'
+#if defined(_WIN32) && !defined(__CYGWIN__)
+# define DIRCH '\\'
#else
# define DIRCH '/'
#endif
* USAGE: define procedures to return "tSuccess". Test their results
* with the SUCCEEDED, FAILED and HADGLITCH macros.
*/
+#undef SUCCESS
#define SUCCESS ((tSuccess) 0)
+#undef FAILURE
#define FAILURE ((tSuccess)-1)
+#undef PROBLEM
#define PROBLEM ((tSuccess) 1)
typedef int tSuccess;
# define AGDUPSTR( p, s, w ) p = strdup( s )
# define TAGMEM( m, t )
-#ifdef AUTOGEN_BUILD
-# include <snprintfv/printf.h>
-#endif /* AUTOGEN_BUILD */
-
/*
* DO option handling?
*
*
* DO NOT EDIT THIS FILE (options.h)
*
- * It has been AutoGen-ed Sunday April 9, 2006 at 11:49:19 AM PDT
+ * It has been AutoGen-ed Saturday July 22, 2006 at 08:36:53 AM PDT
* From the definitions funcs.def
* and the template file options_h
*
/*
* Bits in the fOptState option descriptor field.
*/
-#define OPTST_INIT 0x0000000 /* Initial compiled value */
-#define OPTST_SET 0x0000001 /* Set via the "SET_OPT()" macro */
-#define OPTST_PRESET 0x0000002 /* Set via an RC/INI file */
-#define OPTST_DEFINED 0x0000004 /* Set via a command line option */
+#define OPTST_INIT 0x0000000U /* Initial compiled value */
+#define OPTST_SET 0x0000001U /* Set via the "SET_OPT()" macro */
+#define OPTST_PRESET 0x0000002U /* Set via an RC/INI file */
+#define OPTST_DEFINED 0x0000004U /* Set via a command line option */
-#define OPTST_SET_MASK 0x0000007 /* mask of flags that show set state */
+#define OPTST_SET_MASK 0x0000007U /* mask of flags that show set state */
-#define OPTST_EQUIVALENCE 0x0000010 /* selected by equiv'ed option */
-#define OPTST_DISABLED 0x0000020 /* option is in disabled state */
+#define OPTST_EQUIVALENCE 0x0000010U /* selected by equiv'ed option */
+#define OPTST_DISABLED 0x0000020U /* option is in disabled state */
-#define OPTST_NO_INIT 0x0000100 /* option cannot be preset */
-#define OPTST_NUMBER_OPT 0x0000200 /* opt value (flag) is any digit */
-#define OPTST_STACKED 0x0000400 /* opt uses optionStackArg procedure */
-#define OPTST_INITENABLED 0x0000800 /* option defaults to enabled */
-#define OPTST_ARG_TYPE_MASK 0x000F000 /* bits used to specify opt arg type */
-#define OPTST_ARG_OPTIONAL 0x0010000 /* the option argument not required */
-#define OPTST_IMM 0x0020000 /* process option on first pass */
-#define OPTST_DISABLE_IMM 0x0040000 /* process disablement on first pass */
-#define OPTST_OMITTED 0x0080000 /* compiled out of program */
-#define OPTST_MUST_SET 0x0100000 /* must be set or pre-set */
-#define OPTST_DOCUMENT 0x0200000 /* opt is for documentation only */
-#define OPTST_TWICE 0x0400000 /* process option twice - imm + reg */
-#define OPTST_DISABLE_TWICE 0x0800000 /* process disabled option twice */
+#define OPTST_NO_INIT 0x0000100U /* option cannot be preset */
+#define OPTST_NUMBER_OPT 0x0000200U /* opt value (flag) is any digit */
+#define OPTST_STACKED 0x0000400U /* opt uses optionStackArg procedure */
+#define OPTST_INITENABLED 0x0000800U /* option defaults to enabled */
+#define OPTST_ARG_TYPE_MASK 0x000F000U /* bits used to specify opt arg type */
+#define OPTST_ARG_OPTIONAL 0x0010000U /* the option argument not required */
+#define OPTST_IMM 0x0020000U /* process option on first pass */
+#define OPTST_DISABLE_IMM 0x0040000U /* process disablement on first pass */
+#define OPTST_OMITTED 0x0080000U /* compiled out of program */
+#define OPTST_MUST_SET 0x0100000U /* must be set or pre-set */
+#define OPTST_DOCUMENT 0x0200000U /* opt is for documentation only */
+#define OPTST_TWICE 0x0400000U /* process option twice - imm + reg */
+#define OPTST_DISABLE_TWICE 0x0800000U /* process disabled option twice */
-#define OPTST_PERSISTENT 0xFFFFF00 /* mask of flags that do not change */
+#define OPTST_PERSISTENT 0xFFFFF00U /* mask of flags that do not change */
#define SELECTED_OPT( pod ) ( (pod)->fOptState & (OPTST_SET | OPTST_DEFINED))
#define UNUSED_OPT( pod ) (((pod)->fOptState & OPTST_SET_MASK) == 0)
*/
typedef struct optSpecIndex tOptSpecIndex;
struct optSpecIndex {
- tAoUS more_help;
- tAoUS save_opts;
- tAoUS number_option;
- tAoUS default_opt;
+ const tAoUS more_help;
+ const tAoUS save_opts;
+ const tAoUS number_option;
+ const tAoUS default_opt;
};
#define OPTIONS_STRUCT_VERSION 110594
-#define OPTIONS_VERSION_STRING "27:1:2"
+#define OPTIONS_VERSION_STRING "27:4:2"
#define OPTIONS_MINIMUM_VERSION 102400
#define OPTIONS_MIN_VER_STRING "25:0:0"
typedef void (tOptionXlateProc)(void);
struct options {
- const int structVersion;
- int origArgCt;
- char** origArgVect;
- unsigned int fOptSet;
- unsigned int curOptIdx;
- char* pzCurOpt;
-
- const char* pzProgPath;
- const char* pzProgName;
- const char* pzPROGNAME;
- const char* pzRcName;
- const char* pzCopyright;
- const char* pzCopyNotice;
- const char* pzFullVersion;
- const char** papzHomeList;
- const char* pzUsageTitle;
- const char* pzExplain;
- const char* pzDetail;
- tOptDesc* pOptDesc;
- const char* pzBugAddr;
-
- void* pExtensions;
- void* pSavedState;
-
- tpUsageProc pUsageProc;
- tOptionXlateProc* pTransProc;
-
- tOptSpecIndex specOptIdx;
- const int optCt;
- const int presetOptCt;
+ const int structVersion;
+ int origArgCt;
+ char** origArgVect;
+ unsigned int fOptSet;
+ unsigned int curOptIdx;
+ char* pzCurOpt;
+
+ const char* pzProgPath;
+ const char* pzProgName;
+ const char* const pzPROGNAME;
+ const char* const pzRcName;
+ const char* const pzCopyright;
+ const char* const pzCopyNotice;
+ const char* const pzFullVersion;
+ const char* const* papzHomeList;
+ const char* const pzUsageTitle;
+ const char* const pzExplain;
+ const char* const pzDetail;
+ tOptDesc* const pOptDesc;
+ const char* const pzBugAddr;
+
+ void* pExtensions;
+ void* pSavedState;
+
+ tpUsageProc pUsageProc;
+ tOptionXlateProc* pTransProc;
+
+ tOptSpecIndex specOptIdx;
+ const int optCt;
+ const int presetOptCt;
};
/*
extern void optionOnlyUsage( tOptions*, int );
-/* From: autoopts.c line 934
+/* From: autoopts.c line 936
*
* optionProcess - this is the main option processing routine
*
extern const char* optionVersion( void );
-/* From: ../compat/pathfind.c line 24
+/* From: ../compat/pathfind.c line 33
*
* pathfind - fild a file in a list of directories
*
extern unsigned int ao_string_cook_escape_char( const char*, char*, u_int );
+extern void export_options_to_guile( tOptions* );
+
extern void genshelloptUsage( tOptions*, int );
extern void optionBooleanVal( tOptions*, tOptDesc* );
*
* DO NOT EDIT THIS FILE (usage-txt.h)
*
- * It has been AutoGen-ed Sunday April 9, 2006 at 11:49:19 AM PDT
+ * It has been AutoGen-ed Saturday July 22, 2006 at 08:36:51 AM PDT
* 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 114
+ * tiny strings used by the AutoOpts library. There are 113
* 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
char* utpz_GnuKeyLArg;
char* utpz_GnuNumArg;
char* utpz_GnuStrArg;
- cch_t* apz_str[ 109 ];
+ cch_t* apz_str[ 108 ];
} usage_text_t;
/*
/*
* Provide a mapping from a short name to fields in this structure.
*/
-#define zAO_Bad (option_usage_text.apz_str[0])
-#define zAO_Big (option_usage_text.apz_str[1])
-#define zAO_Err (option_usage_text.apz_str[2])
-#define zAO_Sml (option_usage_text.apz_str[3])
-#define zAll (option_usage_text.apz_str[4])
-#define zAlt (option_usage_text.apz_str[5])
-#define zAmbigKey (option_usage_text.apz_str[6])
-#define zAmbiguous (option_usage_text.apz_str[7])
-#define zArgsMust (option_usage_text.apz_str[8])
-#define zAtMost (option_usage_text.apz_str[9])
-#define zAuto (option_usage_text.apz_str[10])
-#define zBadPipe (option_usage_text.apz_str[11])
-#define zBadVerArg (option_usage_text.apz_str[12])
-#define zCantFmt (option_usage_text.apz_str[13])
-#define zCantSave (option_usage_text.apz_str[14])
-#define zDefaultOpt (option_usage_text.apz_str[15])
-#define zDis (option_usage_text.apz_str[16])
-#define zEnab (option_usage_text.apz_str[17])
-#define zEquiv (option_usage_text.apz_str[18])
-#define zErrOnly (option_usage_text.apz_str[19])
-#define zExamineFmt (option_usage_text.apz_str[20])
-#define zFiveSpaces (option_usage_text.apz_str[21])
-#define zFlagOkay (option_usage_text.apz_str[22])
-#define zFmtFmt (option_usage_text.apz_str[23])
-#define zForkFail (option_usage_text.apz_str[24])
-#define zFSErrOptLoad (option_usage_text.apz_str[25])
-#define zFSErrReadFile (option_usage_text.apz_str[26])
-#define zGenshell (option_usage_text.apz_str[27])
+#define zAO_Bad (option_usage_text.apz_str[ 0])
+#define zAO_Big (option_usage_text.apz_str[ 1])
+#define zAO_Err (option_usage_text.apz_str[ 2])
+#define zAO_Sml (option_usage_text.apz_str[ 3])
+#define zAll (option_usage_text.apz_str[ 4])
+#define zAlt (option_usage_text.apz_str[ 5])
+#define zAmbigKey (option_usage_text.apz_str[ 6])
+#define zAmbiguous (option_usage_text.apz_str[ 7])
+#define zArgsMust (option_usage_text.apz_str[ 8])
+#define zAtMost (option_usage_text.apz_str[ 9])
+#define zAuto (option_usage_text.apz_str[ 10])
+#define zBadPipe (option_usage_text.apz_str[ 11])
+#define zBadVerArg (option_usage_text.apz_str[ 12])
+#define zCantFmt (option_usage_text.apz_str[ 13])
+#define zCantSave (option_usage_text.apz_str[ 14])
+#define zDefaultOpt (option_usage_text.apz_str[ 15])
+#define zDis (option_usage_text.apz_str[ 16])
+#define zEnab (option_usage_text.apz_str[ 17])
+#define zEquiv (option_usage_text.apz_str[ 18])
+#define zErrOnly (option_usage_text.apz_str[ 19])
+#define zExamineFmt (option_usage_text.apz_str[ 20])
+#define zFiveSpaces (option_usage_text.apz_str[ 21])
+#define zFlagOkay (option_usage_text.apz_str[ 22])
+#define zFmtFmt (option_usage_text.apz_str[ 23])
+#define zForkFail (option_usage_text.apz_str[ 24])
+#define zFSErrOptLoad (option_usage_text.apz_str[ 25])
+#define zFSErrReadFile (option_usage_text.apz_str[ 26])
+#define zGenshell (option_usage_text.apz_str[ 27])
#define zGnuBoolArg (option_usage_text.utpz_GnuBoolArg)
-#define zGnuBreak (option_usage_text.apz_str[28])
+#define zGnuBreak (option_usage_text.apz_str[ 28])
#define zGnuKeyArg (option_usage_text.utpz_GnuKeyArg)
#define zGnuKeyLArg (option_usage_text.utpz_GnuKeyLArg)
-#define zGnuNestArg (option_usage_text.apz_str[29])
+#define zGnuNestArg (option_usage_text.apz_str[ 29])
#define zGnuNumArg (option_usage_text.utpz_GnuNumArg)
-#define zGnuOptArg (option_usage_text.apz_str[30])
-#define zGnuOptFmt (option_usage_text.apz_str[31])
+#define zGnuOptArg (option_usage_text.apz_str[ 30])
+#define zGnuOptFmt (option_usage_text.apz_str[ 31])
#define zGnuStrArg (option_usage_text.utpz_GnuStrArg)
-#define zHomePath (option_usage_text.apz_str[32])
-#define zIllOptChr (option_usage_text.apz_str[33])
-#define zIllOptStr (option_usage_text.apz_str[34])
-#define zIllegal (option_usage_text.apz_str[35])
-#define zInvalOptDesc (option_usage_text.apz_str[36])
-#define zKeyWords (option_usage_text.apz_str[37])
-#define zLoadCooked (option_usage_text.apz_str[38])
-#define zLoadKeep (option_usage_text.apz_str[39])
-#define zLoadType (option_usage_text.apz_str[40])
-#define zLoadUncooked (option_usage_text.apz_str[41])
-#define zLtypeInteger (option_usage_text.apz_str[42])
-#define zLtypeNest (option_usage_text.apz_str[43])
-#define zLtypeString (option_usage_text.apz_str[44])
-#define zLtypeBool (option_usage_text.apz_str[45])
-#define zLtypeKeyword (option_usage_text.apz_str[46])
-#define zLtypeSetMembership (option_usage_text.apz_str[47])
-#define zMembers (option_usage_text.apz_str[48])
-#define zMisArg (option_usage_text.apz_str[49])
-#define zMultiEquiv (option_usage_text.apz_str[50])
-#define zMust (option_usage_text.apz_str[51])
-#define zNeedOne (option_usage_text.apz_str[52])
-#define zNoArg (option_usage_text.apz_str[53])
-#define zNoArgs (option_usage_text.apz_str[54])
-#define zNoCreat (option_usage_text.apz_str[55])
-#define zNoFlags (option_usage_text.apz_str[56])
-#define zNoKey (option_usage_text.apz_str[57])
-#define zNoLim (option_usage_text.apz_str[58])
-#define zNoPreset (option_usage_text.apz_str[59])
-#define zNoRq_NoShrtTtl (option_usage_text.apz_str[60])
-#define zNoRq_ShrtTtl (option_usage_text.apz_str[61])
-#define zNoStat (option_usage_text.apz_str[62])
-#define zNoState (option_usage_text.apz_str[63])
-#define zNone (option_usage_text.apz_str[64])
-#define zNotDef (option_usage_text.apz_str[65])
-#define zNotEnough (option_usage_text.apz_str[66])
-#define zNotFile (option_usage_text.apz_str[67])
-#define zNotNumber (option_usage_text.apz_str[68])
-#define zNrmOptFmt (option_usage_text.apz_str[69])
-#define zNumberOpt (option_usage_text.apz_str[70])
-#define zOneSpace (option_usage_text.apz_str[71])
-#define zOnlyOne (option_usage_text.apz_str[72])
-#define zOptsOnly (option_usage_text.apz_str[73])
-#define zPathFmt (option_usage_text.apz_str[74])
-#define zPlsSendBugs (option_usage_text.apz_str[75])
-#define zPreset (option_usage_text.apz_str[76])
-#define zPresetFile (option_usage_text.apz_str[77])
-#define zPresetIntro (option_usage_text.apz_str[78])
-#define zProg (option_usage_text.apz_str[79])
-#define zProhib (option_usage_text.apz_str[80])
-#define zReorder (option_usage_text.apz_str[81])
-#define zReqFmt (option_usage_text.apz_str[82])
-#define zReqOptFmt (option_usage_text.apz_str[83])
-#define zReqThese (option_usage_text.apz_str[84])
-#define zReq_NoShrtTtl (option_usage_text.apz_str[85])
-#define zReq_ShrtTtl (option_usage_text.apz_str[86])
-#define zSepChars (option_usage_text.apz_str[87])
-#define zSetMembers (option_usage_text.apz_str[88])
-#define zSetMemberSettings (option_usage_text.apz_str[89])
-#define zShrtGnuOptFmt (option_usage_text.apz_str[90])
-#define zSixSpaces (option_usage_text.apz_str[91])
-#define zStdBoolArg (option_usage_text.apz_str[92])
-#define zStdBreak (option_usage_text.apz_str[93])
-#define zStdKeyArg (option_usage_text.apz_str[94])
-#define zStdKeyLArg (option_usage_text.apz_str[95])
-#define zStdNestArg (option_usage_text.apz_str[96])
-#define zStdNoArg (option_usage_text.apz_str[97])
-#define zStdNumArg (option_usage_text.apz_str[98])
-#define zStdOptArg (option_usage_text.apz_str[99])
-#define zStdReqArg (option_usage_text.apz_str[100])
-#define zStdStrArg (option_usage_text.apz_str[101])
-#define zTabHyp (option_usage_text.apz_str[102])
-#define zTabHypAnd (option_usage_text.apz_str[103])
-#define zTabout (option_usage_text.apz_str[104])
-#define zThreeSpaces (option_usage_text.apz_str[105])
-#define zTwoSpaces (option_usage_text.apz_str[106])
-#define zUpTo (option_usage_text.apz_str[107])
-#define zValidKeys (option_usage_text.apz_str[108])
+#define zIllOptChr (option_usage_text.apz_str[ 32])
+#define zIllOptStr (option_usage_text.apz_str[ 33])
+#define zIllegal (option_usage_text.apz_str[ 34])
+#define zInvalOptDesc (option_usage_text.apz_str[ 35])
+#define zKeyWords (option_usage_text.apz_str[ 36])
+#define zLoadCooked (option_usage_text.apz_str[ 37])
+#define zLoadKeep (option_usage_text.apz_str[ 38])
+#define zLoadType (option_usage_text.apz_str[ 39])
+#define zLoadUncooked (option_usage_text.apz_str[ 40])
+#define zLtypeInteger (option_usage_text.apz_str[ 41])
+#define zLtypeNest (option_usage_text.apz_str[ 42])
+#define zLtypeString (option_usage_text.apz_str[ 43])
+#define zLtypeBool (option_usage_text.apz_str[ 44])
+#define zLtypeKeyword (option_usage_text.apz_str[ 45])
+#define zLtypeSetMembership (option_usage_text.apz_str[ 46])
+#define zMembers (option_usage_text.apz_str[ 47])
+#define zMisArg (option_usage_text.apz_str[ 48])
+#define zMultiEquiv (option_usage_text.apz_str[ 49])
+#define zMust (option_usage_text.apz_str[ 50])
+#define zNeedOne (option_usage_text.apz_str[ 51])
+#define zNoArg (option_usage_text.apz_str[ 52])
+#define zNoArgs (option_usage_text.apz_str[ 53])
+#define zNoCreat (option_usage_text.apz_str[ 54])
+#define zNoFlags (option_usage_text.apz_str[ 55])
+#define zNoKey (option_usage_text.apz_str[ 56])
+#define zNoLim (option_usage_text.apz_str[ 57])
+#define zNoPreset (option_usage_text.apz_str[ 58])
+#define zNoRq_NoShrtTtl (option_usage_text.apz_str[ 59])
+#define zNoRq_ShrtTtl (option_usage_text.apz_str[ 60])
+#define zNoStat (option_usage_text.apz_str[ 61])
+#define zNoState (option_usage_text.apz_str[ 62])
+#define zNone (option_usage_text.apz_str[ 63])
+#define zNotDef (option_usage_text.apz_str[ 64])
+#define zNotEnough (option_usage_text.apz_str[ 65])
+#define zNotFile (option_usage_text.apz_str[ 66])
+#define zNotNumber (option_usage_text.apz_str[ 67])
+#define zNrmOptFmt (option_usage_text.apz_str[ 68])
+#define zNumberOpt (option_usage_text.apz_str[ 69])
+#define zOneSpace (option_usage_text.apz_str[ 70])
+#define zOnlyOne (option_usage_text.apz_str[ 71])
+#define zOptsOnly (option_usage_text.apz_str[ 72])
+#define zPathFmt (option_usage_text.apz_str[ 73])
+#define zPlsSendBugs (option_usage_text.apz_str[ 74])
+#define zPreset (option_usage_text.apz_str[ 75])
+#define zPresetFile (option_usage_text.apz_str[ 76])
+#define zPresetIntro (option_usage_text.apz_str[ 77])
+#define zProg (option_usage_text.apz_str[ 78])
+#define zProhib (option_usage_text.apz_str[ 79])
+#define zReorder (option_usage_text.apz_str[ 80])
+#define zReqFmt (option_usage_text.apz_str[ 81])
+#define zReqOptFmt (option_usage_text.apz_str[ 82])
+#define zReqThese (option_usage_text.apz_str[ 83])
+#define zReq_NoShrtTtl (option_usage_text.apz_str[ 84])
+#define zReq_ShrtTtl (option_usage_text.apz_str[ 85])
+#define zSepChars (option_usage_text.apz_str[ 86])
+#define zSetMembers (option_usage_text.apz_str[ 87])
+#define zSetMemberSettings (option_usage_text.apz_str[ 88])
+#define zShrtGnuOptFmt (option_usage_text.apz_str[ 89])
+#define zSixSpaces (option_usage_text.apz_str[ 90])
+#define zStdBoolArg (option_usage_text.apz_str[ 91])
+#define zStdBreak (option_usage_text.apz_str[ 92])
+#define zStdKeyArg (option_usage_text.apz_str[ 93])
+#define zStdKeyLArg (option_usage_text.apz_str[ 94])
+#define zStdNestArg (option_usage_text.apz_str[ 95])
+#define zStdNoArg (option_usage_text.apz_str[ 96])
+#define zStdNumArg (option_usage_text.apz_str[ 97])
+#define zStdOptArg (option_usage_text.apz_str[ 98])
+#define zStdReqArg (option_usage_text.apz_str[ 99])
+#define zStdStrArg (option_usage_text.apz_str[100])
+#define zTabHyp (option_usage_text.apz_str[101])
+#define zTabHypAnd (option_usage_text.apz_str[102])
+#define zTabout (option_usage_text.apz_str[103])
+#define zThreeSpaces (option_usage_text.apz_str[104])
+#define zTwoSpaces (option_usage_text.apz_str[105])
+#define zUpTo (option_usage_text.apz_str[106])
+#define zValidKeys (option_usage_text.apz_str[107])
/*
* First, set up the strings. Some of these are writable. These are all in
* xgettext (or equivalents) can extract these strings for translation.
*/
- static cch_t eng_zAO_Bad[] =
- "AutoOpts function called without option descriptor\n";
- static cch_t eng_zAO_Big[] =
- "\tThis exceeds the compiled library version: ";
- static cch_t eng_zAO_Err[] =
- "Automated Options Processing Error!\n\
-\t%s called AutoOpts function with structure version %d:%d:%d.\n";
- static cch_t eng_zAO_Sml[] =
- "\tThis is less than the minimum library version: ";
- static cch_t eng_zAll[] =
- "all";
- static cch_t eng_zAlt[] =
- "\t\t\t\t- an alternate for %s\n";
- static cch_t eng_zAmbigKey[] =
- "%s error: the keyword `%s' is ambiguous\n";
- static cch_t eng_zAmbiguous[] =
- "ambiguous";
- static cch_t eng_zArgsMust[] =
- "%s: Command line arguments required\n";
- static cch_t eng_zAtMost[] =
- "%4$d %1$s%s options allowed\n";
- static cch_t eng_zAuto[] =
- "version and help options:";
- static cch_t eng_zBadPipe[] =
- "Error %d (%s) from the pipe(2) syscall\n";
- static cch_t eng_zBadVerArg[] =
- "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";
- static cch_t eng_zCantFmt[] =
- "ERROR: %s option conflicts with the %s option\n";
- static cch_t eng_zCantSave[] =
- "%s(optionSaveState): error: cannot allocate %d bytes\n";
- static cch_t eng_zDefaultOpt[] =
- "\t\t\t\t- default option for unnamed options\n";
- static cch_t eng_zDis[] =
- "\t\t\t\t- disabled as --%s\n";
- static cch_t eng_zEnab[] =
- "\t\t\t\t- enabled by default\n";
- static cch_t eng_zEquiv[] =
- "-equivalence";
- static cch_t eng_zErrOnly[] =
- "ERROR: only ";
- static cch_t eng_zExamineFmt[] =
- " - examining environment variables named %s_*\n";
- static cch_t eng_zFiveSpaces[] =
- " ";
- static cch_t eng_zFlagOkay[] =
- "Options are specified by doubled hyphens and their name\n\
-or by a single hyphen and the flag character.\n";
- static cch_t eng_zFmtFmt[] =
- "%%-%ds %%s\n";
- static cch_t eng_zForkFail[] =
- "fs error %d (%s) on fork - cannot obtain %s usage\n";
- static cch_t eng_zFSErrOptLoad[] =
- "File error %d (%s) opening %s for loading options\n";
- static cch_t eng_zFSErrReadFile[] =
- "fs error %d (%s) reading file %s\n";
- static cch_t eng_zGenshell[] =
- "\n\
-= = = = = = = =\n\n\
-This incarnation of genshell will produce\n\
-a shell script to parse the options for %s:\n\n";
- static char eng_zGnuBoolArg[] =
- "=T/F";
- static cch_t eng_zGnuBreak[] =
- "\n\
-%s\n\n";
- static char eng_zGnuKeyArg[] =
- "=KWd";
- static char eng_zGnuKeyLArg[] =
- "=Mbr";
- static cch_t eng_zGnuNestArg[] =
- "=Cplx";
- static char eng_zGnuNumArg[] =
- "=num";
- static cch_t eng_zGnuOptArg[] =
- "[=arg]";
- static cch_t eng_zGnuOptFmt[] =
- "--%2$s%1$s";
- static char eng_zGnuStrArg[] =
- "=str";
- static cch_t eng_zHomePath[] =
- " - reading file /... %s's exe directory .../%s \n";
- static cch_t eng_zIllOptChr[] =
- "%s: illegal option -- %c\n";
- static cch_t eng_zIllOptStr[] =
- "%s: %s option -- %s\n";
- static cch_t eng_zIllegal[] =
- "illegal";
- static cch_t eng_zInvalOptDesc[] =
- "AutoOpts ERROR: invalid option descriptor for %s\n";
- static cch_t eng_zKeyWords[] =
- "words=";
- static cch_t eng_zLoadCooked[] =
- "cooked";
- static cch_t eng_zLoadKeep[] =
- "keep";
- static cch_t eng_zLoadType[] =
- "type=";
- static cch_t eng_zLoadUncooked[] =
- "uncooked";
- static cch_t eng_zLtypeInteger[] =
- "integer";
- static cch_t eng_zLtypeNest[] =
- "nested";
- static cch_t eng_zLtypeString[] =
- "string";
- static cch_t eng_zLtypeBool[] =
- "bool";
- static cch_t eng_zLtypeKeyword[] =
- "keyword";
- static cch_t eng_zLtypeSetMembership[] =
- "set";
- static cch_t eng_zMembers[] =
- "\t\t\t\t- is a set membership option\n";
- static cch_t eng_zMisArg[] =
- "%s: option `%s' requires an argument\n";
- static cch_t eng_zMultiEquiv[] =
- "Equivalenced option '%s' was equivalenced to both\n\
-\t'%s' and '%s'";
- static cch_t eng_zMust[] =
- "\t\t\t\t- must appear between %d and %d times\n";
- static cch_t eng_zNeedOne[] =
- "ERROR: The %s option is required\n";
- static cch_t eng_zNoArg[] =
- "%s: option `%s' cannot have an argument\n";
- static cch_t eng_zNoArgs[] =
- "%s: Command line arguments not allowed\n";
- static cch_t eng_zNoCreat[] =
- "error %d (%s) creating %s\n";
- static cch_t eng_zNoFlags[] =
- "Options are specified by single or double hyphens and their name.\n";
- static cch_t eng_zNoKey[] =
- "%s error: `%s' does not match any keywords\n";
- static cch_t eng_zNoLim[] =
- "\t\t\t\t- may appear multiple times\n";
- static cch_t eng_zNoPreset[] =
- "\t\t\t\t- may not be preset\n";
- static cch_t eng_zNoRq_NoShrtTtl[] =
- " Arg Option-Name Description\n";
- static cch_t eng_zNoRq_ShrtTtl[] =
- " Flg Arg Option-Name Description\n";
- static cch_t eng_zNoStat[] =
- "error %d (%s) stat-ing %s\n";
- static cch_t eng_zNoState[] =
- "%s(optionRestore): error: no saved option state\n";
- static cch_t eng_zNone[] =
- "none";
- static cch_t eng_zNotDef[] =
- "'%s' not defined\n";
- static cch_t eng_zNotEnough[] =
- "ERROR: The %s option must appear %d times\n";
- static cch_t eng_zNotFile[] =
- "error: cannot load options from non-regular file %s\n";
- static cch_t eng_zNotNumber[] =
- "%s error: `%s' is not a recognizable number\n";
- static cch_t eng_zNrmOptFmt[] =
- " %3s %s";
- static cch_t eng_zNumberOpt[] =
- "The '-#<number>' option may omit the hash char\n";
- static cch_t eng_zOneSpace[] =
- " ";
- static cch_t eng_zOnlyOne[] =
- "one %s%s option allowed\n";
- static cch_t eng_zOptsOnly[] =
- "All arguments are named options.\n";
- static cch_t eng_zPathFmt[] =
- " - reading file %s";
- static cch_t eng_zPlsSendBugs[] =
- "\n\
-please send bug reports to: %s\n";
- static cch_t eng_zPreset[] =
- "\t\t\t\t- may NOT appear - preset only\n";
- static cch_t eng_zPresetFile[] =
- "# preset/initialization file\n\
-# %s#\n";
- static cch_t eng_zPresetIntro[] =
- "\n\
-The following option preset mechanisms are supported:\n";
- static cch_t eng_zProg[] =
- "program";
- static cch_t eng_zProhib[] =
- "prohibits these options:\n";
- static cch_t eng_zReorder[] =
- "Operands and options may be intermixed. They will be reordered.\n";
- static cch_t eng_zReqFmt[] =
- "ERROR: %s option requires the %s option\n";
- static cch_t eng_zReqOptFmt[] =
- " %3s %-14s %s";
- static cch_t eng_zReqThese[] =
- "requires these options:\n";
- static cch_t eng_zReq_NoShrtTtl[] =
- " Arg Option-Name Req? Description\n";
- static cch_t eng_zReq_ShrtTtl[] =
- " Flg Arg Option-Name Req? Description\n";
- static cch_t eng_zSepChars[] =
- "-_^";
- static cch_t eng_zSetMembers[] =
- "members=";
- static cch_t eng_zSetMemberSettings[] =
- "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";
- static cch_t eng_zShrtGnuOptFmt[] =
- "%s";
- static cch_t eng_zSixSpaces[] =
- " ";
- static cch_t eng_zStdBoolArg[] =
- "T/F";
- static cch_t eng_zStdBreak[] =
- "\n\
-%s\n\n\
-%s";
- static cch_t eng_zStdKeyArg[] =
- "KWd";
- static cch_t eng_zStdKeyLArg[] =
- "Mbr";
- static cch_t eng_zStdNestArg[] =
- "Cpx";
- static cch_t eng_zStdNoArg[] =
- "no ";
- static cch_t eng_zStdNumArg[] =
- "Num";
- static cch_t eng_zStdOptArg[] =
- "opt";
- static cch_t eng_zStdReqArg[] =
- "YES";
- static cch_t eng_zStdStrArg[] =
- "Str";
- static cch_t eng_zTabHyp[] =
- "\t\t\t\t- ";
- static cch_t eng_zTabHypAnd[] =
- "\t\t\t\t-- and ";
- static cch_t eng_zTabout[] =
- "\t\t\t\t%s\n";
- static cch_t eng_zThreeSpaces[] =
- " ";
- static cch_t eng_zTwoSpaces[] =
- " ";
- static cch_t eng_zUpTo[] =
- "\t\t\t\t- may appear up to %d times\n";
- static cch_t eng_zValidKeys[] =
- "The valid \"%s\" option keywords are:\n";
+ static char eng_zGnuBoolArg[] = "=T/F";
+ static char eng_zGnuKeyArg[] = "=KWd";
+ static char eng_zGnuKeyLArg[] = "=Mbr";
+ static char eng_zGnuNumArg[] = "=num";
+ static char eng_zGnuStrArg[] = "=str";
+static const char usage_txt[3202] =
+ "AutoOpts function called without option descriptor\n\0"
+ "\tThis exceeds the compiled library version: \0"
+ "Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n\0"
+ "\tThis is less than the minimum library version: \0"
+ "all\0"
+ "\t\t\t\t- an alternate for %s\n\0"
+ "%s error: the keyword `%s' is ambiguous\n\0"
+ "ambiguous\0"
+ "%s: Command line arguments required\n\0"
+ "%4$d %1$s%s options allowed\n\0"
+ "version and help options:\0"
+ "Error %d (%s) from the pipe(2) syscall\n\0"
+ "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"
+ "ERROR: %s option conflicts with the %s option\n\0"
+ "%s(optionSaveState): error: cannot allocate %d bytes\n\0"
+ "\t\t\t\t- default option for unnamed options\n\0"
+ "\t\t\t\t- disabled as --%s\n\0"
+ "\t\t\t\t- enabled by default\n\0"
+ "-equivalence\0"
+ "ERROR: only \0"
+ " - examining environment variables named %s_*\n\0"
+ " \0"
+ "Options are specified by doubled hyphens and their name\n"
+ "or by a single hyphen and the flag character.\n\0"
+ "%%-%ds %%s\n\0"
+ "fs error %d (%s) on fork - cannot obtain %s usage\n\0"
+ "File error %d (%s) opening %s for loading options\n\0"
+ "fs error %d (%s) reading file %s\n\0"
+ "\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n\0"
+ "\n"
+ "%s\n\n\0"
+ "=Cplx\0"
+ "[=arg]\0"
+ "--%2$s%1$s\0"
+ "%s: illegal option -- %c\n\0"
+ "%s: %s option -- %s\n\0"
+ "illegal\0"
+ "AutoOpts ERROR: invalid option descriptor for %s\n\0"
+ "words=\0"
+ "cooked\0"
+ "keep\0"
+ "type=\0"
+ "uncooked\0"
+ "integer\0"
+ "nested\0"
+ "string\0"
+ "bool\0"
+ "keyword\0"
+ "set\0"
+ "\t\t\t\t- is a set membership option\n\0"
+ "%s: option `%s' requires an argument\n\0"
+ "Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'\0"
+ "\t\t\t\t- must appear between %d and %d times\n\0"
+ "ERROR: The %s option is required\n\0"
+ "%s: option `%s' cannot have an argument\n\0"
+ "%s: Command line arguments not allowed\n\0"
+ "error %d (%s) creating %s\n\0"
+ "Options are specified by single or double hyphens and their name.\n\0"
+ "%s error: `%s' does not match any keywords\n\0"
+ "\t\t\t\t- may appear multiple times\n\0"
+ "\t\t\t\t- may not be preset\n\0"
+ " Arg Option-Name Description\n\0"
+ " Flg Arg Option-Name Description\n\0"
+ "error %d (%s) stat-ing %s\n\0"
+ "%s(optionRestore): error: no saved option state\n\0"
+ "none\0"
+ "'%s' not defined\n\0"
+ "ERROR: The %s option must appear %d times\n\0"
+ "error: cannot load options from non-regular file %s\n\0"
+ "%s error: `%s' is not a recognizable number\n\0"
+ " %3s %s\0"
+ "The '-#<number>' option may omit the hash char\n\0"
+ " \0"
+ "one %s%s option allowed\n\0"
+ "All arguments are named options.\n\0"
+ " - reading file %s\0"
+ "\n"
+ "please send bug reports to: %s\n\0"
+ "\t\t\t\t- may NOT appear - preset only\n\0"
+ "# preset/initialization file\n"
+ "# %s#\n\0"
+ "\n"
+ "The following option preset mechanisms are supported:\n\0"
+ "program\0"
+ "prohibits these options:\n\0"
+ "Operands and options may be intermixed. They will be reordered.\n\0"
+ "ERROR: %s option requires the %s option\n\0"
+ " %3s %-14s %s\0"
+ "requires these options:\n\0"
+ " Arg Option-Name Req? Description\n\0"
+ " Flg Arg Option-Name Req? Description\n\0"
+ "-_^\0"
+ "members=\0"
+ "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"
+ "%s\0"
+ " \0"
+ "T/F\0"
+ "\n"
+ "%s\n\n"
+ "%s\0"
+ "KWd\0"
+ "Mbr\0"
+ "Cpx\0"
+ "no \0"
+ "Num\0"
+ "opt\0"
+ "YES\0"
+ "Str\0"
+ "\t\t\t\t- \0"
+ "\t\t\t\t-- and \0"
+ "\t\t\t\t%s\n\0"
+ " \0"
+ " \0"
+ "\t\t\t\t- may appear up to %d times\n\0"
+ "The valid \"%s\" option keywords are:\n\0";
+
/*
* Now, define (and initialize) the structure that contains
* Aren't you glad you don't maintain this by hand?
*/
usage_text_t option_usage_text = {
- 114,
+ 113,
eng_zGnuBoolArg, eng_zGnuKeyArg, eng_zGnuKeyLArg, eng_zGnuNumArg,
eng_zGnuStrArg,
{
- eng_zAO_Bad, eng_zAO_Big, eng_zAO_Err,
- eng_zAO_Sml, eng_zAll, eng_zAlt,
- eng_zAmbigKey, eng_zAmbiguous, eng_zArgsMust,
- eng_zAtMost, eng_zAuto, eng_zBadPipe,
- eng_zBadVerArg, eng_zCantFmt, eng_zCantSave,
- eng_zDefaultOpt, eng_zDis, eng_zEnab,
- eng_zEquiv, eng_zErrOnly, eng_zExamineFmt,
- eng_zFiveSpaces, eng_zFlagOkay, eng_zFmtFmt,
- eng_zForkFail, eng_zFSErrOptLoad, eng_zFSErrReadFile,
- eng_zGenshell, eng_zGnuBreak, eng_zGnuNestArg,
- eng_zGnuOptArg, eng_zGnuOptFmt, eng_zHomePath,
- eng_zIllOptChr, eng_zIllOptStr, eng_zIllegal,
- eng_zInvalOptDesc, eng_zKeyWords, eng_zLoadCooked,
- eng_zLoadKeep, eng_zLoadType, eng_zLoadUncooked,
- eng_zLtypeInteger, eng_zLtypeNest, eng_zLtypeString,
- eng_zLtypeBool, eng_zLtypeKeyword, eng_zLtypeSetMembership,
- eng_zMembers, eng_zMisArg, eng_zMultiEquiv,
- eng_zMust, eng_zNeedOne, eng_zNoArg,
- eng_zNoArgs, eng_zNoCreat, eng_zNoFlags,
- eng_zNoKey, eng_zNoLim, eng_zNoPreset,
- eng_zNoRq_NoShrtTtl, eng_zNoRq_ShrtTtl, eng_zNoStat,
- eng_zNoState, eng_zNone, eng_zNotDef,
- eng_zNotEnough, eng_zNotFile, eng_zNotNumber,
- eng_zNrmOptFmt, eng_zNumberOpt, eng_zOneSpace,
- eng_zOnlyOne, eng_zOptsOnly, eng_zPathFmt,
- eng_zPlsSendBugs, eng_zPreset, eng_zPresetFile,
- eng_zPresetIntro, eng_zProg, eng_zProhib,
- eng_zReorder, eng_zReqFmt, eng_zReqOptFmt,
- eng_zReqThese, eng_zReq_NoShrtTtl, eng_zReq_ShrtTtl,
- eng_zSepChars, eng_zSetMembers, eng_zSetMemberSettings,
- eng_zShrtGnuOptFmt, eng_zSixSpaces, eng_zStdBoolArg,
- eng_zStdBreak, eng_zStdKeyArg, eng_zStdKeyLArg,
- eng_zStdNestArg, eng_zStdNoArg, eng_zStdNumArg,
- eng_zStdOptArg, eng_zStdReqArg, eng_zStdStrArg,
- eng_zTabHyp, eng_zTabHypAnd, eng_zTabout,
- eng_zThreeSpaces, eng_zTwoSpaces, eng_zUpTo,
- eng_zValidKeys
+ usage_txt + 0, usage_txt + 52, usage_txt + 98, usage_txt + 197,
+ usage_txt + 247, usage_txt + 251, usage_txt + 278, usage_txt + 320,
+ usage_txt + 330, usage_txt + 367, usage_txt + 396, usage_txt + 422,
+ usage_txt + 462, usage_txt + 599, usage_txt + 647, usage_txt + 701,
+ usage_txt + 743, usage_txt + 767, usage_txt + 793, usage_txt + 806,
+ usage_txt + 820, usage_txt + 867, usage_txt + 873, usage_txt + 976,
+ usage_txt + 988, usage_txt +1039, usage_txt +1090, usage_txt +1124,
+ usage_txt +1230, usage_txt +1236, usage_txt +1242, usage_txt +1249,
+ usage_txt +1260, usage_txt +1286, usage_txt +1307, usage_txt +1315,
+ usage_txt +1366, usage_txt +1373, usage_txt +1380, usage_txt +1385,
+ usage_txt +1391, usage_txt +1400, usage_txt +1408, usage_txt +1415,
+ usage_txt +1422, usage_txt +1427, usage_txt +1435, usage_txt +1439,
+ usage_txt +1473, usage_txt +1511, usage_txt +1576, usage_txt +1619,
+ usage_txt +1654, usage_txt +1695, usage_txt +1735, usage_txt +1762,
+ usage_txt +1829, usage_txt +1874, usage_txt +1907, usage_txt +1932,
+ usage_txt +1967, usage_txt +2005, usage_txt +2032, usage_txt +2081,
+ usage_txt +2086, usage_txt +2104, usage_txt +2148, usage_txt +2202,
+ usage_txt +2248, usage_txt +2256, usage_txt +2304, usage_txt +2306,
+ usage_txt +2331, usage_txt +2365, usage_txt +2384, usage_txt +2418,
+ usage_txt +2454, usage_txt +2492, usage_txt +2548, usage_txt +2556,
+ usage_txt +2582, usage_txt +2648, usage_txt +2690, usage_txt +2704,
+ usage_txt +2729, usage_txt +2769, usage_txt +2812, usage_txt +2816,
+ usage_txt +2825, usage_txt +3044, usage_txt +3047, usage_txt +3054,
+ usage_txt +3058, usage_txt +3066, usage_txt +3070, usage_txt +3074,
+ usage_txt +3078, usage_txt +3082, usage_txt +3086, usage_txt +3090,
+ usage_txt +3094, usage_txt +3098, usage_txt +3105, usage_txt +3117,
+ usage_txt +3125, usage_txt +3129, usage_txt +3132, usage_txt +3165
}
};
/* --- fake the preprocessor into handlng portability */
/*
- * Time-stamp: "2006-06-24 10:57:22 bkorb"
+ * Time-stamp: "2006-07-15 08:27:23 bkorb"
*
* Author: Gary V Vaughan <gvaughan@oranda.demon.co.uk>
* Created: Mon Jun 30 15:54:46 1997
*
- * $Id: compat.h,v 4.8 2006/06/24 23:34:51 bkorb Exp $
+ * $Id: compat.h,v 4.10 2006/07/15 22:10:21 bkorb Exp $
*/
-#ifndef COMPAT_H
-#define COMPAT_H 1
+#ifndef COMPAT_H_GUARD
+#define COMPAT_H_GUARD 1
-#ifndef HAVE_CONFIG_H
+#if defined(HAVE_CONFIG_H)
+# include <config.h>
+
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+# include "windows-config.h"
+
+#else
# error "compat.h" requires "config.h"
+ choke me.
#endif
-#include <config.h>
#ifndef HAVE_STRSIGNAL
char * strsignal( int signo );
# if ! defined(HAVE_SYS_POLL_H) && ! defined(HAVE_SYS_SELECT_H)
# error This system cannot support daemon processing
+ Choke Me.
# endif
# if HAVE_SYS_POLL_H
# include <libgen.h>
#endif
-#include <limits.h>
+#if defined(HAVE_LIMITS_H) /* this is also in options.h */
+# include <limits.h>
+#elif defined(HAVE_SYS_LIMITS_H)
+# include <sys/limits.h>
+#endif /* HAVE_LIMITS/SYS_LIMITS_H */
+
#include <memory.h>
#include <setjmp.h>
#include <signal.h>
#include <string.h>
#include <time.h>
-#include <utime.h>
+
+#ifndef __windows__
+# include <utime.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
typedef unsigned long uint32_t;
# else
# error Cannot create a uint32_t type.
+ Choke Me.
# endif
#endif
#define WORD_MIN INT_MIN
#endif
-#endif /* COMPAT_H */
+#endif /* COMPAT_H_GUARD */
/*
* Local Variables:
/*
* Author: Gary V Vaughan <gvaughan@oranda.demon.co.uk>
* Created: Tue Jun 24 15:07:31 1997
- * Last Modified: $Date: 2005/09/04 21:13:39 $
+ * Last Modified: $Date: 2006/07/15 22:10:21 $
* by: bkorb
*
- * $Id: pathfind.c,v 4.4 2005/09/04 21:13:39 bkorb Exp $
+ * $Id: pathfind.c,v 4.6 2006/07/15 22:10:21 bkorb Exp $
*/
/* Code: */
#include "compat.h"
#ifndef HAVE_PATHFIND
+#if defined(__windows__) && !defined(__CYGWIN__)
+char*
+pathfind( const char* path,
+ const char* fileName,
+ const char* mode )
+{
+ return NULL;
+}
+#else
static char* make_absolute( const char *string, const char *dot_path );
static char* canonicalize_pathname( char *path );
*p_index = ix;
return pzDir;
}
-
+#endif /* __windows__ / __CYGWIN__ */
#endif /* HAVE_PATHFIND */
/*
--- /dev/null
+#ifndef WINDOWS_CONFIG_HACKERY
+#define WINDOWS_CONFIG_HACKERY 1
+
+/*
+ * The definitions below have been stolen from NTP's config.h for Windows.
+ * However, they may be kept here in order to keep libopts independent from
+ * the NTP project.
+ */
+#ifndef __windows__
+# define __windows__ 4
+#endif
+
+/*
+ * Miscellaneous functions that Microsoft maps
+ * to other names
+ *
+ * #define inline __inline
+ * #define vsnprintf _vsnprintf
+ */
+#define snprintf _snprintf
+/*
+ * #define stricmp _stricmp
+ * #define strcasecmp _stricmp
+ * #define isascii __isascii
+ * #define finite _finite
+ * #define random rand
+ * #define srandom srand
+ */
+
+#define SIZEOF_INT 4
+
+/*
+ * # define HAVE_NET_IF_H
+ * # define QSORT_USES_VOID_P
+ * # define HAVE_SETVBUF
+ * # define HAVE_VSPRINTF
+ * # define HAVE_SNPRINTF
+ * # define HAVE_VSNPRINTF
+ * # define HAVE_PROTOTYPES /* from ntpq.mak * /
+ * # define HAVE_MEMMOVE
+ * # define HAVE_TERMIOS_H
+ * # define HAVE_ERRNO_H
+ * # define HAVE_STDARG_H
+ * # define HAVE_NO_NICE
+ * # define HAVE_MKTIME
+ * # define TIME_WITH_SYS_TIME
+ * # define HAVE_IO_COMPLETION_PORT
+ * # define ISC_PLATFORM_NEEDNTOP
+ * # define ISC_PLATFORM_NEEDPTON
+ * # define NEED_S_CHAR_TYPEDEF
+ * # define USE_PROTOTYPES /* for ntp_types.h * /
+ *
+ * #define ULONG_CONST(a) a ## UL
+ */
+
+#define HAVE_LIMITS_H 1
+#define HAVE_STRDUP 1
+#define HAVE_STRCHR 1
+#define HAVE_FCNTL_H 1
+
+/*
+ * VS.NET's version of wspiapi.h has a bug in it
+ * where it assigns a value to a variable inside
+ * an if statement. It should be comparing them.
+ * We prevent inclusion since we are not using this
+ * code so we don't have to see the warning messages
+ */
+#ifndef _WSPIAPI_H_
+#define _WSPIAPI_H_
+#endif
+
+/* Prevent inclusion of winsock.h in windows.h */
+#ifndef _WINSOCKAPI_
+#define _WINSOCKAPI_
+#endif
+
+#ifndef __RPCASYNC_H__
+#define __RPCASYNC_H__
+#endif
+
+/* Include Windows headers */
+#include <windows.h>
+#include <winsock2.h>
+
+/*
+ * Compatibility declarations for Windows, assuming SYS_WINNT
+ * has been defined.
+ */
+#define strdup _strdup
+#define stat _stat /* struct stat from <sys/stat.h> */
+#define unlink _unlink
+#define fchmod( _x, _y );
+#define ssize_t SSIZE_T
+
+#include <io.h>
+#define open _open
+#define close _close
+#define read _read
+#define write _write
+#define lseek _lseek
+#define pipe _pipe
+#define dup2 _dup2
+
+#define O_RDWR _O_RDWR
+#define O_RDONLY _O_RDONLY
+#define O_EXCL _O_EXCL
+
+#ifndef S_ISREG
+# define S_IFREG _S_IFREG
+# define S_ISREG(mode) (((mode) & S_IFREG) == S_IFREG)
+#endif
+
+#ifndef S_ISDIR
+# define S_IFDIR _S_IFDIR
+# define S_ISDIR(mode) (((mode) & S_IFDIR) == S_IFDIR)
+#endif
+
+#endif /* WINDOWS_CONFIG_HACKERY */
/*
- * $Id: configfile.c,v 4.22 2006/06/24 23:34:51 bkorb Exp $
+ * $Id: configfile.c,v 4.23 2006/07/01 21:57:23 bkorb Exp $
* Time-stamp: "2006-07-01 12:46:31 bkorb"
*
* configuration/rc/ini file handling.
*
* DO NOT EDIT THIS FILE (genshell.c)
*
- * It has been AutoGen-ed Sunday April 9, 2006 at 11:49:19 AM PDT
+ * It has been AutoGen-ed Saturday July 22, 2006 at 08:36:53 AM PDT
* From the definitions genshell.def
* and the template file options
*/
+/*
+ * This file was produced by an AutoOpts template. AutoOpts is a
+ * copyrighted work. This source file is not encumbered by AutoOpts
+ * licensing, but is provided under the licensing terms chosen by the
+ * genshellopt author or copyright holder. AutoOpts is licensed under
+ * the terms of the LGPL. The redistributable library (``libopts'') is
+ * licensed under the terms of either the LGPL or, at the users discretion,
+ * the BSD license. See the AutoOpts and/or libopts sources for details.
+ *
+ * This source file is copyrighted and licensed under the following terms:
+ *
+ * genshellopt copyright 1999-2006 Bruce Korb - all rights reserved
+ *
+ * genshellopt 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.
+ *
+ * genshellopt 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 genshellopt. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+
#define OPTION_CODE_COMPILE 1
#include "genshell.h"
#define zRcName NULL
#define apzHomeList NULL
-tSCC zBugsAddr[] = "autogen-users@lists.sf.net";
+tSCC zBugsAddr[] = "autogen-users@lists.sourceforge.net";
tSCC zExplain[] = "\n\
Note that `shell' is only useful if the output file does not already\n\
exist. If it does, then the shell name and optional first argument\n\
text, the second line of the file through the ending tag will be replaced\n\
by the newly generated text. The first `#!' line will be regenerated.\n";
tSCC zFullVersion[] = GENSHELLOPT_FULL_VERSION;
-/* extracted from optcode near line 321 */
+/* extracted from optcode near line 368 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
{
USAGE( EXIT_SUCCESS );
}
-/* extracted from optcode near line 418 */
+/* extracted from optcode near line 465 */
#if ENABLE_NLS
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <autoopts/usage-txt.h>
+static char* AO_gettext( const char* pz );
+static void coerce_it(void** s);
+
static char*
AO_gettext( const char* pz )
{
return pzRes;
}
+static void coerce_it(void** s) { *s = AO_gettext(*s); }
+#define COERSION(_f) \
+ coerce_it((void*)&(genshelloptOptions._f))
+
/*
* This invokes the translation code (e.g. gettext(3)).
*/
pOD++;
}
}
- genshelloptOptions.pzCopyright = AO_gettext(genshelloptOptions.pzCopyright);
- genshelloptOptions.pzCopyNotice = AO_gettext(genshelloptOptions.pzCopyNotice);
- genshelloptOptions.pzFullVersion = AO_gettext(genshelloptOptions.pzFullVersion);
- genshelloptOptions.pzUsageTitle = AO_gettext(genshelloptOptions.pzUsageTitle);
- genshelloptOptions.pzExplain = AO_gettext(genshelloptOptions.pzExplain);
- genshelloptOptions.pzDetail = AO_gettext(genshelloptOptions.pzDetail);
+ COERSION(pzCopyright);
+ COERSION(pzCopyNotice);
+ COERSION(pzFullVersion);
+ COERSION(pzUsageTitle);
+ COERSION(pzExplain);
+ COERSION(pzDetail);
}
#endif /* ENABLE_NLS */
*
* DO NOT EDIT THIS FILE (genshell.h)
*
- * It has been AutoGen-ed Sunday April 9, 2006 at 11:49:19 AM PDT
+ * It has been AutoGen-ed Saturday July 22, 2006 at 08:36:53 AM PDT
* From the definitions genshell.def
* and the template file options
*/
-/*
- * This file contains the programmatic interface to the Automated
- * Options generated for the genshellopt program.
- * These macros are documented in the AutoGen info file in the
- * "AutoOpts" chapter. Please refer to that doc for usage help.
- */
-#ifndef AUTOOPTS_GENSHELL_H_GUARD
-#define AUTOOPTS_GENSHELL_H_GUARD
/*
+ * This file was produced by an AutoOpts template. AutoOpts is a
+ * copyrighted work. This header file is not encumbered by AutoOpts
+ * licensing, but is provided under the licensing terms chosen by the
+ * genshellopt author or copyright holder. AutoOpts is licensed under
+ * the terms of the LGPL. The redistributable library (``libopts'') is
+ * licensed under the terms of either the LGPL or, at the users discretion,
+ * the BSD license. See the AutoOpts and/or libopts sources for details.
+ *
+ * This source file is copyrighted and licensed under the following terms:
+ *
* genshellopt copyright 1999-2006 Bruce Korb - all rights reserved
*
* genshellopt is free software; you can redistribute it and/or
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301, USA.
*/
+/*
+ * This file contains the programmatic interface to the Automated
+ * Options generated for the genshellopt program.
+ * These macros are documented in the AutoGen info file in the
+ * "AutoOpts" chapter. Please refer to that doc for usage help.
+ */
+#ifndef AUTOOPTS_GENSHELL_H_GUARD
+#define AUTOOPTS_GENSHELL_H_GUARD
#include <autoopts/options.h>
/*
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
+ Choke Me.
#endif
/*
genshelloptOptions.pzCurOpt = NULL )
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*genshelloptOptions.pUsageProc)( &genshelloptOptions, c )
-/* extracted from opthead near line 289 */
+/* extracted from opthead near line 288 */
/* * * * * *
*
#define AUTOOPTS_INTERNAL
#include "compat/compat.h"
-#define HAVE_LIBSNPRINTFV
#define LOCAL static
#include "autoopts/options.h"
#include "autoopts/usage-txt.h"
/*
- * $Id: load.c,v 4.22 2006/06/24 23:34:51 bkorb Exp $
+ * $Id: load.c,v 4.23 2006/07/01 21:57:23 bkorb Exp $
* Time-stamp: "2006-07-01 12:43:03 bkorb"
*
* This file contains the routines that deal with processing text strings
dnl
dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed Saturday July 1, 2006 at 02:52:02 PM PDT
+dnl It has been AutoGen-ed Saturday July 22, 2006 at 08:36:51 AM PDT
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
/*
- * $Id: makeshell.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
- * Time-stamp: "2006-06-24 10:47:07 bkorb"
+ * $Id: makeshell.c,v 4.13 2006/07/15 22:10:21 bkorb Exp $
+ * Time-stamp: "2006-07-15 08:18:01 bkorb"
*
* This module will interpret the options set in the tOptions
* structure and create a Bourne shell script capable of parsing them.
static void
textToVariable( tOptions* pOpts, teTextTo whichVar, tOptDesc* pOD )
{
+#if defined(__windows__) && !defined(__CYGWIN__)
+ printf( "%1$s_%2$s_TEXT='no %2$s text'\n",
+ pOpts->pzPROGNAME, apzTTNames[ whichVar ]);
+#else
int nlHoldCt = 0;
int pipeFd[2];
FILE* fp;
fputs( "'\n\n", stdout );
close( pipeFd[0] );
+#endif
}
void
genshelloptUsage( tOptions* pOpts, int exitCode )
{
+#if defined(__windows__) && !defined(__CYGWIN__)
+ optionUsage( pOpts, exitCode );
+#else
/*
* IF not EXIT_SUCCESS,
* THEN emit the short form of usage.
}
exit( EXIT_SUCCESS );
+#endif
}
/*
/*
- * $Id: pgusage.c,v 4.9 2006/06/24 23:34:51 bkorb Exp $
- * Time-stamp: "2006-06-24 10:48:00 bkorb"
+ * $Id: pgusage.c,v 4.12 2006/07/16 15:27:50 bkorb Exp $
+ * Time-stamp: "2006-07-16 08:13:26 bkorb"
*
* Automated Options Paged Usage module.
*
void
optionPagedUsage( tOptions* pOptions, tOptDesc* pOD )
{
+#if defined(__windows__) && !defined(__CYGWIN__)
+ (*pOptions->pUsageProc)( pOptions, EXIT_SUCCESS );
+#else
static pid_t my_pid;
char zPageUsage[ 1024 ];
fclose( stderr );
dup2( STDOUT_FILENO, STDERR_FILENO );
- system( zPageUsage );
+ (void)system( zPageUsage );
}
case PAGER_STATE_CHILD:
*/
break;
}
+#endif
}
/*
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Sat Jul 1 14:52:42 PDT 2006
+ * Generated Sat Jul 22 08:37:30 PDT 2006
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1
/*
- * $Id: putshell.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
- * Time-stamp: "2006-06-24 14:29:07 bkorb"
+ * $Id: putshell.c,v 4.12 2006/07/16 15:27:50 bkorb Exp $
+ * Time-stamp: "2006-07-16 08:13:24 bkorb"
*
* This module will interpret the options set in the tOptions
* structure and print them to standard out in a fashion that
/*
* Emit the string up to the single quote (apostrophe) we just found.
*/
- fwrite( pzStr, (unsigned)(pz - pzStr), 1, stdout );
+ (void)fwrite( pzStr, (unsigned)(pz - pzStr), 1, stdout );
fputc( '\'', stdout );
pzStr = pz;
/*
- * save.c $Id: save.c,v 4.14 2006/06/24 23:34:51 bkorb Exp $
- * Time-stamp: "2006-07-01 12:41:27 bkorb"
+ * save.c $Id: save.c,v 4.16 2006/07/16 15:27:50 bkorb Exp $
+ * Time-stamp: "2006-07-16 08:13:22 bkorb"
*
* This module's routines will take the currently set options and
* store them into an ".rc" file for re-interpretation the next
/*
* Print the continuation and the text from the current line
*/
- fwrite( pzLA, (unsigned)(pzNl - pzLA), 1, fp );
+ (void)fwrite( pzLA, (unsigned)(pzNl - pzLA), 1, fp );
pzLA = pzNl+1; /* advance the Last Arg pointer */
fputs( "\\\n", fp );
}
/*
* stack.c
- * $Id: stack.c,v 4.8 2006/03/25 19:23:28 bkorb Exp $
- * Time-stamp: "2006-07-01 14:35:13 bkorb"
+ * $Id: stack.c,v 4.10 2006/07/14 04:20:17 bkorb Exp $
+ * Time-stamp: "2006-07-13 21:11:29 bkorb"
*
* This is a special option processing routine that will save the
* argument to an option in a FIFO queue.
* If you do not wish that, delete this exception notice.
*/
-#include REGEX_HEADER
+#ifdef WITH_LIBREGEX
+# include REGEX_HEADER
+#endif
/*=export_func optionUnstackArg
* private:
/*
- * usage.c $Id: usage.c,v 4.13 2006/06/24 23:34:51 bkorb Exp $
+ * usage.c $Id: usage.c,v 4.14 2006/07/01 21:57:23 bkorb Exp $
* Time-stamp: "2006-07-01 12:41:02 bkorb"
*
* This module implements the default usage procedure for