From: Harlan Stenn Date: Tue, 17 Nov 2009 11:44:44 +0000 (-0500) Subject: Upgrade to autogen 5.10 X-Git-Tag: NTP_4_2_5P246_RC~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e07c80df9b9d6ed741fa9a295f77af3b013b4c04;p=thirdparty%2Fntp.git Upgrade to autogen 5.10 bk: 4b028cacZTf-NxXnyZTsmjxyDIikPQ --- diff --git a/ChangeLog b/ChangeLog index 77e16f0d5..e081a2f1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* 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. diff --git a/libopts/Makefile.am b/libopts/Makefile.am index 147e65976..adf3196b2 100644 --- a/libopts/Makefile.am +++ b/libopts/Makefile.am @@ -7,7 +7,7 @@ noinst_LTLIBRARIES = libopts.la 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 \ diff --git a/libopts/ag-char-map.h b/libopts/ag-char-map.h index 85e384117..3659fe8e1 100644 --- a/libopts/ag-char-map.h +++ b/libopts/ag-char-map.h @@ -1,5 +1,5 @@ /* - * 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. diff --git a/libopts/autoopts.c b/libopts/autoopts.c index 417d469ad..21ad423f1 100644 --- a/libopts/autoopts.c +++ b/libopts/autoopts.c @@ -1,7 +1,7 @@ /* - * $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 @@ -240,7 +240,7 @@ handleOption( tOptions* pOpts, tOptState* pOptState ) /* * If provided a procedure to call, call it */ - if (pOP != (tpOptProc)NULL) + if (pOP != NULL) (*pOP)( pOpts, pOD ); return SUCCESS; @@ -288,8 +288,12 @@ longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState ) } 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) { /* @@ -344,6 +348,17 @@ longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState ) * 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 @@ -351,7 +366,7 @@ longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState ) if (disable) pOptState->flags |= OPTST_DISABLED; - pOptState->pOD = pOpts->pOptDesc + matchIdx; + pOptState->pOD = pOD; pOptState->pzOptArg = pzEq; pOptState->optType = TOPT_LONG; return SUCCESS; @@ -380,7 +395,7 @@ longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState ) 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; @@ -401,28 +416,28 @@ shortOptionFind( tOptions* pOpts, uint_t optValue, tOptState* pOptState ) /* * 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 @@ -439,6 +454,8 @@ shortOptionFind( tOptions* pOpts, uint_t optValue, tOptState* pOptState ) return SUCCESS; } + short_opt_error: + /* * IF we are to stop on errors (the default, actually) * THEN call the usage procedure. diff --git a/libopts/autoopts.h b/libopts/autoopts.h index 108bcb7ac..0a99df4fd 100644 --- a/libopts/autoopts.h +++ b/libopts/autoopts.h @@ -2,7 +2,7 @@ /* * 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. diff --git a/libopts/boolean.c b/libopts/boolean.c index 58a59d023..71e341a09 100644 --- a/libopts/boolean.c +++ b/libopts/boolean.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/libopts/compat/compat.h b/libopts/compat/compat.h index 5c73ae8e4..e2dd13497 100644 --- a/libopts/compat/compat.h +++ b/libopts/compat/compat.h @@ -2,9 +2,9 @@ /* 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. @@ -259,66 +259,89 @@ #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 diff --git a/libopts/compat/pathfind.c b/libopts/compat/pathfind.c index 480674dda..9e813178a 100644 --- a/libopts/compat/pathfind.c +++ b/libopts/compat/pathfind.c @@ -5,10 +5,9 @@ /* * Author: Gary V Vaughan * 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: */ diff --git a/libopts/compat/windows-config.h b/libopts/compat/windows-config.h index 76a9956f0..967d277db 100644 --- a/libopts/compat/windows-config.h +++ b/libopts/compat/windows-config.h @@ -2,7 +2,6 @@ /* * 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. * diff --git a/libopts/configfile.c b/libopts/configfile.c index b8fdb6904..07e1a6775 100644 --- a/libopts/configfile.c +++ b/libopts/configfile.c @@ -1,5 +1,5 @@ /* - * $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. diff --git a/libopts/cook.c b/libopts/cook.c index baf9d81df..b2b1c5284 100644 --- a/libopts/cook.c +++ b/libopts/cook.c @@ -1,5 +1,5 @@ /* - * $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 diff --git a/libopts/enumeration.c b/libopts/enumeration.c index 1c67679b4..700b22d67 100644 --- a/libopts/enumeration.c +++ b/libopts/enumeration.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/libopts/environment.c b/libopts/environment.c index d201e22fd..a688158dd 100644 --- a/libopts/environment.c +++ b/libopts/environment.c @@ -1,6 +1,6 @@ /* - * $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 diff --git a/libopts/file.c b/libopts/file.c index 2224c8b4e..fccb042cf 100644 --- a/libopts/file.c +++ b/libopts/file.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/libopts/load.c b/libopts/load.c index f2982a7be..ef84b0fe9 100644 --- a/libopts/load.c +++ b/libopts/load.c @@ -1,6 +1,6 @@ /* - * $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 diff --git a/libopts/m4/libopts.m4 b/libopts/m4/libopts.m4 index 13083120a..ef7f2930a 100644 --- a/libopts/m4/libopts.m4 +++ b/libopts/m4/libopts.m4 @@ -2,7 +2,7 @@ dnl -*- buffer-read-only: t -*- vi: set ro: 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 @@ -10,13 +10,7 @@ dnl do always before generated macros: 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 # ================= @@ -107,6 +101,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[ # ---------------------------------------------------------------------- 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 @@ -444,7 +439,6 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[ 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 diff --git a/libopts/m4/liboptschk.m4 b/libopts/m4/liboptschk.m4 index db3ce4a68..67443e879 100644 --- a/libopts/m4/liboptschk.m4 +++ b/libopts/m4/liboptschk.m4 @@ -6,7 +6,6 @@ dnl gives unlimited permission to copy and/or distribute it, 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 diff --git a/libopts/makeshell.c b/libopts/makeshell.c index 4d9271bfb..5bbb05c5d 100644 --- a/libopts/makeshell.c +++ b/libopts/makeshell.c @@ -1,7 +1,7 @@ /* - * $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. @@ -33,19 +33,19 @@ tOptions* pShellParseOptions = NULL; * * 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" @@ -55,12 +55,12 @@ tSCC zMultiDef[] = "\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"; @@ -73,7 +73,7 @@ tSCC zSingleNoDef[] = "\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" @@ -88,7 +88,7 @@ tSCC zLoopCase[] = "\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" @@ -103,16 +103,16 @@ tSCC zLoopOnly[] = "\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" @@ -122,7 +122,7 @@ tSCC zNoSelection[] = * * 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" @@ -137,7 +137,7 @@ tSCC zLoopEnd[] = "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"; @@ -146,22 +146,22 @@ tSCC zTrailerMarker[] = "\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" @@ -175,29 +175,29 @@ tSCC zOptionUnknown[] = * * 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" @@ -205,14 +205,14 @@ tSCC zSingleArg[] = " %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" @@ -222,15 +222,15 @@ tSCC zNoSingleArg[] = " 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"; @@ -241,7 +241,7 @@ tSCC zCantArg[] = * * 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" @@ -249,7 +249,7 @@ tSCC zLongOptInit[] = " 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" @@ -285,11 +285,11 @@ tSCC zLongOptArg[] = * * 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" @@ -483,7 +483,7 @@ textToVariable( tOptions* pOpts, teTextTo whichVar, tOptDesc* pOD ) 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 @@ -1013,7 +1013,7 @@ openOutput( char const* pzFile ) void genshelloptUsage( tOptions* pOpts, int exitCode ) { -#if defined(__windows__) && !defined(__CYGWIN__) +#if ! defined(HAVE_WORKING_FORK) optionUsage( pOpts, exitCode ); #else /* @@ -1033,13 +1033,13 @@ genshelloptUsage( tOptions* pOpts, int exitCode ) 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: diff --git a/libopts/nested.c b/libopts/nested.c index fddb572da..3c016b747 100644 --- a/libopts/nested.c +++ b/libopts/nested.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/libopts/numeric.c b/libopts/numeric.c index 1c8a4926a..1596f4782 100644 --- a/libopts/numeric.c +++ b/libopts/numeric.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/libopts/pgusage.c b/libopts/pgusage.c index d59b107ab..8ce9a9650 100644 --- a/libopts/pgusage.c +++ b/libopts/pgusage.c @@ -1,7 +1,7 @@ /* - * $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. * @@ -41,11 +41,12 @@ tePagerState pagerState = PAGER_STATE_INITIAL; * 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; @@ -93,7 +94,7 @@ optionPagedUsage( tOptions* pOptions, tOptDesc* pOD ) */ (*pOptions->pUsageProc)( pOptions, EXIT_SUCCESS ); - /*NOTREACHED*/ + /* NOTREACHED */ _exit( EXIT_FAILURE ); } diff --git a/libopts/proto.h b/libopts/proto.h index 10673c9aa..91cde020f 100644 --- a/libopts/proto.h +++ b/libopts/proto.h @@ -1,7 +1,7 @@ /* -*- 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 diff --git a/libopts/putshell.c b/libopts/putshell.c index c0aac05d1..8cdd7a528 100644 --- a/libopts/putshell.c +++ b/libopts/putshell.c @@ -1,6 +1,6 @@ /* - * $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 diff --git a/libopts/reset.c b/libopts/reset.c index 7f6dec967..47a2ec0cf 100644 --- a/libopts/reset.c +++ b/libopts/reset.c @@ -1,7 +1,7 @@ /* - * $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. @@ -86,6 +86,8 @@ optionResetOpt( tOptions* pOpts, tOptDesc* pOD ) if ((pzArg == NULL) || (*pzArg == NUL)) { fputs(zNoResetArg, stderr); pOpts->pUsageProc(pOpts, EXIT_FAILURE); + /* NOTREACHED */ + assert(0 == 1); } reset_active = AG_TRUE; @@ -101,12 +103,16 @@ optionResetOpt( tOptions* pOpts, tOptDesc* pOD ) 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); } } diff --git a/libopts/restore.c b/libopts/restore.c index 28b16576e..40a9bc0d1 100644 --- a/libopts/restore.c +++ b/libopts/restore.c @@ -1,6 +1,6 @@ /* - * 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 diff --git a/libopts/save.c b/libopts/save.c index 4a9d76e5d..5ea2c5632 100644 --- a/libopts/save.c +++ b/libopts/save.c @@ -1,6 +1,6 @@ /* - * 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 diff --git a/libopts/sort.c b/libopts/sort.c index 900581d49..4d81a6186 100644 --- a/libopts/sort.c +++ b/libopts/sort.c @@ -1,6 +1,6 @@ /* - * 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. diff --git a/libopts/stack.c b/libopts/stack.c index a0ac11be5..8eb7856da 100644 --- a/libopts/stack.c +++ b/libopts/stack.c @@ -1,7 +1,7 @@ /* * 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 diff --git a/libopts/streqvcmp.c b/libopts/streqvcmp.c index 836079744..744212357 100644 --- a/libopts/streqvcmp.c +++ b/libopts/streqvcmp.c @@ -1,6 +1,6 @@ /* - * $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 diff --git a/libopts/text_mmap.c b/libopts/text_mmap.c index 34d29d03f..c5a99e360 100644 --- a/libopts/text_mmap.c +++ b/libopts/text_mmap.c @@ -1,5 +1,5 @@ /* - * $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" * diff --git a/libopts/time.c b/libopts/time.c index 2d9a1d073..1f2f7bbcd 100644 --- a/libopts/time.c +++ b/libopts/time.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/libopts/usage.c b/libopts/usage.c index ba6782d73..9a1cf63f6 100644 --- a/libopts/usage.c +++ b/libopts/usage.c @@ -1,7 +1,7 @@ /* - * 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. @@ -60,6 +60,12 @@ printInitList( tCC* pzRc, tCC* pzPN ); +static void +printOptPreamble( + tOptions* pOptions, + tOptDesc* pOD, + arg_types_t* pAT ); + static void printOneUsage( tOptions* pOptions, @@ -68,9 +74,9 @@ printOneUsage( static void printOptionUsage( - tOptions* pOpts, - int ex_code, - tCC* pOptTitle ); + tOptions * pOpts, + int ex_code, + tCC * pOptTitle ); static void printProgramDetails( tOptions* pOptions ); @@ -462,11 +468,8 @@ printInitList( } -/* - * Print the usage information for a single option. - */ static void -printOneUsage( +printOptPreamble( tOptions* pOptions, tOptDesc* pOD, arg_types_t* pAT ) @@ -479,17 +482,31 @@ printOneUsage( */ 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 ]; @@ -539,18 +556,36 @@ printOneUsage( */ 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) { @@ -575,7 +610,7 @@ printOptionUsage( && ((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, diff --git a/libopts/value-type.h b/libopts/value-type.h index 2eff3dbd0..17719e1b4 100644 --- a/libopts/value-type.h +++ b/libopts/value-type.h @@ -1,5 +1,5 @@ /* - * 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. */ diff --git a/libopts/version.c b/libopts/version.c index 0005c9f7d..07e0e183c 100644 --- a/libopts/version.c +++ b/libopts/version.c @@ -1,5 +1,5 @@ -/* $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 diff --git a/libopts/xat-attribute.h b/libopts/xat-attribute.h index ae87eacae..517d8fd39 100644 --- a/libopts/xat-attribute.h +++ b/libopts/xat-attribute.h @@ -1,5 +1,5 @@ /* - * 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. */ diff --git a/sntp/libopts/Makefile.am b/sntp/libopts/Makefile.am index 147e65976..adf3196b2 100644 --- a/sntp/libopts/Makefile.am +++ b/sntp/libopts/Makefile.am @@ -7,7 +7,7 @@ noinst_LTLIBRARIES = libopts.la 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 \ diff --git a/sntp/libopts/ag-char-map.h b/sntp/libopts/ag-char-map.h index 85e384117..3659fe8e1 100644 --- a/sntp/libopts/ag-char-map.h +++ b/sntp/libopts/ag-char-map.h @@ -1,5 +1,5 @@ /* - * 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. diff --git a/sntp/libopts/autoopts.c b/sntp/libopts/autoopts.c index 417d469ad..21ad423f1 100644 --- a/sntp/libopts/autoopts.c +++ b/sntp/libopts/autoopts.c @@ -1,7 +1,7 @@ /* - * $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 @@ -240,7 +240,7 @@ handleOption( tOptions* pOpts, tOptState* pOptState ) /* * If provided a procedure to call, call it */ - if (pOP != (tpOptProc)NULL) + if (pOP != NULL) (*pOP)( pOpts, pOD ); return SUCCESS; @@ -288,8 +288,12 @@ longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState ) } 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) { /* @@ -344,6 +348,17 @@ longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState ) * 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 @@ -351,7 +366,7 @@ longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState ) if (disable) pOptState->flags |= OPTST_DISABLED; - pOptState->pOD = pOpts->pOptDesc + matchIdx; + pOptState->pOD = pOD; pOptState->pzOptArg = pzEq; pOptState->optType = TOPT_LONG; return SUCCESS; @@ -380,7 +395,7 @@ longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState ) 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; @@ -401,28 +416,28 @@ shortOptionFind( tOptions* pOpts, uint_t optValue, tOptState* pOptState ) /* * 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 @@ -439,6 +454,8 @@ shortOptionFind( tOptions* pOpts, uint_t optValue, tOptState* pOptState ) return SUCCESS; } + short_opt_error: + /* * IF we are to stop on errors (the default, actually) * THEN call the usage procedure. diff --git a/sntp/libopts/autoopts.h b/sntp/libopts/autoopts.h index 108bcb7ac..0a99df4fd 100644 --- a/sntp/libopts/autoopts.h +++ b/sntp/libopts/autoopts.h @@ -2,7 +2,7 @@ /* * 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. diff --git a/sntp/libopts/boolean.c b/sntp/libopts/boolean.c index 58a59d023..71e341a09 100644 --- a/sntp/libopts/boolean.c +++ b/sntp/libopts/boolean.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/sntp/libopts/compat/compat.h b/sntp/libopts/compat/compat.h index 5c73ae8e4..e2dd13497 100644 --- a/sntp/libopts/compat/compat.h +++ b/sntp/libopts/compat/compat.h @@ -2,9 +2,9 @@ /* 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. @@ -259,66 +259,89 @@ #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 diff --git a/sntp/libopts/compat/pathfind.c b/sntp/libopts/compat/pathfind.c index 480674dda..9e813178a 100644 --- a/sntp/libopts/compat/pathfind.c +++ b/sntp/libopts/compat/pathfind.c @@ -5,10 +5,9 @@ /* * Author: Gary V Vaughan * 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: */ diff --git a/sntp/libopts/compat/windows-config.h b/sntp/libopts/compat/windows-config.h index 76a9956f0..967d277db 100644 --- a/sntp/libopts/compat/windows-config.h +++ b/sntp/libopts/compat/windows-config.h @@ -2,7 +2,6 @@ /* * 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. * diff --git a/sntp/libopts/configfile.c b/sntp/libopts/configfile.c index b8fdb6904..07e1a6775 100644 --- a/sntp/libopts/configfile.c +++ b/sntp/libopts/configfile.c @@ -1,5 +1,5 @@ /* - * $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. diff --git a/sntp/libopts/cook.c b/sntp/libopts/cook.c index baf9d81df..b2b1c5284 100644 --- a/sntp/libopts/cook.c +++ b/sntp/libopts/cook.c @@ -1,5 +1,5 @@ /* - * $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 diff --git a/sntp/libopts/enumeration.c b/sntp/libopts/enumeration.c index 1c67679b4..700b22d67 100644 --- a/sntp/libopts/enumeration.c +++ b/sntp/libopts/enumeration.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/sntp/libopts/environment.c b/sntp/libopts/environment.c index d201e22fd..a688158dd 100644 --- a/sntp/libopts/environment.c +++ b/sntp/libopts/environment.c @@ -1,6 +1,6 @@ /* - * $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 diff --git a/sntp/libopts/file.c b/sntp/libopts/file.c index 2224c8b4e..fccb042cf 100644 --- a/sntp/libopts/file.c +++ b/sntp/libopts/file.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/sntp/libopts/load.c b/sntp/libopts/load.c index f2982a7be..ef84b0fe9 100644 --- a/sntp/libopts/load.c +++ b/sntp/libopts/load.c @@ -1,6 +1,6 @@ /* - * $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 diff --git a/sntp/libopts/m4/libopts.m4 b/sntp/libopts/m4/libopts.m4 index 13083120a..ef7f2930a 100644 --- a/sntp/libopts/m4/libopts.m4 +++ b/sntp/libopts/m4/libopts.m4 @@ -2,7 +2,7 @@ dnl -*- buffer-read-only: t -*- vi: set ro: 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 @@ -10,13 +10,7 @@ dnl do always before generated macros: 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 # ================= @@ -107,6 +101,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[ # ---------------------------------------------------------------------- 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 @@ -444,7 +439,6 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[ 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 diff --git a/sntp/libopts/m4/liboptschk.m4 b/sntp/libopts/m4/liboptschk.m4 index db3ce4a68..67443e879 100644 --- a/sntp/libopts/m4/liboptschk.m4 +++ b/sntp/libopts/m4/liboptschk.m4 @@ -6,7 +6,6 @@ dnl gives unlimited permission to copy and/or distribute it, 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 diff --git a/sntp/libopts/makeshell.c b/sntp/libopts/makeshell.c index 4d9271bfb..5bbb05c5d 100644 --- a/sntp/libopts/makeshell.c +++ b/sntp/libopts/makeshell.c @@ -1,7 +1,7 @@ /* - * $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. @@ -33,19 +33,19 @@ tOptions* pShellParseOptions = NULL; * * 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" @@ -55,12 +55,12 @@ tSCC zMultiDef[] = "\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"; @@ -73,7 +73,7 @@ tSCC zSingleNoDef[] = "\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" @@ -88,7 +88,7 @@ tSCC zLoopCase[] = "\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" @@ -103,16 +103,16 @@ tSCC zLoopOnly[] = "\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" @@ -122,7 +122,7 @@ tSCC zNoSelection[] = * * 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" @@ -137,7 +137,7 @@ tSCC zLoopEnd[] = "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"; @@ -146,22 +146,22 @@ tSCC zTrailerMarker[] = "\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" @@ -175,29 +175,29 @@ tSCC zOptionUnknown[] = * * 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" @@ -205,14 +205,14 @@ tSCC zSingleArg[] = " %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" @@ -222,15 +222,15 @@ tSCC zNoSingleArg[] = " 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"; @@ -241,7 +241,7 @@ tSCC zCantArg[] = * * 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" @@ -249,7 +249,7 @@ tSCC zLongOptInit[] = " 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" @@ -285,11 +285,11 @@ tSCC zLongOptArg[] = * * 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" @@ -483,7 +483,7 @@ textToVariable( tOptions* pOpts, teTextTo whichVar, tOptDesc* pOD ) 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 @@ -1013,7 +1013,7 @@ openOutput( char const* pzFile ) void genshelloptUsage( tOptions* pOpts, int exitCode ) { -#if defined(__windows__) && !defined(__CYGWIN__) +#if ! defined(HAVE_WORKING_FORK) optionUsage( pOpts, exitCode ); #else /* @@ -1033,13 +1033,13 @@ genshelloptUsage( tOptions* pOpts, int exitCode ) 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: diff --git a/sntp/libopts/nested.c b/sntp/libopts/nested.c index fddb572da..3c016b747 100644 --- a/sntp/libopts/nested.c +++ b/sntp/libopts/nested.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/sntp/libopts/numeric.c b/sntp/libopts/numeric.c index 1c8a4926a..1596f4782 100644 --- a/sntp/libopts/numeric.c +++ b/sntp/libopts/numeric.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/sntp/libopts/pgusage.c b/sntp/libopts/pgusage.c index d59b107ab..8ce9a9650 100644 --- a/sntp/libopts/pgusage.c +++ b/sntp/libopts/pgusage.c @@ -1,7 +1,7 @@ /* - * $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. * @@ -41,11 +41,12 @@ tePagerState pagerState = PAGER_STATE_INITIAL; * 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; @@ -93,7 +94,7 @@ optionPagedUsage( tOptions* pOptions, tOptDesc* pOD ) */ (*pOptions->pUsageProc)( pOptions, EXIT_SUCCESS ); - /*NOTREACHED*/ + /* NOTREACHED */ _exit( EXIT_FAILURE ); } diff --git a/sntp/libopts/proto.h b/sntp/libopts/proto.h index 10673c9aa..91cde020f 100644 --- a/sntp/libopts/proto.h +++ b/sntp/libopts/proto.h @@ -1,7 +1,7 @@ /* -*- 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 diff --git a/sntp/libopts/putshell.c b/sntp/libopts/putshell.c index c0aac05d1..8cdd7a528 100644 --- a/sntp/libopts/putshell.c +++ b/sntp/libopts/putshell.c @@ -1,6 +1,6 @@ /* - * $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 diff --git a/sntp/libopts/reset.c b/sntp/libopts/reset.c index 7f6dec967..47a2ec0cf 100644 --- a/sntp/libopts/reset.c +++ b/sntp/libopts/reset.c @@ -1,7 +1,7 @@ /* - * $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. @@ -86,6 +86,8 @@ optionResetOpt( tOptions* pOpts, tOptDesc* pOD ) if ((pzArg == NULL) || (*pzArg == NUL)) { fputs(zNoResetArg, stderr); pOpts->pUsageProc(pOpts, EXIT_FAILURE); + /* NOTREACHED */ + assert(0 == 1); } reset_active = AG_TRUE; @@ -101,12 +103,16 @@ optionResetOpt( tOptions* pOpts, tOptDesc* pOD ) 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); } } diff --git a/sntp/libopts/restore.c b/sntp/libopts/restore.c index 28b16576e..40a9bc0d1 100644 --- a/sntp/libopts/restore.c +++ b/sntp/libopts/restore.c @@ -1,6 +1,6 @@ /* - * 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 diff --git a/sntp/libopts/save.c b/sntp/libopts/save.c index 4a9d76e5d..5ea2c5632 100644 --- a/sntp/libopts/save.c +++ b/sntp/libopts/save.c @@ -1,6 +1,6 @@ /* - * 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 diff --git a/sntp/libopts/sort.c b/sntp/libopts/sort.c index 900581d49..4d81a6186 100644 --- a/sntp/libopts/sort.c +++ b/sntp/libopts/sort.c @@ -1,6 +1,6 @@ /* - * 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. diff --git a/sntp/libopts/stack.c b/sntp/libopts/stack.c index a0ac11be5..8eb7856da 100644 --- a/sntp/libopts/stack.c +++ b/sntp/libopts/stack.c @@ -1,7 +1,7 @@ /* * 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 diff --git a/sntp/libopts/streqvcmp.c b/sntp/libopts/streqvcmp.c index 836079744..744212357 100644 --- a/sntp/libopts/streqvcmp.c +++ b/sntp/libopts/streqvcmp.c @@ -1,6 +1,6 @@ /* - * $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 diff --git a/sntp/libopts/text_mmap.c b/sntp/libopts/text_mmap.c index 34d29d03f..c5a99e360 100644 --- a/sntp/libopts/text_mmap.c +++ b/sntp/libopts/text_mmap.c @@ -1,5 +1,5 @@ /* - * $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" * diff --git a/sntp/libopts/time.c b/sntp/libopts/time.c index 2d9a1d073..1f2f7bbcd 100644 --- a/sntp/libopts/time.c +++ b/sntp/libopts/time.c @@ -1,6 +1,6 @@ /* - * $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. diff --git a/sntp/libopts/usage.c b/sntp/libopts/usage.c index ba6782d73..9a1cf63f6 100644 --- a/sntp/libopts/usage.c +++ b/sntp/libopts/usage.c @@ -1,7 +1,7 @@ /* - * 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. @@ -60,6 +60,12 @@ printInitList( tCC* pzRc, tCC* pzPN ); +static void +printOptPreamble( + tOptions* pOptions, + tOptDesc* pOD, + arg_types_t* pAT ); + static void printOneUsage( tOptions* pOptions, @@ -68,9 +74,9 @@ printOneUsage( static void printOptionUsage( - tOptions* pOpts, - int ex_code, - tCC* pOptTitle ); + tOptions * pOpts, + int ex_code, + tCC * pOptTitle ); static void printProgramDetails( tOptions* pOptions ); @@ -462,11 +468,8 @@ printInitList( } -/* - * Print the usage information for a single option. - */ static void -printOneUsage( +printOptPreamble( tOptions* pOptions, tOptDesc* pOD, arg_types_t* pAT ) @@ -479,17 +482,31 @@ printOneUsage( */ 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 ]; @@ -539,18 +556,36 @@ printOneUsage( */ 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) { @@ -575,7 +610,7 @@ printOptionUsage( && ((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, diff --git a/sntp/libopts/value-type.h b/sntp/libopts/value-type.h index 2eff3dbd0..17719e1b4 100644 --- a/sntp/libopts/value-type.h +++ b/sntp/libopts/value-type.h @@ -1,5 +1,5 @@ /* - * 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. */ diff --git a/sntp/libopts/version.c b/sntp/libopts/version.c index 0005c9f7d..07e0e183c 100644 --- a/sntp/libopts/version.c +++ b/sntp/libopts/version.c @@ -1,5 +1,5 @@ -/* $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 diff --git a/sntp/libopts/xat-attribute.h b/sntp/libopts/xat-attribute.h index ae87eacae..517d8fd39 100644 --- a/sntp/libopts/xat-attribute.h +++ b/sntp/libopts/xat-attribute.h @@ -1,5 +1,5 @@ /* - * 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. */