]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Upgrade to autogen 5.10
authorHarlan Stenn <stenn@ntp.org>
Tue, 17 Nov 2009 11:44:44 +0000 (06:44 -0500)
committerHarlan Stenn <stenn@ntp.org>
Tue, 17 Nov 2009 11:44:44 +0000 (06:44 -0500)
bk: 4b028cacZTf-NxXnyZTsmjxyDIikPQ

69 files changed:
ChangeLog
libopts/Makefile.am
libopts/ag-char-map.h
libopts/autoopts.c
libopts/autoopts.h
libopts/boolean.c
libopts/compat/compat.h
libopts/compat/pathfind.c
libopts/compat/windows-config.h
libopts/configfile.c
libopts/cook.c
libopts/enumeration.c
libopts/environment.c
libopts/file.c
libopts/load.c
libopts/m4/libopts.m4
libopts/m4/liboptschk.m4
libopts/makeshell.c
libopts/nested.c
libopts/numeric.c
libopts/pgusage.c
libopts/proto.h
libopts/putshell.c
libopts/reset.c
libopts/restore.c
libopts/save.c
libopts/sort.c
libopts/stack.c
libopts/streqvcmp.c
libopts/text_mmap.c
libopts/time.c
libopts/usage.c
libopts/value-type.h
libopts/version.c
libopts/xat-attribute.h
sntp/libopts/Makefile.am
sntp/libopts/ag-char-map.h
sntp/libopts/autoopts.c
sntp/libopts/autoopts.h
sntp/libopts/boolean.c
sntp/libopts/compat/compat.h
sntp/libopts/compat/pathfind.c
sntp/libopts/compat/windows-config.h
sntp/libopts/configfile.c
sntp/libopts/cook.c
sntp/libopts/enumeration.c
sntp/libopts/environment.c
sntp/libopts/file.c
sntp/libopts/load.c
sntp/libopts/m4/libopts.m4
sntp/libopts/m4/liboptschk.m4
sntp/libopts/makeshell.c
sntp/libopts/nested.c
sntp/libopts/numeric.c
sntp/libopts/pgusage.c
sntp/libopts/proto.h
sntp/libopts/putshell.c
sntp/libopts/reset.c
sntp/libopts/restore.c
sntp/libopts/save.c
sntp/libopts/sort.c
sntp/libopts/stack.c
sntp/libopts/streqvcmp.c
sntp/libopts/text_mmap.c
sntp/libopts/time.c
sntp/libopts/usage.c
sntp/libopts/value-type.h
sntp/libopts/version.c
sntp/libopts/xat-attribute.h

index 77e16f0d55c17aa6a6340884a0b8b808c95a9ac6..e081a2f1b70c9cd8466f1fa84f43aa7e39bf26a7 100644 (file)
--- 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.
index 147e65976c13c9870c0f0c7b010638f2ebe8e9ae..adf3196b214e9db446b2b56a636b278d0dcb93af 100644 (file)
@@ -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  \
index 85e384117f3d2c30f1bfdb374d6a11245eb8d292..3659fe8e15ca40fb6590be1c8df6b907cb126721 100644 (file)
@@ -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.
index 417d469ad0c7a019aa5f9e0b06f10486aeffd06d..21ad423f17cdd83a6abff198ec5fc0d594323629 100644 (file)
@@ -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.
index 108bcb7ac1f440d8ffae55f4720a121aa02c9452..0a99df4fdd1066fcde84a8bc8ca361b772e11a7b 100644 (file)
@@ -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.
index 58a59d02396320519fd6feb786d5c5a463c7dbb7..71e341a0994f32c3664f7a7b8a2025c8ff56a18e 100644 (file)
@@ -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.
index 5c73ae8e429dfe1dcb0929135fda09666131dbd9..e2dd13497af11349240fbfb26caa0f56e9542eb8 100644 (file)
@@ -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.
 #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
index 480674dda630308c77beb008b35707af2abb96df..9e813178aaa710579193c8a92e10a378fafe08a5 100644 (file)
@@ -5,10 +5,9 @@
 /*
  * 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: */
index 76a9956f03f1b1214f33e0d00811392e67788b6e..967d277dbec5bb20d53ecf272b5638547a4da653 100644 (file)
@@ -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.
  *
index b8fdb6904b4ced2d9f72e783f79c371473656afa..07e1a6775f798b898a8f474a04b0d924d7aff02f 100644 (file)
@@ -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.
index baf9d81df9dd03abdd468f23588942bbd62ee4b7..b2b1c528464770ad9d0e8ea8285d49a4fb71e7c9 100644 (file)
@@ -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
index 1c67679b41bd3ead0d5f10e127b9bff33551bd6d..700b22d673b5afce52d86b37903a374f960fd4a0 100644 (file)
@@ -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.
index d201e22fd1c8030445e234c5d078d7a522fb8f3d..a688158dd71cc92ae83573a75365265e7d34ebfa 100644 (file)
@@ -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
index 2224c8b4ef035c63d6b7c9d39a79ef860062cb22..fccb042cf9f817cafe367639bea45bb01c84abfa 100644 (file)
@@ -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.
index f2982a7be0d683b41fc2a207f9c2c7fbe5d08efc..ef84b0fe9f42f139188fadbd191acb86449112b9 100644 (file)
@@ -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
index 13083120aaeceba7c581675b0d04099f389937d0..ef7f2930aaf5574dd3fb7beccbab70582076636c 100644 (file)
@@ -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
index db3ce4a68c9e0f836eaeb74b3bc312b26ad77357..67443e87980da069d4526b4b29372bec7a460cad 100644 (file)
@@ -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
index 4d9271bfbc44f0c08134df82961f64aca4ac04f3..5bbb05c5d6a19f06991ac75729e94795daa9e6e6 100644 (file)
@@ -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:
index fddb572dae4402d37c57ad188af8e4b18a05f3c2..3c016b7475f35d7e8fcff4ba909d66ddcb88619d 100644 (file)
@@ -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.
index 1c8a4926a95b7a1d9849c9fd902c64fec7d77267..1596f47826893b30e0cf93a9d01054bedb782660 100644 (file)
@@ -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.
index d59b107ab275f854e972a16289257a273e7cdbc4..8ce9a965017356e1b3a934d26b698b258c072482 100644 (file)
@@ -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 );
     }
 
index 10673c9aae8e9ec2f1c80e8888a14d58586560eb..91cde020ffc04cb842ae1eeba388862f0e36233f 100644 (file)
@@ -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
index c0aac05d16811024bccf693b1f76df3bcd3e10c2..8cdd7a528755e38c052092480b377ca9ba4dec1e 100644 (file)
@@ -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
index 7f6dec967068a7b35547e051e3fc0459ca75d6b7..47a2ec0cfa2afe33a3382d54cefe687b6f2476e3 100644 (file)
@@ -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);
         }
     }
 
index 28b16576eb1c91c3b67f8ce13a81b980d55c204e..40a9bc0d1380c9f82f8badcbf9a26344aedc56c3 100644 (file)
@@ -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
index 4a9d76e5d2feffda1ab947aded457855df91dc9d..5ea2c563225466c438f208f28eab6c1eb435cd8e 100644 (file)
@@ -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
index 900581d497abb65578f6db89c070fcb38b42aa4b..4d81a61864b71acc18552d341807c89d9a2b66e7 100644 (file)
@@ -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.
index a0ac11be578a3dccb4cf853ef46007082cb63223..8eb7856da04fb9660b10ff6841ebbb8e725a9861 100644 (file)
@@ -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
index 8360797444f722c8eabb1a8c0a9c2ef6b1efcd6a..744212357aa63d015b857302b6d88e280bd4d863 100644 (file)
@@ -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
index 34d29d03f6b190f962fea5e6cf8826f8cfd29916..c5a99e360300d1f4d8efdbca4207f98b609e67a9 100644 (file)
@@ -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"
  *
index 2d9a1d0733ec4d37c01b8aa3252ba6852d62a525..1f2f7bbcd054f14ed4507ef41ec82ddb9dd92e7c 100644 (file)
@@ -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.
index ba6782d732b38a3d29cd371aaa419504e17fca49..9a1cf63f6ff9340b4ad2a161737c8e5cd981c94d 100644 (file)
@@ -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,
index 2eff3dbd0231a1778f2b94054e2755c41885ebdb..17719e1b4404137af0a22c46fb5d9356aeb59281 100644 (file)
@@ -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.
  */
index 0005c9f7d125bb188b04f085aaa1f04abdb7b519..07e0e183ca3f91f930fbb6dc58519aade4ef3910 100644 (file)
@@ -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
index ae87eacaeb2e141cddd85a60a8b43447c3f50c08..517d8fd3928fa9023083395b8a6feb86ab45a2ca 100644 (file)
@@ -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.
  */
index 147e65976c13c9870c0f0c7b010638f2ebe8e9ae..adf3196b214e9db446b2b56a636b278d0dcb93af 100644 (file)
@@ -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  \
index 85e384117f3d2c30f1bfdb374d6a11245eb8d292..3659fe8e15ca40fb6590be1c8df6b907cb126721 100644 (file)
@@ -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.
index 417d469ad0c7a019aa5f9e0b06f10486aeffd06d..21ad423f17cdd83a6abff198ec5fc0d594323629 100644 (file)
@@ -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.
index 108bcb7ac1f440d8ffae55f4720a121aa02c9452..0a99df4fdd1066fcde84a8bc8ca361b772e11a7b 100644 (file)
@@ -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.
index 58a59d02396320519fd6feb786d5c5a463c7dbb7..71e341a0994f32c3664f7a7b8a2025c8ff56a18e 100644 (file)
@@ -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.
index 5c73ae8e429dfe1dcb0929135fda09666131dbd9..e2dd13497af11349240fbfb26caa0f56e9542eb8 100644 (file)
@@ -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.
 #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
index 480674dda630308c77beb008b35707af2abb96df..9e813178aaa710579193c8a92e10a378fafe08a5 100644 (file)
@@ -5,10 +5,9 @@
 /*
  * 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: */
index 76a9956f03f1b1214f33e0d00811392e67788b6e..967d277dbec5bb20d53ecf272b5638547a4da653 100644 (file)
@@ -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.
  *
index b8fdb6904b4ced2d9f72e783f79c371473656afa..07e1a6775f798b898a8f474a04b0d924d7aff02f 100644 (file)
@@ -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.
index baf9d81df9dd03abdd468f23588942bbd62ee4b7..b2b1c528464770ad9d0e8ea8285d49a4fb71e7c9 100644 (file)
@@ -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
index 1c67679b41bd3ead0d5f10e127b9bff33551bd6d..700b22d673b5afce52d86b37903a374f960fd4a0 100644 (file)
@@ -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.
index d201e22fd1c8030445e234c5d078d7a522fb8f3d..a688158dd71cc92ae83573a75365265e7d34ebfa 100644 (file)
@@ -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
index 2224c8b4ef035c63d6b7c9d39a79ef860062cb22..fccb042cf9f817cafe367639bea45bb01c84abfa 100644 (file)
@@ -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.
index f2982a7be0d683b41fc2a207f9c2c7fbe5d08efc..ef84b0fe9f42f139188fadbd191acb86449112b9 100644 (file)
@@ -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
index 13083120aaeceba7c581675b0d04099f389937d0..ef7f2930aaf5574dd3fb7beccbab70582076636c 100644 (file)
@@ -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
index db3ce4a68c9e0f836eaeb74b3bc312b26ad77357..67443e87980da069d4526b4b29372bec7a460cad 100644 (file)
@@ -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
index 4d9271bfbc44f0c08134df82961f64aca4ac04f3..5bbb05c5d6a19f06991ac75729e94795daa9e6e6 100644 (file)
@@ -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:
index fddb572dae4402d37c57ad188af8e4b18a05f3c2..3c016b7475f35d7e8fcff4ba909d66ddcb88619d 100644 (file)
@@ -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.
index 1c8a4926a95b7a1d9849c9fd902c64fec7d77267..1596f47826893b30e0cf93a9d01054bedb782660 100644 (file)
@@ -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.
index d59b107ab275f854e972a16289257a273e7cdbc4..8ce9a965017356e1b3a934d26b698b258c072482 100644 (file)
@@ -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 );
     }
 
index 10673c9aae8e9ec2f1c80e8888a14d58586560eb..91cde020ffc04cb842ae1eeba388862f0e36233f 100644 (file)
@@ -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
index c0aac05d16811024bccf693b1f76df3bcd3e10c2..8cdd7a528755e38c052092480b377ca9ba4dec1e 100644 (file)
@@ -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
index 7f6dec967068a7b35547e051e3fc0459ca75d6b7..47a2ec0cfa2afe33a3382d54cefe687b6f2476e3 100644 (file)
@@ -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);
         }
     }
 
index 28b16576eb1c91c3b67f8ce13a81b980d55c204e..40a9bc0d1380c9f82f8badcbf9a26344aedc56c3 100644 (file)
@@ -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
index 4a9d76e5d2feffda1ab947aded457855df91dc9d..5ea2c563225466c438f208f28eab6c1eb435cd8e 100644 (file)
@@ -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
index 900581d497abb65578f6db89c070fcb38b42aa4b..4d81a61864b71acc18552d341807c89d9a2b66e7 100644 (file)
@@ -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.
index a0ac11be578a3dccb4cf853ef46007082cb63223..8eb7856da04fb9660b10ff6841ebbb8e725a9861 100644 (file)
@@ -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
index 8360797444f722c8eabb1a8c0a9c2ef6b1efcd6a..744212357aa63d015b857302b6d88e280bd4d863 100644 (file)
@@ -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
index 34d29d03f6b190f962fea5e6cf8826f8cfd29916..c5a99e360300d1f4d8efdbca4207f98b609e67a9 100644 (file)
@@ -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"
  *
index 2d9a1d0733ec4d37c01b8aa3252ba6852d62a525..1f2f7bbcd054f14ed4507ef41ec82ddb9dd92e7c 100644 (file)
@@ -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.
index ba6782d732b38a3d29cd371aaa419504e17fca49..9a1cf63f6ff9340b4ad2a161737c8e5cd981c94d 100644 (file)
@@ -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,
index 2eff3dbd0231a1778f2b94054e2755c41885ebdb..17719e1b4404137af0a22c46fb5d9356aeb59281 100644 (file)
@@ -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.
  */
index 0005c9f7d125bb188b04f085aaa1f04abdb7b519..07e0e183ca3f91f930fbb6dc58519aade4ef3910 100644 (file)
@@ -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
index ae87eacaeb2e141cddd85a60a8b43447c3f50c08..517d8fd3928fa9023083395b8a6feb86ab45a2ca 100644 (file)
@@ -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.
  */