+* Upgrade to autogen-5.10
* [Bug 1378] Unnecessary resetting of peers during interface update.
* [Bug 1382] p245 configure --disable-dependency-tracking won't build.
* [Bug 1384] ntpq :config core dumped with a blank password.
endif
libopts_la_SOURCES = libopts.c
libopts_la_CPPFLAGS = -I$(top_srcdir)
-libopts_la_LDFLAGS = -version-info 32:1:7
+libopts_la_LDFLAGS = -version-info 33:0:8
EXTRA_DIST = \
COPYING.gplv3 COPYING.lgplv3 COPYING.mbsd \
MakeDefs.inc README ag-char-map.h \
/*
- * Character mapping generated 08/01/09 11:21:22
+ * Character mapping generated 11/08/09 08:41:19
*
* This file contains the character classifications
* used by AutoGen and AutoOpts for identifying tokens.
/*
- * $Id: autoopts.c,v 4.40 2009/08/01 17:44:36 bkorb Exp $
- * Time-stamp: "2009-01-12 02:49:49 bkorb"
+ * $Id: 56abb301f50605ec5bae137ded730e330d8d7735 $
+ * Time-stamp: "2009-11-01 10:50:34 bkorb"
*
* This file contains all of the routines that must be linked into
* an executable to use the generated option processing. The optional
/*
* If provided a procedure to call, call it
*/
- if (pOP != (tpOptProc)NULL)
+ if (pOP != NULL)
(*pOP)( pOpts, pOD );
return SUCCESS;
} else nameLen = strlen( pzOptName );
do {
- if (SKIP_OPT(pOD))
- continue;
+ if (SKIP_OPT(pOD)) {
+ if ( (pOD->fOptState != (OPTST_OMITTED | OPTST_NO_INIT))
+ || (pOD->pz_Name == NULL))
+ continue;
+ }
+ else assert(pOD->pz_Name != NULL);
if (strneqvcmp( pzOptName, pOD->pz_Name, nameLen ) == 0) {
/*
* Make sure we either found an exact match or found only one partial
*/
if (matchCt == 1) {
+ pOD = pOpts->pOptDesc + matchIdx;
+
+ if (SKIP_OPT(pOD)) {
+ fprintf(stderr, zDisabledErr, pOpts->pzProgName, pOD->pz_Name);
+ if (pOD->pzText != NULL)
+ fprintf(stderr, " -- %s", pOD->pzText);
+ fputc('\n', stderr);
+ (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ }
+
/*
* IF we found a disablement name,
* THEN set the bit in the callers' flag word
if (disable)
pOptState->flags |= OPTST_DISABLED;
- pOptState->pOD = pOpts->pOptDesc + matchIdx;
+ pOptState->pOD = pOD;
pOptState->pzOptArg = pzEq;
pOptState->optType = TOPT_LONG;
return SUCCESS;
if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) {
fprintf(stderr, (matchCt == 0) ? zIllOptStr : zAmbigOptStr,
pOpts->pzProgPath, pzOptName);
- (*pOpts->pUsageProc)( pOpts, EXIT_FAILURE );
+ (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
}
return FAILURE;
/*
* Search the option list
*/
- for (;;) {
- /*
- * IF the values match,
- * THEN we stop here
- */
- if ((! SKIP_OPT(pRes)) && (optValue == pRes->optValue)) {
- pOptState->pOD = pRes;
- pOptState->optType = TOPT_SHORT;
- return SUCCESS;
+ do {
+ if (optValue != pRes->optValue)
+ continue;
+
+ if (SKIP_OPT(pRes)) {
+ if ( (pRes->fOptState == (OPTST_OMITTED | OPTST_NO_INIT))
+ && (pRes->pz_Name != NULL)) {
+ fprintf(stderr, zDisabledErr, pOpts->pzProgPath, pRes->pz_Name);
+ if (pRes->pzText != NULL)
+ fprintf(stderr, " -- %s", pRes->pzText);
+ fputc('\n', stderr);
+ (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ }
+ goto short_opt_error;
}
- /*
- * Advance to next option description
- */
- pRes++;
+ pOptState->pOD = pRes;
+ pOptState->optType = TOPT_SHORT;
+ return SUCCESS;
- /*
- * IF we have searched everything, ...
- */
- if (--ct <= 0)
- break;
- }
+ } while (pRes++, --ct > 0);
/*
* IF the character value is a digit
return SUCCESS;
}
+ short_opt_error:
+
/*
* IF we are to stop on errors (the default, actually)
* THEN call the usage procedure.
/*
* Time-stamp: "2008-11-01 20:08:06 bkorb"
*
- * autoopts.h $Id: autoopts.h,v 4.31 2009/08/01 17:44:36 bkorb Exp $
+ * autoopts.h $Id: d5e30331d37ca10ec88c592d24d8615dd6c1f0ee $
*
* This file defines all the global structures and special values
* used in the automated option processing library.
/*
- * $Id: boolean.c,v 4.17 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 329b43154b88d78564d8f960a00a83ec7d8baee0 $
* Time-stamp: "2008-08-03 13:06:02 bkorb"
*
* Automated Options Paged Usage module.
/* compat.h --- fake the preprocessor into handlng portability
*
- * Time-stamp: "2008-06-14 09:36:25 bkorb"
+ * Time-stamp: "2009-10-18 11:14:14 bkorb"
*
- * $Id: compat.h,v 4.21 2009/01/01 16:51:52 bkorb Exp $
+ * $Id: 27c1eb45f171295ab6176280aeca742cfdbe9fed $
*
* compat.h is free software.
* This file is part of AutoGen.
#endif
#ifndef SHORT_MAX
-# define SHORT_MAX ~(1 << (8*sizeof(short) -1))
+# define SHORT_MAX ~(1 << (8*sizeof(short) - 1))
#else
# define USHORT_MAX ~(OUS)
#endif
#ifndef HAVE_INT8_T
- typedef signed char int8_t;
+ typedef signed char int8_t;
+# define HAVE_INT8_T 1
#endif
#ifndef HAVE_UINT8_T
- typedef unsigned char uint8_t;
+ typedef unsigned char uint8_t;
+# define HAVE_UINT8_T 1
#endif
#ifndef HAVE_INT16_T
- typedef signed short int16_t;
+ typedef signed short int16_t;
+# define HAVE_INT16_T 1
#endif
#ifndef HAVE_UINT16_T
- typedef unsigned short uint16_t;
-#endif
-#ifndef HAVE_UINT_T
- typedef unsigned int uint_t;
+ typedef unsigned short uint16_t;
+# define HAVE_UINT16_T 1
#endif
#ifndef HAVE_INT32_T
-# if SIZEOF_INT == 4
- typedef signed int int32_t;
-# elif SIZEOF_LONG == 4
- typedef signed long int32_t;
+# if SIZEOF_INT == 4
+ typedef signed int int32_t;
+# elif SIZEOF_LONG == 4
+ typedef signed long int32_t;
# endif
+# define HAVE_INT32_T 1
#endif
#ifndef HAVE_UINT32_T
-# if SIZEOF_INT == 4
- typedef unsigned int uint32_t;
-# elif SIZEOF_LONG == 4
- typedef unsigned long uint32_t;
+# if SIZEOF_INT == 4
+ typedef unsigned int uint32_t;
+# elif SIZEOF_LONG == 4
+ typedef unsigned long uint32_t;
# else
# error Cannot create a uint32_t type.
Choke Me.
# endif
+# define HAVE_UINT32_T 1
#endif
#ifndef HAVE_INTPTR_T
- typedef signed long intptr_t;
+# if SIZEOF_CHARP == SIZEOF_LONG
+ typedef signed long intptr_t;
+# else
+ typedef signed int intptr_t;
+# endif
+# define HAVE_INTPTR_T 1
#endif
+
#ifndef HAVE_UINTPTR_T
- typedef unsigned long uintptr_t;
+# if SIZEOF_CHARP == SIZEOF_LONG
+ typedef unsigned long intptr_t;
+# else
+ typedef unsigned int intptr_t;
+# endif
+# define HAVE_INTPTR_T 1
#endif
+
+#ifndef HAVE_UINT_T
+ typedef unsigned int uint_t;
+# define HAVE_UINT_T 1
+#endif
+
#ifndef HAVE_SIZE_T
- typedef unsigned int size_t;
+ typedef unsigned int size_t;
+# define HAVE_SIZE_T 1
#endif
#ifndef HAVE_WINT_T
- typedef unsigned int wint_t;
+ typedef unsigned int wint_t;
+# define HAVE_WINT_T 1
#endif
#ifndef HAVE_PID_T
- typedef signed int pid_t;
+ typedef signed int pid_t;
+# define HAVE_PID_T 1
#endif
/* redefine these for BSD style string libraries */
#ifndef HAVE_STRCHR
-# define strchr index
-# define strrchr rindex
+# define strchr index
+# define strrchr rindex
#endif
#ifdef USE_FOPEN_BINARY
/*
* Author: Gary V Vaughan <gvaughan@oranda.demon.co.uk>
* Time-stamp: "2006-09-23 19:46:16 bkorb"
- * Last Modified: $Date: 2007/07/04 20:51:18 $
* by: bkorb
*
- * $Id: pathfind.c,v 4.11 2007/07/04 20:51:18 bkorb Exp $
+ * $Id: 8ce7ddfe2378f0b75c91c0ab348a6ad81634fb01 $
*/
/* Code: */
/*
* Time-stamp: "2009-07-22 18:53:59 bkorb"
* by: bkorb
- * Last Committed: $Date: 2009/07/23 02:07:46 $
*
* This file is part of AutoGen.
*
/*
- * $Id: configfile.c,v 1.36 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: f1650b45a91ec95af830ff76041cc4f0048e60f0 $
* Time-stamp: "2009-01-18 10:21:58 bkorb"
*
* configuration/rc/ini file handling.
/*
- * $Id: cook.c,v 4.18 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 3da9a5fc88c904673b3b95d0c9667b2bcbccfc80 $
* Time-stamp: "2007-11-16 22:49:11 bkorb"
*
* This file contains the routines that deal with processing quoted strings
/*
- * $Id: enumeration.c,v 4.26 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 27595043d23170eb4bb8b9831fc54016944e00e8 $
* Time-stamp: "2008-07-27 12:28:01 bkorb"
*
* Automated Options Paged Usage module.
/*
- * $Id: environment.c,v 4.21 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 8700c8e91e8094c455392c691d9b6a7d62222240 $
* Time-stamp: "2009-07-20 20:12:24 bkorb"
*
* This file contains all of the routines that must be linked into
/*
- * $Id: file.c,v 1.9 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 1410aaa5f08a562e0cd6c28ffae5a49dc7a3164f $
* Time-stamp: "2009-07-23 17:23:46 bkorb"
*
* This file is part of AutoOpts, a companion to AutoGen.
/*
- * $Id: load.c,v 4.29 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: f0ececd5fec43bacb417d7b50294accc2121923f $
* Time-stamp: "2008-12-06 10:16:05 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 August 1, 2009 at 11:21:13 AM by AutoGen 5.9.9pre4
+dnl It has been AutoGen-ed November 8, 2009 at 08:41:10 AM by AutoGen 5.9.10pre13
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
dnl
AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
[if test X${INVOKE_LIBOPTS_MACROS_FIRST_done} != Xyes ; then]
- # =================
- # AC_HEADER_STDC
- # =================
AC_HEADER_STDC
- # =================
- # AC_HEADER_DIRENT
- # =================
AC_HEADER_DIRENT
# =================
# ----------------------------------------------------------------------
AC_CHECK_LIB(gen, pathfind)
AC_FUNC_VPRINTF
+ AC_FUNC_FORK
AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr \
strrchr strsignal])
[ INVOKE_LIBOPTS_MACROS_FIRST_done=yes
dnl @synopsis LIBOPTS_CHECK
dnl
dnl Time-stamp: "2009-07-22 18:50:49 bkorb"
-dnl Last Committed: $Date: 2009/07/23 02:07:47 $
dnl
dnl If autoopts-config works, add the linking information to LIBS.
dnl Otherwise, add ``libopts-${ao_rev}'' to SUBDIRS and run all
dnl with or without modifications, as long as this notice is preserved.
dnl Time-stamp: "2009-07-22 18:53:27 bkorb"
-dnl Last Committed: $Date: 2009/07/23 02:07:46 $
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
/*
- * $Id: makeshell.c,v 4.29 2009/08/01 17:44:36 bkorb Exp $
- * Time-stamp: "2008-07-26 16:10:51 bkorb"
+ * $Id: 7226344c6486a4eda395f893881080b7d80a2003 $
+ * Time-stamp: "2009-11-01 11:52:37 bkorb"
*
* This module will interpret the options set in the tOptions
* structure and create a Bourne shell script capable of parsing them.
*
* Setup Format Strings
*/
-tSCC zStartMarker[] =
+static char const zStartMarker[] =
"# # # # # # # # # # -- do not modify this marker --\n#\n"
"# DO NOT EDIT THIS SECTION";
-tSCC zPreamble[] =
+static char const zPreamble[] =
"%s OF %s\n#\n"
"# From here to the next `-- do not modify this marker --',\n"
"# the text has been generated %s\n";
-tSCC zEndPreamble[] =
+static char const zEndPreamble[] =
"# From the %s option definitions\n#\n";
-tSCC zMultiDef[] = "\n"
+static char const zMultiDef[] = "\n"
"if test -z \"${%1$s_%2$s}\"\n"
"then\n"
" %1$s_%2$s_CT=0\n"
"fi\n"
"export %1$s_%2$s_CT";
-tSCC zSingleDef[] = "\n"
+static char const zSingleDef[] = "\n"
"%1$s_%2$s=\"${%1$s_%2$s-'%3$s'}\"\n"
"%1$s_%2$s_set=false\n"
"export %1$s_%2$s\n";
-tSCC zSingleNoDef[] = "\n"
+static char const zSingleNoDef[] = "\n"
"%1$s_%2$s=\"${%1$s_%2$s}\"\n"
"%1$s_%2$s_set=false\n"
"export %1$s_%2$s\n";
* all options are named options (loop only)
* regular, marked option processing.
*/
-tSCC zLoopCase[] = "\n"
+static char const zLoopCase[] = "\n"
"OPT_PROCESS=true\n"
"OPT_ARG=\"$1\"\n\n"
"while ${OPT_PROCESS} && [ $# -gt 0 ]\ndo\n"
" shift\n"
" ;;\n\n";
-tSCC zLoopOnly[] = "\n"
+static char const zLoopOnly[] = "\n"
"OPT_ARG=\"$1\"\n\n"
"while [ $# -gt 0 ]\ndo\n"
" OPT_ELEMENT=''\n"
* then we must have selectors for each acceptable option
* type (long option, flag character and non-option)
*/
-tSCC zLongSelection[] =
+static char const zLongSelection[] =
" --* )\n";
-tSCC zFlagSelection[] =
+static char const zFlagSelection[] =
" -* )\n";
-tSCC zEndSelection[] =
+static char const zEndSelection[] =
" ;;\n\n";
-tSCC zNoSelection[] =
+static char const zNoSelection[] =
" * )\n"
" OPT_PROCESS=false\n"
" ;;\n"
*
* LOOP END
*/
-tSCC zLoopEnd[] =
+static char const zLoopEnd[] =
" if [ -n \"${OPT_ARG_VAL}\" ]\n"
" then\n"
" eval %1$s_${OPT_NAME}${OPT_ELEMENT}=\"'${OPT_ARG_VAL}'\"\n"
"unset OPT_CODE || :\n"
"unset OPT_ARG_VAL || :\n%2$s";
-tSCC zTrailerMarker[] = "\n"
+static char const zTrailerMarker[] = "\n"
"# # # # # # # # # #\n#\n"
"# END OF AUTOMATED OPTION PROCESSING\n"
"#\n# # # # # # # # # # -- do not modify this marker --\n";
*
* OPTION SELECTION
*/
-tSCC zOptionCase[] =
+static char const zOptionCase[] =
" case \"${OPT_CODE}\" in\n";
-tSCC zOptionPartName[] =
+static char const zOptionPartName[] =
" '%s' | \\\n";
-tSCC zOptionFullName[] =
+static char const zOptionFullName[] =
" '%s' )\n";
-tSCC zOptionFlag[] =
+static char const zOptionFlag[] =
" '%c' )\n";
-tSCC zOptionEndSelect[] =
+static char const zOptionEndSelect[] =
" ;;\n\n";
-tSCC zOptionUnknown[] =
+static char const zOptionUnknown[] =
" * )\n"
" echo Unknown %s: \"${OPT_CODE}\" >&2\n"
" echo \"$%s_USAGE_TEXT\"\n"
*
* Formats for emitting the text for handling particular options
*/
-tSCC zTextExit[] =
+static char const zTextExit[] =
" echo \"$%s_%s_TEXT\"\n"
" exit 0\n";
-tSCC zPagedUsageExit[] =
+static char const zPagedUsageExit[] =
" echo \"$%s_LONGUSAGE_TEXT\" | ${PAGER-more}\n"
" exit 0\n";
-tSCC zCmdFmt[] =
+static char const zCmdFmt[] =
" %s\n";
-tSCC zCountTest[] =
+static char const zCountTest[] =
" if [ $%1$s_%2$s_CT -ge %3$d ] ; then\n"
" echo Error: more than %3$d %2$s options >&2\n"
" echo \"$%1$s_USAGE_TEXT\"\n"
" exit 1 ; fi\n";
-tSCC zMultiArg[] =
+static char const zMultiArg[] =
" %1$s_%2$s_CT=`expr ${%1$s_%2$s_CT} + 1`\n"
" OPT_ELEMENT=\"_${%1$s_%2$s_CT}\"\n"
" OPT_NAME='%2$s'\n";
-tSCC zSingleArg[] =
+static char const zSingleArg[] =
" if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n"
" echo Error: duplicate %2$s option >&2\n"
" echo \"$%1$s_USAGE_TEXT\"\n"
" %1$s_%2$s_set=true\n"
" OPT_NAME='%2$s'\n";
-tSCC zNoMultiArg[] =
+static char const zNoMultiArg[] =
" %1$s_%2$s_CT=0\n"
" OPT_ELEMENT=''\n"
" %1$s_%2$s='%3$s'\n"
" export %1$s_%2$s\n"
" OPT_NAME='%2$s'\n";
-tSCC zNoSingleArg[] =
+static char const zNoSingleArg[] =
" if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n"
" echo Error: duplicate %2$s option >&2\n"
" echo \"$%1$s_USAGE_TEXT\"\n"
" export %1$s_%2$s\n"
" OPT_NAME='%2$s'\n";
-tSCC zMayArg[] =
+static char const zMayArg[] =
" eval %1$s_%2$s${OPT_ELEMENT}=true\n"
" export %1$s_%2$s${OPT_ELEMENT}\n"
" OPT_ARG_NEEDED=OK\n";
-tSCC zMustArg[] =
+static char const zMustArg[] =
" OPT_ARG_NEEDED=YES\n";
-tSCC zCantArg[] =
+static char const zCantArg[] =
" eval %1$s_%2$s${OPT_ELEMENT}=true\n"
" export %1$s_%2$s${OPT_ELEMENT}\n"
" OPT_ARG_NEEDED=NO\n";
*
* Formats for emitting the text for handling long option types
*/
-tSCC zLongOptInit[] =
+static char const zLongOptInit[] =
" OPT_CODE=`echo \"X${OPT_ARG}\"|sed 's/^X-*//'`\n"
" shift\n"
" OPT_ARG=\"$1\"\n\n"
" OPT_ARG_VAL=`echo \"${OPT_CODE}\"|sed 's/^[^=]*=//'`\n"
" OPT_CODE=`echo \"${OPT_CODE}\"|sed 's/=.*$//'` ;; esac\n\n";
-tSCC zLongOptArg[] =
+static char const zLongOptArg[] =
" case \"${OPT_ARG_NEEDED}\" in\n"
" NO )\n"
" OPT_ARG_VAL=''\n"
*
* Formats for emitting the text for handling flag option types
*/
-tSCC zFlagOptInit[] =
+static char const zFlagOptInit[] =
" OPT_CODE=`echo \"X${OPT_ARG}\" | sed 's/X-\\(.\\).*/\\1/'`\n"
" OPT_ARG=` echo \"X${OPT_ARG}\" | sed 's/X-.//'`\n\n";
-tSCC zFlagOptArg[] =
+static char const zFlagOptArg[] =
" case \"${OPT_ARG_NEEDED}\" in\n"
" NO )\n"
" if [ -n \"${OPT_ARG}\" ]\n"
static char const* apzTTNames[] = { TEXTTO_TABLE };
# undef _TT_
-#if defined(__windows__) && !defined(__CYGWIN__)
+#if ! defined(HAVE_WORKING_FORK)
printf( "%1$s_%2$s_TEXT='no %2$s text'\n",
pOpts->pzPROGNAME, apzTTNames[ whichVar ]);
#else
void
genshelloptUsage( tOptions* pOpts, int exitCode )
{
-#if defined(__windows__) && !defined(__CYGWIN__)
+#if ! defined(HAVE_WORKING_FORK)
optionUsage( pOpts, exitCode );
#else
/*
switch (fork()) {
case -1:
optionUsage( pOpts, EXIT_FAILURE );
- /*NOTREACHED*/
+ /* NOTREACHED */
_exit( EXIT_FAILURE );
case 0:
pagerState = PAGER_STATE_CHILD;
optionUsage( pOpts, EXIT_SUCCESS );
- /*NOTREACHED*/
+ /* NOTREACHED */
_exit( EXIT_FAILURE );
default:
/*
- * $Id: nested.c,v 4.28 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 43877d3ade0b626b4bec87f2f340a8358c118333 $
* Time-stamp: "2008-07-28 19:18:28 bkorb"
*
* Automated Options Nested Values module.
/*
- * $Id: numeric.c,v 4.23 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 52d772d69bed7f2911d88ff17b9a44308d6ca0b1 $
* Time-stamp: "2009-07-23 17:25:39 bkorb"
*
* This file is part of AutoOpts, a companion to AutoGen.
/*
- * $Id: pgusage.c,v 4.18 2009/08/01 17:44:36 bkorb Exp $
- * Time-stamp: "2008-07-27 21:08:42 bkorb"
+ * $Id: da09fc943da953195b243b7697fdbf5127f5b6c2 $
+ * Time-stamp: "2009-11-01 11:52:51 bkorb"
*
* Automated Options Paged Usage module.
*
* doc:
* Run the usage output through a pager.
* This is very handy if it is very long.
+ * This is disabled on platforms without a working fork() function.
=*/
void
optionPagedUsage( tOptions* pOptions, tOptDesc* pOD )
{
-#if defined(__windows__) && !defined(__CYGWIN__)
+#if ! defined(HAVE_WORKING_FORK)
if ((pOD->fOptState & OPTST_RESET) != 0)
return;
*/
(*pOptions->pUsageProc)( pOptions, EXIT_SUCCESS );
- /*NOTREACHED*/
+ /* NOTREACHED */
_exit( EXIT_FAILURE );
}
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Sat Aug 1 11:21:12 PDT 2009
+ * Generated Sun Nov 8 08:41:10 PST 2009
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1
/*
- * $Id: putshell.c,v 4.27 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 5d14243d5d32d234f05bc8a20b1a6464716b30aa $
* Time-stamp: "2008-07-27 12:14:38 bkorb"
*
* This module will interpret the options set in the tOptions
/*
- * $Id: reset.c,v 4.4 2009/08/01 17:44:36 bkorb Exp $
- * Time-stamp: "2008-08-02 12:25:18 bkorb"
+ * $Id: 808e536555f06924b450ab6b5a72c03b67c5b99a $
+ * Time-stamp: "2009-11-01 11:45:57 bkorb"
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
if ((pzArg == NULL) || (*pzArg == NUL)) {
fputs(zNoResetArg, stderr);
pOpts->pUsageProc(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ assert(0 == 1);
}
reset_active = AG_TRUE;
if (! SUCCESSFUL(succ)) {
fprintf(stderr, zIllOptChr, pOpts->pzProgPath, *pzArg);
pOpts->pUsageProc(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ assert(0 == 1);
}
} else {
succ = longOptionFind(pOpts, (char *)pzArg, &opt_state);
if (! SUCCESSFUL(succ)) {
fprintf(stderr, zIllOptStr, pOpts->pzProgPath, pzArg);
pOpts->pUsageProc(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ assert(0 == 1);
}
}
/*
- * restore.c $Id: restore.c,v 4.15 2009/08/01 17:44:36 bkorb Exp $
+ * restore.c $Id: 6f5237ba2586755d8ca354f325fc00e7fa1395ec $
* Time-stamp: "2007-07-04 11:34:40 bkorb"
*
* This module's routines will save the current option state to memory
/*
- * save.c $Id: save.c,v 4.32 2009/08/01 17:44:36 bkorb Exp $
+ * save.c $Id: 5a69234fab4c2d8d7eaf4aed4dbb3052ce6be5b6 $
* Time-stamp: "2009-07-20 20:40:28 bkorb"
*
* This module's routines will take the currently set options and
/*
- * sort.c $Id: sort.c,v 4.16 2009/08/01 17:44:36 bkorb Exp $
+ * sort.c $Id: aac1bf81481f4bb149a72129fbd11fe54db7fa35 $
* Time-stamp: "2007-07-04 11:34:52 bkorb"
*
* This module implements argument sorting.
/*
* stack.c
- * $Id: stack.c,v 4.19 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 9d4a7c1c6ae364a6134dc5ff01f58f08b52f1a16 $
* Time-stamp: "2008-07-30 16:56:32 bkorb"
*
* This is a special option processing routine that will save the
/*
- * $Id: streqvcmp.c,v 4.16 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: cb437d22b0c48960c9e1c23501fba6e3291fecd8 $
* Time-stamp: "2008-12-26 10:15:46 bkorb"
*
* String Equivalence Comparison
/*
- * $Id: text_mmap.c,v 4.20 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 14e1f51d1a5a31d8395fdf1e93a07bace1c59e87 $
*
* Time-stamp: "2007-07-04 11:35:49 bkorb"
*
/*
- * $Id: time.c,v 4.4 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 63d3312044fd7854ad0995faea41c96f5185cb93 $
* Time-stamp: "2008-11-16 14:51:48 bkorb"
*
* This file is part of AutoOpts, a companion to AutoGen.
/*
- * usage.c $Id: usage.c,v 4.31 2009/08/01 17:44:37 bkorb Exp $
- * Time-stamp: "2009-01-17 13:18:23 bkorb"
+ * usage.c $Id: f611ee45aa9aa8dc102b8acf6b4bc568c60fa99f $
+ * Time-stamp: "2009-10-02 23:18:50 bkorb"
*
* This module implements the default usage procedure for
* Automated Options. It may be overridden, of course.
tCC* pzRc,
tCC* pzPN );
+static void
+printOptPreamble(
+ tOptions* pOptions,
+ tOptDesc* pOD,
+ arg_types_t* pAT );
+
static void
printOneUsage(
tOptions* pOptions,
static void
printOptionUsage(
- tOptions* pOpts,
- int ex_code,
- tCC* pOptTitle );
+ tOptions * pOpts,
+ int ex_code,
+ tCC * pOptTitle );
static void
printProgramDetails( tOptions* pOptions );
}
-/*
- * Print the usage information for a single option.
- */
static void
-printOneUsage(
+printOptPreamble(
tOptions* pOptions,
tOptDesc* pOD,
arg_types_t* pAT )
*/
if ((pOptions->fOptSet & OPTPROC_SHORTOPT) == 0)
fputs( pAT->pzSpc, option_usage_fp );
+
else if (! IS_GRAPHIC_CHAR(pOD->optValue)) {
if ( (pOptions->fOptSet & (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
== (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
fputc( ' ', option_usage_fp );
fputs( pAT->pzNoF, option_usage_fp );
+
} else {
fprintf( option_usage_fp, " -%c", pOD->optValue );
if ( (pOptions->fOptSet & (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
== (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
fputs( ", ", option_usage_fp );
}
+}
+
+/*
+ * Print the usage information for a single option.
+ */
+static void
+printOneUsage(
+ tOptions* pOptions,
+ tOptDesc* pOD,
+ arg_types_t* pAT )
+{
+ printOptPreamble(pOptions, pOD, pAT);
{
char z[ 80 ];
*/
static void
printOptionUsage(
- tOptions* pOpts,
- int ex_code,
- tCC* pOptTitle )
+ tOptions * pOpts,
+ int ex_code,
+ tCC * pOptTitle )
{
- int ct = pOpts->optCt;
- int optNo = 0;
- tOptDesc* pOD = pOpts->pOptDesc;
- int docCt = 0;
+ int ct = pOpts->optCt;
+ int optNo = 0;
+ tOptDesc * pOD = pOpts->pOptDesc;
+ int docCt = 0;
do {
- if ((pOD->fOptState & OPTST_NO_USAGE_MASK) != 0)
+ if ((pOD->fOptState & OPTST_NO_USAGE_MASK) != 0) {
+
+ /*
+ * IF this is a compiled-out option
+ * *AND* usage was requested with "omitted-usage"
+ * *AND* this is NOT abbreviated usage
+ * THEN display this option.
+ */
+ if ( (pOD->fOptState == (OPTST_OMITTED | OPTST_NO_INIT))
+ && (pOD->pz_Name != NULL)
+ && (ex_code == EXIT_SUCCESS)) {
+
+ char const * why_pz =
+ (pOD->pzText == NULL) ? zDisabledWhy : pOD->pzText;
+ printOptPreamble(pOpts, pOD, &argTypes);
+ fprintf(option_usage_fp, zDisabledOpt, pOD->pz_Name, why_pz);
+ }
+
continue;
+ }
if ((pOD->fOptState & OPTST_DOCUMENT) != 0) {
if (ex_code == EXIT_SUCCESS) {
&& ((pOD[-1].fOptState & OPTST_DOCUMENT) == 0) )
fprintf( option_usage_fp, argTypes.pzBrk, zAuto, pOptTitle );
- printOneUsage( pOpts, pOD, &argTypes );
+ printOneUsage(pOpts, pOD, &argTypes);
/*
* IF we were invoked because of the --help option,
/*
- * Generated header for gperf generated source Sat Aug 1 11:21:22 PDT 2009
+ * Generated header for gperf generated source Sun Nov 8 08:41:19 PST 2009
* This file enumerates the list of names and declares the
* procedure for mapping string names to the enum value.
*/
-/* $Id: version.c,v 4.17 2009/08/01 17:44:37 bkorb Exp $
+/* $Id: e21e2bf9958c54e440efbdc7c1026e46ac589f66 $
* Time-stamp: "2008-07-27 10:11:30 bkorb"
*
* This module implements the default usage procedure for
/*
- * Generated header for gperf generated source Sat Aug 1 11:21:22 PDT 2009
+ * Generated header for gperf generated source Sun Nov 8 08:41:19 PST 2009
* This file enumerates the list of names and declares the
* procedure for mapping string names to the enum value.
*/
endif
libopts_la_SOURCES = libopts.c
libopts_la_CPPFLAGS = -I$(top_srcdir)
-libopts_la_LDFLAGS = -version-info 32:1:7
+libopts_la_LDFLAGS = -version-info 33:0:8
EXTRA_DIST = \
COPYING.gplv3 COPYING.lgplv3 COPYING.mbsd \
MakeDefs.inc README ag-char-map.h \
/*
- * Character mapping generated 08/01/09 11:21:22
+ * Character mapping generated 11/08/09 08:41:19
*
* This file contains the character classifications
* used by AutoGen and AutoOpts for identifying tokens.
/*
- * $Id: autoopts.c,v 4.40 2009/08/01 17:44:36 bkorb Exp $
- * Time-stamp: "2009-01-12 02:49:49 bkorb"
+ * $Id: 56abb301f50605ec5bae137ded730e330d8d7735 $
+ * Time-stamp: "2009-11-01 10:50:34 bkorb"
*
* This file contains all of the routines that must be linked into
* an executable to use the generated option processing. The optional
/*
* If provided a procedure to call, call it
*/
- if (pOP != (tpOptProc)NULL)
+ if (pOP != NULL)
(*pOP)( pOpts, pOD );
return SUCCESS;
} else nameLen = strlen( pzOptName );
do {
- if (SKIP_OPT(pOD))
- continue;
+ if (SKIP_OPT(pOD)) {
+ if ( (pOD->fOptState != (OPTST_OMITTED | OPTST_NO_INIT))
+ || (pOD->pz_Name == NULL))
+ continue;
+ }
+ else assert(pOD->pz_Name != NULL);
if (strneqvcmp( pzOptName, pOD->pz_Name, nameLen ) == 0) {
/*
* Make sure we either found an exact match or found only one partial
*/
if (matchCt == 1) {
+ pOD = pOpts->pOptDesc + matchIdx;
+
+ if (SKIP_OPT(pOD)) {
+ fprintf(stderr, zDisabledErr, pOpts->pzProgName, pOD->pz_Name);
+ if (pOD->pzText != NULL)
+ fprintf(stderr, " -- %s", pOD->pzText);
+ fputc('\n', stderr);
+ (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ }
+
/*
* IF we found a disablement name,
* THEN set the bit in the callers' flag word
if (disable)
pOptState->flags |= OPTST_DISABLED;
- pOptState->pOD = pOpts->pOptDesc + matchIdx;
+ pOptState->pOD = pOD;
pOptState->pzOptArg = pzEq;
pOptState->optType = TOPT_LONG;
return SUCCESS;
if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) {
fprintf(stderr, (matchCt == 0) ? zIllOptStr : zAmbigOptStr,
pOpts->pzProgPath, pzOptName);
- (*pOpts->pUsageProc)( pOpts, EXIT_FAILURE );
+ (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
}
return FAILURE;
/*
* Search the option list
*/
- for (;;) {
- /*
- * IF the values match,
- * THEN we stop here
- */
- if ((! SKIP_OPT(pRes)) && (optValue == pRes->optValue)) {
- pOptState->pOD = pRes;
- pOptState->optType = TOPT_SHORT;
- return SUCCESS;
+ do {
+ if (optValue != pRes->optValue)
+ continue;
+
+ if (SKIP_OPT(pRes)) {
+ if ( (pRes->fOptState == (OPTST_OMITTED | OPTST_NO_INIT))
+ && (pRes->pz_Name != NULL)) {
+ fprintf(stderr, zDisabledErr, pOpts->pzProgPath, pRes->pz_Name);
+ if (pRes->pzText != NULL)
+ fprintf(stderr, " -- %s", pRes->pzText);
+ fputc('\n', stderr);
+ (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ }
+ goto short_opt_error;
}
- /*
- * Advance to next option description
- */
- pRes++;
+ pOptState->pOD = pRes;
+ pOptState->optType = TOPT_SHORT;
+ return SUCCESS;
- /*
- * IF we have searched everything, ...
- */
- if (--ct <= 0)
- break;
- }
+ } while (pRes++, --ct > 0);
/*
* IF the character value is a digit
return SUCCESS;
}
+ short_opt_error:
+
/*
* IF we are to stop on errors (the default, actually)
* THEN call the usage procedure.
/*
* Time-stamp: "2008-11-01 20:08:06 bkorb"
*
- * autoopts.h $Id: autoopts.h,v 4.31 2009/08/01 17:44:36 bkorb Exp $
+ * autoopts.h $Id: d5e30331d37ca10ec88c592d24d8615dd6c1f0ee $
*
* This file defines all the global structures and special values
* used in the automated option processing library.
/*
- * $Id: boolean.c,v 4.17 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 329b43154b88d78564d8f960a00a83ec7d8baee0 $
* Time-stamp: "2008-08-03 13:06:02 bkorb"
*
* Automated Options Paged Usage module.
/* compat.h --- fake the preprocessor into handlng portability
*
- * Time-stamp: "2008-06-14 09:36:25 bkorb"
+ * Time-stamp: "2009-10-18 11:14:14 bkorb"
*
- * $Id: compat.h,v 4.21 2009/01/01 16:51:52 bkorb Exp $
+ * $Id: 27c1eb45f171295ab6176280aeca742cfdbe9fed $
*
* compat.h is free software.
* This file is part of AutoGen.
#endif
#ifndef SHORT_MAX
-# define SHORT_MAX ~(1 << (8*sizeof(short) -1))
+# define SHORT_MAX ~(1 << (8*sizeof(short) - 1))
#else
# define USHORT_MAX ~(OUS)
#endif
#ifndef HAVE_INT8_T
- typedef signed char int8_t;
+ typedef signed char int8_t;
+# define HAVE_INT8_T 1
#endif
#ifndef HAVE_UINT8_T
- typedef unsigned char uint8_t;
+ typedef unsigned char uint8_t;
+# define HAVE_UINT8_T 1
#endif
#ifndef HAVE_INT16_T
- typedef signed short int16_t;
+ typedef signed short int16_t;
+# define HAVE_INT16_T 1
#endif
#ifndef HAVE_UINT16_T
- typedef unsigned short uint16_t;
-#endif
-#ifndef HAVE_UINT_T
- typedef unsigned int uint_t;
+ typedef unsigned short uint16_t;
+# define HAVE_UINT16_T 1
#endif
#ifndef HAVE_INT32_T
-# if SIZEOF_INT == 4
- typedef signed int int32_t;
-# elif SIZEOF_LONG == 4
- typedef signed long int32_t;
+# if SIZEOF_INT == 4
+ typedef signed int int32_t;
+# elif SIZEOF_LONG == 4
+ typedef signed long int32_t;
# endif
+# define HAVE_INT32_T 1
#endif
#ifndef HAVE_UINT32_T
-# if SIZEOF_INT == 4
- typedef unsigned int uint32_t;
-# elif SIZEOF_LONG == 4
- typedef unsigned long uint32_t;
+# if SIZEOF_INT == 4
+ typedef unsigned int uint32_t;
+# elif SIZEOF_LONG == 4
+ typedef unsigned long uint32_t;
# else
# error Cannot create a uint32_t type.
Choke Me.
# endif
+# define HAVE_UINT32_T 1
#endif
#ifndef HAVE_INTPTR_T
- typedef signed long intptr_t;
+# if SIZEOF_CHARP == SIZEOF_LONG
+ typedef signed long intptr_t;
+# else
+ typedef signed int intptr_t;
+# endif
+# define HAVE_INTPTR_T 1
#endif
+
#ifndef HAVE_UINTPTR_T
- typedef unsigned long uintptr_t;
+# if SIZEOF_CHARP == SIZEOF_LONG
+ typedef unsigned long intptr_t;
+# else
+ typedef unsigned int intptr_t;
+# endif
+# define HAVE_INTPTR_T 1
#endif
+
+#ifndef HAVE_UINT_T
+ typedef unsigned int uint_t;
+# define HAVE_UINT_T 1
+#endif
+
#ifndef HAVE_SIZE_T
- typedef unsigned int size_t;
+ typedef unsigned int size_t;
+# define HAVE_SIZE_T 1
#endif
#ifndef HAVE_WINT_T
- typedef unsigned int wint_t;
+ typedef unsigned int wint_t;
+# define HAVE_WINT_T 1
#endif
#ifndef HAVE_PID_T
- typedef signed int pid_t;
+ typedef signed int pid_t;
+# define HAVE_PID_T 1
#endif
/* redefine these for BSD style string libraries */
#ifndef HAVE_STRCHR
-# define strchr index
-# define strrchr rindex
+# define strchr index
+# define strrchr rindex
#endif
#ifdef USE_FOPEN_BINARY
/*
* Author: Gary V Vaughan <gvaughan@oranda.demon.co.uk>
* Time-stamp: "2006-09-23 19:46:16 bkorb"
- * Last Modified: $Date: 2007/07/04 20:51:18 $
* by: bkorb
*
- * $Id: pathfind.c,v 4.11 2007/07/04 20:51:18 bkorb Exp $
+ * $Id: 8ce7ddfe2378f0b75c91c0ab348a6ad81634fb01 $
*/
/* Code: */
/*
* Time-stamp: "2009-07-22 18:53:59 bkorb"
* by: bkorb
- * Last Committed: $Date: 2009/07/23 02:07:46 $
*
* This file is part of AutoGen.
*
/*
- * $Id: configfile.c,v 1.36 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: f1650b45a91ec95af830ff76041cc4f0048e60f0 $
* Time-stamp: "2009-01-18 10:21:58 bkorb"
*
* configuration/rc/ini file handling.
/*
- * $Id: cook.c,v 4.18 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 3da9a5fc88c904673b3b95d0c9667b2bcbccfc80 $
* Time-stamp: "2007-11-16 22:49:11 bkorb"
*
* This file contains the routines that deal with processing quoted strings
/*
- * $Id: enumeration.c,v 4.26 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 27595043d23170eb4bb8b9831fc54016944e00e8 $
* Time-stamp: "2008-07-27 12:28:01 bkorb"
*
* Automated Options Paged Usage module.
/*
- * $Id: environment.c,v 4.21 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 8700c8e91e8094c455392c691d9b6a7d62222240 $
* Time-stamp: "2009-07-20 20:12:24 bkorb"
*
* This file contains all of the routines that must be linked into
/*
- * $Id: file.c,v 1.9 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 1410aaa5f08a562e0cd6c28ffae5a49dc7a3164f $
* Time-stamp: "2009-07-23 17:23:46 bkorb"
*
* This file is part of AutoOpts, a companion to AutoGen.
/*
- * $Id: load.c,v 4.29 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: f0ececd5fec43bacb417d7b50294accc2121923f $
* Time-stamp: "2008-12-06 10:16:05 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 August 1, 2009 at 11:21:13 AM by AutoGen 5.9.9pre4
+dnl It has been AutoGen-ed November 8, 2009 at 08:41:10 AM by AutoGen 5.9.10pre13
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
dnl
AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
[if test X${INVOKE_LIBOPTS_MACROS_FIRST_done} != Xyes ; then]
- # =================
- # AC_HEADER_STDC
- # =================
AC_HEADER_STDC
- # =================
- # AC_HEADER_DIRENT
- # =================
AC_HEADER_DIRENT
# =================
# ----------------------------------------------------------------------
AC_CHECK_LIB(gen, pathfind)
AC_FUNC_VPRINTF
+ AC_FUNC_FORK
AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr \
strrchr strsignal])
[ INVOKE_LIBOPTS_MACROS_FIRST_done=yes
dnl @synopsis LIBOPTS_CHECK
dnl
dnl Time-stamp: "2009-07-22 18:50:49 bkorb"
-dnl Last Committed: $Date: 2009/07/23 02:07:47 $
dnl
dnl If autoopts-config works, add the linking information to LIBS.
dnl Otherwise, add ``libopts-${ao_rev}'' to SUBDIRS and run all
dnl with or without modifications, as long as this notice is preserved.
dnl Time-stamp: "2009-07-22 18:53:27 bkorb"
-dnl Last Committed: $Date: 2009/07/23 02:07:46 $
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
/*
- * $Id: makeshell.c,v 4.29 2009/08/01 17:44:36 bkorb Exp $
- * Time-stamp: "2008-07-26 16:10:51 bkorb"
+ * $Id: 7226344c6486a4eda395f893881080b7d80a2003 $
+ * Time-stamp: "2009-11-01 11:52:37 bkorb"
*
* This module will interpret the options set in the tOptions
* structure and create a Bourne shell script capable of parsing them.
*
* Setup Format Strings
*/
-tSCC zStartMarker[] =
+static char const zStartMarker[] =
"# # # # # # # # # # -- do not modify this marker --\n#\n"
"# DO NOT EDIT THIS SECTION";
-tSCC zPreamble[] =
+static char const zPreamble[] =
"%s OF %s\n#\n"
"# From here to the next `-- do not modify this marker --',\n"
"# the text has been generated %s\n";
-tSCC zEndPreamble[] =
+static char const zEndPreamble[] =
"# From the %s option definitions\n#\n";
-tSCC zMultiDef[] = "\n"
+static char const zMultiDef[] = "\n"
"if test -z \"${%1$s_%2$s}\"\n"
"then\n"
" %1$s_%2$s_CT=0\n"
"fi\n"
"export %1$s_%2$s_CT";
-tSCC zSingleDef[] = "\n"
+static char const zSingleDef[] = "\n"
"%1$s_%2$s=\"${%1$s_%2$s-'%3$s'}\"\n"
"%1$s_%2$s_set=false\n"
"export %1$s_%2$s\n";
-tSCC zSingleNoDef[] = "\n"
+static char const zSingleNoDef[] = "\n"
"%1$s_%2$s=\"${%1$s_%2$s}\"\n"
"%1$s_%2$s_set=false\n"
"export %1$s_%2$s\n";
* all options are named options (loop only)
* regular, marked option processing.
*/
-tSCC zLoopCase[] = "\n"
+static char const zLoopCase[] = "\n"
"OPT_PROCESS=true\n"
"OPT_ARG=\"$1\"\n\n"
"while ${OPT_PROCESS} && [ $# -gt 0 ]\ndo\n"
" shift\n"
" ;;\n\n";
-tSCC zLoopOnly[] = "\n"
+static char const zLoopOnly[] = "\n"
"OPT_ARG=\"$1\"\n\n"
"while [ $# -gt 0 ]\ndo\n"
" OPT_ELEMENT=''\n"
* then we must have selectors for each acceptable option
* type (long option, flag character and non-option)
*/
-tSCC zLongSelection[] =
+static char const zLongSelection[] =
" --* )\n";
-tSCC zFlagSelection[] =
+static char const zFlagSelection[] =
" -* )\n";
-tSCC zEndSelection[] =
+static char const zEndSelection[] =
" ;;\n\n";
-tSCC zNoSelection[] =
+static char const zNoSelection[] =
" * )\n"
" OPT_PROCESS=false\n"
" ;;\n"
*
* LOOP END
*/
-tSCC zLoopEnd[] =
+static char const zLoopEnd[] =
" if [ -n \"${OPT_ARG_VAL}\" ]\n"
" then\n"
" eval %1$s_${OPT_NAME}${OPT_ELEMENT}=\"'${OPT_ARG_VAL}'\"\n"
"unset OPT_CODE || :\n"
"unset OPT_ARG_VAL || :\n%2$s";
-tSCC zTrailerMarker[] = "\n"
+static char const zTrailerMarker[] = "\n"
"# # # # # # # # # #\n#\n"
"# END OF AUTOMATED OPTION PROCESSING\n"
"#\n# # # # # # # # # # -- do not modify this marker --\n";
*
* OPTION SELECTION
*/
-tSCC zOptionCase[] =
+static char const zOptionCase[] =
" case \"${OPT_CODE}\" in\n";
-tSCC zOptionPartName[] =
+static char const zOptionPartName[] =
" '%s' | \\\n";
-tSCC zOptionFullName[] =
+static char const zOptionFullName[] =
" '%s' )\n";
-tSCC zOptionFlag[] =
+static char const zOptionFlag[] =
" '%c' )\n";
-tSCC zOptionEndSelect[] =
+static char const zOptionEndSelect[] =
" ;;\n\n";
-tSCC zOptionUnknown[] =
+static char const zOptionUnknown[] =
" * )\n"
" echo Unknown %s: \"${OPT_CODE}\" >&2\n"
" echo \"$%s_USAGE_TEXT\"\n"
*
* Formats for emitting the text for handling particular options
*/
-tSCC zTextExit[] =
+static char const zTextExit[] =
" echo \"$%s_%s_TEXT\"\n"
" exit 0\n";
-tSCC zPagedUsageExit[] =
+static char const zPagedUsageExit[] =
" echo \"$%s_LONGUSAGE_TEXT\" | ${PAGER-more}\n"
" exit 0\n";
-tSCC zCmdFmt[] =
+static char const zCmdFmt[] =
" %s\n";
-tSCC zCountTest[] =
+static char const zCountTest[] =
" if [ $%1$s_%2$s_CT -ge %3$d ] ; then\n"
" echo Error: more than %3$d %2$s options >&2\n"
" echo \"$%1$s_USAGE_TEXT\"\n"
" exit 1 ; fi\n";
-tSCC zMultiArg[] =
+static char const zMultiArg[] =
" %1$s_%2$s_CT=`expr ${%1$s_%2$s_CT} + 1`\n"
" OPT_ELEMENT=\"_${%1$s_%2$s_CT}\"\n"
" OPT_NAME='%2$s'\n";
-tSCC zSingleArg[] =
+static char const zSingleArg[] =
" if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n"
" echo Error: duplicate %2$s option >&2\n"
" echo \"$%1$s_USAGE_TEXT\"\n"
" %1$s_%2$s_set=true\n"
" OPT_NAME='%2$s'\n";
-tSCC zNoMultiArg[] =
+static char const zNoMultiArg[] =
" %1$s_%2$s_CT=0\n"
" OPT_ELEMENT=''\n"
" %1$s_%2$s='%3$s'\n"
" export %1$s_%2$s\n"
" OPT_NAME='%2$s'\n";
-tSCC zNoSingleArg[] =
+static char const zNoSingleArg[] =
" if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n"
" echo Error: duplicate %2$s option >&2\n"
" echo \"$%1$s_USAGE_TEXT\"\n"
" export %1$s_%2$s\n"
" OPT_NAME='%2$s'\n";
-tSCC zMayArg[] =
+static char const zMayArg[] =
" eval %1$s_%2$s${OPT_ELEMENT}=true\n"
" export %1$s_%2$s${OPT_ELEMENT}\n"
" OPT_ARG_NEEDED=OK\n";
-tSCC zMustArg[] =
+static char const zMustArg[] =
" OPT_ARG_NEEDED=YES\n";
-tSCC zCantArg[] =
+static char const zCantArg[] =
" eval %1$s_%2$s${OPT_ELEMENT}=true\n"
" export %1$s_%2$s${OPT_ELEMENT}\n"
" OPT_ARG_NEEDED=NO\n";
*
* Formats for emitting the text for handling long option types
*/
-tSCC zLongOptInit[] =
+static char const zLongOptInit[] =
" OPT_CODE=`echo \"X${OPT_ARG}\"|sed 's/^X-*//'`\n"
" shift\n"
" OPT_ARG=\"$1\"\n\n"
" OPT_ARG_VAL=`echo \"${OPT_CODE}\"|sed 's/^[^=]*=//'`\n"
" OPT_CODE=`echo \"${OPT_CODE}\"|sed 's/=.*$//'` ;; esac\n\n";
-tSCC zLongOptArg[] =
+static char const zLongOptArg[] =
" case \"${OPT_ARG_NEEDED}\" in\n"
" NO )\n"
" OPT_ARG_VAL=''\n"
*
* Formats for emitting the text for handling flag option types
*/
-tSCC zFlagOptInit[] =
+static char const zFlagOptInit[] =
" OPT_CODE=`echo \"X${OPT_ARG}\" | sed 's/X-\\(.\\).*/\\1/'`\n"
" OPT_ARG=` echo \"X${OPT_ARG}\" | sed 's/X-.//'`\n\n";
-tSCC zFlagOptArg[] =
+static char const zFlagOptArg[] =
" case \"${OPT_ARG_NEEDED}\" in\n"
" NO )\n"
" if [ -n \"${OPT_ARG}\" ]\n"
static char const* apzTTNames[] = { TEXTTO_TABLE };
# undef _TT_
-#if defined(__windows__) && !defined(__CYGWIN__)
+#if ! defined(HAVE_WORKING_FORK)
printf( "%1$s_%2$s_TEXT='no %2$s text'\n",
pOpts->pzPROGNAME, apzTTNames[ whichVar ]);
#else
void
genshelloptUsage( tOptions* pOpts, int exitCode )
{
-#if defined(__windows__) && !defined(__CYGWIN__)
+#if ! defined(HAVE_WORKING_FORK)
optionUsage( pOpts, exitCode );
#else
/*
switch (fork()) {
case -1:
optionUsage( pOpts, EXIT_FAILURE );
- /*NOTREACHED*/
+ /* NOTREACHED */
_exit( EXIT_FAILURE );
case 0:
pagerState = PAGER_STATE_CHILD;
optionUsage( pOpts, EXIT_SUCCESS );
- /*NOTREACHED*/
+ /* NOTREACHED */
_exit( EXIT_FAILURE );
default:
/*
- * $Id: nested.c,v 4.28 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 43877d3ade0b626b4bec87f2f340a8358c118333 $
* Time-stamp: "2008-07-28 19:18:28 bkorb"
*
* Automated Options Nested Values module.
/*
- * $Id: numeric.c,v 4.23 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 52d772d69bed7f2911d88ff17b9a44308d6ca0b1 $
* Time-stamp: "2009-07-23 17:25:39 bkorb"
*
* This file is part of AutoOpts, a companion to AutoGen.
/*
- * $Id: pgusage.c,v 4.18 2009/08/01 17:44:36 bkorb Exp $
- * Time-stamp: "2008-07-27 21:08:42 bkorb"
+ * $Id: da09fc943da953195b243b7697fdbf5127f5b6c2 $
+ * Time-stamp: "2009-11-01 11:52:51 bkorb"
*
* Automated Options Paged Usage module.
*
* doc:
* Run the usage output through a pager.
* This is very handy if it is very long.
+ * This is disabled on platforms without a working fork() function.
=*/
void
optionPagedUsage( tOptions* pOptions, tOptDesc* pOD )
{
-#if defined(__windows__) && !defined(__CYGWIN__)
+#if ! defined(HAVE_WORKING_FORK)
if ((pOD->fOptState & OPTST_RESET) != 0)
return;
*/
(*pOptions->pUsageProc)( pOptions, EXIT_SUCCESS );
- /*NOTREACHED*/
+ /* NOTREACHED */
_exit( EXIT_FAILURE );
}
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Sat Aug 1 11:21:12 PDT 2009
+ * Generated Sun Nov 8 08:41:10 PST 2009
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1
/*
- * $Id: putshell.c,v 4.27 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 5d14243d5d32d234f05bc8a20b1a6464716b30aa $
* Time-stamp: "2008-07-27 12:14:38 bkorb"
*
* This module will interpret the options set in the tOptions
/*
- * $Id: reset.c,v 4.4 2009/08/01 17:44:36 bkorb Exp $
- * Time-stamp: "2008-08-02 12:25:18 bkorb"
+ * $Id: 808e536555f06924b450ab6b5a72c03b67c5b99a $
+ * Time-stamp: "2009-11-01 11:45:57 bkorb"
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
if ((pzArg == NULL) || (*pzArg == NUL)) {
fputs(zNoResetArg, stderr);
pOpts->pUsageProc(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ assert(0 == 1);
}
reset_active = AG_TRUE;
if (! SUCCESSFUL(succ)) {
fprintf(stderr, zIllOptChr, pOpts->pzProgPath, *pzArg);
pOpts->pUsageProc(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ assert(0 == 1);
}
} else {
succ = longOptionFind(pOpts, (char *)pzArg, &opt_state);
if (! SUCCESSFUL(succ)) {
fprintf(stderr, zIllOptStr, pOpts->pzProgPath, pzArg);
pOpts->pUsageProc(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ assert(0 == 1);
}
}
/*
- * restore.c $Id: restore.c,v 4.15 2009/08/01 17:44:36 bkorb Exp $
+ * restore.c $Id: 6f5237ba2586755d8ca354f325fc00e7fa1395ec $
* Time-stamp: "2007-07-04 11:34:40 bkorb"
*
* This module's routines will save the current option state to memory
/*
- * save.c $Id: save.c,v 4.32 2009/08/01 17:44:36 bkorb Exp $
+ * save.c $Id: 5a69234fab4c2d8d7eaf4aed4dbb3052ce6be5b6 $
* Time-stamp: "2009-07-20 20:40:28 bkorb"
*
* This module's routines will take the currently set options and
/*
- * sort.c $Id: sort.c,v 4.16 2009/08/01 17:44:36 bkorb Exp $
+ * sort.c $Id: aac1bf81481f4bb149a72129fbd11fe54db7fa35 $
* Time-stamp: "2007-07-04 11:34:52 bkorb"
*
* This module implements argument sorting.
/*
* stack.c
- * $Id: stack.c,v 4.19 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 9d4a7c1c6ae364a6134dc5ff01f58f08b52f1a16 $
* Time-stamp: "2008-07-30 16:56:32 bkorb"
*
* This is a special option processing routine that will save the
/*
- * $Id: streqvcmp.c,v 4.16 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: cb437d22b0c48960c9e1c23501fba6e3291fecd8 $
* Time-stamp: "2008-12-26 10:15:46 bkorb"
*
* String Equivalence Comparison
/*
- * $Id: text_mmap.c,v 4.20 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 14e1f51d1a5a31d8395fdf1e93a07bace1c59e87 $
*
* Time-stamp: "2007-07-04 11:35:49 bkorb"
*
/*
- * $Id: time.c,v 4.4 2009/08/01 17:44:36 bkorb Exp $
+ * $Id: 63d3312044fd7854ad0995faea41c96f5185cb93 $
* Time-stamp: "2008-11-16 14:51:48 bkorb"
*
* This file is part of AutoOpts, a companion to AutoGen.
/*
- * usage.c $Id: usage.c,v 4.31 2009/08/01 17:44:37 bkorb Exp $
- * Time-stamp: "2009-01-17 13:18:23 bkorb"
+ * usage.c $Id: f611ee45aa9aa8dc102b8acf6b4bc568c60fa99f $
+ * Time-stamp: "2009-10-02 23:18:50 bkorb"
*
* This module implements the default usage procedure for
* Automated Options. It may be overridden, of course.
tCC* pzRc,
tCC* pzPN );
+static void
+printOptPreamble(
+ tOptions* pOptions,
+ tOptDesc* pOD,
+ arg_types_t* pAT );
+
static void
printOneUsage(
tOptions* pOptions,
static void
printOptionUsage(
- tOptions* pOpts,
- int ex_code,
- tCC* pOptTitle );
+ tOptions * pOpts,
+ int ex_code,
+ tCC * pOptTitle );
static void
printProgramDetails( tOptions* pOptions );
}
-/*
- * Print the usage information for a single option.
- */
static void
-printOneUsage(
+printOptPreamble(
tOptions* pOptions,
tOptDesc* pOD,
arg_types_t* pAT )
*/
if ((pOptions->fOptSet & OPTPROC_SHORTOPT) == 0)
fputs( pAT->pzSpc, option_usage_fp );
+
else if (! IS_GRAPHIC_CHAR(pOD->optValue)) {
if ( (pOptions->fOptSet & (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
== (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
fputc( ' ', option_usage_fp );
fputs( pAT->pzNoF, option_usage_fp );
+
} else {
fprintf( option_usage_fp, " -%c", pOD->optValue );
if ( (pOptions->fOptSet & (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
== (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
fputs( ", ", option_usage_fp );
}
+}
+
+/*
+ * Print the usage information for a single option.
+ */
+static void
+printOneUsage(
+ tOptions* pOptions,
+ tOptDesc* pOD,
+ arg_types_t* pAT )
+{
+ printOptPreamble(pOptions, pOD, pAT);
{
char z[ 80 ];
*/
static void
printOptionUsage(
- tOptions* pOpts,
- int ex_code,
- tCC* pOptTitle )
+ tOptions * pOpts,
+ int ex_code,
+ tCC * pOptTitle )
{
- int ct = pOpts->optCt;
- int optNo = 0;
- tOptDesc* pOD = pOpts->pOptDesc;
- int docCt = 0;
+ int ct = pOpts->optCt;
+ int optNo = 0;
+ tOptDesc * pOD = pOpts->pOptDesc;
+ int docCt = 0;
do {
- if ((pOD->fOptState & OPTST_NO_USAGE_MASK) != 0)
+ if ((pOD->fOptState & OPTST_NO_USAGE_MASK) != 0) {
+
+ /*
+ * IF this is a compiled-out option
+ * *AND* usage was requested with "omitted-usage"
+ * *AND* this is NOT abbreviated usage
+ * THEN display this option.
+ */
+ if ( (pOD->fOptState == (OPTST_OMITTED | OPTST_NO_INIT))
+ && (pOD->pz_Name != NULL)
+ && (ex_code == EXIT_SUCCESS)) {
+
+ char const * why_pz =
+ (pOD->pzText == NULL) ? zDisabledWhy : pOD->pzText;
+ printOptPreamble(pOpts, pOD, &argTypes);
+ fprintf(option_usage_fp, zDisabledOpt, pOD->pz_Name, why_pz);
+ }
+
continue;
+ }
if ((pOD->fOptState & OPTST_DOCUMENT) != 0) {
if (ex_code == EXIT_SUCCESS) {
&& ((pOD[-1].fOptState & OPTST_DOCUMENT) == 0) )
fprintf( option_usage_fp, argTypes.pzBrk, zAuto, pOptTitle );
- printOneUsage( pOpts, pOD, &argTypes );
+ printOneUsage(pOpts, pOD, &argTypes);
/*
* IF we were invoked because of the --help option,
/*
- * Generated header for gperf generated source Sat Aug 1 11:21:22 PDT 2009
+ * Generated header for gperf generated source Sun Nov 8 08:41:19 PST 2009
* This file enumerates the list of names and declares the
* procedure for mapping string names to the enum value.
*/
-/* $Id: version.c,v 4.17 2009/08/01 17:44:37 bkorb Exp $
+/* $Id: e21e2bf9958c54e440efbdc7c1026e46ac589f66 $
* Time-stamp: "2008-07-27 10:11:30 bkorb"
*
* This module implements the default usage procedure for
/*
- * Generated header for gperf generated source Sat Aug 1 11:21:22 PDT 2009
+ * Generated header for gperf generated source Sun Nov 8 08:41:19 PST 2009
* This file enumerates the list of names and declares the
* procedure for mapping string names to the enum value.
*/