]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Upgrade to libopts-27.3.2
authorHarlan Stenn <stenn@ntp.org>
Mon, 3 Jul 2006 23:05:18 +0000 (19:05 -0400)
committerHarlan Stenn <stenn@ntp.org>
Mon, 3 Jul 2006 23:05:18 +0000 (19:05 -0400)
bk: 44a9a2aeMtPyoR7P_cxfQ8yt0ATx_g

58 files changed:
libopts/Makefile.am
libopts/autoopts.c
libopts/autoopts.h
libopts/boolean.c
libopts/compat/compat.h
libopts/compat/pathfind.c
libopts/compat/strchr.c [new file with mode: 0644]
libopts/configfile.c
libopts/cook.c
libopts/enumeration.c
libopts/environment.c
libopts/libopts.c
libopts/load.c
libopts/m4/libopts.m4
libopts/makeshell.c
libopts/nested.c
libopts/numeric.c
libopts/pgusage.c
libopts/proto.h
libopts/putshell.c
libopts/restore.c
libopts/save.c
libopts/sort.c
libopts/stack.c
libopts/streqvcmp.c
libopts/text_mmap.c
libopts/tokenize.c
libopts/usage.c
libopts/version.c
sntp/libopts/Makefile.am
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/strchr.c [new file with mode: 0644]
sntp/libopts/configfile.c
sntp/libopts/cook.c
sntp/libopts/enumeration.c
sntp/libopts/environment.c
sntp/libopts/libopts.c
sntp/libopts/load.c
sntp/libopts/m4/libopts.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/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/tokenize.c
sntp/libopts/usage.c
sntp/libopts/version.c

index ca0f8a676d7f5c93306e6208b22306c13300a45e..610842644104a0940944fc21df643f1fd04af6bd 100644 (file)
@@ -3,18 +3,18 @@ MAINTAINERCLEANFILES  = Makefile.in
 lib_LTLIBRARIES       = libopts.la
 libopts_la_SOURCES    = libopts.c
 libopts_la_CPPFLAGS   = -I$(top_srcdir)
-libopts_la_LDFLAGS    = -version-info  27:1:2
+libopts_la_LDFLAGS    = -version-info  27:3:2
 EXTRA_DIST            = \
     COPYING.lgpl         COPYING.mbsd         MakeDefs.inc  \
     README               autoopts/options.h   autoopts/usage-txt.h  \
     autoopts.c           autoopts.h           boolean.c  \
     compat/compat.h      compat/pathfind.c    compat/snprintf.c  \
-    compat/strdup.c      configfile.c         cook.c  \
-    enumeration.c        environment.c        genshell.c  \
-    genshell.h           load.c               m4/libopts.m4  \
-    m4/liboptschk.m4     makeshell.c          nested.c  \
-    numeric.c            pgusage.c            proto.h  \
-    putshell.c           restore.c            save.c  \
-    sort.c               stack.c              streqvcmp.c  \
-    text_mmap.c          tokenize.c           usage.c  \
-    version.c
+    compat/strdup.c      compat/strchr.c      configfile.c  \
+    cook.c               enumeration.c        environment.c  \
+    genshell.c           genshell.h           load.c  \
+    m4/libopts.m4        m4/liboptschk.m4     makeshell.c  \
+    nested.c             numeric.c            pgusage.c  \
+    proto.h              putshell.c           restore.c  \
+    save.c               sort.c               stack.c  \
+    streqvcmp.c          text_mmap.c          tokenize.c  \
+    usage.c              version.c
index 6d88967e4831f9e023a7a91cb30c0780d368d5da..806d71b9d2835d4248b5469a5675bd25e6dd58a0 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: autoopts.c,v 4.14 2006/03/25 19:24:56 bkorb Exp $
- *  Time-stamp:      "2005-10-29 13:19:36 bkorb"
+ *  $Id: autoopts.c,v 4.20 2006/06/24 23:34:51 bkorb Exp $
+ *  Time-stamp:      "2006-07-01 14:41:46 bkorb"
  *
  *  This file contains all of the routines that must be linked into
  *  an executable to use the generated option processing.  The optional
 # endif
 #endif
 
+#ifndef HAVE_STRCHR
+#  include "compat/strchr.c"
+#endif
+
 static const char zNil[] = "";
 
 #define SKIP_RC_FILES(po) \
@@ -350,7 +354,7 @@ longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState )
  *  Find the short option descriptor for the current option
  */
 LOCAL tSuccess
-shortOptionFind( tOptions* pOpts, tAoUC optValue, tOptState* pOptState )
+shortOptionFind( tOptions* pOpts, uint_t optValue, tOptState* pOptState )
 {
     tOptDesc*  pRes = pOpts->pOptDesc;
     int        ct   = pOpts->optCt;
@@ -423,7 +427,7 @@ findOptDesc( tOptions* pOpts, tOptState* pOptState )
      *  OTHERWISE see if there is room to advance and then do so.
      */
     if ((pOpts->pzCurOpt != NULL) && (*pOpts->pzCurOpt != NUL))
-        return shortOptionFind( pOpts, *pOpts->pzCurOpt, pOptState );
+        return shortOptionFind( pOpts, (tAoUC)*(pOpts->pzCurOpt), pOptState );
 
     if (pOpts->curOptIdx >= pOpts->origArgCt)
         return PROBLEM; /* NORMAL COMPLETION */
@@ -493,7 +497,7 @@ findOptDesc( tOptions* pOpts, tOptState* pOptState )
      *  short (i.e. single character) option.
      */
     if ((pOpts->fOptSet & OPTPROC_SHORTOPT) != 0)
-        return shortOptionFind( pOpts, *pOpts->pzCurOpt, pOptState );
+        return shortOptionFind( pOpts, (tAoUC)*(pOpts->pzCurOpt), pOptState );
 
     return longOptionFind( pOpts, pOpts->pzCurOpt, pOptState );
 }
index af01f07cad32b55d9023fcd3e71c671fc64553e2..675da5373c80afe06f60f2364dc6cb17374bfa73 100644 (file)
@@ -1,8 +1,8 @@
 
 /*
- *  Time-stamp:      "2005-10-29 15:06:44 bkorb"
+ *  Time-stamp:      "2006-07-01 14:40:47 bkorb"
  *
- *  autoopts.h  $Id: autoopts.h,v 4.17 2006/03/25 19:24:56 bkorb Exp $
+ *  autoopts.h  $Id: autoopts.h,v 4.22 2006/06/24 23:34:51 bkorb Exp $
  *  Time-stamp:      "2005-02-14 05:59:50 bkorb"
  *
  *  This file defines all the global structures and special values
 #undef  EXPORT
 #define EXPORT
 
+#if defined(_WIN32)
+# define DIRch '\\'
+#else
+# define DIRCH '/'
+#endif
+
 /*
  *  Convert the number to a list usable in a printf call
  */
@@ -178,8 +184,8 @@ typedef struct {
     tCC*    pzOptFmt;
 } arg_types_t;
 
-#  define AGALOC( c, w )        malloc( c )
-#  define AGREALOC( p, c, w )   realloc( p, c )
+#  define AGALOC( c, w )        malloc( (unsigned)c )
+#  define AGREALOC( p, c, w )   realloc( p, (unsigned)c )
 #  define AGFREE( p )           free( p )
 #  define AGDUPSTR( p, s, w )   p = strdup( s )
 #  define TAGMEM( m, t )
@@ -292,6 +298,11 @@ typedef struct {
 # endif
 #endif
 
+#ifndef HAVE_STRCHR
+extern char* strchr( const char *s, int c);
+extern char* strrchr( const char *s, int c);
+#endif
+
 /*
  *  Define and initialize all the user visible strings.
  *  We do not do translations.  If translations are to be done, then
@@ -307,9 +318,6 @@ extern FILE* option_usage_fp;
 
 extern tOptProc optionPrintVersion, optionPagedUsage, optionLoadOpt;
 
-#define LOCAL static
-#include "proto.h"
-
 #endif /* AUTOGEN_AUTOOPTS_H */
 /*
  * Local Variables:
index 30ccd0d5e2a5b124af5227aa36c75076e6082275..d09833003472e82eb61fdf865e6a2cb4f35a6dda 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: boolean.c,v 4.5 2006/03/25 19:24:56 bkorb Exp $
+ *  $Id: boolean.c,v 4.6 2006/03/25 19:23:28 bkorb Exp $
  * Time-stamp:      "2005-02-14 08:24:12 bkorb"
  *
  *   Automated Options Paged Usage module.
index 5c9e923016d498e3fa94949bf555f646be4caff3..b23790b46b67c0ac16df78b6a4964415e698aa25 100644 (file)
@@ -2,12 +2,12 @@
 
 /* --- fake the preprocessor into handlng portability */
 /*
- *  Time-stamp:      "2005-09-21 20:56:13 bkorb"
+ *  Time-stamp:      "2006-06-24 10:57:22 bkorb"
  *
  * Author:           Gary V Vaughan <gvaughan@oranda.demon.co.uk>
  * Created:          Mon Jun 30 15:54:46 1997
  *
- * $Id: compat.h,v 4.6 2005/10/02 16:34:30 bkorb Exp $
+ * $Id: compat.h,v 4.8 2006/06/24 23:34:51 bkorb Exp $
  */
 #ifndef COMPAT_H
 #define COMPAT_H 1
 #ifndef HAVE_UINT16_T
   typedef unsigned short    uint16_t;
 #endif
+#ifndef HAVE_UINT_T
+  typedef unsigned int      uint_t;
+#endif
 
 #ifndef HAVE_INT32_T
 # if SIZEOF_INT == 4
index 4da759f3ba21b5a5a65471afdd1f2820c73257b0..d827cf7d75c9eaefe9cf08e177ecb8dfb4ea2327 100644 (file)
@@ -5,10 +5,10 @@
 /*
  * Author:           Gary V Vaughan <gvaughan@oranda.demon.co.uk>
  * Created:          Tue Jun 24 15:07:31 1997
- * Last Modified:    $Date: 2005/07/27 17:26:32 $
+ * Last Modified:    $Date: 2005/09/04 21:13:39 $
  *            by: bkorb
  *
- * $Id: pathfind.c,v 4.4 2005/07/27 17:26:32 bkorb Exp $
+ * $Id: pathfind.c,v 4.4 2005/09/04 21:13:39 bkorb Exp $
  */
 
 /* Code: */
diff --git a/libopts/compat/strchr.c b/libopts/compat/strchr.c
new file mode 100644 (file)
index 0000000..fd6507f
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+   SYNOPSIS
+       #include <string.h>
+
+       char *strchr(const char *s, int c);
+
+       char *strrchr(const char *s, int c);
+
+   DESCRIPTION
+       The  strchr() function returns a pointer to the first occurrence of the
+       character c in the string s.
+
+       The strrchr() function returns a pointer to the last occurrence of  the
+       character c in the string s.
+
+       Here  "character"  means "byte" - these functions do not work with wide
+       or multi-byte characters.
+
+   RETURN VALUE
+       The strchr() and strrchr() functions return a pointer  to  the  matched
+       character or NULL if the character is not found.
+
+   CONFORMING TO
+       SVID 3, POSIX, BSD 4.3, ISO 9899
+*/
+
+char*
+strchr( const char *s, int c)
+{
+    do {
+        if ((unsigned)*s == (unsigned)c)
+            return s;
+
+    } while (*(++s) != NUL);
+
+    return NULL;
+}
+
+char*
+strrchr( const char *s, int c)
+{
+    const char *e = s + strlen(s);
+
+    for (;;) {
+        if (--e < s)
+            break;
+
+        if ((unsigned)*e == (unsigned)c)
+            return e;
+    }
+    return NULL;
+}
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ * end of compat/strsignal.c */
index 4a2155a48c38d1c006f27778b244ca05a31dfc28..be228bc357614a4caa0bb320e8b998d2cc2428d8 100644 (file)
@@ -1,6 +1,6 @@
 /*
- *  $Id: configfile.c,v 4.12 2006/03/25 19:24:56 bkorb Exp $
- *  Time-stamp:      "2005-10-16 15:16:32 bkorb"
+ *  $Id: configfile.c,v 4.22 2006/06/24 23:34:51 bkorb Exp $
+ *  Time-stamp:      "2006-07-01 12:46:31 bkorb"
  *
  *  configuration/rc/ini file handling.
  */
@@ -640,7 +640,7 @@ handleDirective(
 
         if (isspace(*pzText)) {
             while (isspace(*pzText))  pzText++;
-            if (  (strneqvcmp( pzText, pOpts->pzProgName, name_len ) == 0)
+            if (  (strneqvcmp( pzText, pOpts->pzProgName, (int)name_len) == 0)
                && (pzText[name_len] == '>'))  {
                 pzText += name_len + 1;
                 break;
@@ -847,8 +847,8 @@ internalFileLoad( tOptions* pOpts )
                 continue;
 
             pz = zFileName + len;
-            if (pz[-1] != '/')
-                *(pz++) = '/';
+            if (pz[-1] != DIRCH)
+                *(pz++) = DIRCH;
             strcpy( pz, pOpts->pzRcName );
         }
 
@@ -1249,7 +1249,7 @@ validateOptionsStruct( tOptions* pOpts, const char* pzProgram )
      *  and the set of equivalent characters.
      */
     if (pOpts->pzProgName == NULL) {
-        const char* pz = strrchr( pzProgram, '/' );
+        const char* pz = strrchr( pzProgram, DIRCH );
 
         if (pz == NULL)
              pOpts->pzProgName = pzProgram;
index 763f697da343ee96ddafafe16cd1e6746da478e8..aecd4ec483d1d5b1f2048517ebaa442eb883eb30 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: cook.c,v 4.3 2006/03/25 19:24:56 bkorb Exp $
- *  Time-stamp:      "2005-05-20 13:58:56 bkorb"
+ *  $Id: cook.c,v 4.6 2006/06/24 23:34:51 bkorb Exp $
+ *  Time-stamp:      "2006-06-24 11:29:58 bkorb"
  *
  *  This file contains the routines that deal with processing quoted strings
  *  into an internal format.
@@ -60,7 +60,7 @@
  * what:  escape-process a string fragment
  * arg:   + const char* + pzScan  + points to character after the escape +
  * arg:   + char*       + pRes    + Where to put the result byte +
- * arg:   + char        + nl_ch   + replacement char if scanned char is \n +
+ * arg:   + u_int       + nl_ch   + replacement char if scanned char is \n +
  *
  * ret-type: unsigned int
  * ret-desc: The number of bytes consumed processing the escaped character.
@@ -81,7 +81,7 @@
  * err:  @code{NULL} is returned if the string(s) is/are mal-formed.
 =*/
 unsigned int
-ao_string_cook_escape_char( const char* pzIn, char* pRes, char nl )
+ao_string_cook_escape_char( const char* pzIn, char* pRes, u_int nl )
 {
     unsigned int  res = 1;
 
@@ -94,7 +94,7 @@ ao_string_cook_escape_char( const char* pzIn, char* pRes, char nl )
         res++;
         /* FALLTHROUGH */
     case '\n':        /* NL  - emit newline        */
-        *pRes = nl;
+        *pRes = (char)nl;
         return res;
 
     case 'a': *pRes = '\a'; break;
@@ -325,7 +325,7 @@ ao_string_cook( char* pzScan, int* pLineCt )
              *  THEN we do the full escape character processing
              */
             else if (q != '\'') {
-                int ct = ao_string_cook_escape_char( pzS, pzD-1, '\n' );
+                int ct = ao_string_cook_escape_char( pzS, pzD-1, (u_int)'\n' );
                 if (ct == 0)
                     return NULL;
 
index 86f7cc0e056fe53ff6b7af9b427acc6b3530f6ff..0dbe5661414c7e929aa259cc5f78edfa3565d609 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: enumeration.c,v 4.9 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-12-09 06:37:15 bkorb"
+ *  $Id: enumeration.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-06-24 10:46:02 bkorb"
  *
  *   Automated Options Paged Usage module.
  *
@@ -193,7 +193,7 @@ findName(
             if (res != name_ct) {
                 pz_enum_err_fmt = zAmbigKey;
                 option_usage_fp = stderr;
-                enumError( pOpts, pOD, paz_names, name_ct );
+                enumError( pOpts, pOD, paz_names, (int)name_ct );
             }
             res = idx; /* save partial match */
         }
@@ -205,7 +205,7 @@ findName(
     if (res == name_ct) {
         pz_enum_err_fmt = zNoKey;
         option_usage_fp = stderr;
-        enumError( pOpts, pOD, paz_names, name_ct );
+        enumError( pOpts, pOD, paz_names, (int)name_ct );
     }
 
     /*
@@ -275,7 +275,7 @@ optionEnumerationVal(
         /*
          *  print the list of enumeration names.
          */
-        enumError( pOpts, pOD, paz_names, name_ct );
+        enumError( pOpts, pOD, paz_names, (int)name_ct );
         return (char*)0UL;
 
     case 1UL:
@@ -341,7 +341,7 @@ optionSetMembers(
         /*
          *  print the list of enumeration names.
          */
-        enumError( pOpts, pOD, paz_names, name_ct );
+        enumError( pOpts, pOD, paz_names, (int)name_ct );
         return;
 
     case 1UL:
@@ -433,7 +433,7 @@ optionSetMembers(
             if ((len == 3) && (strncmp( pzArg, zAll, 3 ) == 0)) {
                 if (iv)
                      res = 0;
-                else res = ~0;
+                else res = ~0UL;
             }
             else if ((len == 4) && (strncmp( pzArg, zNone, 4 ) == 0)) {
                 if (! iv)
@@ -449,7 +449,7 @@ optionSetMembers(
                     if (*pz != NUL) {
                         if (len >= AO_NAME_LIMIT)
                             break;
-                        strncpy( z, pzArg, len );
+                        strncpy( z, pzArg, (unsigned)len );
                         z[len] = NUL;
                         p = z;
                     } else {
index 285b229a95da4cef7960dc55daca5fdf2c2a19f1..caaa712bac907f7167c805d222a4d62965f80beb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: environment.c,v 4.8 2006/03/25 19:24:56 bkorb Exp $
+ *  $Id: environment.c,v 4.10 2006/03/25 19:23:28 bkorb Exp $
  * Time-stamp:      "2005-10-29 13:23:59 bkorb"
  *
  *  This file contains all of the routines that must be linked into
index 960a492fbbc2e3177c2393ecd6fcc372374bb5f6..7222a8c1349339616cc38dbaa7a239de96eb26aa 100644 (file)
@@ -1,6 +1,7 @@
 #define AUTOOPTS_INTERNAL
 #include "compat/compat.h"
 #define HAVE_LIBSNPRINTFV
+#define LOCAL static
 #include "autoopts/options.h"
 #include "autoopts/usage-txt.h"
 #include "genshell.h"
index e5a2b8ff2ab1355ec944f2fd89a7af11f9378c8c..19b446457a4710a93a369ea026347b063882df19 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: load.c,v 4.18 2006/03/25 19:24:56 bkorb Exp $
- *  Time-stamp:      "2005-10-29 14:45:36 bkorb"
+ *  $Id: load.c,v 4.22 2006/06/24 23:34:51 bkorb Exp $
+ *  Time-stamp:      "2006-07-01 12:43:03 bkorb"
  *
  *  This file contains the routines that deal with processing text strings
  *  for options, either from a NUL-terminated string passed in or from an
@@ -102,7 +102,7 @@ assembleArgValue( char* pzTxt, tOptionLoadMode mode );
  *
  *  Please note: both @code{$$} and @code{$NAME} must be at the start of the
  *     @code{pzName} string and must either be the entire string or be followed
- *     by the @code{'/'} character.
+ *     by the @code{'/'} (backslash on windows) character.
  *
  * err:  @code{AG_FALSE} is returned if:
  *       @*
@@ -195,7 +195,7 @@ insertProgramPath(
     int     skip = 2;
 
     switch (pzName[2]) {
-    case '/':
+    case DIRCH:
         skip = 3;
     case NUL:
         break;
@@ -208,7 +208,7 @@ insertProgramPath(
      *  If it is, we're done.  Otherwise, we have to hunt
      *  for the program using "pathfind".
      */
-    if (strchr( pzProgPath, '/' ) != NULL)
+    if (strchr( pzProgPath, DIRCH ) != NULL)
         pzPath = pzProgPath;
     else {
         pzPath = pathfind( getenv( "PATH" ), (char*)pzProgPath, "rx" );
@@ -217,7 +217,7 @@ insertProgramPath(
             return AG_FALSE;
     }
 
-    pz = strrchr( pzPath, '/' );
+    pz = strrchr( pzPath, DIRCH );
 
     /*
      *  IF we cannot find a directory name separator,
@@ -235,7 +235,7 @@ insertProgramPath(
     if ((pz - pzPath)+1 + strlen(pzName) >= bufSize)
         return AG_FALSE;
 
-    memcpy( pzBuf, pzPath, (pz - pzPath)+1 );
+    memcpy( pzBuf, pzPath, (unsigned)((pz - pzPath)+1) );
     strcpy( pzBuf + (pz - pzPath) + 1, pzName );
 
     /*
index 085c776441f1649cae4a599ce0bde8ebbf0dee44..3e9c2432a574eaacffd22ffec176ab6484656112 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  Sunday April  9, 2006 at 11:49:18 AM PDT
+dnl It has been AutoGen-ed  Saturday July  1, 2006 at 02:52:02 PM PDT
 dnl From the definitions    libopts.def
 dnl and the template file   conftest.tpl
 dnl
@@ -84,7 +84,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
   # ----------------------------------------------------------------------
   AC_CHECK_LIB(gen, pathfind)
   AC_FUNC_VPRINTF
-  AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup])
+  AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr strrchr])
 [  INVOKE_LIBOPTS_MACROS_FIRST_done=yes
 fi]])
 
@@ -200,20 +200,13 @@ int main() {
   ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex
   AC_MSG_RESULT([${libopts_cv_with_libregex}])
 
-  if test "X${libopts_cv_with_libregex}" = Xno
+  if test "X${libopts_cv_with_libregex}" != Xno
   then
+    AC_DEFINE([WITH_LIBREGEX],[1],
+        [Define this if a working libregex can be found])
+  else
     CPPFLAGS="${libopts_save_CPPFLAGS}"
     LIBS="${libopts_save_LIBS}"
-               cat >&2 <<'_EOF_'
-I cannot detect POSIX compliant regcomp/regexec routines.
-These are required for AutoGen to work correctly.  If you have
-such a library present on your system, you must specify it by
-setting the LIBS environment variable, e.g., "LIBS='-lregex'".
-If you do not have such a library on your system, then you should
-download and install, for example, the one from:
-    ftp://ftp.gnu.org/gnu/rx/
-_EOF_
-AC_MSG_ERROR([Cannot find working POSIX regex library])
   fi
   
 ]) # end of AC_DEFUN of LIBOPTS_WITHLIB_REGEX
index 32bcaa3e9be838c76f5836ffdae7f4b2a276bded..40ccedefec2bde18f4deb9e639464d3b700345d2 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: makeshell.c,v 4.8 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-10-29 13:23:33 bkorb"
+ *  $Id: makeshell.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-06-24 10:47:07 bkorb"
  *
  *  This module will interpret the options set in the tOptions
  *  structure and create a Bourne shell script capable of parsing them.
@@ -930,8 +930,8 @@ openOutput( const char* pzFile )
     struct stat stbf;
 
     do  {
-        char*  pzScan;
-        int    sizeLeft;
+        char*    pzScan;
+        uint32_t sizeLeft;
 
         /*
          *  IF we cannot stat the file,
@@ -949,10 +949,10 @@ openOutput( const char* pzFile )
             exit( EXIT_FAILURE );
         }
 
-        pzData = (char*)malloc( stbf.st_size + 1 );
+        pzData = (char*)malloc( (unsigned)(stbf.st_size + 1) );
         fp = fopen( pzFile, "r" FOPEN_BINARY_FLAG );
 
-        sizeLeft = stbf.st_size;
+        sizeLeft = (unsigned)stbf.st_size;
         pzScan   = pzData;
 
         /*
@@ -1045,8 +1045,8 @@ genshelloptUsage( tOptions*  pOpts, int exitCode )
 
     default:
     {
-        int  stat;
-        wait( &stat );
+        int  sts;
+        wait( &sts );
     }
     }
 
@@ -1082,8 +1082,8 @@ genshelloptUsage( tOptions*  pOpts, int exitCode )
 
     default:
     {
-        int  stat;
-        wait( &stat );
+        int  sts;
+        wait( &sts );
     }
     }
 
index ef32f2845c249a4becbcd546fb47aa4f5cc44f27..00b88691afb4c87cdca25334427af11723b84d86 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: nested.c,v 4.4 2006/03/25 19:24:56 bkorb Exp $
+ *  $Id: nested.c,v 4.9 2006/03/25 19:23:28 bkorb Exp $
  *  Time-stamp:      "2005-07-27 10:10:28 bkorb"
  *
  *   Automated Options Nested Values module.
index 54be7c10a5ebf7eebd086e21324ea77b99d7a0b2..26790df3c78b167b47b64cc6ac2ff662d271f9ff 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: numeric.c,v 4.6 2006/03/25 19:24:56 bkorb Exp $
+ *  $Id: numeric.c,v 4.7 2006/03/25 19:23:28 bkorb Exp $
  *  Time-stamp:      "2005-02-14 08:22:56 bkorb"
  */
 
index 9842a72313f0e42222da1ad1a61770280bfcef0e..353e0f27752937c93aab0b612268226edc0a719b 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: pgusage.c,v 4.7 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-10-29 13:23:12 bkorb"
+ *  $Id: pgusage.c,v 4.9 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-06-24 10:48:00 bkorb"
  *
  *   Automated Options Paged Usage module.
  *
@@ -114,7 +114,7 @@ optionPagedUsage( tOptions* pOptions, tOptDesc* pOD )
     case PAGER_STATE_READY:
     {
         tSCC zPage[]  = "%1$s /tmp/use.%2$lu ; rm -f /tmp/use.%2$lu";
-        char* pzPager = getenv( "PAGER" );
+        tCC* pzPager  = (tCC*)getenv( "PAGER" );
 
         /*
          *  Use the "more(1)" program if "PAGER" has not been defined
index f15050179a1f311a5210ed78ed15e59f94c83d97..2779c5c671651fac388e7b051faf853a0028ae4a 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- buffer-read-only: t -*- vi: set ro:
  *
  * Prototypes for autoopts
- * Generated Sun Apr  9 11:50:00 PDT 2006
+ * Generated Sat Jul  1 14:52:42 PDT 2006
  */
 #ifndef AUTOOPTS_PROTO_H_GUARD
 #define AUTOOPTS_PROTO_H_GUARD 1
@@ -21,7 +21,7 @@ LOCAL tSuccess
 longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState );
 
 LOCAL tSuccess
-shortOptionFind( tOptions* pOpts, tAoUC optValue, tOptState* pOptState );
+shortOptionFind( tOptions* pOpts, uint_t optValue, tOptState* pOptState );
 
 LOCAL tSuccess
 doImmediateOpts( tOptions* pOpts );
index feed57b3ae526732c34ab55c33334de7bacc3d35..a97574bb7bb4c099ae205bfbb786d17a839e1a5d 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: putshell.c,v 4.9 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-12-13 10:28:47 bkorb"
+ *  $Id: putshell.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-06-24 14:29:07 bkorb"
  *
  *  This module will interpret the options set in the tOptions
  *  structure and print them to standard out in a fashion that
@@ -95,7 +95,7 @@ putQuotedStr( tCC* pzStr )
         /*
          *  Emit the string up to the single quote (apostrophe) we just found.
          */
-        fwrite( pzStr, (pz - pzStr), 1, stdout );
+        fwrite( pzStr, (unsigned)(pz - pzStr), 1, stdout );
         fputc( '\'', stdout );
         pzStr = pz;
 
@@ -200,7 +200,7 @@ optionPutShell( tOptions* pOpts )
                     else if (ch == NUL)      { pz--; goto name_done; }
                     else fputc( '_', stdout );
                 } name_done:;
-                printf( "=%1$ld # 0x%1$lX\n", val );
+                printf( "=%1$lu # 0x%1$lX\n", (unsigned long)val );
                 val <<= 1;
             }
             free( (void*)(pOD->pzLastArg) );
@@ -230,13 +230,13 @@ optionPutShell( tOptions* pOpts )
             printf( zOptCookieCt, pOpts->pzPROGNAME, pOD->pz_NAME, ct );
 
             while (--ct >= 0) {
-                tSCC zOptNumArg[] = "%s_%s_%d=";
-                tSCC zOptEnd[]    = "\nexport %s_%s_%d\n";
+                tSCC numarg_z[] = "%s_%s_%d=";
+                tSCC end_z[]    = "\nexport %s_%s_%d\n";
 
-                printf( zOptNumArg, pOpts->pzPROGNAME, pOD->pz_NAME,
+                printf( numarg_z, pOpts->pzPROGNAME, pOD->pz_NAME,
                         pAL->useCt - ct );
                 putQuotedStr( *(ppz++) );
-                printf( zOptEnd, pOpts->pzPROGNAME, pOD->pz_NAME,
+                printf( end_z, pOpts->pzPROGNAME, pOD->pz_NAME,
                         pAL->useCt - ct );
             }
         }
index 959e0f9d62d0655fd202c92dad424a13cd8d6330..ce788b3303c62cf41d5fef44a5280831b3f73aa6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  restore.c  $Id: restore.c,v 4.6 2006/03/25 19:24:56 bkorb Exp $
+ *  restore.c  $Id: restore.c,v 4.7 2006/03/25 19:23:28 bkorb Exp $
  * Time-stamp:      "2005-02-23 15:10:20 bkorb"
  *
  *  This module's routines will save the current option state to memory
index 51fa212f7fdd6dcf6c1979b74503794eba37e7e9..938a4fd1240b3b8483d4693a92385b51e556e767 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  save.c  $Id: save.c,v 4.12 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-02-20 13:49:46 bkorb"
+ *  save.c  $Id: save.c,v 4.14 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-07-01 12:41:27 bkorb"
  *
  *  This module's routines will take the currently set options and
  *  store them into an ".rc" file for re-interpretation the next
@@ -100,7 +100,7 @@ findDirName( tOptions* pOpts, int* p_free )
         return pzDir;
 
     {
-        tCC*  pzEndDir = strchr( ++pzDir, '/' );
+        tCC*  pzEndDir = strchr( ++pzDir, DIRCH );
         char* pzFileName;
         char* pzEnv;
 
@@ -108,7 +108,7 @@ findDirName( tOptions* pOpts, int* p_free )
             char z[ AO_NAME_SIZE ];
             if ((pzEndDir - pzDir) > AO_NAME_LIMIT )
                 return NULL;
-            strncpy( z, pzDir, (pzEndDir - pzDir) );
+            strncpy( z, pzDir, (unsigned)(pzEndDir - pzDir) );
             z[ (pzEndDir - pzDir) ] = NUL;
             pzEnv = getenv( z );
         } else {
@@ -176,13 +176,13 @@ findFileName( tOptions* pOpts, int* p_free_name )
              *  Strip off the last component, stat the remaining string and
              *  that string must name a directory
              */
-            char* pzDirCh = strrchr( pzDir, '/' );
+            char* pzDirCh = strrchr( pzDir, DIRCH );
             if (pzDirCh == NULL) {
                 stBuf.st_mode = S_IFREG;
                 continue;  /* bail out of error condition */
             }
 
-            strncpy( z, pzDir, pzDirCh - pzDir );
+            strncpy( z, pzDir, (unsigned)(pzDirCh - pzDir));
             z[ pzDirCh - pzDir ] = NUL;
 
             if (  (stat( z, &stBuf ) == 0)
@@ -308,7 +308,7 @@ printEntry(
             /*
              *  Print the continuation and the text from the current line
              */
-            fwrite( pzLA, pzNl - pzLA, 1, fp );
+            fwrite( pzLA, (unsigned)(pzNl - pzLA), 1, fp );
             pzLA = pzNl+1; /* advance the Last Arg pointer */
             fputs( "\\\n", fp );
         }
index e7f29ed1882205b9d698cf5b50f2abf2ef4eff16..de0bd5634d1bfa997d7f71a81f343d0cacca5de8 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  sort.c  $Id: sort.c,v 4.7 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-02-20 17:18:41 bkorb"
+ *  sort.c  $Id: sort.c,v 4.10 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-06-24 10:53:35 bkorb"
  *
  *  This module implements argument sorting.
  */
@@ -155,7 +155,7 @@ checkShortOpts( tOptions* pOpts, char* pzArg, tOptState* pOS,
                 char** ppzOpts, int* pOptsIdx )
 {
     while (*pzArg != NUL) {
-        if (FAILED( shortOptionFind( pOpts, *pzArg, pOS )))
+        if (FAILED( shortOptionFind( pOpts, (tAoUC)*pzArg, pOS )))
             return FAILURE;
 
         /*
@@ -295,7 +295,7 @@ optionSort( tOptions* pOpts )
             if ((pOpts->fOptSet & OPTPROC_SHORTOPT) == 0) {
                 res = longOptionFind( pOpts, pzArg+1, &os );
             } else {
-                res = shortOptionFind( pOpts, pzArg[1], &os );
+                res = shortOptionFind( pOpts, (tAoUC)pzArg[1], &os );
             }
             break;
         }
index bbea3342be16c07842e501b990ada1202bc44fd7..13137375ae87fe51a856efabd8b14f239988dfb5 100644 (file)
@@ -1,8 +1,8 @@
 
 /*
  *  stack.c
- *  $Id: stack.c,v 4.6 2006/03/25 19:24:56 bkorb Exp $
- *  Time-stamp:      "2005-02-20 16:33:20 bkorb"
+ *  $Id: stack.c,v 4.8 2006/03/25 19:23:28 bkorb Exp $
+ *  Time-stamp:      "2006-07-01 14:35:13 bkorb"
  *
  *  This is a special option processing routine that will save the
  *  argument to an option in a FIFO queue.
@@ -82,6 +82,7 @@ optionUnstackArg(
         return;
     }
 
+#ifdef WITH_LIBREGEX
     {
         regex_t   re;
         int       i, ct, dIdx;
@@ -130,7 +131,45 @@ optionUnstackArg(
 
         regfree( &re );
     }
+#else  /* not WITH_LIBREGEX */
+    {
+        int i, ct, dIdx;
 
+        /*
+         *  search the list for the entry(s) to remove.  Entries that
+         *  are removed are *not* copied into the result.  The source
+         *  index is incremented every time.  The destination only when
+         *  we are keeping a define.
+         */
+        for (i = 0, dIdx = 0, ct = pAL->useCt; --ct >= 0; i++) {
+            tCC*      pzSrc = pAL->apzArgs[ i ];
+            char*     pzEq  = strchr( pzSrc, '=' );
+
+            if (pzEq != NULL)
+                *pzEq = NUL;
+
+            if (strcmp( pzSrc, pOptDesc->pzLastArg ) == 0) {
+                /*
+                 *  Remove this entry by reducing the in-use count
+                 *  and *not* putting the string pointer back into
+                 *  the list.
+                 */
+                pAL->useCt--;
+            } else {
+                if (pzEq != NULL)
+                    *pzEq = '=';
+
+                /*
+                 *  IF we have dropped an entry
+                 *  THEN we have to move the current one.
+                 */
+                if (dIdx != i)
+                    pAL->apzArgs[ dIdx ] = pzSrc;
+                dIdx++;
+            }
+        }
+    }
+#endif /* WITH_LIBREGEX */
     /*
      *  IF we have unstacked everything,
      *  THEN indicate that we don't have any of these options
index 135e23563f6c4d4aa9fddb087dd3371b97cb2438..28b255a36b76c99950e95ce05159d327f35e482f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: streqvcmp.c,v 4.7 2006/03/25 19:24:56 bkorb Exp $
+ *  $Id: streqvcmp.c,v 4.9 2006/03/25 19:23:28 bkorb Exp $
  * Time-stamp:      "2005-10-29 14:05:07 bkorb"
  *
  *  String Equivalence Comparison
index 825cd900efff4a5fde05e85215173d353a1279b1..a8d06b3a637ad96891571af1968ba7b0571f9908 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * $Id: text_mmap.c,v 4.11 2006/02/01 17:18:00 bkorb Exp $
+ * $Id: text_mmap.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
  *
- * Time-stamp:      "2006-02-01 08:45:37 bkorb"
+ * Time-stamp:      "2006-06-24 10:54:43 bkorb"
  */
 
 #ifndef MAP_ANONYMOUS 
@@ -19,7 +19,7 @@
 #define AO_INVALID_FD  -1
 
 #define FILE_WRITABLE(_prt,_flg) \
-       ((_prt & PROT_WRITE) && (_flg & (MAP_SHARED|MAP_PRIVATE) == MAP_SHARED))
+       ((_prt & PROT_WRITE) && ((_flg & (MAP_SHARED|MAP_PRIVATE)) == MAP_SHARED))
 #define MAP_FAILED_PTR ((void*)MAP_FAILED)
 
 /*=export_func  text_mmap
index 074473ccaac7192da17d080c0a5321cdf5c82796..09b80f5854ed27c569e7701618adf9921ff05a34 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  This file defines the string_tokenize interface
- * Time-stamp:      "2005-04-25 18:47:21 bkorb"
+ * Time-stamp:      "2006-06-24 15:27:49 bkorb"
  *
  *  string_tokenize copyright 2005 Bruce Korb
  *
@@ -240,7 +240,7 @@ ao_string_tokenize( const char* str )
 
                 switch (ch) {
                 case '"':
-                    copy_cooked( &pzDest, (cc_t**)&str );
+                    copy_cooked( &pzDest, (cc_t**)(void*)&str );
                     if (str == NULL) {
                         free(res);
                         errno = EINVAL;
@@ -251,7 +251,7 @@ ao_string_tokenize( const char* str )
                     break;
 
                 case '\'':
-                    copy_raw( &pzDest, (cc_t**)&str );
+                    copy_raw( &pzDest, (cc_t**)(void*)&str );
                     if (str == NULL) {
                         free(res);
                         errno = EINVAL;
index 5d36ab91f6c245c95c639ac925c0e18f3956bef3..8d06b31bc9d8e0370d9bdf28a4e3bdac9b1c2b08 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  usage.c  $Id: usage.c,v 4.11 2006/03/25 19:24:57 bkorb Exp $
- * Time-stamp:      "2006-02-04 13:35:26 bkorb"
+ *  usage.c  $Id: usage.c,v 4.13 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-07-01 12:41:02 bkorb"
  *
  *  This module implements the default usage procedure for
  *  Automated Options.  It may be overridden, of course.
@@ -76,10 +76,10 @@ printExtendedUsage(
 
 static void
 printInitList(
-    tCC**    papz,
-    ag_bool* pInitIntro,
-    tCC*     pzRc,
-    tCC*     pzPN );
+    tCC* const* papz,
+    ag_bool*    pInitIntro,
+    tCC*        pzRc,
+    tCC*        pzPN );
 
 static void
 printOneUsage(
@@ -395,10 +395,10 @@ printExtendedUsage(
  */
 static void
 printInitList(
-    tCC**    papz,
-    ag_bool* pInitIntro,
-    tCC*     pzRc,
-    tCC*     pzPN )
+    tCC* const* papz,
+    ag_bool*    pInitIntro,
+    tCC*        pzRc,
+    tCC*        pzPN )
 {
     char zPath[ MAXPATHLEN+1 ];
 
@@ -431,7 +431,7 @@ printInitList(
              */
             if (  (stat( pzPath, &sb ) == 0)
               &&  S_ISDIR( sb.st_mode ) ) {
-                fputc( '/', option_usage_fp );
+                fputc( DIRCH, option_usage_fp );
                 fputs( pzRc, option_usage_fp );
             }
         }
index ede91732db90586168f9bb43bbcfa1170dd4b4bf..290ee0fe0fc2d3a9b41787c4a5990835a9ffc7e9 100644 (file)
@@ -1,5 +1,5 @@
 
-/*  $Id: version.c,v 4.7 2006/03/25 19:24:57 bkorb Exp $
+/*  $Id: version.c,v 4.8 2006/03/25 19:23:28 bkorb Exp $
  * Time-stamp:      "2005-12-13 10:29:09 bkorb"
  *
  *  This module implements the default usage procedure for
index ca0f8a676d7f5c93306e6208b22306c13300a45e..610842644104a0940944fc21df643f1fd04af6bd 100644 (file)
@@ -3,18 +3,18 @@ MAINTAINERCLEANFILES  = Makefile.in
 lib_LTLIBRARIES       = libopts.la
 libopts_la_SOURCES    = libopts.c
 libopts_la_CPPFLAGS   = -I$(top_srcdir)
-libopts_la_LDFLAGS    = -version-info  27:1:2
+libopts_la_LDFLAGS    = -version-info  27:3:2
 EXTRA_DIST            = \
     COPYING.lgpl         COPYING.mbsd         MakeDefs.inc  \
     README               autoopts/options.h   autoopts/usage-txt.h  \
     autoopts.c           autoopts.h           boolean.c  \
     compat/compat.h      compat/pathfind.c    compat/snprintf.c  \
-    compat/strdup.c      configfile.c         cook.c  \
-    enumeration.c        environment.c        genshell.c  \
-    genshell.h           load.c               m4/libopts.m4  \
-    m4/liboptschk.m4     makeshell.c          nested.c  \
-    numeric.c            pgusage.c            proto.h  \
-    putshell.c           restore.c            save.c  \
-    sort.c               stack.c              streqvcmp.c  \
-    text_mmap.c          tokenize.c           usage.c  \
-    version.c
+    compat/strdup.c      compat/strchr.c      configfile.c  \
+    cook.c               enumeration.c        environment.c  \
+    genshell.c           genshell.h           load.c  \
+    m4/libopts.m4        m4/liboptschk.m4     makeshell.c  \
+    nested.c             numeric.c            pgusage.c  \
+    proto.h              putshell.c           restore.c  \
+    save.c               sort.c               stack.c  \
+    streqvcmp.c          text_mmap.c          tokenize.c  \
+    usage.c              version.c
index 6d88967e4831f9e023a7a91cb30c0780d368d5da..806d71b9d2835d4248b5469a5675bd25e6dd58a0 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: autoopts.c,v 4.14 2006/03/25 19:24:56 bkorb Exp $
- *  Time-stamp:      "2005-10-29 13:19:36 bkorb"
+ *  $Id: autoopts.c,v 4.20 2006/06/24 23:34:51 bkorb Exp $
+ *  Time-stamp:      "2006-07-01 14:41:46 bkorb"
  *
  *  This file contains all of the routines that must be linked into
  *  an executable to use the generated option processing.  The optional
 # endif
 #endif
 
+#ifndef HAVE_STRCHR
+#  include "compat/strchr.c"
+#endif
+
 static const char zNil[] = "";
 
 #define SKIP_RC_FILES(po) \
@@ -350,7 +354,7 @@ longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState )
  *  Find the short option descriptor for the current option
  */
 LOCAL tSuccess
-shortOptionFind( tOptions* pOpts, tAoUC optValue, tOptState* pOptState )
+shortOptionFind( tOptions* pOpts, uint_t optValue, tOptState* pOptState )
 {
     tOptDesc*  pRes = pOpts->pOptDesc;
     int        ct   = pOpts->optCt;
@@ -423,7 +427,7 @@ findOptDesc( tOptions* pOpts, tOptState* pOptState )
      *  OTHERWISE see if there is room to advance and then do so.
      */
     if ((pOpts->pzCurOpt != NULL) && (*pOpts->pzCurOpt != NUL))
-        return shortOptionFind( pOpts, *pOpts->pzCurOpt, pOptState );
+        return shortOptionFind( pOpts, (tAoUC)*(pOpts->pzCurOpt), pOptState );
 
     if (pOpts->curOptIdx >= pOpts->origArgCt)
         return PROBLEM; /* NORMAL COMPLETION */
@@ -493,7 +497,7 @@ findOptDesc( tOptions* pOpts, tOptState* pOptState )
      *  short (i.e. single character) option.
      */
     if ((pOpts->fOptSet & OPTPROC_SHORTOPT) != 0)
-        return shortOptionFind( pOpts, *pOpts->pzCurOpt, pOptState );
+        return shortOptionFind( pOpts, (tAoUC)*(pOpts->pzCurOpt), pOptState );
 
     return longOptionFind( pOpts, pOpts->pzCurOpt, pOptState );
 }
index af01f07cad32b55d9023fcd3e71c671fc64553e2..675da5373c80afe06f60f2364dc6cb17374bfa73 100644 (file)
@@ -1,8 +1,8 @@
 
 /*
- *  Time-stamp:      "2005-10-29 15:06:44 bkorb"
+ *  Time-stamp:      "2006-07-01 14:40:47 bkorb"
  *
- *  autoopts.h  $Id: autoopts.h,v 4.17 2006/03/25 19:24:56 bkorb Exp $
+ *  autoopts.h  $Id: autoopts.h,v 4.22 2006/06/24 23:34:51 bkorb Exp $
  *  Time-stamp:      "2005-02-14 05:59:50 bkorb"
  *
  *  This file defines all the global structures and special values
 #undef  EXPORT
 #define EXPORT
 
+#if defined(_WIN32)
+# define DIRch '\\'
+#else
+# define DIRCH '/'
+#endif
+
 /*
  *  Convert the number to a list usable in a printf call
  */
@@ -178,8 +184,8 @@ typedef struct {
     tCC*    pzOptFmt;
 } arg_types_t;
 
-#  define AGALOC( c, w )        malloc( c )
-#  define AGREALOC( p, c, w )   realloc( p, c )
+#  define AGALOC( c, w )        malloc( (unsigned)c )
+#  define AGREALOC( p, c, w )   realloc( p, (unsigned)c )
 #  define AGFREE( p )           free( p )
 #  define AGDUPSTR( p, s, w )   p = strdup( s )
 #  define TAGMEM( m, t )
@@ -292,6 +298,11 @@ typedef struct {
 # endif
 #endif
 
+#ifndef HAVE_STRCHR
+extern char* strchr( const char *s, int c);
+extern char* strrchr( const char *s, int c);
+#endif
+
 /*
  *  Define and initialize all the user visible strings.
  *  We do not do translations.  If translations are to be done, then
@@ -307,9 +318,6 @@ extern FILE* option_usage_fp;
 
 extern tOptProc optionPrintVersion, optionPagedUsage, optionLoadOpt;
 
-#define LOCAL static
-#include "proto.h"
-
 #endif /* AUTOGEN_AUTOOPTS_H */
 /*
  * Local Variables:
index 30ccd0d5e2a5b124af5227aa36c75076e6082275..d09833003472e82eb61fdf865e6a2cb4f35a6dda 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: boolean.c,v 4.5 2006/03/25 19:24:56 bkorb Exp $
+ *  $Id: boolean.c,v 4.6 2006/03/25 19:23:28 bkorb Exp $
  * Time-stamp:      "2005-02-14 08:24:12 bkorb"
  *
  *   Automated Options Paged Usage module.
index 5c9e923016d498e3fa94949bf555f646be4caff3..b23790b46b67c0ac16df78b6a4964415e698aa25 100644 (file)
@@ -2,12 +2,12 @@
 
 /* --- fake the preprocessor into handlng portability */
 /*
- *  Time-stamp:      "2005-09-21 20:56:13 bkorb"
+ *  Time-stamp:      "2006-06-24 10:57:22 bkorb"
  *
  * Author:           Gary V Vaughan <gvaughan@oranda.demon.co.uk>
  * Created:          Mon Jun 30 15:54:46 1997
  *
- * $Id: compat.h,v 4.6 2005/10/02 16:34:30 bkorb Exp $
+ * $Id: compat.h,v 4.8 2006/06/24 23:34:51 bkorb Exp $
  */
 #ifndef COMPAT_H
 #define COMPAT_H 1
 #ifndef HAVE_UINT16_T
   typedef unsigned short    uint16_t;
 #endif
+#ifndef HAVE_UINT_T
+  typedef unsigned int      uint_t;
+#endif
 
 #ifndef HAVE_INT32_T
 # if SIZEOF_INT == 4
index 4da759f3ba21b5a5a65471afdd1f2820c73257b0..d827cf7d75c9eaefe9cf08e177ecb8dfb4ea2327 100644 (file)
@@ -5,10 +5,10 @@
 /*
  * Author:           Gary V Vaughan <gvaughan@oranda.demon.co.uk>
  * Created:          Tue Jun 24 15:07:31 1997
- * Last Modified:    $Date: 2005/07/27 17:26:32 $
+ * Last Modified:    $Date: 2005/09/04 21:13:39 $
  *            by: bkorb
  *
- * $Id: pathfind.c,v 4.4 2005/07/27 17:26:32 bkorb Exp $
+ * $Id: pathfind.c,v 4.4 2005/09/04 21:13:39 bkorb Exp $
  */
 
 /* Code: */
diff --git a/sntp/libopts/compat/strchr.c b/sntp/libopts/compat/strchr.c
new file mode 100644 (file)
index 0000000..fd6507f
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+   SYNOPSIS
+       #include <string.h>
+
+       char *strchr(const char *s, int c);
+
+       char *strrchr(const char *s, int c);
+
+   DESCRIPTION
+       The  strchr() function returns a pointer to the first occurrence of the
+       character c in the string s.
+
+       The strrchr() function returns a pointer to the last occurrence of  the
+       character c in the string s.
+
+       Here  "character"  means "byte" - these functions do not work with wide
+       or multi-byte characters.
+
+   RETURN VALUE
+       The strchr() and strrchr() functions return a pointer  to  the  matched
+       character or NULL if the character is not found.
+
+   CONFORMING TO
+       SVID 3, POSIX, BSD 4.3, ISO 9899
+*/
+
+char*
+strchr( const char *s, int c)
+{
+    do {
+        if ((unsigned)*s == (unsigned)c)
+            return s;
+
+    } while (*(++s) != NUL);
+
+    return NULL;
+}
+
+char*
+strrchr( const char *s, int c)
+{
+    const char *e = s + strlen(s);
+
+    for (;;) {
+        if (--e < s)
+            break;
+
+        if ((unsigned)*e == (unsigned)c)
+            return e;
+    }
+    return NULL;
+}
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ * end of compat/strsignal.c */
index 4a2155a48c38d1c006f27778b244ca05a31dfc28..be228bc357614a4caa0bb320e8b998d2cc2428d8 100644 (file)
@@ -1,6 +1,6 @@
 /*
- *  $Id: configfile.c,v 4.12 2006/03/25 19:24:56 bkorb Exp $
- *  Time-stamp:      "2005-10-16 15:16:32 bkorb"
+ *  $Id: configfile.c,v 4.22 2006/06/24 23:34:51 bkorb Exp $
+ *  Time-stamp:      "2006-07-01 12:46:31 bkorb"
  *
  *  configuration/rc/ini file handling.
  */
@@ -640,7 +640,7 @@ handleDirective(
 
         if (isspace(*pzText)) {
             while (isspace(*pzText))  pzText++;
-            if (  (strneqvcmp( pzText, pOpts->pzProgName, name_len ) == 0)
+            if (  (strneqvcmp( pzText, pOpts->pzProgName, (int)name_len) == 0)
                && (pzText[name_len] == '>'))  {
                 pzText += name_len + 1;
                 break;
@@ -847,8 +847,8 @@ internalFileLoad( tOptions* pOpts )
                 continue;
 
             pz = zFileName + len;
-            if (pz[-1] != '/')
-                *(pz++) = '/';
+            if (pz[-1] != DIRCH)
+                *(pz++) = DIRCH;
             strcpy( pz, pOpts->pzRcName );
         }
 
@@ -1249,7 +1249,7 @@ validateOptionsStruct( tOptions* pOpts, const char* pzProgram )
      *  and the set of equivalent characters.
      */
     if (pOpts->pzProgName == NULL) {
-        const char* pz = strrchr( pzProgram, '/' );
+        const char* pz = strrchr( pzProgram, DIRCH );
 
         if (pz == NULL)
              pOpts->pzProgName = pzProgram;
index 763f697da343ee96ddafafe16cd1e6746da478e8..aecd4ec483d1d5b1f2048517ebaa442eb883eb30 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: cook.c,v 4.3 2006/03/25 19:24:56 bkorb Exp $
- *  Time-stamp:      "2005-05-20 13:58:56 bkorb"
+ *  $Id: cook.c,v 4.6 2006/06/24 23:34:51 bkorb Exp $
+ *  Time-stamp:      "2006-06-24 11:29:58 bkorb"
  *
  *  This file contains the routines that deal with processing quoted strings
  *  into an internal format.
@@ -60,7 +60,7 @@
  * what:  escape-process a string fragment
  * arg:   + const char* + pzScan  + points to character after the escape +
  * arg:   + char*       + pRes    + Where to put the result byte +
- * arg:   + char        + nl_ch   + replacement char if scanned char is \n +
+ * arg:   + u_int       + nl_ch   + replacement char if scanned char is \n +
  *
  * ret-type: unsigned int
  * ret-desc: The number of bytes consumed processing the escaped character.
@@ -81,7 +81,7 @@
  * err:  @code{NULL} is returned if the string(s) is/are mal-formed.
 =*/
 unsigned int
-ao_string_cook_escape_char( const char* pzIn, char* pRes, char nl )
+ao_string_cook_escape_char( const char* pzIn, char* pRes, u_int nl )
 {
     unsigned int  res = 1;
 
@@ -94,7 +94,7 @@ ao_string_cook_escape_char( const char* pzIn, char* pRes, char nl )
         res++;
         /* FALLTHROUGH */
     case '\n':        /* NL  - emit newline        */
-        *pRes = nl;
+        *pRes = (char)nl;
         return res;
 
     case 'a': *pRes = '\a'; break;
@@ -325,7 +325,7 @@ ao_string_cook( char* pzScan, int* pLineCt )
              *  THEN we do the full escape character processing
              */
             else if (q != '\'') {
-                int ct = ao_string_cook_escape_char( pzS, pzD-1, '\n' );
+                int ct = ao_string_cook_escape_char( pzS, pzD-1, (u_int)'\n' );
                 if (ct == 0)
                     return NULL;
 
index 86f7cc0e056fe53ff6b7af9b427acc6b3530f6ff..0dbe5661414c7e929aa259cc5f78edfa3565d609 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: enumeration.c,v 4.9 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-12-09 06:37:15 bkorb"
+ *  $Id: enumeration.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-06-24 10:46:02 bkorb"
  *
  *   Automated Options Paged Usage module.
  *
@@ -193,7 +193,7 @@ findName(
             if (res != name_ct) {
                 pz_enum_err_fmt = zAmbigKey;
                 option_usage_fp = stderr;
-                enumError( pOpts, pOD, paz_names, name_ct );
+                enumError( pOpts, pOD, paz_names, (int)name_ct );
             }
             res = idx; /* save partial match */
         }
@@ -205,7 +205,7 @@ findName(
     if (res == name_ct) {
         pz_enum_err_fmt = zNoKey;
         option_usage_fp = stderr;
-        enumError( pOpts, pOD, paz_names, name_ct );
+        enumError( pOpts, pOD, paz_names, (int)name_ct );
     }
 
     /*
@@ -275,7 +275,7 @@ optionEnumerationVal(
         /*
          *  print the list of enumeration names.
          */
-        enumError( pOpts, pOD, paz_names, name_ct );
+        enumError( pOpts, pOD, paz_names, (int)name_ct );
         return (char*)0UL;
 
     case 1UL:
@@ -341,7 +341,7 @@ optionSetMembers(
         /*
          *  print the list of enumeration names.
          */
-        enumError( pOpts, pOD, paz_names, name_ct );
+        enumError( pOpts, pOD, paz_names, (int)name_ct );
         return;
 
     case 1UL:
@@ -433,7 +433,7 @@ optionSetMembers(
             if ((len == 3) && (strncmp( pzArg, zAll, 3 ) == 0)) {
                 if (iv)
                      res = 0;
-                else res = ~0;
+                else res = ~0UL;
             }
             else if ((len == 4) && (strncmp( pzArg, zNone, 4 ) == 0)) {
                 if (! iv)
@@ -449,7 +449,7 @@ optionSetMembers(
                     if (*pz != NUL) {
                         if (len >= AO_NAME_LIMIT)
                             break;
-                        strncpy( z, pzArg, len );
+                        strncpy( z, pzArg, (unsigned)len );
                         z[len] = NUL;
                         p = z;
                     } else {
index 285b229a95da4cef7960dc55daca5fdf2c2a19f1..caaa712bac907f7167c805d222a4d62965f80beb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: environment.c,v 4.8 2006/03/25 19:24:56 bkorb Exp $
+ *  $Id: environment.c,v 4.10 2006/03/25 19:23:28 bkorb Exp $
  * Time-stamp:      "2005-10-29 13:23:59 bkorb"
  *
  *  This file contains all of the routines that must be linked into
index 960a492fbbc2e3177c2393ecd6fcc372374bb5f6..7222a8c1349339616cc38dbaa7a239de96eb26aa 100644 (file)
@@ -1,6 +1,7 @@
 #define AUTOOPTS_INTERNAL
 #include "compat/compat.h"
 #define HAVE_LIBSNPRINTFV
+#define LOCAL static
 #include "autoopts/options.h"
 #include "autoopts/usage-txt.h"
 #include "genshell.h"
index e5a2b8ff2ab1355ec944f2fd89a7af11f9378c8c..19b446457a4710a93a369ea026347b063882df19 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: load.c,v 4.18 2006/03/25 19:24:56 bkorb Exp $
- *  Time-stamp:      "2005-10-29 14:45:36 bkorb"
+ *  $Id: load.c,v 4.22 2006/06/24 23:34:51 bkorb Exp $
+ *  Time-stamp:      "2006-07-01 12:43:03 bkorb"
  *
  *  This file contains the routines that deal with processing text strings
  *  for options, either from a NUL-terminated string passed in or from an
@@ -102,7 +102,7 @@ assembleArgValue( char* pzTxt, tOptionLoadMode mode );
  *
  *  Please note: both @code{$$} and @code{$NAME} must be at the start of the
  *     @code{pzName} string and must either be the entire string or be followed
- *     by the @code{'/'} character.
+ *     by the @code{'/'} (backslash on windows) character.
  *
  * err:  @code{AG_FALSE} is returned if:
  *       @*
@@ -195,7 +195,7 @@ insertProgramPath(
     int     skip = 2;
 
     switch (pzName[2]) {
-    case '/':
+    case DIRCH:
         skip = 3;
     case NUL:
         break;
@@ -208,7 +208,7 @@ insertProgramPath(
      *  If it is, we're done.  Otherwise, we have to hunt
      *  for the program using "pathfind".
      */
-    if (strchr( pzProgPath, '/' ) != NULL)
+    if (strchr( pzProgPath, DIRCH ) != NULL)
         pzPath = pzProgPath;
     else {
         pzPath = pathfind( getenv( "PATH" ), (char*)pzProgPath, "rx" );
@@ -217,7 +217,7 @@ insertProgramPath(
             return AG_FALSE;
     }
 
-    pz = strrchr( pzPath, '/' );
+    pz = strrchr( pzPath, DIRCH );
 
     /*
      *  IF we cannot find a directory name separator,
@@ -235,7 +235,7 @@ insertProgramPath(
     if ((pz - pzPath)+1 + strlen(pzName) >= bufSize)
         return AG_FALSE;
 
-    memcpy( pzBuf, pzPath, (pz - pzPath)+1 );
+    memcpy( pzBuf, pzPath, (unsigned)((pz - pzPath)+1) );
     strcpy( pzBuf + (pz - pzPath) + 1, pzName );
 
     /*
index 085c776441f1649cae4a599ce0bde8ebbf0dee44..3e9c2432a574eaacffd22ffec176ab6484656112 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  Sunday April  9, 2006 at 11:49:18 AM PDT
+dnl It has been AutoGen-ed  Saturday July  1, 2006 at 02:52:02 PM PDT
 dnl From the definitions    libopts.def
 dnl and the template file   conftest.tpl
 dnl
@@ -84,7 +84,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
   # ----------------------------------------------------------------------
   AC_CHECK_LIB(gen, pathfind)
   AC_FUNC_VPRINTF
-  AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup])
+  AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr strrchr])
 [  INVOKE_LIBOPTS_MACROS_FIRST_done=yes
 fi]])
 
@@ -200,20 +200,13 @@ int main() {
   ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex
   AC_MSG_RESULT([${libopts_cv_with_libregex}])
 
-  if test "X${libopts_cv_with_libregex}" = Xno
+  if test "X${libopts_cv_with_libregex}" != Xno
   then
+    AC_DEFINE([WITH_LIBREGEX],[1],
+        [Define this if a working libregex can be found])
+  else
     CPPFLAGS="${libopts_save_CPPFLAGS}"
     LIBS="${libopts_save_LIBS}"
-               cat >&2 <<'_EOF_'
-I cannot detect POSIX compliant regcomp/regexec routines.
-These are required for AutoGen to work correctly.  If you have
-such a library present on your system, you must specify it by
-setting the LIBS environment variable, e.g., "LIBS='-lregex'".
-If you do not have such a library on your system, then you should
-download and install, for example, the one from:
-    ftp://ftp.gnu.org/gnu/rx/
-_EOF_
-AC_MSG_ERROR([Cannot find working POSIX regex library])
   fi
   
 ]) # end of AC_DEFUN of LIBOPTS_WITHLIB_REGEX
index 32bcaa3e9be838c76f5836ffdae7f4b2a276bded..40ccedefec2bde18f4deb9e639464d3b700345d2 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: makeshell.c,v 4.8 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-10-29 13:23:33 bkorb"
+ *  $Id: makeshell.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-06-24 10:47:07 bkorb"
  *
  *  This module will interpret the options set in the tOptions
  *  structure and create a Bourne shell script capable of parsing them.
@@ -930,8 +930,8 @@ openOutput( const char* pzFile )
     struct stat stbf;
 
     do  {
-        char*  pzScan;
-        int    sizeLeft;
+        char*    pzScan;
+        uint32_t sizeLeft;
 
         /*
          *  IF we cannot stat the file,
@@ -949,10 +949,10 @@ openOutput( const char* pzFile )
             exit( EXIT_FAILURE );
         }
 
-        pzData = (char*)malloc( stbf.st_size + 1 );
+        pzData = (char*)malloc( (unsigned)(stbf.st_size + 1) );
         fp = fopen( pzFile, "r" FOPEN_BINARY_FLAG );
 
-        sizeLeft = stbf.st_size;
+        sizeLeft = (unsigned)stbf.st_size;
         pzScan   = pzData;
 
         /*
@@ -1045,8 +1045,8 @@ genshelloptUsage( tOptions*  pOpts, int exitCode )
 
     default:
     {
-        int  stat;
-        wait( &stat );
+        int  sts;
+        wait( &sts );
     }
     }
 
@@ -1082,8 +1082,8 @@ genshelloptUsage( tOptions*  pOpts, int exitCode )
 
     default:
     {
-        int  stat;
-        wait( &stat );
+        int  sts;
+        wait( &sts );
     }
     }
 
index ef32f2845c249a4becbcd546fb47aa4f5cc44f27..00b88691afb4c87cdca25334427af11723b84d86 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: nested.c,v 4.4 2006/03/25 19:24:56 bkorb Exp $
+ *  $Id: nested.c,v 4.9 2006/03/25 19:23:28 bkorb Exp $
  *  Time-stamp:      "2005-07-27 10:10:28 bkorb"
  *
  *   Automated Options Nested Values module.
index 54be7c10a5ebf7eebd086e21324ea77b99d7a0b2..26790df3c78b167b47b64cc6ac2ff662d271f9ff 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: numeric.c,v 4.6 2006/03/25 19:24:56 bkorb Exp $
+ *  $Id: numeric.c,v 4.7 2006/03/25 19:23:28 bkorb Exp $
  *  Time-stamp:      "2005-02-14 08:22:56 bkorb"
  */
 
index 9842a72313f0e42222da1ad1a61770280bfcef0e..353e0f27752937c93aab0b612268226edc0a719b 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: pgusage.c,v 4.7 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-10-29 13:23:12 bkorb"
+ *  $Id: pgusage.c,v 4.9 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-06-24 10:48:00 bkorb"
  *
  *   Automated Options Paged Usage module.
  *
@@ -114,7 +114,7 @@ optionPagedUsage( tOptions* pOptions, tOptDesc* pOD )
     case PAGER_STATE_READY:
     {
         tSCC zPage[]  = "%1$s /tmp/use.%2$lu ; rm -f /tmp/use.%2$lu";
-        char* pzPager = getenv( "PAGER" );
+        tCC* pzPager  = (tCC*)getenv( "PAGER" );
 
         /*
          *  Use the "more(1)" program if "PAGER" has not been defined
index f15050179a1f311a5210ed78ed15e59f94c83d97..2779c5c671651fac388e7b051faf853a0028ae4a 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- buffer-read-only: t -*- vi: set ro:
  *
  * Prototypes for autoopts
- * Generated Sun Apr  9 11:50:00 PDT 2006
+ * Generated Sat Jul  1 14:52:42 PDT 2006
  */
 #ifndef AUTOOPTS_PROTO_H_GUARD
 #define AUTOOPTS_PROTO_H_GUARD 1
@@ -21,7 +21,7 @@ LOCAL tSuccess
 longOptionFind( tOptions* pOpts, char* pzOptName, tOptState* pOptState );
 
 LOCAL tSuccess
-shortOptionFind( tOptions* pOpts, tAoUC optValue, tOptState* pOptState );
+shortOptionFind( tOptions* pOpts, uint_t optValue, tOptState* pOptState );
 
 LOCAL tSuccess
 doImmediateOpts( tOptions* pOpts );
index feed57b3ae526732c34ab55c33334de7bacc3d35..a97574bb7bb4c099ae205bfbb786d17a839e1a5d 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: putshell.c,v 4.9 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-12-13 10:28:47 bkorb"
+ *  $Id: putshell.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-06-24 14:29:07 bkorb"
  *
  *  This module will interpret the options set in the tOptions
  *  structure and print them to standard out in a fashion that
@@ -95,7 +95,7 @@ putQuotedStr( tCC* pzStr )
         /*
          *  Emit the string up to the single quote (apostrophe) we just found.
          */
-        fwrite( pzStr, (pz - pzStr), 1, stdout );
+        fwrite( pzStr, (unsigned)(pz - pzStr), 1, stdout );
         fputc( '\'', stdout );
         pzStr = pz;
 
@@ -200,7 +200,7 @@ optionPutShell( tOptions* pOpts )
                     else if (ch == NUL)      { pz--; goto name_done; }
                     else fputc( '_', stdout );
                 } name_done:;
-                printf( "=%1$ld # 0x%1$lX\n", val );
+                printf( "=%1$lu # 0x%1$lX\n", (unsigned long)val );
                 val <<= 1;
             }
             free( (void*)(pOD->pzLastArg) );
@@ -230,13 +230,13 @@ optionPutShell( tOptions* pOpts )
             printf( zOptCookieCt, pOpts->pzPROGNAME, pOD->pz_NAME, ct );
 
             while (--ct >= 0) {
-                tSCC zOptNumArg[] = "%s_%s_%d=";
-                tSCC zOptEnd[]    = "\nexport %s_%s_%d\n";
+                tSCC numarg_z[] = "%s_%s_%d=";
+                tSCC end_z[]    = "\nexport %s_%s_%d\n";
 
-                printf( zOptNumArg, pOpts->pzPROGNAME, pOD->pz_NAME,
+                printf( numarg_z, pOpts->pzPROGNAME, pOD->pz_NAME,
                         pAL->useCt - ct );
                 putQuotedStr( *(ppz++) );
-                printf( zOptEnd, pOpts->pzPROGNAME, pOD->pz_NAME,
+                printf( end_z, pOpts->pzPROGNAME, pOD->pz_NAME,
                         pAL->useCt - ct );
             }
         }
index 959e0f9d62d0655fd202c92dad424a13cd8d6330..ce788b3303c62cf41d5fef44a5280831b3f73aa6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  restore.c  $Id: restore.c,v 4.6 2006/03/25 19:24:56 bkorb Exp $
+ *  restore.c  $Id: restore.c,v 4.7 2006/03/25 19:23:28 bkorb Exp $
  * Time-stamp:      "2005-02-23 15:10:20 bkorb"
  *
  *  This module's routines will save the current option state to memory
index 51fa212f7fdd6dcf6c1979b74503794eba37e7e9..938a4fd1240b3b8483d4693a92385b51e556e767 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  save.c  $Id: save.c,v 4.12 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-02-20 13:49:46 bkorb"
+ *  save.c  $Id: save.c,v 4.14 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-07-01 12:41:27 bkorb"
  *
  *  This module's routines will take the currently set options and
  *  store them into an ".rc" file for re-interpretation the next
@@ -100,7 +100,7 @@ findDirName( tOptions* pOpts, int* p_free )
         return pzDir;
 
     {
-        tCC*  pzEndDir = strchr( ++pzDir, '/' );
+        tCC*  pzEndDir = strchr( ++pzDir, DIRCH );
         char* pzFileName;
         char* pzEnv;
 
@@ -108,7 +108,7 @@ findDirName( tOptions* pOpts, int* p_free )
             char z[ AO_NAME_SIZE ];
             if ((pzEndDir - pzDir) > AO_NAME_LIMIT )
                 return NULL;
-            strncpy( z, pzDir, (pzEndDir - pzDir) );
+            strncpy( z, pzDir, (unsigned)(pzEndDir - pzDir) );
             z[ (pzEndDir - pzDir) ] = NUL;
             pzEnv = getenv( z );
         } else {
@@ -176,13 +176,13 @@ findFileName( tOptions* pOpts, int* p_free_name )
              *  Strip off the last component, stat the remaining string and
              *  that string must name a directory
              */
-            char* pzDirCh = strrchr( pzDir, '/' );
+            char* pzDirCh = strrchr( pzDir, DIRCH );
             if (pzDirCh == NULL) {
                 stBuf.st_mode = S_IFREG;
                 continue;  /* bail out of error condition */
             }
 
-            strncpy( z, pzDir, pzDirCh - pzDir );
+            strncpy( z, pzDir, (unsigned)(pzDirCh - pzDir));
             z[ pzDirCh - pzDir ] = NUL;
 
             if (  (stat( z, &stBuf ) == 0)
@@ -308,7 +308,7 @@ printEntry(
             /*
              *  Print the continuation and the text from the current line
              */
-            fwrite( pzLA, pzNl - pzLA, 1, fp );
+            fwrite( pzLA, (unsigned)(pzNl - pzLA), 1, fp );
             pzLA = pzNl+1; /* advance the Last Arg pointer */
             fputs( "\\\n", fp );
         }
index e7f29ed1882205b9d698cf5b50f2abf2ef4eff16..de0bd5634d1bfa997d7f71a81f343d0cacca5de8 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  sort.c  $Id: sort.c,v 4.7 2006/03/25 19:24:56 bkorb Exp $
- * Time-stamp:      "2005-02-20 17:18:41 bkorb"
+ *  sort.c  $Id: sort.c,v 4.10 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-06-24 10:53:35 bkorb"
  *
  *  This module implements argument sorting.
  */
@@ -155,7 +155,7 @@ checkShortOpts( tOptions* pOpts, char* pzArg, tOptState* pOS,
                 char** ppzOpts, int* pOptsIdx )
 {
     while (*pzArg != NUL) {
-        if (FAILED( shortOptionFind( pOpts, *pzArg, pOS )))
+        if (FAILED( shortOptionFind( pOpts, (tAoUC)*pzArg, pOS )))
             return FAILURE;
 
         /*
@@ -295,7 +295,7 @@ optionSort( tOptions* pOpts )
             if ((pOpts->fOptSet & OPTPROC_SHORTOPT) == 0) {
                 res = longOptionFind( pOpts, pzArg+1, &os );
             } else {
-                res = shortOptionFind( pOpts, pzArg[1], &os );
+                res = shortOptionFind( pOpts, (tAoUC)pzArg[1], &os );
             }
             break;
         }
index bbea3342be16c07842e501b990ada1202bc44fd7..13137375ae87fe51a856efabd8b14f239988dfb5 100644 (file)
@@ -1,8 +1,8 @@
 
 /*
  *  stack.c
- *  $Id: stack.c,v 4.6 2006/03/25 19:24:56 bkorb Exp $
- *  Time-stamp:      "2005-02-20 16:33:20 bkorb"
+ *  $Id: stack.c,v 4.8 2006/03/25 19:23:28 bkorb Exp $
+ *  Time-stamp:      "2006-07-01 14:35:13 bkorb"
  *
  *  This is a special option processing routine that will save the
  *  argument to an option in a FIFO queue.
@@ -82,6 +82,7 @@ optionUnstackArg(
         return;
     }
 
+#ifdef WITH_LIBREGEX
     {
         regex_t   re;
         int       i, ct, dIdx;
@@ -130,7 +131,45 @@ optionUnstackArg(
 
         regfree( &re );
     }
+#else  /* not WITH_LIBREGEX */
+    {
+        int i, ct, dIdx;
 
+        /*
+         *  search the list for the entry(s) to remove.  Entries that
+         *  are removed are *not* copied into the result.  The source
+         *  index is incremented every time.  The destination only when
+         *  we are keeping a define.
+         */
+        for (i = 0, dIdx = 0, ct = pAL->useCt; --ct >= 0; i++) {
+            tCC*      pzSrc = pAL->apzArgs[ i ];
+            char*     pzEq  = strchr( pzSrc, '=' );
+
+            if (pzEq != NULL)
+                *pzEq = NUL;
+
+            if (strcmp( pzSrc, pOptDesc->pzLastArg ) == 0) {
+                /*
+                 *  Remove this entry by reducing the in-use count
+                 *  and *not* putting the string pointer back into
+                 *  the list.
+                 */
+                pAL->useCt--;
+            } else {
+                if (pzEq != NULL)
+                    *pzEq = '=';
+
+                /*
+                 *  IF we have dropped an entry
+                 *  THEN we have to move the current one.
+                 */
+                if (dIdx != i)
+                    pAL->apzArgs[ dIdx ] = pzSrc;
+                dIdx++;
+            }
+        }
+    }
+#endif /* WITH_LIBREGEX */
     /*
      *  IF we have unstacked everything,
      *  THEN indicate that we don't have any of these options
index 135e23563f6c4d4aa9fddb087dd3371b97cb2438..28b255a36b76c99950e95ce05159d327f35e482f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: streqvcmp.c,v 4.7 2006/03/25 19:24:56 bkorb Exp $
+ *  $Id: streqvcmp.c,v 4.9 2006/03/25 19:23:28 bkorb Exp $
  * Time-stamp:      "2005-10-29 14:05:07 bkorb"
  *
  *  String Equivalence Comparison
index 825cd900efff4a5fde05e85215173d353a1279b1..a8d06b3a637ad96891571af1968ba7b0571f9908 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * $Id: text_mmap.c,v 4.11 2006/02/01 17:18:00 bkorb Exp $
+ * $Id: text_mmap.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
  *
- * Time-stamp:      "2006-02-01 08:45:37 bkorb"
+ * Time-stamp:      "2006-06-24 10:54:43 bkorb"
  */
 
 #ifndef MAP_ANONYMOUS 
@@ -19,7 +19,7 @@
 #define AO_INVALID_FD  -1
 
 #define FILE_WRITABLE(_prt,_flg) \
-       ((_prt & PROT_WRITE) && (_flg & (MAP_SHARED|MAP_PRIVATE) == MAP_SHARED))
+       ((_prt & PROT_WRITE) && ((_flg & (MAP_SHARED|MAP_PRIVATE)) == MAP_SHARED))
 #define MAP_FAILED_PTR ((void*)MAP_FAILED)
 
 /*=export_func  text_mmap
index 074473ccaac7192da17d080c0a5321cdf5c82796..09b80f5854ed27c569e7701618adf9921ff05a34 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  This file defines the string_tokenize interface
- * Time-stamp:      "2005-04-25 18:47:21 bkorb"
+ * Time-stamp:      "2006-06-24 15:27:49 bkorb"
  *
  *  string_tokenize copyright 2005 Bruce Korb
  *
@@ -240,7 +240,7 @@ ao_string_tokenize( const char* str )
 
                 switch (ch) {
                 case '"':
-                    copy_cooked( &pzDest, (cc_t**)&str );
+                    copy_cooked( &pzDest, (cc_t**)(void*)&str );
                     if (str == NULL) {
                         free(res);
                         errno = EINVAL;
@@ -251,7 +251,7 @@ ao_string_tokenize( const char* str )
                     break;
 
                 case '\'':
-                    copy_raw( &pzDest, (cc_t**)&str );
+                    copy_raw( &pzDest, (cc_t**)(void*)&str );
                     if (str == NULL) {
                         free(res);
                         errno = EINVAL;
index 5d36ab91f6c245c95c639ac925c0e18f3956bef3..8d06b31bc9d8e0370d9bdf28a4e3bdac9b1c2b08 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  usage.c  $Id: usage.c,v 4.11 2006/03/25 19:24:57 bkorb Exp $
- * Time-stamp:      "2006-02-04 13:35:26 bkorb"
+ *  usage.c  $Id: usage.c,v 4.13 2006/06/24 23:34:51 bkorb Exp $
+ * Time-stamp:      "2006-07-01 12:41:02 bkorb"
  *
  *  This module implements the default usage procedure for
  *  Automated Options.  It may be overridden, of course.
@@ -76,10 +76,10 @@ printExtendedUsage(
 
 static void
 printInitList(
-    tCC**    papz,
-    ag_bool* pInitIntro,
-    tCC*     pzRc,
-    tCC*     pzPN );
+    tCC* const* papz,
+    ag_bool*    pInitIntro,
+    tCC*        pzRc,
+    tCC*        pzPN );
 
 static void
 printOneUsage(
@@ -395,10 +395,10 @@ printExtendedUsage(
  */
 static void
 printInitList(
-    tCC**    papz,
-    ag_bool* pInitIntro,
-    tCC*     pzRc,
-    tCC*     pzPN )
+    tCC* const* papz,
+    ag_bool*    pInitIntro,
+    tCC*        pzRc,
+    tCC*        pzPN )
 {
     char zPath[ MAXPATHLEN+1 ];
 
@@ -431,7 +431,7 @@ printInitList(
              */
             if (  (stat( pzPath, &sb ) == 0)
               &&  S_ISDIR( sb.st_mode ) ) {
-                fputc( '/', option_usage_fp );
+                fputc( DIRCH, option_usage_fp );
                 fputs( pzRc, option_usage_fp );
             }
         }
index ede91732db90586168f9bb43bbcfa1170dd4b4bf..290ee0fe0fc2d3a9b41787c4a5990835a9ffc7e9 100644 (file)
@@ -1,5 +1,5 @@
 
-/*  $Id: version.c,v 4.7 2006/03/25 19:24:57 bkorb Exp $
+/*  $Id: version.c,v 4.8 2006/03/25 19:23:28 bkorb Exp $
  * Time-stamp:      "2005-12-13 10:29:09 bkorb"
  *
  *  This module implements the default usage procedure for