]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
We need another RC release to be sure the new autogen/libopts works.
authorHarlan Stenn <stenn@ntp.org>
Sat, 19 May 2007 06:33:04 +0000 (02:33 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 19 May 2007 06:33:04 +0000 (02:33 -0400)
bk: 464e9a20fSUDt7IgsgOclqKP6efmIQ

68 files changed:
clockstuff/clktest-opts.c
clockstuff/clktest-opts.def
clockstuff/clktest-opts.h
include/autogen-version.def
libopts/Makefile.am
libopts/README
libopts/autoopts.c
libopts/autoopts.h
libopts/autoopts/options.h
libopts/autoopts/usage-txt.h
libopts/compat/compat.h
libopts/compat/windows-config.h
libopts/configfile.c
libopts/environment.c
libopts/genshell.c
libopts/genshell.h
libopts/m4/libopts.m4
libopts/pgusage.c
libopts/proto.h
libopts/save.c
libopts/sort.c
libopts/streqvcmp.c
libopts/usage.c
libopts/version.c
ntpd/ntpd-opts.c
ntpd/ntpd-opts.h
ntpd/ntpd-opts.texi
ntpd/ntpd.1
ntpd/ntpdsim-opts.c
ntpd/ntpdsim-opts.h
ntpd/ntpdsim-opts.texi
ntpd/ntpdsim.1
ntpdc/ntpdc-opts.c
ntpdc/ntpdc-opts.h
ntpdc/ntpdc-opts.texi
ntpdc/ntpdc.1
ntpq/ntpq-opts.c
ntpq/ntpq-opts.h
ntpq/ntpq-opts.texi
ntpq/ntpq.1
packageinfo.sh
sntp/libopts/Makefile.am
sntp/libopts/README
sntp/libopts/autoopts.c
sntp/libopts/autoopts.h
sntp/libopts/autoopts/options.h
sntp/libopts/autoopts/usage-txt.h
sntp/libopts/compat/compat.h
sntp/libopts/compat/windows-config.h
sntp/libopts/configfile.c
sntp/libopts/environment.c
sntp/libopts/genshell.c
sntp/libopts/genshell.h
sntp/libopts/m4/libopts.m4
sntp/libopts/pgusage.c
sntp/libopts/proto.h
sntp/libopts/save.c
sntp/libopts/sort.c
sntp/libopts/streqvcmp.c
sntp/libopts/usage.c
sntp/libopts/version.c
sntp/sntp-opts.c
sntp/sntp-opts.h
sntp/sntp-opts.texi
util/ntp-keygen-opts.c
util/ntp-keygen-opts.h
util/ntp-keygen-opts.texi
util/ntp-keygen.1

index bddd9101b02ac1e41f5a1cad430c8505cc43c18b..774dab544b7887aa63546a6e3faf4e6e0291fd7b 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (clktest-opts.c)
  *  
- *  It has been AutoGen-ed  Thursday October 12, 2006 at 11:27:56 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:24:49 AM EDT
  *  From the definitions    clktest-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 27:5:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -38,16 +38,13 @@ tSCC zCopyright[] =
        "clktest copyright (c) 1970-2006 ntp.org, all rights reserved";
 tSCC zCopyrightNotice[] =
        
-/* extracted from /deacon/backroom/ntp-dev/include/copyright.def near line 8 */
+/* extracted from /deacon/backroom/ntp-stable-hms/include/copyright.def near line 8 */
 "see html/copyright.html";
 extern tUsageProc optionUsage;
 
 /*
  *  global included definitions
  */
-#ifdef STREAM
-char magic[32] = "";
-#endif
 extern int speed;
 extern int ttflags;
 
@@ -60,63 +57,6 @@ extern int ttflags;
 #ifndef EXIT_FAILURE
 #  define  EXIT_FAILURE 1
 #endif
-/*
- *  Magic2 option description:
- */
-#ifdef CLKLDISC
-tSCC    zMagic2Text[] =
-        "The 'kill' character (default: '\\r')";
-tSCC    zMagic2_NAME[]             = "MAGIC2";
-tSCC    zMagic2_Name[]             = "magic2";
-#define MAGIC2_FLAGS       (OPTST_DISABLED \
-        | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
-
-#else   /* disable Magic2 */
-#define VALUE_OPT_MAGIC2 NO_EQUIVALENT
-#define MAGIC2_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
-#define zMagic2Text       NULL
-#define zMagic2_NAME      NULL
-#define zMagic2_Name      NULL
-#endif  /* CLKLDISC */
-
-/*
- *  Magic1 option description:
- */
-#ifdef CLKLDISC
-tSCC    zMagic1Text[] =
-        "The 'erase' character (default: '\\r')";
-tSCC    zMagic1_NAME[]             = "MAGIC1";
-tSCC    zMagic1_Name[]             = "magic1";
-#define MAGIC1_FLAGS       (OPTST_DISABLED \
-        | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
-
-#else   /* disable Magic1 */
-#define VALUE_OPT_MAGIC1 NO_EQUIVALENT
-#define MAGIC1_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
-#define zMagic1Text       NULL
-#define zMagic1_NAME      NULL
-#define zMagic1_Name      NULL
-#endif  /* CLKLDISC */
-
-/*
- *  Magic1 option description:
- */
-#ifdef STREAM
-tSCC    zMagic1Text[] =
-        "Magic characters for streams";
-tSCC    zMagic1_NAME[]             = "MAGIC1";
-tSCC    zMagic1_Name[]             = "magic1";
-#define MAGIC1_FLAGS       (OPTST_DISABLED \
-        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
-
-#else   /* disable Magic1 */
-#define VALUE_OPT_MAGIC1 NO_EQUIVALENT
-#define MAGIC1_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
-#define zMagic1Text       NULL
-#define zMagic1_NAME      NULL
-#define zMagic1_Name      NULL
-#endif  /* STREAM */
-
 /*
  *  Speed option description:
  */
@@ -196,21 +136,6 @@ tSCC zNotLoad_Opts_Pfx[]  = "no";
 /*
  *  Declare option callback procedures
  */
-#ifdef CLKLDISC
-  static tOptProc doOptMagic2;
-#else /* not CLKLDISC */
-# define doOptMagic2 NULL
-#endif /* def/not CLKLDISC */
-#ifdef CLKLDISC
-  static tOptProc doOptMagic1;
-#else /* not CLKLDISC */
-# define doOptMagic1 NULL
-#endif /* def/not CLKLDISC */
-#ifdef STREAM
-  static tOptProc doOptMagic1;
-#else /* not STREAM */
-# define doOptMagic1 NULL
-#endif /* def/not STREAM */
 #if defined(TEST_CLKTEST_OPTS)
 /*
  *  Under test, omit argument processing, or call optionStackArg,
@@ -219,7 +144,7 @@ tSCC zNotLoad_Opts_Pfx[]  = "no";
 extern tOptProc
     optionPagedUsage, optionVersionStderr;
 static tOptProc
-    doOptMagic1, doOptMagic2, doOptTimeout, doUsageOpt;
+    doOptTimeout, doUsageOpt;
 
 /*
  *  #define map the "normal" callout procs to the test ones...
@@ -257,44 +182,8 @@ static tOptProc
  *  Define the Clktest Option Descriptions.
  */
 static tOptDesc optDesc[ OPTION_CT ] = {
-  {  /* entry idx, value */ 0, VALUE_OPT_MAGIC2,
-     /* equiv idx, value */ 0, VALUE_OPT_MAGIC2,
-     /* equivalenced to  */ NO_EQUIVALENT,
-     /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ MAGIC2_FLAGS, 0,
-     /* last opt argumnt */ { NULL },
-     /* arg list/cookie  */ NULL,
-     /* must/cannot opts */ NULL, NULL,
-     /* option proc      */ doOptMagic2,
-     /* desc, NAME, name */ zMagic2Text, zMagic2_NAME, zMagic2_Name,
-     /* disablement strs */ NULL, NULL },
-
-  {  /* entry idx, value */ 1, VALUE_OPT_MAGIC1,
-     /* equiv idx, value */ 1, VALUE_OPT_MAGIC1,
-     /* equivalenced to  */ NO_EQUIVALENT,
-     /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ MAGIC1_FLAGS, 0,
-     /* last opt argumnt */ { NULL },
-     /* arg list/cookie  */ NULL,
-     /* must/cannot opts */ NULL, NULL,
-     /* option proc      */ doOptMagic1,
-     /* desc, NAME, name */ zMagic1Text, zMagic1_NAME, zMagic1_Name,
-     /* disablement strs */ NULL, NULL },
-
-  {  /* entry idx, value */ 2, VALUE_OPT_MAGIC1,
-     /* equiv idx, value */ 2, VALUE_OPT_MAGIC1,
-     /* equivalenced to  */ NO_EQUIVALENT,
-     /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ MAGIC1_FLAGS, 0,
-     /* last opt argumnt */ { NULL },
-     /* arg list/cookie  */ NULL,
-     /* must/cannot opts */ NULL, NULL,
-     /* option proc      */ doOptMagic1,
-     /* desc, NAME, name */ zMagic1Text, zMagic1_NAME, zMagic1_Name,
-     /* disablement strs */ NULL, NULL },
-
-  {  /* entry idx, value */ 3, VALUE_OPT_SPEED,
-     /* equiv idx, value */ 3, VALUE_OPT_SPEED,
+  {  /* entry idx, value */ 0, VALUE_OPT_SPEED,
+     /* equiv idx, value */ 0, VALUE_OPT_SPEED,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ SPEED_FLAGS, 0,
@@ -305,8 +194,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zSpeedText, zSpeed_NAME, zSpeed_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 4, VALUE_OPT_DEBUG,
-     /* equiv idx, value */ 4, VALUE_OPT_DEBUG,
+  {  /* entry idx, value */ 1, VALUE_OPT_DEBUG,
+     /* equiv idx, value */ 1, VALUE_OPT_DEBUG,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ DEBUG_FLAGS, 0,
@@ -317,8 +206,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zDebugText, zDebug_NAME, zDebug_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 5, VALUE_OPT_CRMOD,
-     /* equiv idx, value */ 5, VALUE_OPT_CRMOD,
+  {  /* entry idx, value */ 2, VALUE_OPT_CRMOD,
+     /* equiv idx, value */ 2, VALUE_OPT_CRMOD,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ CRMOD_FLAGS, 0,
@@ -329,8 +218,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zCrmodText, zCrmod_NAME, zCrmod_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 6, VALUE_OPT_COMMAND,
-     /* equiv idx, value */ 6, VALUE_OPT_COMMAND,
+  {  /* entry idx, value */ 3, VALUE_OPT_COMMAND,
+     /* equiv idx, value */ 3, VALUE_OPT_COMMAND,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ COMMAND_FLAGS, 0,
@@ -341,8 +230,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zCommandText, zCommand_NAME, zCommand_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 7, VALUE_OPT_TIMEOUT,
-     /* equiv idx, value */ 7, VALUE_OPT_TIMEOUT,
+  {  /* entry idx, value */ 4, VALUE_OPT_TIMEOUT,
+     /* equiv idx, value */ 4, VALUE_OPT_TIMEOUT,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ TIMEOUT_FLAGS, 0,
@@ -353,12 +242,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zTimeoutText, zTimeout_NAME, zTimeout_Name,
      /* disablement strs */ NULL, NULL },
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+#  define VERSION_OPT_FLAGS     OPTST_IMM | OPTST_NO_INIT
+#else
+#  define VERSION_OPT_FLAGS     OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+                                OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
+#endif
+
   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL, 0,
+     /* opt state flags  */ VERSION_OPT_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -366,11 +261,14 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
      /* disablement strs */ NULL, NULL },
 
+#undef VERSION_OPT_FLAGS
+
+
   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -382,7 +280,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -395,7 +293,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL, 0,
+                          | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -407,8 +305,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, NOLIMIT, 0,
-     /* opt state flags  */ OPTST_DISABLE_IMM | \
-                       OPTST_SET_ARGTYPE(OPARG_TYPE_STRING), 0,
+     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) \
+                         | OPTST_DISABLE_IMM, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -423,7 +321,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
  */
 tSCC   zPROGNAME[]   = "CLKTEST";
 tSCC   zUsageTitle[] =
-"clktest - test the clock line discipline - Ver. 4.2.3p56\n\
+"clktest - test the clock line discipline - Ver. 4.2.4p2-RC1\n\
 USAGE:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... <tty_device>\n";
 tSCC   zRcName[]     = ".ntprc";
 tSCC*  apzHomeList[] = {
@@ -438,7 +336,7 @@ Clktest can be used to test the clock line discipline (CLKLDISC,\n\
 it must be available), and to take a look at radio clocks attached\n\
 to a serial port.\n";
 tSCC    zFullVersion[] = CLKTEST_FULL_VERSION;
-/* extracted from optcode near line 368 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 408 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -476,7 +374,7 @@ tOptions clktestOptions = {
       NO_EQUIVALENT /* index of '-#' option */,
       NO_EQUIVALENT /* index of default opt */
     },
-    OPTION_CT, 8 /* user option count */
+    10 /* full option count */, 5 /* user option count */
 };
 
 /*
@@ -490,137 +388,6 @@ doUsageOpt(
     USAGE( EXIT_SUCCESS );
 }
 
-/* * * * * * *
- *
- *   For the magic2 option, when CLKLDISC is #define-d.
- */
-#ifdef CLKLDISC
-static void
-doOptMagic2(
-    tOptions*   pOptions,
-    tOptDesc*   pOptDesc )
-{
-    static const struct {const int rmin, rmax;} rng[ 1 ] = {
-        { 0, 255 } };
-    int val;
-    int ix;
-    char const* pzIndent = "\t\t\t\t  ";
-    extern FILE* option_usage_fp;
-
-    if (pOptDesc == NULL) /* usage is requesting range list
-                             option_usage_fp has already been set */
-        goto emit_ranges;
-
-    val = atoi( pOptDesc->optArg.argString );
-    for (ix = 0; ix < 1; ix++) {
-        if (val < rng[ix].rmin)
-            continue;  /* ranges need not be ordered. */
-        if (val == rng[ix].rmin)
-            goto valid_return;
-        if (rng[ix].rmax == INT_MIN)
-            continue;
-        if (val <= rng[ix].rmax)
-            goto valid_return;
-    }
-
-    option_usage_fp = stderr;
-    fprintf(stderr, _("%s error:  %s option value ``%s''is out of range.\n"),
-            pOptions->pzProgName, pOptDesc->pz_Name, pOptDesc->optArg.argString);
-    pzIndent = "\t";
-
-  emit_ranges:
-    fprintf( option_usage_fp, _("%sit must lie in the range: %d to %d\n"),
-             pzIndent, rng[0].rmin, rng[0].rmax );
-    if (pOptDesc == NULL)
-        return;
-
-    USAGE( EXIT_FAILURE );
-    /* NOTREACHED */
-    return;
-
-  valid_return:
-    pOptDesc->optArg.argInt = val;
-}
-#endif /* defined CLKLDISC */
-
-/* * * * * * *
- *
- *   For the magic1 option, when CLKLDISC is #define-d.
- */
-#ifdef CLKLDISC
-static void
-doOptMagic1(
-    tOptions*   pOptions,
-    tOptDesc*   pOptDesc )
-{
-    static const struct {const int rmin, rmax;} rng[ 1 ] = {
-        { 0, 255 } };
-    int val;
-    int ix;
-    char const* pzIndent = "\t\t\t\t  ";
-    extern FILE* option_usage_fp;
-
-    if (pOptDesc == NULL) /* usage is requesting range list
-                             option_usage_fp has already been set */
-        goto emit_ranges;
-
-    val = atoi( pOptDesc->optArg.argString );
-    for (ix = 0; ix < 1; ix++) {
-        if (val < rng[ix].rmin)
-            continue;  /* ranges need not be ordered. */
-        if (val == rng[ix].rmin)
-            goto valid_return;
-        if (rng[ix].rmax == INT_MIN)
-            continue;
-        if (val <= rng[ix].rmax)
-            goto valid_return;
-    }
-
-    option_usage_fp = stderr;
-    fprintf(stderr, _("%s error:  %s option value ``%s''is out of range.\n"),
-            pOptions->pzProgName, pOptDesc->pz_Name, pOptDesc->optArg.argString);
-    pzIndent = "\t";
-
-  emit_ranges:
-    fprintf( option_usage_fp, _("%sit must lie in the range: %d to %d\n"),
-             pzIndent, rng[0].rmin, rng[0].rmax );
-    if (pOptDesc == NULL)
-        return;
-
-    USAGE( EXIT_FAILURE );
-    /* NOTREACHED */
-    return;
-
-  valid_return:
-    pOptDesc->optArg.argInt = val;
-}
-#endif /* defined CLKLDISC */
-
-#if ! defined(TEST_CLKTEST_OPTS)
-
-/* * * * * * *
- *
- *   For the magic1 option, when STREAM is #define-d.
- */
-#ifdef STREAM
-static void
-doOptMagic1(
-    tOptions*   pOptions,
-    tOptDesc*   pOptDesc )
-{
-    /* extracted from clktest-opts.def, line 102 */
-    unsigned long tmp;
-
-    if (!atouint(pOptDesc->pzLastArg, &tmp)) {
-        fprintf(stderr, "%s error:  not a number:  ``%s''\n",
-                pOptions->pzProgName, pOptDesc->pzLastArg );
-        USAGE( EXIT_FAILURE );
-    }
-}
-#endif /* defined STREAM */
-
-#endif /* defined(TEST_CLKTEST_OPTS) */
-
 #if ! defined(TEST_CLKTEST_OPTS)
 
 /* * * * * * *
@@ -632,7 +399,7 @@ doOptSpeed(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from clktest-opts.def, line 125 */
+    /* extracted from clktest-opts.def, line 130 */
     /*
      * speed table
      */
@@ -684,7 +451,7 @@ doOptCrmod(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from clktest-opts.def, line 179 */
+    /* extracted from clktest-opts.def, line 184 */
     ttflags |= CRMOD;
 }
 
@@ -741,7 +508,7 @@ doOptTimeout(
     pOptDesc->optArg.argInt = val;
 }
 
-/* extracted from optmain.tpl near line 92 */
+/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 92 */
 
 #if defined(TEST_CLKTEST_OPTS) /* TEST MAIN PROCEDURE: */
 
@@ -757,7 +524,7 @@ main( int argc, char** argv )
     return res;
 }
 #endif  /* defined TEST_CLKTEST_OPTS */
-/* extracted from optcode near line 465 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 514 */
 
 #if ENABLE_NLS
 #include <stdio.h>
@@ -845,3 +612,4 @@ translate_option_strings( void )
 #ifdef  __cplusplus
 }
 #endif
+/* clktest-opts.c ends here */
index 32567bcba02c100045f0e9c4324a1b6630adb494..2960f0f181516949588b6aec83ebc54993fad9aa 100644 (file)
@@ -50,6 +50,7 @@ export = <<- _EOExport_
        #endif
        _EOExport_;
 
+#ifdef CLKLDISC
 flag = {
     name      = magic2;
     value     = a;
@@ -75,7 +76,9 @@ flag = {
        Or maybe the kill or maybe something else.
        _EndOfDoc_;
 };
+#endif CLKLDISC
 
+#ifdef STREAM
 extern = <<- _EOExtern_
        #ifdef STREAM
        extern char magic[32];
@@ -109,6 +112,7 @@ flag = {
            }
        _EOCode_;
 };
+#endif
 
 include       = 'extern int speed;';
 flag = {
index 5732624cf18d9bd5ab4ebee17a35c9262ff5161f..fc584b19e2779dcf489770f812b081e43912086f 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (clktest-opts.h)
  *  
- *  It has been AutoGen-ed  Thursday October 12, 2006 at 11:27:56 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:24:48 AM EDT
  *  From the definitions    clktest-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 27:5:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -42,7 +42,7 @@
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 110597
+#define AO_TEMPLATE_VERSION 118784
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
  *  Enumeration of each option:
  */
 typedef enum {
-        INDEX_OPT_MAGIC2           =  0,
-        INDEX_OPT_MAGIC1           =  1,
-        INDEX_OPT_MAGIC1           =  2,
-        INDEX_OPT_SPEED            =  3,
-        INDEX_OPT_DEBUG            =  4,
-        INDEX_OPT_CRMOD            =  5,
-        INDEX_OPT_COMMAND          =  6,
-        INDEX_OPT_TIMEOUT          =  7,
-        INDEX_OPT_VERSION          = 8,
-        INDEX_OPT_HELP             = 9,
-        INDEX_OPT_MORE_HELP        = 10,
-        INDEX_OPT_SAVE_OPTS        = 11,
-        INDEX_OPT_LOAD_OPTS        = 12
+        INDEX_OPT_SPEED            =  0,
+        INDEX_OPT_DEBUG            =  1,
+        INDEX_OPT_CRMOD            =  2,
+        INDEX_OPT_COMMAND          =  3,
+        INDEX_OPT_TIMEOUT          =  4,
+        INDEX_OPT_VERSION          = 5,
+        INDEX_OPT_HELP             = 6,
+        INDEX_OPT_MORE_HELP        = 7,
+        INDEX_OPT_SAVE_OPTS        = 8,
+        INDEX_OPT_LOAD_OPTS        = 9
 } teOptIndex;
 
-#define OPTION_CT    13
-#define CLKTEST_VERSION       "4.2.3p56"
-#define CLKTEST_FULL_VERSION  "clktest - test the clock line discipline - Ver. 4.2.3p56"
+#define OPTION_CT    10
+#define CLKTEST_VERSION       "4.2.4p2-RC1"
+#define CLKTEST_FULL_VERSION  "clktest - test the clock line discipline - Ver. 4.2.4p2-RC1"
 
 /*
  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
  *  option name (as in the teOptIndex enumeration above).
- *  e.g. HAVE_OPT( MAGIC2 )
+ *  e.g. HAVE_OPT( SPEED )
  */
-#define         DESC(n) clktestOptions.pOptDesc[INDEX_OPT_ ## n]
+#define         DESC(n) (clktestOptions.pOptDesc[INDEX_OPT_## n])
 #define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
 #define      OPT_ARG(n) (DESC(n).optArg.argString)
 #define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
@@ -97,18 +94,6 @@ typedef enum {
  *  Make sure there are no #define name conflicts with the option names
  */
 #ifndef     NO_OPTION_NAME_WARNINGS
-# ifdef    MAGIC2
-#  warning undefining MAGIC2 due to option name conflict
-#  undef   MAGIC2
-# endif
-# ifdef    MAGIC1
-#  warning undefining MAGIC1 due to option name conflict
-#  undef   MAGIC1
-# endif
-# ifdef    MAGIC1
-#  warning undefining MAGIC1 due to option name conflict
-#  undef   MAGIC1
-# endif
 # ifdef    SPEED
 #  warning undefining SPEED due to option name conflict
 #  undef   SPEED
@@ -130,9 +115,6 @@ typedef enum {
 #  undef   TIMEOUT
 # endif
 #else  /* NO_OPTION_NAME_WARNINGS */
-# undef MAGIC2
-# undef MAGIC1
-# undef MAGIC1
 # undef SPEED
 # undef DEBUG
 # undef CRMOD
@@ -143,17 +125,6 @@ typedef enum {
 /*
  *  Interface defines for specific options.
  */
-#ifdef CLKLDISC
-#define VALUE_OPT_MAGIC2         'a'
-#define OPT_VALUE_MAGIC2         (DESC(MAGIC2).optArg.argInt)
-#endif /* CLKLDISC */
-#ifdef CLKLDISC
-#define VALUE_OPT_MAGIC1         'c'
-#define OPT_VALUE_MAGIC1         (DESC(MAGIC1).optArg.argInt)
-#endif /* CLKLDISC */
-#ifdef STREAM
-#define VALUE_OPT_MAGIC1         'c'
-#endif /* STREAM */
 #define VALUE_OPT_SPEED          'b'
 #define VALUE_OPT_DEBUG          'd'
 #define VALUE_OPT_CRMOD          'f'
@@ -162,10 +133,10 @@ typedef enum {
 #define OPT_VALUE_TIMEOUT        (DESC(TIMEOUT).optArg.argInt)
 
 #define VALUE_OPT_VERSION       'v'
-#define VALUE_OPT_SAVE_OPTS     '>'
-#define VALUE_OPT_LOAD_OPTS     '<'
 #define VALUE_OPT_HELP          '?'
 #define VALUE_OPT_MORE_HELP     '!'
+#define VALUE_OPT_SAVE_OPTS     '>'
+#define VALUE_OPT_LOAD_OPTS     '<'
 #define SET_OPT_SAVE_OPTS(a)   STMTS( \
         DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
         DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
@@ -180,7 +151,7 @@ typedef enum {
                 clktestOptions.pzCurOpt  = NULL )
 #define START_OPT       RESTART_OPT(1)
 #define USAGE(c)        (*clktestOptions.pUsageProc)( &clktestOptions, c )
-/* extracted from opthead near line 312 */
+/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
 
 /* * * * * *
  *
@@ -243,10 +214,4 @@ extern tOptions   clktestOptions;
 }
 #endif
 #endif /* AUTOOPTS_CLKTEST_OPTS_H_GUARD */
-/*
- * Local Variables:
- * Mode: C
- * c-file-style: "stroustrup"
- * indent-tabs-mode: nil
- * End:
- * options.h ends here */
+/* clktest-opts.h ends here */
index 351d33b84b9e2538aef7f2f42264c3c4fdb27b6f..89439830eb87807c793cbc0fe7e4dd463e5426d1 100644 (file)
@@ -1,2 +1,2 @@
-#assert (version-compare >= autogen-version "5.8.7")
+#assert (version-compare >= autogen-version "5.9.1")
 guard-option-names;
index dfcfb46530db927e8abb6472cc6a1954607204bf..5f13861442217c72936cdac5f9d547e1fffe5c45 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  28:0:3
+libopts_la_LDFLAGS      = -version-info  29:0:4
 EXTRA_DIST              = \
     COPYING.lgpl            COPYING.mbsd            MakeDefs.inc  \
     README                  autoopts/options.h      autoopts/usage-txt.h  \
index 7f426fa974e0f043872cdb680a7bcc306e6ba155..7cbe0b044feb36d608b8e19cf8c3433cc23831d7 100644 (file)
@@ -85,7 +85,7 @@ will need to hand craft the rules for building the library.
 
 LICENSING:
 
-This material is copyright 1993-2006 by Bruce Korb.
+This material is copyright 1993-2007 by Bruce Korb.
 You are licensed to use this under the terms of either
 the GNU Lesser General Public License (see: COPYING.lgpl), or,
 at your option, the modified Berkeley Software Distribution
index 28f93f1c7612168bbe3cc03353aef66c5ef311e4..139841bbb2a19eab09a110e8a6641a1c2be68bff 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: autoopts.c,v 4.23 2007/02/13 19:43:46 bkorb Exp $
- *  Time-stamp:      "2007-02-13 11:26:59 bkorb"
+ *  $Id: autoopts.c,v 4.25 2007/04/15 19:01:18 bkorb Exp $
+ *  Time-stamp:      "2007-04-15 11:10:40 bkorb"
  *
  *  This file contains all of the routines that must be linked into
  *  an executable to use the generated option processing.  The optional
@@ -54,9 +54,6 @@
 
 static char const zNil[] = "";
 
-#define SKIP_RC_FILES(po) \
-    DISABLED_OPT(&((po)->pOptDesc[ (po)->specOptIdx.save_opts+1]))
-
 /* = = = START-STATIC-FORWARD = = = */
 /* static forward declarations maintained by :mkfwd */
 static tSuccess
@@ -697,7 +694,7 @@ nextOption( tOptions* pOpts, tOptState* pOptState )
         case TOPT_DEFAULT:
             fputs( "AutoOpts lib error: defaulted to option with optional arg\n",
                    stderr );
-            exit( EXIT_FAILURE );
+            exit( EX_SOFTWARE );
         }
 
         /*
@@ -830,9 +827,22 @@ doRegularOpts( tOptions* pOpts )
 static tSuccess
 doPresets( tOptions* pOpts )
 {
+    tOptDesc * pOD = NULL;
+
     if (! SUCCESSFUL( doImmediateOpts( pOpts )))
         return FAILURE;
 
+    /*
+     *  IF this option set has a --save-opts option, then it also
+     *  has a --load-opts option.  See if a command line option has disabled
+     *  option presetting.
+     */
+    if (pOpts->specOptIdx.save_opts != 0) {
+        pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts + 1;
+        if (DISABLED_OPT(pOD))
+            return SUCCESS;
+    }
+
     /*
      *  Until we return from this procedure, disable non-presettable opts
      */
@@ -841,13 +851,22 @@ doPresets( tOptions* pOpts )
      *  IF there are no config files,
      *  THEN do any environment presets and leave.
      */
-    if (  (pOpts->papzHomeList == NULL)
-       || SKIP_RC_FILES(pOpts) )  {
+    if (pOpts->papzHomeList == NULL) {
         doEnvPresets( pOpts, ENV_ALL );
     }
     else {
         doEnvPresets( pOpts, ENV_IMM );
-        internalFileLoad( pOpts );
+
+        /*
+         *  Check to see if environment variables have disabled presetting.
+         */
+        if ((pOD != NULL) && ! DISABLED_OPT(pOD))
+            internalFileLoad( pOpts );
+
+        /*
+         *  ${PROGRAM_LOAD_OPTS} value of "no" cannot disable other environment
+         *  variable options.  Only the loading of .rc files.
+         */
         doEnvPresets( pOpts, ENV_NON_IMM );
     }
     pOpts->fOptSet &= ~OPTPROC_PRESETTING;
@@ -1031,7 +1050,7 @@ optionProcess(
     char**     argVect )
 {
     if (! SUCCESSFUL( validateOptionsStruct( pOpts, argVect[0] )))
-        exit( EXIT_FAILURE );
+        exit( EX_SOFTWARE );
 
     /*
      *  Establish the real program name, the program full path,
index f2ac93e9a4617990193edc4a0aa580428e49edc9..2645757eaa1478cd1cf9c8472d5afe4e4939baf2 100644 (file)
@@ -1,8 +1,8 @@
 
 /*
- *  Time-stamp:      "2007-01-17 16:37:34 bkorb"
+ *  Time-stamp:      "2007-04-15 09:59:39 bkorb"
  *
- *  autoopts.h  $Id: autoopts.h,v 4.22 2007/02/04 17:44:12 bkorb Exp $
+ *  autoopts.h  $Id: autoopts.h,v 4.23 2007/04/15 19:01:18 bkorb Exp $
  *  Time-stamp:      "2005-02-14 05:59:50 bkorb"
  *
  *  This file defines all the global structures and special values
 
 #include "compat/compat.h"
 
-#define AO_NAME_LIMIT    127
-#define AO_NAME_SIZE     ((size_t)(AO_NAME_LIMIT + 1))
+#define AO_NAME_LIMIT           127
+#define AO_NAME_SIZE            ((size_t)(AO_NAME_LIMIT + 1))
 
 #ifndef AG_PATH_MAX
 #  ifdef PATH_MAX
-#    define AG_PATH_MAX   ((size_t)PATH_MAX)
+#    define AG_PATH_MAX         ((size_t)PATH_MAX)
 #  else
-#    define AG_PATH_MAX   ((size_t)4096)
+#    define AG_PATH_MAX         ((size_t)4096)
 #  endif
 #else
 #  if defined(PATH_MAX) && (PATH_MAX > MAXPATHLEN)
 #     undef  AG_PATH_MAX
-#     define AG_PATH_MAX  ((size_t)PATH_MAX)
+#     define AG_PATH_MAX        ((size_t)PATH_MAX)
 #  endif
 #endif
 
 #define EXPORT
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
-# define DIRCH '\\'
+# define DIRCH                  '\\'
 #else
-# define DIRCH '/'
+# define DIRCH                  '/'
+#endif
+
+#ifndef EX_NOINPUT
+#  define EX_NOINPUT            66
+#endif
+#ifndef EX_SOFTWARE
+#  define EX_SOFTWARE           70
+#endif
+#ifndef EX_CONFIG
+#  define EX_CONFIG             78
 #endif
 
 /*
  *  Convert the number to a list usable in a printf call
  */
-#define NUM_TO_VER(n)       ((n) >> 12), ((n) >> 7) & 0x001F, (n) & 0x007F
+#define NUM_TO_VER(n)           ((n) >> 12), ((n) >> 7) & 0x001F, (n) & 0x007F
 
 #define NAMED_OPTS(po) \
         (((po)->fOptSet & (OPTPROC_SHORTOPT | OPTPROC_LONGOPT)) == 0)
 #define SKIP_OPT(p)  (((p)->fOptState & (OPTST_DOCUMENT|OPTST_OMITTED)) != 0)
 
 typedef int tDirection;
-#define DIRECTION_PRESET  -1
-#define DIRECTION_PROCESS  1
-#define DIRECTION_CALLED   0
+#define DIRECTION_PRESET        -1
+#define DIRECTION_PROCESS       1
+#define DIRECTION_CALLED        0
 
-#define PROCESSING(d)     ((d)>0)
-#define PRESETTING(d)     ((d)<0)
+#define PROCESSING(d)           ((d)>0)
+#define PRESETTING(d)           ((d)<0)
 
-#define ISNAMECHAR( c )    (isalnum(c) || ((c) == '_') || ((c) == '-'))
+#define ISNAMECHAR( c )         (isalnum(c) || ((c) == '_') || ((c) == '-'))
 
 /*
  *  Procedure success codes
@@ -119,16 +129,16 @@ typedef int tDirection;
 #undef  FAILED
 #undef  HADGLITCH
 
-#define SUCCESS  ((tSuccess) 0)
-#define FAILURE  ((tSuccess)-1)
-#define PROBLEM  ((tSuccess) 1)
+#define SUCCESS                 ((tSuccess) 0)
+#define FAILURE                 ((tSuccess)-1)
+#define PROBLEM                 ((tSuccess) 1)
 
 typedef int tSuccess;
 
-#define SUCCEEDED( p )     ((p) == SUCCESS)
-#define SUCCESSFUL( p )    SUCCEEDED( p )
-#define FAILED( p )        ((p) <  SUCCESS)
-#define HADGLITCH( p )     ((p) >  SUCCESS)
+#define SUCCEEDED( p )          ((p) == SUCCESS)
+#define SUCCESSFUL( p )         SUCCEEDED( p )
+#define FAILED( p )             ((p) <  SUCCESS)
+#define HADGLITCH( p )          ((p) >  SUCCESS)
 
 /*
  *  When loading a line (or block) of text as an option, the value can
@@ -224,10 +234,10 @@ typedef struct {
     tCC*    pzOptFmt;
 } arg_types_t;
 
-#define AGALOC( c, w )        ao_malloc((size_t)c)
-#define AGREALOC( p, c, w )   ao_realloc((void*)p, (size_t)c)
-#define AGFREE( p )           ao_free((void*)p)
-#define AGDUPSTR( p, s, w )   (p = ao_strdup(s))
+#define AGALOC( c, w )          ao_malloc((size_t)c)
+#define AGREALOC( p, c, w )     ao_realloc((void*)p, (size_t)c)
+#define AGFREE( p )             ao_free((void*)p)
+#define AGDUPSTR( p, s, w )     (p = ao_strdup(s))
 
 static void *
 ao_malloc( size_t sz );
@@ -324,26 +334,26 @@ ao_strdup( char const *str );
 #  include <sys/mman.h>
 #else
 #  ifndef  PROT_READ
-#   define PROT_READ    0x01
+#   define PROT_READ            0x01
 #  endif
 #  ifndef  PROT_WRITE
-#   define PROT_WRITE   0x02
+#   define PROT_WRITE           0x02
 #  endif
 #  ifndef  MAP_SHARED
-#   define MAP_SHARED   0x01
+#   define MAP_SHARED           0x01
 #  endif
 #  ifndef  MAP_PRIVATE
-#   define MAP_PRIVATE  0x02
+#   define MAP_PRIVATE          0x02
 #  endif
 #endif
 
 #ifndef MAP_FAILED
-#  define  MAP_FAILED   ((void*)-1)
+#  define  MAP_FAILED           ((void*)-1)
 #endif
 
 #ifndef  _SC_PAGESIZE
 # ifdef  _SC_PAGE_SIZE
-#  define _SC_PAGESIZE _SC_PAGE_SIZE
+#  define _SC_PAGESIZE          _SC_PAGE_SIZE
 # endif
 #endif
 
index db97c72d30c6b7af9481ec4af16d57722f80e9d9..c2ceeb3dbb13610802e0bd0fb655c1aafd52bdb9 100644 (file)
@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (options.h)
  *  
- *  It has been AutoGen-ed  Saturday February 17, 2007 at 12:49:35 PM PST
+ *  It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:34 PM PDT
  *  From the definitions    funcs.def
  *  and the template file   options_h
  *
 # include <sys/limits.h>
 #endif /* HAVE_LIMITS/SYS_LIMITS_H */
 
+#if defined(HAVE_SYSEXITS_H)
+#  include <sysexits.h>
+#endif /* HAVE_SYSEXITS_H */
+
+#ifndef EX_USAGE
+#  define EX_USAGE              64
+#endif
+
 /*
  *  PUBLIC DEFINES
  *
@@ -60,8 +68,8 @@
  *  values for "opt_name" are available.
  */
 
-#define  OPTIONS_STRUCT_VERSION  114688
-#define  OPTIONS_VERSION_STRING  "28:0:3"
+#define  OPTIONS_STRUCT_VERSION  118784
+#define  OPTIONS_VERSION_STRING  "29:0:4"
 #define  OPTIONS_MINIMUM_VERSION 102400
 #define  OPTIONS_MIN_VER_STRING  "25:0:0"
 
@@ -92,28 +100,28 @@ typedef struct optionValue {
  *  Bits in the fOptState option descriptor field.
  */
 typedef enum {
-        OPTST_SET_ID             =   0, /* Set via the "SET_OPT()" macro */
-        OPTST_PRESET_ID          =   1, /* Set via an RC/INI file        */
-        OPTST_DEFINED_ID         =   2, /* Set via a command line option */
-        OPTST_EQUIVALENCE_ID     =   4, /* selected by equiv'ed option   */
-        OPTST_DISABLED_ID        =   5, /* option is in disabled state   */
-        OPTST_ALLOC_ARG_ID       =   6, /* pzOptArg was allocated        */
-        OPTST_NO_INIT_ID         =   8, /* option cannot be preset       */
-        OPTST_NUMBER_OPT_ID      =   9, /* opt value (flag) is any digit */
-        OPTST_STACKED_ID         =  10, /* opt uses optionStackArg proc  */
-        OPTST_INITENABLED_ID     =  11, /* option defaults to enabled    */
-        OPTST_ARG_TYPE_1_ID      =  12, /* bit 1 of arg type enum        */
-        OPTST_ARG_TYPE_2_ID      =  13, /* bit 2 of arg type enum        */
-        OPTST_ARG_TYPE_3_ID      =  14, /* bit 3 of arg type enum        */
-        OPTST_ARG_TYPE_4_ID      =  15, /* bit 4 of arg type enum        */
-        OPTST_ARG_OPTIONAL_ID    =  16, /* the option arg not required   */
-        OPTST_IMM_ID             =  17, /* process opt on first pass     */
-        OPTST_DISABLE_IMM_ID     =  18, /* process disablement immed.    */
-        OPTST_OMITTED_ID         =  19, /* compiled out of program       */
-        OPTST_MUST_SET_ID        =  20, /* must be set or pre-set        */
-        OPTST_DOCUMENT_ID        =  21, /* opt is for doc only           */
-        OPTST_TWICE_ID           =  22, /* process opt twice - imm + reg */
-        OPTST_DISABLE_TWICE_ID   =  23  /* process disabled option twice */
+    OPTST_SET_ID             =   0, /* Set via the "SET_OPT()" macro */
+    OPTST_PRESET_ID          =   1, /* Set via an RC/INI file        */
+    OPTST_DEFINED_ID         =   2, /* Set via a command line option */
+    OPTST_EQUIVALENCE_ID     =   4, /* selected by equiv'ed option   */
+    OPTST_DISABLED_ID        =   5, /* option is in disabled state   */
+    OPTST_ALLOC_ARG_ID       =   6, /* pzOptArg was allocated        */
+    OPTST_NO_INIT_ID         =   8, /* option cannot be preset       */
+    OPTST_NUMBER_OPT_ID      =   9, /* opt value (flag) is any digit */
+    OPTST_STACKED_ID         =  10, /* opt uses optionStackArg proc  */
+    OPTST_INITENABLED_ID     =  11, /* option defaults to enabled    */
+    OPTST_ARG_TYPE_1_ID      =  12, /* bit 1 of arg type enum        */
+    OPTST_ARG_TYPE_2_ID      =  13, /* bit 2 of arg type enum        */
+    OPTST_ARG_TYPE_3_ID      =  14, /* bit 3 of arg type enum        */
+    OPTST_ARG_TYPE_4_ID      =  15, /* bit 4 of arg type enum        */
+    OPTST_ARG_OPTIONAL_ID    =  16, /* the option arg not required   */
+    OPTST_IMM_ID             =  17, /* process opt on first pass     */
+    OPTST_DISABLE_IMM_ID     =  18, /* process disablement immed.    */
+    OPTST_OMITTED_ID         =  19, /* compiled out of program       */
+    OPTST_MUST_SET_ID        =  20, /* must be set or pre-set        */
+    OPTST_DOCUMENT_ID        =  21, /* opt is for doc only           */
+    OPTST_TWICE_ID           =  22, /* process opt twice - imm + reg */
+    OPTST_DISABLE_TWICE_ID   =  23  /* process disabled option twice */
 } opt_state_enum_t;
 
 #define OPTST_INIT           0U
@@ -164,6 +172,11 @@ typedef enum {
         OPTST_ARG_TYPE_3 | \
         OPTST_ARG_TYPE_4 )
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+# undef  OPTST_ARG_OPTIONAL
+# define OPTST_ARG_OPTIONAL   0
+#endif
+
 #define OPTST_PERSISTENT_MASK (~OPTST_MUTABLE_MASK)
 
 #define SELECTED_OPT( pod )   ((pod)->fOptState  & OPTST_SELECTED_MASK)
@@ -186,22 +199,22 @@ typedef enum {
  *  Define the processing state flags
  */
 typedef enum {
-        OPTPROC_LONGOPT_ID       =   0, /* Process long style options      */
-        OPTPROC_SHORTOPT_ID      =   1, /* Process short style "flags"     */
-        OPTPROC_ERRSTOP_ID       =   2, /* Stop on argument errors         */
-        OPTPROC_DISABLEDOPT_ID   =   3, /* Current option is disabled      */
-        OPTPROC_NO_REQ_OPT_ID    =   4, /* no options are required         */
-        OPTPROC_NUM_OPT_ID       =   5, /* there is a number option        */
-        OPTPROC_INITDONE_ID      =   6, /* have initializations been done? */
-        OPTPROC_NEGATIONS_ID     =   7, /* any negation options?           */
-        OPTPROC_ENVIRON_ID       =   8, /* check environment?              */
-        OPTPROC_NO_ARGS_ID       =   9, /* Disallow remaining arguments    */
-        OPTPROC_ARGS_REQ_ID      =  10, /* Require arguments after options */
-        OPTPROC_REORDER_ID       =  11, /* reorder operands after options  */
-        OPTPROC_GNUUSAGE_ID      =  12, /* emit usage in GNU style         */
-        OPTPROC_TRANSLATE_ID     =  13, /* Translate strings in tOptions   */
-        OPTPROC_HAS_IMMED_ID     =  14, /* program defines immed options   */
-        OPTPROC_PRESETTING_ID    =  19  /* opt processing in preset state  */
+    OPTPROC_LONGOPT_ID       =   0, /* Process long style options      */
+    OPTPROC_SHORTOPT_ID      =   1, /* Process short style "flags"     */
+    OPTPROC_ERRSTOP_ID       =   2, /* Stop on argument errors         */
+    OPTPROC_DISABLEDOPT_ID   =   3, /* Current option is disabled      */
+    OPTPROC_NO_REQ_OPT_ID    =   4, /* no options are required         */
+    OPTPROC_NUM_OPT_ID       =   5, /* there is a number option        */
+    OPTPROC_INITDONE_ID      =   6, /* have initializations been done? */
+    OPTPROC_NEGATIONS_ID     =   7, /* any negation options?           */
+    OPTPROC_ENVIRON_ID       =   8, /* check environment?              */
+    OPTPROC_NO_ARGS_ID       =   9, /* Disallow remaining arguments    */
+    OPTPROC_ARGS_REQ_ID      =  10, /* Require arguments after options */
+    OPTPROC_REORDER_ID       =  11, /* reorder operands after options  */
+    OPTPROC_GNUUSAGE_ID      =  12, /* emit usage in GNU style         */
+    OPTPROC_TRANSLATE_ID     =  13, /* Translate strings in tOptions   */
+    OPTPROC_HAS_IMMED_ID     =  14, /* program defines immed options   */
+    OPTPROC_PRESETTING_ID    =  19  /* opt processing in preset state  */
 } optproc_state_enum_t;
 
 #define OPTPROC_NONE         0U
@@ -350,7 +363,7 @@ struct optSpecIndex {
 typedef void (tOptionXlateProc)(void);
 
 struct options {
-    const int           structVersion;
+    int const           structVersion;
     int                 origArgCt;
     char**              origArgVect;
     unsigned int        fOptSet;
@@ -364,7 +377,7 @@ struct options {
     char const* const   pzCopyright;
     char const* const   pzCopyNotice;
     char const* const   pzFullVersion;
-    char const* const*  papzHomeList;
+    char const* const* const papzHomeList;
     char const* const   pzUsageTitle;
     char const* const   pzExplain;
     char const* const   pzDetail;
@@ -378,8 +391,8 @@ struct options {
     tOptionXlateProc*   pTransProc;
 
     tOptSpecIndex       specOptIdx;
-    const int           optCt;
-    const int           presetOptCt;
+    int const           optCt;
+    int const           presetOptCt;
 };
 
 /*
@@ -498,7 +511,7 @@ extern token_list_t* ao_string_tokenize( char const* );
 extern const tOptionValue* configFileLoad( char const* );
 
 
-/* From: configfile.c line 880
+/* From: configfile.c line 883
  *
  * optionFileLoad - Load the locatable config files, in order
  *
@@ -653,7 +666,7 @@ extern const tOptionValue* optionNextValue( const tOptionValue*, const tOptionVa
 extern void optionOnlyUsage( tOptions*, int );
 
 
-/* From: autoopts.c line 993
+/* From: autoopts.c line 1012
  *
  * optionProcess - this is the main option processing routine
  *
index 57fc2603a29dbcc3363e000a103eb7e4d92b4bbb..5aaaa01a66ffda2b0f0629a383fc113720b3c20b 100644 (file)
@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (usage-txt.h)
  *  
- *  It has been AutoGen-ed  Saturday February 17, 2007 at 12:49:33 PM PST
+ *  It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:33 PM PDT
  *  From the definitions    usage-txt.def
  *  and the template file   usage-txt.tpl
  *
index 86fff8e270b5dbb0d4e2cf062284241638a41088..b3bd58ff425397c332c2ecbdcbaf8abd421f3ab9 100644 (file)
@@ -7,7 +7,7 @@
  * Author:           Gary V Vaughan <gvaughan@oranda.demon.co.uk>
  * Created:          Mon Jun 30 15:54:46 1997
  *
- * $Id: compat.h,v 4.15 2007/02/04 22:17:39 bkorb Exp $
+ * $Id: compat.h,v 4.16 2007/04/27 01:10:47 bkorb Exp $
  */
 #ifndef COMPAT_H_GUARD
 #define COMPAT_H_GUARD 1
 #  define MAXPATHLEN PATH_MAX
 #endif /* !MAXPATHLEN && PATH_MAX */
 
+#if !defined (MAXPATHLEN) && defined(_MAX_PATH)
+#  define PATH_MAX _MAX_PATH
+#  define MAXPATHLEN _MAX_PATH
+#endif
+
 #if !defined (MAXPATHLEN)
 #  define MAXPATHLEN ((size_t)4096)
 #endif /* MAXPATHLEN */
index d4f3d2a820624196fc566235ef0682cd30fdca02..2612980bf5a0b3c628c5e3b81790c1a06f8efbc5 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Time-stamp:        "2006-10-14 14:55:09 bkorb"
  *             by: bkorb
- * Last Committed:    $Date: 2006/10/14 22:39:49 $
+ * Last Committed:    $Date: 2007/04/28 22:19:23 $
  */
 #ifndef WINDOWS_CONFIG_HACKERY
 #define WINDOWS_CONFIG_HACKERY 1
@@ -92,6 +92,7 @@ typedef unsigned long uintptr_t;
 /* Include Windows headers */
 #include <windows.h>
 #include <winsock2.h>
+#include <limits.h>
 
 /*
  * Compatibility declarations for Windows, assuming SYS_WINNT
index f3016dcda7943e102160fc5e7d49eff5b53dc783..e0b8a7487aa35f16f97dfc98f9322463b18b3762 100644 (file)
@@ -1,6 +1,6 @@
 /*
- *  $Id: configfile.c,v 1.20 2007/02/04 17:44:12 bkorb Exp $
- *  Time-stamp:      "2007-01-13 12:49:10 bkorb"
+ *  $Id: configfile.c,v 1.21 2007/04/15 19:01:18 bkorb Exp $
+ *  Time-stamp:      "2007-04-15 11:22:46 bkorb"
  *
  *  configuration/rc/ini file handling.
  */
@@ -869,11 +869,14 @@ internalFileLoad( tOptions* pOpts )
          *  IF we are now to skip config files AND we are presetting,
          *  THEN change direction.  We must go the other way.
          */
-        if (SKIP_RC_FILES(pOpts) && PRESETTING(inc)) {
-            idx -= inc;  /* go back and reprocess current file */
-            inc =  DIRECTION_PROCESS;
+        {
+            tOptDesc * pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts+1;
+            if (DISABLED_OPT(pOD) && PRESETTING(inc)) {
+                idx -= inc;  /* go back and reprocess current file */
+                inc =  DIRECTION_PROCESS;
+            }
         }
-    } /* For every path in the home list, ... */
+    } /* twice for every path in the home list, ... */
 }
 
 
@@ -937,11 +940,10 @@ void
 optionLoadOpt( tOptions* pOpts, tOptDesc* pOptDesc )
 {
     /*
-     *  IF the option is not being disabled,
-     *  THEN load the file.  There must be a file.
-     *  (If it is being disabled, then the disablement processing
-     *  already took place.  It must be done to suppress preloading
-     *  of ini/rc files.)
+     *  IF the option is not being disabled, THEN load the file.  There must
+     *  be a file.  (If it is being disabled, then the disablement processing
+     *  already took place.  It must be done to suppress preloading of ini/rc
+     *  files.)
      */
     if (! DISABLED_OPT( pOptDesc )) {
         struct stat sb;
@@ -951,7 +953,7 @@ optionLoadOpt( tOptions* pOpts, tOptDesc* pOptDesc )
 
             fprintf( stderr, zFSErrOptLoad, errno, strerror( errno ),
                      pOptDesc->optArg.argString );
-            (*pOpts->pUsageProc)( pOpts, EXIT_FAILURE );
+            exit(EX_NOINPUT);
             /* NOT REACHED */
         }
 
@@ -960,7 +962,7 @@ optionLoadOpt( tOptions* pOpts, tOptDesc* pOptDesc )
                 return;
 
             fprintf( stderr, zNotFile, pOptDesc->optArg.argString );
-            (*pOpts->pUsageProc)( pOpts, EXIT_FAILURE );
+            exit(EX_NOINPUT);
             /* NOT REACHED */
         }
 
@@ -1223,7 +1225,7 @@ validateOptionsStruct( tOptions* pOpts, char const* pzProgram )
 {
     if (pOpts == NULL) {
         fputs( zAO_Bad, stderr );
-        exit( EXIT_FAILURE );
+        exit( EX_CONFIG );
     }
 
     /*
index 4060c46538b450d02f6132a68bd8e9b5d6fc3665..9fb155011216cdf9724ce24155c8a7935a35dcda 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: environment.c,v 4.12 2007/02/04 17:44:12 bkorb Exp $
- * Time-stamp:      "2007-01-13 10:02:07 bkorb"
+ *  $Id: environment.c,v 4.13 2007/04/15 19:01:18 bkorb Exp $
+ * Time-stamp:      "2007-04-15 11:50:35 bkorb"
  *
  *  This file contains all of the routines that must be linked into
  *  an executable to use the generated option processing.  The optional
@@ -54,6 +54,9 @@
 
 /* = = = START-STATIC-FORWARD = = = */
 /* static forward declarations maintained by :mkfwd */
+static void
+checkEnvOpt(tOptState * os, char * env_name,
+            tOptions* pOpts, teEnvPresetType type);
 /* = = = END-STATIC-FORWARD = = = */
 
 /*
@@ -145,6 +148,66 @@ doPrognameEnv( tOptions* pOpts, teEnvPresetType type )
     pOpts->fOptSet     = sv_flag;
 }
 
+static void
+checkEnvOpt(tOptState * os, char * env_name,
+            tOptions* pOpts, teEnvPresetType type)
+{
+    os->pzOptArg = getenv( env_name );
+    if (os->pzOptArg == NULL)
+        return;
+
+    os->flags    = OPTST_PRESET | OPTST_ALLOC_ARG | os->pOD->fOptState;
+    os->optType  = TOPT_UNDEFINED;
+
+    if (  (os->pOD->pz_DisablePfx != NULL)
+       && (streqvcmp( os->pzOptArg, os->pOD->pz_DisablePfx ) == 0)) {
+        os->flags |= OPTST_DISABLED;
+        os->pzOptArg = NULL;
+    }
+
+    switch (type) {
+    case ENV_IMM:
+        /*
+         *  Process only immediate actions
+         */
+        if (DO_IMMEDIATELY(os->flags))
+            break;
+        return;
+
+    case ENV_NON_IMM:
+        /*
+         *  Process only NON immediate actions
+         */
+        if (DO_NORMALLY(os->flags) || DO_SECOND_TIME(os->flags))
+            break;
+        return;
+
+    default: /* process everything */
+        break;
+    }
+
+    /*
+     *  Make sure the option value string is persistent and consistent.
+     *
+     *  The interpretation of the option value depends
+     *  on the type of value argument the option takes
+     */
+    if (os->pzOptArg != NULL) {
+        if (OPTST_GET_ARGTYPE(os->pOD->fOptState) == OPARG_TYPE_NONE) {
+            os->pzOptArg = NULL;
+        } else if (  (os->pOD->fOptState & OPTST_ARG_OPTIONAL)
+                     && (*os->pzOptArg == NUL)) {
+            os->pzOptArg = NULL;
+        } else if (*os->pzOptArg == NUL) {
+            os->pzOptArg = zNil;
+        } else {
+            AGDUPSTR( os->pzOptArg, os->pzOptArg, "option argument" );
+            os->flags |= OPTST_ALLOC_ARG;
+        }
+    }
+
+    handleOption( pOpts, os );
+}
 
 /*
  *  doEnvPresets - check for preset values from the envrionment
@@ -194,60 +257,16 @@ doEnvPresets( tOptions* pOpts, teEnvPresetType type )
          *  Set up the option state
          */
         strcpy( pzFlagName, st.pOD->pz_NAME );
-        st.pzOptArg = getenv( zEnvName );
-        if (st.pzOptArg == NULL)
-            continue;
-        st.flags    = OPTST_PRESET | OPTST_ALLOC_ARG | st.pOD->fOptState;
-        st.optType  = TOPT_UNDEFINED;
-
-        if (  (st.pOD->pz_DisablePfx != NULL)
-           && (streqvcmp( st.pzOptArg, st.pOD->pz_DisablePfx ) == 0)) {
-            st.flags |= OPTST_DISABLED;
-            st.pzOptArg = NULL;
-        }
-
-        switch (type) {
-        case ENV_IMM:
-            /*
-             *  Process only immediate actions
-             */
-            if (DO_IMMEDIATELY(st.flags))
-                break;
-            continue;
-
-        case ENV_NON_IMM:
-            /*
-             *  Process only NON immediate actions
-             */
-            if (DO_NORMALLY(st.flags) || DO_SECOND_TIME(st.flags))
-                break;
-            continue;
-
-        default: /* process everything */
-            break;
-        }
-
-        /*
-         *  Make sure the option value string is persistent and consistent.
-         *
-         *  The interpretation of the option value depends
-         *  on the type of value argument the option takes
-         */
-        if (st.pzOptArg != NULL) {
-            if (OPTST_GET_ARGTYPE(st.pOD->fOptState) == OPARG_TYPE_NONE) {
-                st.pzOptArg = NULL;
-            } else if (  (st.pOD->fOptState & OPTST_ARG_OPTIONAL)
-                      && (*st.pzOptArg == NUL)) {
-                    st.pzOptArg = NULL;
-            } else if (*st.pzOptArg == NUL) {
-                st.pzOptArg = zNil;
-            } else {
-                AGDUPSTR( st.pzOptArg, st.pzOptArg, "option argument" );
-                st.flags |= OPTST_ALLOC_ARG;
-            }
-        }
+        checkEnvOpt(&st, zEnvName, pOpts, type);
+    }
 
-        handleOption( pOpts, &st );
+    /*
+     *  Special handling for ${PROGNAME_LOAD_OPTS}
+     */
+    if (pOpts->specOptIdx.save_opts != 0) {
+        st.pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts + 1;
+        strcpy( pzFlagName, st.pOD->pz_NAME );
+        checkEnvOpt(&st, zEnvName, pOpts, type);
     }
 }
 
index a3fcd0fe200bce99b12733aeddc86e1cabc974a3..de098a565ac586379e7598f75415129acc59099f 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (genshell.c)
  *  
- *  It has been AutoGen-ed  Saturday February 17, 2007 at 12:49:35 PM PST
+ *  It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:35 PM PDT
  *  From the definitions    genshell.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -20,7 +20,7 @@
  *
  * This source file is copyrighted and licensed under the following terms:
  *
- * genshellopt copyright 1999-2006 Bruce Korb - all rights reserved
+ * genshellopt copyright 1999-2007 Bruce Korb - all rights reserved
  *
  * genshellopt is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -49,7 +49,7 @@
 extern "C" {
 #endif
 tSCC zCopyright[] =
-       "genshellopt copyright (c) 1999-2006 Bruce Korb, all rights reserved";
+       "genshellopt copyright (c) 1999-2007 Bruce Korb, all rights reserved";
 tSCC zCopyrightNotice[] =
        "genshellopt is free software; you can redistribute it and/or\n\
 modify it under the terms of the GNU Lesser General Public\n\
@@ -145,12 +145,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zShellText, zShell_NAME, zShell_Name,
      /* disablement strs */ zNotShell_Name, zNotShell_Pfx },
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+#  define VERSION_OPT_FLAGS     OPTST_IMM | OPTST_NO_INIT
+#else
+#  define VERSION_OPT_FLAGS     OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+                                OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
+#endif
+
   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL | OPTST_IMM, 0,
+     /* opt state flags  */ VERSION_OPT_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -158,11 +164,14 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
      /* disablement strs */ NULL, NULL },
 
+#undef VERSION_OPT_FLAGS
+
+
   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -174,7 +183,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -204,7 +213,7 @@ If the script file already exists and contains Automated Option Processing\n\
 text, the second line of the file through the ending tag will be replaced\n\
 by the newly generated text.  The first `#!' line will be regenerated.\n";
 tSCC    zFullVersion[] = GENSHELLOPT_FULL_VERSION;
-/* extracted from optcode.tpl near line 378 */
+/* extracted from optcode.tpl near line 408 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -241,7 +250,7 @@ tOptions genshelloptOptions = {
       NO_EQUIVALENT /* index of '-#' option */,
       NO_EQUIVALENT /* index of default opt */
     },
-    OPTION_CT, 2 /* user option count */
+    5 /* full option count */, 2 /* user option count */
 };
 
 /*
@@ -254,7 +263,7 @@ doUsageOpt(
 {
     USAGE( EXIT_SUCCESS );
 }
-/* extracted from optcode.tpl near line 475 */
+/* extracted from optcode.tpl near line 514 */
 
 #if ENABLE_NLS
 #include <stdio.h>
index af177d1779b4d6195f5ea2f304459b82dd1dd95b..b57677dce59f178d3fc502900f065903eaea769c 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (genshell.h)
  *  
- *  It has been AutoGen-ed  Saturday February 17, 2007 at 12:49:35 PM PST
+ *  It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:35 PM PDT
  *  From the definitions    genshell.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -20,7 +20,7 @@
  *
  * This source file is copyrighted and licensed under the following terms:
  *
- * genshellopt copyright 1999-2006 Bruce Korb - all rights reserved
+ * genshellopt copyright 1999-2007 Bruce Korb - all rights reserved
  *
  * genshellopt is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -55,7 +55,7 @@
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 114688
+#define AO_TEMPLATE_VERSION 118784
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
@@ -117,7 +117,7 @@ typedef enum {
                 genshelloptOptions.pzCurOpt  = NULL )
 #define START_OPT       RESTART_OPT(1)
 #define USAGE(c)        (*genshelloptOptions.pUsageProc)( &genshelloptOptions, c )
-/* extracted from opthead.tpl near line 345 */
+/* extracted from opthead.tpl near line 360 */
 
 /* * * * * *
  *
index 85f555ba05e658d4e305c74302f754b7beb741b5..adc3235d25d3cfec027b7b15e8ce425a83578f3c 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  Saturday February 17, 2007 at 12:49:37 PM PST
+dnl It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:37 PM PDT
 dnl From the definitions    libopts.def
 dnl and the template file   conftest.tpl
 dnl
@@ -25,7 +25,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
   AC_CHECK_HEADERS(dlfcn.h errno.h fcntl.h libgen.h memory.h netinet/in.h \
     setjmp.h sys/mman.h sys/param.h sys/poll.h sys/procset.h sys/select.h \
     sys/socket.h sys/stropts.h sys/time.h sys/un.h sys/wait.h unistd.h    \
-    utime.h )
+    utime.h sysexits.h)
   
   # --------------------------------------------
   # Verify certain entries from AC_CHECK_HEADERS
@@ -370,6 +370,23 @@ return (fp == NULL) ? 1 : fclose(fp); }],
 ]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_TEXT
 
 
+AC_DEFUN([LIBOPTS_DISABLE_OPTIONAL_ARGS],[
+  AC_ARG_ENABLE([optional-args],
+    AC_HELP_STRING([--disable-optional-args], [not wanting optional option args]),
+    [libopts_cv_enable_optional_args=${enable_optional_args}],
+    AC_CACHE_CHECK([whether not wanting optional option args], libopts_cv_enable_optional_args,
+      libopts_cv_enable_optional_args=yes)
+  ) # end of AC_ARG_ENABLE
+
+  if test "X${libopts_cv_enable_optional_args}" = Xno
+  then
+    AC_DEFINE([NO_OPTIONAL_OPT_ARGS], [1],
+          [Define this if optional arguments are disallowed])
+  fi
+  
+]) # end of AC_DEFUN of LIBOPTS_DISABLE_OPTIONAL_ARGS
+
+
 AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   INVOKE_LIBOPTS_MACROS_FIRST
   # Check to see if a reg expr header is specified.
@@ -396,6 +413,9 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   # Check to see if fopen accepts "t" mode.
   LIBOPTS_RUN_FOPEN_TEXT
 
+  # Check to see if not wanting optional option args.
+  LIBOPTS_DISABLE_OPTIONAL_ARGS
+
 ]) # end AC_DEFUN of INVOKE_LIBOPTS_MACROS
 
 dnl @synopsis  LIBOPTS_CHECK
index 384ef257a1b50d46e785a44295d8cece35049464..c417c63d5c5fc7f40cc85b652d832850c08aadc3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: pgusage.c,v 4.11 2006/09/24 02:11:16 bkorb Exp $
+ *  $Id: pgusage.c,v 4.12 2007/04/28 22:19:23 bkorb Exp $
  * Time-stamp:      "2006-07-16 08:13:26 bkorb"
  *
  *   Automated Options Paged Usage module.
@@ -10,7 +10,7 @@
  */
 
 /*
- *  Automated Options copyright 1992-2006 Bruce Korb
+ *  Automated Options copyright 1992-2007 Bruce Korb
  *
  *  Automated Options is free software.
  *  You may redistribute it and/or modify it under the terms of the
index 0ab75f65a4165b9dd2299e4ac0374848db394e41..e87ab87bd089dda57e7204f43b05d5db1a7471ff 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- buffer-read-only: t -*- vi: set ro:
  *
  * Prototypes for autoopts
- * Generated Sat Feb 17 12:49:36 PST 2007
+ * Generated Sat May  5 12:02:36 PDT 2007
  */
 #ifndef AUTOOPTS_PROTO_H_GUARD
 #define AUTOOPTS_PROTO_H_GUARD 1
index a6fd5634fa67c5763985a898fda16ad370ac1aa8..22b0888032c7841a28a6e21c6a62018d49f6fa67 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  save.c  $Id: save.c,v 4.17 2007/02/04 17:44:12 bkorb Exp $
- * Time-stamp:      "2007-01-13 10:32:27 bkorb"
+ *  save.c  $Id: save.c,v 4.18 2007/04/15 19:01:18 bkorb Exp $
+ * Time-stamp:      "2007-04-15 11:11:10 bkorb"
  *
  *  This module's routines will take the currently set options and
  *  store them into an ".rc" file for re-interpretation the next
index 8ca6860c662f57a599a8bfc47c8fe9076d241937..ead71337276eaabc8920991336805c53b477ca7b 100644 (file)
@@ -1,13 +1,13 @@
 
 /*
- *  sort.c  $Id: sort.c,v 4.9 2006/10/21 15:42:49 bkorb Exp $
+ *  sort.c  $Id: sort.c,v 4.10 2007/04/28 22:19:23 bkorb Exp $
  * Time-stamp:      "2006-10-18 11:29:04 bkorb"
  *
  *  This module implements argument sorting.
  */
 
 /*
- *  Automated Options copyright 1992-2006 Bruce Korb
+ *  Automated Options copyright 1992-2007 Bruce Korb
  *
  *  Automated Options is free software.
  *  You may redistribute it and/or modify it under the terms of the
index 166ba8abd0c8431689db93dffb55d2f45a336dcd..8249794e0e00282eb464c7803ceba3279ef63b61 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: streqvcmp.c,v 4.9 2006/09/24 02:11:16 bkorb Exp $
+ *  $Id: streqvcmp.c,v 4.10 2007/04/28 22:19:23 bkorb Exp $
  * Time-stamp:      "2006-07-26 18:25:53 bkorb"
  *
  *  String Equivalence Comparison
@@ -12,7 +12,7 @@
  */
 
 /*
- *  Automated Options copyright 1992-2006 Bruce Korb
+ *  Automated Options copyright 1992-2007 Bruce Korb
  *
  *  Automated Options is free software.
  *  You may redistribute it and/or modify it under the terms of the
index d8b9b6476c81a2d1fd4a192cadce24521166f081..960339b63cbc43b1f090c4f87dae193d88d60a43 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  usage.c  $Id: usage.c,v 4.13 2006/11/27 01:52:23 bkorb Exp $
- * Time-stamp:      "2006-07-01 12:41:02 bkorb"
+ *  usage.c  $Id: usage.c,v 4.15 2007/04/28 22:19:23 bkorb Exp $
+ * Time-stamp:      "2007-04-15 11:02:46 bkorb"
  *
  *  This module implements the default usage procedure for
  *  Automated Options.  It may be overridden, of course.
@@ -13,7 +13,7 @@
  */
 
 /*
- *  Automated Options copyright 1992-2006 Bruce Korb
+ *  Automated Options copyright 1992-2007 Bruce Korb
  *
  *  Automated Options is free software.
  *  You may redistribute it and/or modify it under the terms of the
@@ -169,12 +169,18 @@ optionOnlyUsage(
  *  formats.  The descriptor specifies the default, but AUTOOPTS_USAGE will
  *  over-ride this, providing the value of it is set to either "gnu" or
  *  "autoopts".  This routine will @strong{not} return.
+ *
+ *  If "exitCode" is "EX_USAGE" (normally 64), then output will to to stdout
+ *  and the actual exit code will be "EXIT_SUCCESS".
 =*/
 void
 optionUsage(
     tOptions* pOptions,
-    int       exitCode )
+    int       usage_exit_code )
 {
+    int actual_exit_code =
+        (usage_exit_code == EX_USAGE) ? EXIT_SUCCESS : usage_exit_code;
+
     displayEnum = AG_FALSE;
 
     /*
@@ -183,7 +189,7 @@ optionUsage(
      *  on successful exit (help was requested), otherwise error out.
      */
     if (option_usage_fp == NULL)
-        option_usage_fp = (exitCode != EXIT_SUCCESS) ? stderr : stdout;
+        option_usage_fp = (actual_exit_code != EXIT_SUCCESS) ? stderr : stdout;
 
     fprintf( option_usage_fp, pOptions->pzUsageTitle, pOptions->pzProgName );
 
@@ -207,13 +213,13 @@ optionUsage(
              *  option, we do *NOT* want to emit the column headers.
              *  Otherwise, we do.
              */
-            if (  (exitCode != EXIT_SUCCESS)
+            if (  (usage_exit_code != EXIT_SUCCESS)
                || ((pOptions->pOptDesc->fOptState & OPTST_DOCUMENT) == 0) )
 
                 fputs( pOptTitle, option_usage_fp );
         }
 
-        printOptionUsage( pOptions, exitCode, pOptTitle );
+        printOptionUsage( pOptions, usage_exit_code, pOptTitle );
     }
 
     /*
@@ -241,14 +247,14 @@ optionUsage(
      *  IF the user is asking for help (thus exiting with SUCCESS),
      *  THEN see what additional information we can provide.
      */
-    if (exitCode == EXIT_SUCCESS)
+    if (usage_exit_code == EXIT_SUCCESS)
         printProgramDetails( pOptions );
 
     if (pOptions->pzBugAddr != NULL)
         fprintf( option_usage_fp, zPlsSendBugs, pOptions->pzBugAddr );
     fflush( option_usage_fp );
 
-    exit( exitCode );
+    exit( actual_exit_code );
 }
 
 
@@ -344,12 +350,15 @@ printExtendedUsage(
     /*
      *  IF this particular option can NOT be preset
      *    AND some form of presetting IS allowed,
+     *    AND it is not an auto-managed option (e.g. --help, et al.)
      *  THEN advise that this option may not be preset.
      */
     if (  ((pOD->fOptState & OPTST_NO_INIT) != 0)
        && (  (pOptions->papzHomeList != NULL)
           || (pOptions->pzPROGNAME != NULL)
-       )  )
+          )
+       && (pOD->optIndex < pOptions->presetOptCt)
+       )
 
         fputs( zNoPreset, option_usage_fp );
 
@@ -509,7 +518,7 @@ printOneUsage(
 
  bogus_desc:
     fprintf( stderr, zInvalOptDesc, pOD->pz_Name );
-    exit( EXIT_FAILURE );
+    exit( EX_SOFTWARE );
 }
 
 
index a3936540fc03b754cf11b4d4ff6345c25667f259..85949d5d3f3b2638cbcc85419e94e418ceca4047 100644 (file)
@@ -1,13 +1,13 @@
 
-/*  $Id: version.c,v 4.9 2006/09/24 02:11:16 bkorb Exp $
- * Time-stamp:      "2006-09-22 18:15:00 bkorb"
+/*  $Id: version.c,v 4.10 2007/04/28 22:19:23 bkorb Exp $
+ * Time-stamp:      "2007-04-28 10:08:34 bkorb"
  *
  *  This module implements the default usage procedure for
  *  Automated Options.  It may be overridden, of course.
  */
 
 static char const zAOV[] =
-    "Automated Options version %s, copyright (c) 1999-2006 Bruce Korb\n";
+    "Automated Options version %s, copyright (c) 1999-2007 Bruce Korb\n";
 
 /*  Automated Options is free software.
  *  You may redistribute it and/or modify it under the terms of the
@@ -79,9 +79,14 @@ printVersion( tOptions* pOpts, tOptDesc* pOD, FILE* fp )
 {
     char swCh;
 
-    if (pOD->optArg.argString == NULL)
+    /*
+     *  IF the optional argument flag is off, or the argument is not provided,
+     *  then just print the version.
+     */
+    if (  ((pOD->fOptState & OPTST_ARG_OPTIONAL) == 0)
+       || (pOD->optArg.argString == NULL))
          swCh = 'v';
-    else swCh = pOD->optArg.argString[0];
+    else swCh = tolower(pOD->optArg.argString[0]);
 
     if (pOpts->pzFullVersion != NULL) {
         fputs( pOpts->pzFullVersion, fp );
@@ -89,17 +94,15 @@ printVersion( tOptions* pOpts, tOptDesc* pOD, FILE* fp )
 
     } else {
         char const *pz = pOpts->pzUsageTitle;
-        do { fputc( *pz, fp ); } while (*(pz++) != '\n');
+        do { fputc(*pz, fp); } while (*(pz++) != '\n');
     }
 
     switch (swCh) {
-    case NUL:
+    case NUL: /* arg provided, but empty */
     case 'v':
-    case 'V':
         break;
 
     case 'c':
-    case 'C':
         if (pOpts->pzCopyright != NULL) {
             fputs( pOpts->pzCopyright, fp );
             fputc( '\n', fp );
@@ -110,7 +113,6 @@ printVersion( tOptions* pOpts, tOptDesc* pOD, FILE* fp )
         break;
 
     case 'n':
-    case 'N':
         if (pOpts->pzCopyright != NULL) {
             fputs( pOpts->pzCopyright, fp );
             fputc( '\n', fp );
index 5b6bfe1779389fcc4860e96753792f1edc2f174c..ce3b243e39c00ceed712a18c8ad95fbd6fae12e7 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (ntpd-opts.c)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 06:56:46 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:24:52 AM EDT
  *  From the definitions    ntpd-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -38,7 +38,7 @@ tSCC zCopyright[] =
        "ntpd copyright (c) 1970-2006 ntp.org, all rights reserved";
 tSCC zCopyrightNotice[] =
        
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from /deacon/backroom/ntp-stable-hms/include/copyright.def near line 8 */
 "see html/copyright.html";
 extern tUsageProc optionUsage;
 
@@ -783,12 +783,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zSlewText, zSlew_NAME, zSlew_Name,
      /* disablement strs */ NULL, NULL },
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+#  define VERSION_OPT_FLAGS     OPTST_IMM | OPTST_NO_INIT
+#else
+#  define VERSION_OPT_FLAGS     OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+                                OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
+#endif
+
   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL | OPTST_IMM, 0,
+     /* opt state flags  */ VERSION_OPT_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -796,11 +802,14 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
      /* disablement strs */ NULL, NULL },
 
+#undef VERSION_OPT_FLAGS
+
+
   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -812,7 +821,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -836,7 +845,7 @@ tSCC   zBugsAddr[]    = "http://bugs.ntp.isc.org, bugs@ntp.org";
 #define zExplain NULL
 tSCC    zDetail[]     = "\n\n";
 tSCC    zFullVersion[] = NTPD_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 378 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 408 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -873,7 +882,7 @@ tOptions ntpdOptions = {
       NO_EQUIVALENT /* index of '-#' option */,
       NO_EQUIVALENT /* index of default opt */
     },
-    OPTION_CT, 29 /* user option count */
+    32 /* full option count */, 29 /* user option count */
 };
 
 /*
@@ -899,7 +908,7 @@ doOptSet_Debug_Level(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from ../include/debug-opt.def, line 29 */
+    /* extracted from /deacon/backroom/ntp-stable-hms/include/debug-opt.def, line 29 */
 DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
 }
 #endif /* defined DEBUG */
@@ -922,7 +931,7 @@ main( int argc, char** argv )
     return res;
 }
 #endif  /* defined TEST_NTPD_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 475 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 514 */
 
 #if ENABLE_NLS
 #include <stdio.h>
index b39cab75ea26b49cdbf2fedf2fcfa0f33830c759..3d3df4d588851a6b380fa7b4ce72f9ea726a6f36 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (ntpd-opts.h)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 06:56:46 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:24:51 AM EDT
  *  From the definitions    ntpd-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -42,7 +42,7 @@
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 114688
+#define AO_TEMPLATE_VERSION 118784
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
@@ -320,7 +320,7 @@ typedef enum {
                 ntpdOptions.pzCurOpt  = NULL )
 #define START_OPT       RESTART_OPT(1)
 #define USAGE(c)        (*ntpdOptions.pUsageProc)( &ntpdOptions, c )
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 345 */
+/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
 
 /* * * * * *
  *
index 62f1592d34e0e4f997c5b1bb8a3294b36c1a9a50..1ef390dae3b2aa5dc7240d74e1ae8b1d116df198 100644 (file)
@@ -7,7 +7,7 @@
 # 
 # DO NOT EDIT THIS FILE   (ntpd-opts.texi)
 # 
-# It has been AutoGen-ed  Saturday April 14, 2007 at 06:56:49 PM EDT
+# It has been AutoGen-ed  Saturday May 19, 2007 at 02:19:06 AM EDT
 # From the definitions    ntpd-opts.def
 # and the template file   aginfo.tpl
 @end ignore
@@ -61,7 +61,7 @@ This is the automatically generated usage text for ntpd:
 
 @exampleindent 0
 @example
-ntpd - NTP daemon program - Ver. 4.2.5p20
+ntpd - NTP daemon program - Ver. 4.2.5p29
 USAGE:  ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
   Flg Arg Option-Name    Description
    -4 no  ipv4           Force IPv4 DNS name resolution
@@ -106,17 +106,11 @@ USAGE:  ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
    -v opt version        Output version information and exit
    -? no  help           Display usage information and exit
    -! no  more-help      Extended usage information passed thru pager
-   -> opt save-opts      Save the option state to a config file
-   -< Str load-opts      Load options from a config file
-                                - disabled as --no-load-opts
-                                - may appear multiple times
 
 Options are specified by doubled hyphens and their name
 or by a single hyphen and the flag character.
 
 The following option preset mechanisms are supported:
- - reading file /users/stenn/.ntprc
- - reading file /deacon/backroom/snaps/ntp-stable/ntpd/.ntprc
  - examining environment variables named NTPD_*
 
 
index ab4d2c6cc0687dc8f159ec9c5f555c239a06419d..5eea262038c1e67299675b3a294bf854bad77113 100644 (file)
@@ -1,7 +1,7 @@
-.TH NTPD 1 2007-04-14 "( 4.2.4p2-RC1)" "Programmer's Manual"
+.TH NTPD 1 2007-05-19 "( 4.2.4p2-RC1)" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (ntpd.1)
 .\"  
-.\"  It has been AutoGen-ed  Saturday April 14, 2007 at 06:56:48 PM EDT
+.\"  It has been AutoGen-ed  Saturday May 19, 2007 at 02:19:05 AM EDT
 .\"  From the definitions    ntpd-opts.def
 .\"  and the template file   agman1.tpl
 .\"
index eebecaef2eca42b392f329c5fba3ee81a0c7366d..05d9ea6f31420f3835929a49d81c31e08d511b01 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (ntpdsim-opts.c)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 06:56:51 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:24:56 AM EDT
  *  From the definitions    ntpdsim-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -38,7 +38,7 @@ tSCC zCopyright[] =
        "ntpdsim copyright (c) 1970-2006 ntp.org, all rights reserved";
 tSCC zCopyrightNotice[] =
        
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from /deacon/backroom/ntp-stable-hms/include/copyright.def near line 8 */
 "see html/copyright.html";
 extern tUsageProc optionUsage;
 
@@ -994,12 +994,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zPdelayText, zPdelay_NAME, zPdelay_Name,
      /* disablement strs */ NULL, NULL },
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+#  define VERSION_OPT_FLAGS     OPTST_IMM | OPTST_NO_INIT
+#else
+#  define VERSION_OPT_FLAGS     OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+                                OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
+#endif
+
   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL | OPTST_IMM, 0,
+     /* opt state flags  */ VERSION_OPT_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -1007,11 +1013,14 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
      /* disablement strs */ NULL, NULL },
 
+#undef VERSION_OPT_FLAGS
+
+
   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -1023,7 +1032,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -1036,7 +1045,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL, 0,
+                          | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -1048,8 +1057,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, NOLIMIT, 0,
-     /* opt state flags  */ OPTST_DISABLE_IMM | \
-                       OPTST_SET_ARGTYPE(OPARG_TYPE_STRING), 0,
+     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) \
+                         | OPTST_DISABLE_IMM, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -1076,7 +1085,7 @@ tSCC   zBugsAddr[]    = "http://bugs.ntp.isc.org, bugs@ntp.org";
 #define zExplain NULL
 tSCC    zDetail[]     = "\n\n";
 tSCC    zFullVersion[] = NTPDSIM_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 378 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 408 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -1114,7 +1123,7 @@ tOptions ntpdsimOptions = {
       NO_EQUIVALENT /* index of '-#' option */,
       NO_EQUIVALENT /* index of default opt */
     },
-    OPTION_CT, 38 /* user option count */
+    43 /* full option count */, 38 /* user option count */
 };
 
 /*
@@ -1140,7 +1149,7 @@ doOptSet_Debug_Level(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from ../include/debug-opt.def, line 29 */
+    /* extracted from /deacon/backroom/ntp-stable-hms/include/debug-opt.def, line 29 */
 DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
 }
 #endif /* defined DEBUG */
@@ -1163,7 +1172,7 @@ main( int argc, char** argv )
     return res;
 }
 #endif  /* defined TEST_NTPDSIM_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 475 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 514 */
 
 #if ENABLE_NLS
 #include <stdio.h>
index 74ac6fa19dee82045c630c91436e6354d8d336f6..5b60e0493820a7dac74e31d6913990062b38d58f 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (ntpdsim-opts.h)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 06:56:51 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:24:55 AM EDT
  *  From the definitions    ntpdsim-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -42,7 +42,7 @@
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 114688
+#define AO_TEMPLATE_VERSION 118784
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
@@ -373,10 +373,10 @@ typedef enum {
 #define VALUE_OPT_PDELAY         'Z'
 
 #define VALUE_OPT_VERSION       'v'
-#define VALUE_OPT_SAVE_OPTS     '>'
-#define VALUE_OPT_LOAD_OPTS     '<'
 #define VALUE_OPT_HELP          '?'
 #define VALUE_OPT_MORE_HELP     '!'
+#define VALUE_OPT_SAVE_OPTS     '>'
+#define VALUE_OPT_LOAD_OPTS     '<'
 #define SET_OPT_SAVE_OPTS(a)   STMTS( \
         DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
         DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
@@ -391,7 +391,7 @@ typedef enum {
                 ntpdsimOptions.pzCurOpt  = NULL )
 #define START_OPT       RESTART_OPT(1)
 #define USAGE(c)        (*ntpdsimOptions.pUsageProc)( &ntpdsimOptions, c )
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 345 */
+/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
 
 /* * * * * *
  *
index 8c08bba7305d848ced9396cebfde46cf2d135d63..3f85f61f9c17ec649d7a4d7a349b440d8b7e0c9a 100644 (file)
@@ -7,7 +7,7 @@
 # 
 # DO NOT EDIT THIS FILE   (ntpdsim-opts.texi)
 # 
-# It has been AutoGen-ed  Saturday April 14, 2007 at 06:56:54 PM EDT
+# It has been AutoGen-ed  Saturday May 19, 2007 at 02:19:14 AM EDT
 # From the definitions    ntpdsim-opts.def
 # and the template file   aginfo.tpl
 @end ignore
index dd34157d69917befce97ee10a5ed9c0693e8c2fd..2f9f760c8d50aafa2afcbc918aa01a3dcc6d7160 100644 (file)
@@ -1,7 +1,7 @@
-.TH NTPDSIM 1 2007-04-14 "( 4.2.4p2-RC1)" "Programmer's Manual"
+.TH NTPDSIM 1 2007-05-19 "( 4.2.4p2-RC1)" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (ntpdsim.1)
 .\"  
-.\"  It has been AutoGen-ed  Saturday April 14, 2007 at 06:56:53 PM EDT
+.\"  It has been AutoGen-ed  Saturday May 19, 2007 at 02:19:13 AM EDT
 .\"  From the definitions    ntpdsim-opts.def
 .\"  and the template file   agman1.tpl
 .\"
index 01ac5635163f8d827c817bac5c46611176513143..ad5e303fff86a577bcd2229663bb86f6ef244bee 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (ntpdc-opts.c)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 07:03:03 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:24:59 AM EDT
  *  From the definitions    ntpdc-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -38,7 +38,7 @@ tSCC zCopyright[] =
        "ntpdc copyright (c) 1970-2006 ntp.org, all rights reserved";
 tSCC zCopyrightNotice[] =
        
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from /deacon/backroom/ntp-stable-hms/include/copyright.def near line 8 */
 "see html/copyright.html";
 extern tUsageProc optionUsage;
 
@@ -384,12 +384,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zNumericText, zNumeric_NAME, zNumeric_Name,
      /* disablement strs */ NULL, NULL },
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+#  define VERSION_OPT_FLAGS     OPTST_IMM | OPTST_NO_INIT
+#else
+#  define VERSION_OPT_FLAGS     OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+                                OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
+#endif
+
   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL | OPTST_IMM, 0,
+     /* opt state flags  */ VERSION_OPT_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -397,11 +403,14 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
      /* disablement strs */ NULL, NULL },
 
+#undef VERSION_OPT_FLAGS
+
+
   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -413,7 +422,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -426,7 +435,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL, 0,
+                          | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -438,8 +447,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, NOLIMIT, 0,
-     /* opt state flags  */ OPTST_DISABLE_IMM | \
-                       OPTST_SET_ARGTYPE(OPARG_TYPE_STRING), 0,
+     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) \
+                         | OPTST_DISABLE_IMM, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -482,7 +491,7 @@ configuration options which can be specified at startup using\n\
 ntpd's configuration file may also be specified at run time using\n\
 [= prog-name =] .\n";
 tSCC    zFullVersion[] = NTPDC_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 378 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 408 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -519,7 +528,7 @@ tOptions ntpdcOptions = {
       NO_EQUIVALENT /* index of '-#' option */,
       NO_EQUIVALENT /* index of default opt */
     },
-    OPTION_CT, 10 /* user option count */
+    15 /* full option count */, 10 /* user option count */
 };
 
 /*
@@ -545,7 +554,7 @@ doOptSet_Debug_Level(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from ../include/debug-opt.def, line 29 */
+    /* extracted from /deacon/backroom/ntp-stable-hms/include/debug-opt.def, line 29 */
 DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
 }
 #endif /* defined DEBUG */
@@ -568,7 +577,7 @@ main( int argc, char** argv )
     return res;
 }
 #endif  /* defined TEST_NTPDC_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 475 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 514 */
 
 #if ENABLE_NLS
 #include <stdio.h>
index 73f7ba391aaec362940c5cfa7aeed1902f21e524..7b3aeab4310b4cafbf9f0d0c63d86f5f96c8e1e6 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (ntpdc-opts.h)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 07:03:02 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:24:58 AM EDT
  *  From the definitions    ntpdc-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -42,7 +42,7 @@
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 114688
+#define AO_TEMPLATE_VERSION 118784
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
@@ -173,10 +173,10 @@ typedef enum {
 #define VALUE_OPT_NUMERIC        'n'
 
 #define VALUE_OPT_VERSION       'v'
-#define VALUE_OPT_SAVE_OPTS     '>'
-#define VALUE_OPT_LOAD_OPTS     '<'
 #define VALUE_OPT_HELP          '?'
 #define VALUE_OPT_MORE_HELP     '!'
+#define VALUE_OPT_SAVE_OPTS     '>'
+#define VALUE_OPT_LOAD_OPTS     '<'
 #define SET_OPT_SAVE_OPTS(a)   STMTS( \
         DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
         DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
@@ -191,7 +191,7 @@ typedef enum {
                 ntpdcOptions.pzCurOpt  = NULL )
 #define START_OPT       RESTART_OPT(1)
 #define USAGE(c)        (*ntpdcOptions.pUsageProc)( &ntpdcOptions, c )
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 345 */
+/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
 
 /* * * * * *
  *
index e7aad93fcf2a23ab492ab9e89080e5e3f9cbba8b..1fc8a8a656dabde25b938c8f20d28a17fa9378ef 100644 (file)
@@ -7,7 +7,7 @@
 # 
 # DO NOT EDIT THIS FILE   (ntpdc-opts.texi)
 # 
-# It has been AutoGen-ed  Saturday April 14, 2007 at 07:03:04 PM EDT
+# It has been AutoGen-ed  Saturday May 19, 2007 at 02:22:00 AM EDT
 # From the definitions    ntpdc-opts.def
 # and the template file   aginfo.tpl
 @end ignore
@@ -59,7 +59,7 @@ This is the automatically generated usage text for ntpdc:
 
 @exampleindent 0
 @example
-ntpdc - vendor-specific NTP query program - Ver. 4.2.5p20
+ntpdc - vendor-specific NTP query program - Ver. 4.2.5p29
 USAGE:  ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
   Flg Arg Option-Name    Description
    -4 no  ipv4           Force IPv4 DNS name resolution
@@ -100,7 +100,7 @@ or by a single hyphen and the flag character.
 
 The following option preset mechanisms are supported:
  - reading file /users/stenn/.ntprc
- - reading file /deacon/backroom/snaps/ntp-stable/ntpdc/.ntprc
+ - reading file /deacon/backroom/ntp-stable-hms/ntpdc/.ntprc
  - examining environment variables named NTPDC_*
 
 The
index b724a742e24abc3fa79b48fda71caaca43421ac1..4b15d79b69e76482b7b8f3d66103192786e3eb08 100644 (file)
@@ -1,7 +1,7 @@
-.TH NTPDC 1 2007-04-14 "( 4.2.4p2-RC1)" "Programmer's Manual"
+.TH NTPDC 1 2007-05-19 "( 4.2.4p2-RC1)" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (ntpdc.1)
 .\"  
-.\"  It has been AutoGen-ed  Saturday April 14, 2007 at 07:03:03 PM EDT
+.\"  It has been AutoGen-ed  Saturday May 19, 2007 at 02:21:59 AM EDT
 .\"  From the definitions    ntpdc-opts.def
 .\"  and the template file   agman1.tpl
 .\"
index d1790975e6c8aad8f9fe4b9a46b19823ec2e3a98..036eb23b8e2295dba148e0950369800dc061361c 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (ntpq-opts.c)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 07:03:32 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:25:02 AM EDT
  *  From the definitions    ntpq-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -38,7 +38,7 @@ tSCC zCopyright[] =
        "ntpq copyright (c) 1970-2006 ntp.org, all rights reserved";
 tSCC zCopyrightNotice[] =
        
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from /deacon/backroom/ntp-stable-hms/include/copyright.def near line 8 */
 "see html/copyright.html";
 extern tUsageProc optionUsage;
 
@@ -332,12 +332,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zNumericText, zNumeric_NAME, zNumeric_Name,
      /* disablement strs */ NULL, NULL },
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+#  define VERSION_OPT_FLAGS     OPTST_IMM | OPTST_NO_INIT
+#else
+#  define VERSION_OPT_FLAGS     OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+                                OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
+#endif
+
   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL | OPTST_IMM, 0,
+     /* opt state flags  */ VERSION_OPT_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -345,11 +351,14 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
      /* disablement strs */ NULL, NULL },
 
+#undef VERSION_OPT_FLAGS
+
+
   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -361,7 +370,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -374,7 +383,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL, 0,
+                          | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -386,8 +395,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, NOLIMIT, 0,
-     /* opt state flags  */ OPTST_DISABLE_IMM | \
-                       OPTST_SET_ARGTYPE(OPARG_TYPE_STRING), 0,
+     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) \
+                         | OPTST_DISABLE_IMM, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -422,7 +431,7 @@ information about current state and/or changes in that state.\n\
 The same formats are used in NTPv4, although some of the\n\
 variables have changed and new ones added.\n";
 tSCC    zFullVersion[] = NTPQ_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 378 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 408 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -459,7 +468,7 @@ tOptions ntpqOptions = {
       NO_EQUIVALENT /* index of '-#' option */,
       NO_EQUIVALENT /* index of default opt */
     },
-    OPTION_CT, 8 /* user option count */
+    13 /* full option count */, 8 /* user option count */
 };
 
 /*
@@ -485,7 +494,7 @@ doOptSet_Debug_Level(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from ../include/debug-opt.def, line 29 */
+    /* extracted from /deacon/backroom/ntp-stable-hms/include/debug-opt.def, line 29 */
 DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
 }
 #endif /* defined DEBUG */
@@ -508,7 +517,7 @@ main( int argc, char** argv )
     return res;
 }
 #endif  /* defined TEST_NTPQ_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 475 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 514 */
 
 #if ENABLE_NLS
 #include <stdio.h>
index 37ff31f5471b7b7653388f71ef3f69bbb12b1b22..250401ec890a96a26ceba6ce6a8aebf735c259bb 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (ntpq-opts.h)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 07:03:32 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:25:00 AM EDT
  *  From the definitions    ntpq-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -42,7 +42,7 @@
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 114688
+#define AO_TEMPLATE_VERSION 118784
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
@@ -159,10 +159,10 @@ typedef enum {
 #define VALUE_OPT_NUMERIC        'n'
 
 #define VALUE_OPT_VERSION       'v'
-#define VALUE_OPT_SAVE_OPTS     '>'
-#define VALUE_OPT_LOAD_OPTS     '<'
 #define VALUE_OPT_HELP          '?'
 #define VALUE_OPT_MORE_HELP     '!'
+#define VALUE_OPT_SAVE_OPTS     '>'
+#define VALUE_OPT_LOAD_OPTS     '<'
 #define SET_OPT_SAVE_OPTS(a)   STMTS( \
         DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
         DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
@@ -177,7 +177,7 @@ typedef enum {
                 ntpqOptions.pzCurOpt  = NULL )
 #define START_OPT       RESTART_OPT(1)
 #define USAGE(c)        (*ntpqOptions.pUsageProc)( &ntpqOptions, c )
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 345 */
+/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
 
 /* * * * * *
  *
index 29bb273455eff70d6123c31f8cdfb090f9bf88df..a10bcf5f48bd8b30b36f04d88fe74ee5800ed390 100644 (file)
@@ -7,7 +7,7 @@
 # 
 # DO NOT EDIT THIS FILE   (ntpq-opts.texi)
 # 
-# It has been AutoGen-ed  Saturday April 14, 2007 at 07:03:34 PM EDT
+# It has been AutoGen-ed  Saturday May 19, 2007 at 02:22:43 AM EDT
 # From the definitions    ntpq-opts.def
 # and the template file   aginfo.tpl
 @end ignore
@@ -47,7 +47,7 @@ This is the automatically generated usage text for ntpq:
 
 @exampleindent 0
 @example
-ntpq - standard NTP query program - Ver. 4.2.5p20
+ntpq - standard NTP query program - Ver. 4.2.5p29
 USAGE:  ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
   Flg Arg Option-Name    Description
    -4 no  ipv4           Force IPv4 DNS name resolution
@@ -80,7 +80,7 @@ or by a single hyphen and the flag character.
 
 The following option preset mechanisms are supported:
  - reading file /users/stenn/.ntprc
- - reading file /deacon/backroom/snaps/ntp-stable/ntpq/.ntprc
+ - reading file /deacon/backroom/ntp-stable-hms/ntpq/.ntprc
  - examining environment variables named NTPQ_*
 
 The
index e1c6c1a6cacfb2784a71d822b50aade679219b4c..ea0d893246201ffbf63a8025c2cc05c61d79b2cf 100644 (file)
@@ -1,7 +1,7 @@
-.TH NTPQ 1 2007-04-14 "( 4.2.4p2-RC1)" "Programmer's Manual"
+.TH NTPQ 1 2007-05-19 "( 4.2.4p2-RC1)" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (ntpq.1)
 .\"  
-.\"  It has been AutoGen-ed  Saturday April 14, 2007 at 07:03:33 PM EDT
+.\"  It has been AutoGen-ed  Saturday May 19, 2007 at 02:22:42 AM EDT
 .\"  From the definitions    ntpq-opts.def
 .\"  and the template file   agman1.tpl
 .\"
index 5c77752211167b8385c0890484d3bd26458a8507..d6f37b76b379112cc73372c7e2ba4218744da101 100644 (file)
@@ -27,5 +27,5 @@ CLTAG=NTP_4_2_0
 # - - rcpoint gets set to 0
 # - - releasecandidate gets set to no
 # - GRONK is for -dev
-rcpoint=GO
+rcpoint=1
 #rcpoint=GRONK
index dfcfb46530db927e8abb6472cc6a1954607204bf..5f13861442217c72936cdac5f9d547e1fffe5c45 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  28:0:3
+libopts_la_LDFLAGS      = -version-info  29:0:4
 EXTRA_DIST              = \
     COPYING.lgpl            COPYING.mbsd            MakeDefs.inc  \
     README                  autoopts/options.h      autoopts/usage-txt.h  \
index 7f426fa974e0f043872cdb680a7bcc306e6ba155..7cbe0b044feb36d608b8e19cf8c3433cc23831d7 100644 (file)
@@ -85,7 +85,7 @@ will need to hand craft the rules for building the library.
 
 LICENSING:
 
-This material is copyright 1993-2006 by Bruce Korb.
+This material is copyright 1993-2007 by Bruce Korb.
 You are licensed to use this under the terms of either
 the GNU Lesser General Public License (see: COPYING.lgpl), or,
 at your option, the modified Berkeley Software Distribution
index 28f93f1c7612168bbe3cc03353aef66c5ef311e4..139841bbb2a19eab09a110e8a6641a1c2be68bff 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: autoopts.c,v 4.23 2007/02/13 19:43:46 bkorb Exp $
- *  Time-stamp:      "2007-02-13 11:26:59 bkorb"
+ *  $Id: autoopts.c,v 4.25 2007/04/15 19:01:18 bkorb Exp $
+ *  Time-stamp:      "2007-04-15 11:10:40 bkorb"
  *
  *  This file contains all of the routines that must be linked into
  *  an executable to use the generated option processing.  The optional
@@ -54,9 +54,6 @@
 
 static char const zNil[] = "";
 
-#define SKIP_RC_FILES(po) \
-    DISABLED_OPT(&((po)->pOptDesc[ (po)->specOptIdx.save_opts+1]))
-
 /* = = = START-STATIC-FORWARD = = = */
 /* static forward declarations maintained by :mkfwd */
 static tSuccess
@@ -697,7 +694,7 @@ nextOption( tOptions* pOpts, tOptState* pOptState )
         case TOPT_DEFAULT:
             fputs( "AutoOpts lib error: defaulted to option with optional arg\n",
                    stderr );
-            exit( EXIT_FAILURE );
+            exit( EX_SOFTWARE );
         }
 
         /*
@@ -830,9 +827,22 @@ doRegularOpts( tOptions* pOpts )
 static tSuccess
 doPresets( tOptions* pOpts )
 {
+    tOptDesc * pOD = NULL;
+
     if (! SUCCESSFUL( doImmediateOpts( pOpts )))
         return FAILURE;
 
+    /*
+     *  IF this option set has a --save-opts option, then it also
+     *  has a --load-opts option.  See if a command line option has disabled
+     *  option presetting.
+     */
+    if (pOpts->specOptIdx.save_opts != 0) {
+        pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts + 1;
+        if (DISABLED_OPT(pOD))
+            return SUCCESS;
+    }
+
     /*
      *  Until we return from this procedure, disable non-presettable opts
      */
@@ -841,13 +851,22 @@ doPresets( tOptions* pOpts )
      *  IF there are no config files,
      *  THEN do any environment presets and leave.
      */
-    if (  (pOpts->papzHomeList == NULL)
-       || SKIP_RC_FILES(pOpts) )  {
+    if (pOpts->papzHomeList == NULL) {
         doEnvPresets( pOpts, ENV_ALL );
     }
     else {
         doEnvPresets( pOpts, ENV_IMM );
-        internalFileLoad( pOpts );
+
+        /*
+         *  Check to see if environment variables have disabled presetting.
+         */
+        if ((pOD != NULL) && ! DISABLED_OPT(pOD))
+            internalFileLoad( pOpts );
+
+        /*
+         *  ${PROGRAM_LOAD_OPTS} value of "no" cannot disable other environment
+         *  variable options.  Only the loading of .rc files.
+         */
         doEnvPresets( pOpts, ENV_NON_IMM );
     }
     pOpts->fOptSet &= ~OPTPROC_PRESETTING;
@@ -1031,7 +1050,7 @@ optionProcess(
     char**     argVect )
 {
     if (! SUCCESSFUL( validateOptionsStruct( pOpts, argVect[0] )))
-        exit( EXIT_FAILURE );
+        exit( EX_SOFTWARE );
 
     /*
      *  Establish the real program name, the program full path,
index f2ac93e9a4617990193edc4a0aa580428e49edc9..2645757eaa1478cd1cf9c8472d5afe4e4939baf2 100644 (file)
@@ -1,8 +1,8 @@
 
 /*
- *  Time-stamp:      "2007-01-17 16:37:34 bkorb"
+ *  Time-stamp:      "2007-04-15 09:59:39 bkorb"
  *
- *  autoopts.h  $Id: autoopts.h,v 4.22 2007/02/04 17:44:12 bkorb Exp $
+ *  autoopts.h  $Id: autoopts.h,v 4.23 2007/04/15 19:01:18 bkorb Exp $
  *  Time-stamp:      "2005-02-14 05:59:50 bkorb"
  *
  *  This file defines all the global structures and special values
 
 #include "compat/compat.h"
 
-#define AO_NAME_LIMIT    127
-#define AO_NAME_SIZE     ((size_t)(AO_NAME_LIMIT + 1))
+#define AO_NAME_LIMIT           127
+#define AO_NAME_SIZE            ((size_t)(AO_NAME_LIMIT + 1))
 
 #ifndef AG_PATH_MAX
 #  ifdef PATH_MAX
-#    define AG_PATH_MAX   ((size_t)PATH_MAX)
+#    define AG_PATH_MAX         ((size_t)PATH_MAX)
 #  else
-#    define AG_PATH_MAX   ((size_t)4096)
+#    define AG_PATH_MAX         ((size_t)4096)
 #  endif
 #else
 #  if defined(PATH_MAX) && (PATH_MAX > MAXPATHLEN)
 #     undef  AG_PATH_MAX
-#     define AG_PATH_MAX  ((size_t)PATH_MAX)
+#     define AG_PATH_MAX        ((size_t)PATH_MAX)
 #  endif
 #endif
 
 #define EXPORT
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
-# define DIRCH '\\'
+# define DIRCH                  '\\'
 #else
-# define DIRCH '/'
+# define DIRCH                  '/'
+#endif
+
+#ifndef EX_NOINPUT
+#  define EX_NOINPUT            66
+#endif
+#ifndef EX_SOFTWARE
+#  define EX_SOFTWARE           70
+#endif
+#ifndef EX_CONFIG
+#  define EX_CONFIG             78
 #endif
 
 /*
  *  Convert the number to a list usable in a printf call
  */
-#define NUM_TO_VER(n)       ((n) >> 12), ((n) >> 7) & 0x001F, (n) & 0x007F
+#define NUM_TO_VER(n)           ((n) >> 12), ((n) >> 7) & 0x001F, (n) & 0x007F
 
 #define NAMED_OPTS(po) \
         (((po)->fOptSet & (OPTPROC_SHORTOPT | OPTPROC_LONGOPT)) == 0)
 #define SKIP_OPT(p)  (((p)->fOptState & (OPTST_DOCUMENT|OPTST_OMITTED)) != 0)
 
 typedef int tDirection;
-#define DIRECTION_PRESET  -1
-#define DIRECTION_PROCESS  1
-#define DIRECTION_CALLED   0
+#define DIRECTION_PRESET        -1
+#define DIRECTION_PROCESS       1
+#define DIRECTION_CALLED        0
 
-#define PROCESSING(d)     ((d)>0)
-#define PRESETTING(d)     ((d)<0)
+#define PROCESSING(d)           ((d)>0)
+#define PRESETTING(d)           ((d)<0)
 
-#define ISNAMECHAR( c )    (isalnum(c) || ((c) == '_') || ((c) == '-'))
+#define ISNAMECHAR( c )         (isalnum(c) || ((c) == '_') || ((c) == '-'))
 
 /*
  *  Procedure success codes
@@ -119,16 +129,16 @@ typedef int tDirection;
 #undef  FAILED
 #undef  HADGLITCH
 
-#define SUCCESS  ((tSuccess) 0)
-#define FAILURE  ((tSuccess)-1)
-#define PROBLEM  ((tSuccess) 1)
+#define SUCCESS                 ((tSuccess) 0)
+#define FAILURE                 ((tSuccess)-1)
+#define PROBLEM                 ((tSuccess) 1)
 
 typedef int tSuccess;
 
-#define SUCCEEDED( p )     ((p) == SUCCESS)
-#define SUCCESSFUL( p )    SUCCEEDED( p )
-#define FAILED( p )        ((p) <  SUCCESS)
-#define HADGLITCH( p )     ((p) >  SUCCESS)
+#define SUCCEEDED( p )          ((p) == SUCCESS)
+#define SUCCESSFUL( p )         SUCCEEDED( p )
+#define FAILED( p )             ((p) <  SUCCESS)
+#define HADGLITCH( p )          ((p) >  SUCCESS)
 
 /*
  *  When loading a line (or block) of text as an option, the value can
@@ -224,10 +234,10 @@ typedef struct {
     tCC*    pzOptFmt;
 } arg_types_t;
 
-#define AGALOC( c, w )        ao_malloc((size_t)c)
-#define AGREALOC( p, c, w )   ao_realloc((void*)p, (size_t)c)
-#define AGFREE( p )           ao_free((void*)p)
-#define AGDUPSTR( p, s, w )   (p = ao_strdup(s))
+#define AGALOC( c, w )          ao_malloc((size_t)c)
+#define AGREALOC( p, c, w )     ao_realloc((void*)p, (size_t)c)
+#define AGFREE( p )             ao_free((void*)p)
+#define AGDUPSTR( p, s, w )     (p = ao_strdup(s))
 
 static void *
 ao_malloc( size_t sz );
@@ -324,26 +334,26 @@ ao_strdup( char const *str );
 #  include <sys/mman.h>
 #else
 #  ifndef  PROT_READ
-#   define PROT_READ    0x01
+#   define PROT_READ            0x01
 #  endif
 #  ifndef  PROT_WRITE
-#   define PROT_WRITE   0x02
+#   define PROT_WRITE           0x02
 #  endif
 #  ifndef  MAP_SHARED
-#   define MAP_SHARED   0x01
+#   define MAP_SHARED           0x01
 #  endif
 #  ifndef  MAP_PRIVATE
-#   define MAP_PRIVATE  0x02
+#   define MAP_PRIVATE          0x02
 #  endif
 #endif
 
 #ifndef MAP_FAILED
-#  define  MAP_FAILED   ((void*)-1)
+#  define  MAP_FAILED           ((void*)-1)
 #endif
 
 #ifndef  _SC_PAGESIZE
 # ifdef  _SC_PAGE_SIZE
-#  define _SC_PAGESIZE _SC_PAGE_SIZE
+#  define _SC_PAGESIZE          _SC_PAGE_SIZE
 # endif
 #endif
 
index db97c72d30c6b7af9481ec4af16d57722f80e9d9..c2ceeb3dbb13610802e0bd0fb655c1aafd52bdb9 100644 (file)
@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (options.h)
  *  
- *  It has been AutoGen-ed  Saturday February 17, 2007 at 12:49:35 PM PST
+ *  It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:34 PM PDT
  *  From the definitions    funcs.def
  *  and the template file   options_h
  *
 # include <sys/limits.h>
 #endif /* HAVE_LIMITS/SYS_LIMITS_H */
 
+#if defined(HAVE_SYSEXITS_H)
+#  include <sysexits.h>
+#endif /* HAVE_SYSEXITS_H */
+
+#ifndef EX_USAGE
+#  define EX_USAGE              64
+#endif
+
 /*
  *  PUBLIC DEFINES
  *
@@ -60,8 +68,8 @@
  *  values for "opt_name" are available.
  */
 
-#define  OPTIONS_STRUCT_VERSION  114688
-#define  OPTIONS_VERSION_STRING  "28:0:3"
+#define  OPTIONS_STRUCT_VERSION  118784
+#define  OPTIONS_VERSION_STRING  "29:0:4"
 #define  OPTIONS_MINIMUM_VERSION 102400
 #define  OPTIONS_MIN_VER_STRING  "25:0:0"
 
@@ -92,28 +100,28 @@ typedef struct optionValue {
  *  Bits in the fOptState option descriptor field.
  */
 typedef enum {
-        OPTST_SET_ID             =   0, /* Set via the "SET_OPT()" macro */
-        OPTST_PRESET_ID          =   1, /* Set via an RC/INI file        */
-        OPTST_DEFINED_ID         =   2, /* Set via a command line option */
-        OPTST_EQUIVALENCE_ID     =   4, /* selected by equiv'ed option   */
-        OPTST_DISABLED_ID        =   5, /* option is in disabled state   */
-        OPTST_ALLOC_ARG_ID       =   6, /* pzOptArg was allocated        */
-        OPTST_NO_INIT_ID         =   8, /* option cannot be preset       */
-        OPTST_NUMBER_OPT_ID      =   9, /* opt value (flag) is any digit */
-        OPTST_STACKED_ID         =  10, /* opt uses optionStackArg proc  */
-        OPTST_INITENABLED_ID     =  11, /* option defaults to enabled    */
-        OPTST_ARG_TYPE_1_ID      =  12, /* bit 1 of arg type enum        */
-        OPTST_ARG_TYPE_2_ID      =  13, /* bit 2 of arg type enum        */
-        OPTST_ARG_TYPE_3_ID      =  14, /* bit 3 of arg type enum        */
-        OPTST_ARG_TYPE_4_ID      =  15, /* bit 4 of arg type enum        */
-        OPTST_ARG_OPTIONAL_ID    =  16, /* the option arg not required   */
-        OPTST_IMM_ID             =  17, /* process opt on first pass     */
-        OPTST_DISABLE_IMM_ID     =  18, /* process disablement immed.    */
-        OPTST_OMITTED_ID         =  19, /* compiled out of program       */
-        OPTST_MUST_SET_ID        =  20, /* must be set or pre-set        */
-        OPTST_DOCUMENT_ID        =  21, /* opt is for doc only           */
-        OPTST_TWICE_ID           =  22, /* process opt twice - imm + reg */
-        OPTST_DISABLE_TWICE_ID   =  23  /* process disabled option twice */
+    OPTST_SET_ID             =   0, /* Set via the "SET_OPT()" macro */
+    OPTST_PRESET_ID          =   1, /* Set via an RC/INI file        */
+    OPTST_DEFINED_ID         =   2, /* Set via a command line option */
+    OPTST_EQUIVALENCE_ID     =   4, /* selected by equiv'ed option   */
+    OPTST_DISABLED_ID        =   5, /* option is in disabled state   */
+    OPTST_ALLOC_ARG_ID       =   6, /* pzOptArg was allocated        */
+    OPTST_NO_INIT_ID         =   8, /* option cannot be preset       */
+    OPTST_NUMBER_OPT_ID      =   9, /* opt value (flag) is any digit */
+    OPTST_STACKED_ID         =  10, /* opt uses optionStackArg proc  */
+    OPTST_INITENABLED_ID     =  11, /* option defaults to enabled    */
+    OPTST_ARG_TYPE_1_ID      =  12, /* bit 1 of arg type enum        */
+    OPTST_ARG_TYPE_2_ID      =  13, /* bit 2 of arg type enum        */
+    OPTST_ARG_TYPE_3_ID      =  14, /* bit 3 of arg type enum        */
+    OPTST_ARG_TYPE_4_ID      =  15, /* bit 4 of arg type enum        */
+    OPTST_ARG_OPTIONAL_ID    =  16, /* the option arg not required   */
+    OPTST_IMM_ID             =  17, /* process opt on first pass     */
+    OPTST_DISABLE_IMM_ID     =  18, /* process disablement immed.    */
+    OPTST_OMITTED_ID         =  19, /* compiled out of program       */
+    OPTST_MUST_SET_ID        =  20, /* must be set or pre-set        */
+    OPTST_DOCUMENT_ID        =  21, /* opt is for doc only           */
+    OPTST_TWICE_ID           =  22, /* process opt twice - imm + reg */
+    OPTST_DISABLE_TWICE_ID   =  23  /* process disabled option twice */
 } opt_state_enum_t;
 
 #define OPTST_INIT           0U
@@ -164,6 +172,11 @@ typedef enum {
         OPTST_ARG_TYPE_3 | \
         OPTST_ARG_TYPE_4 )
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+# undef  OPTST_ARG_OPTIONAL
+# define OPTST_ARG_OPTIONAL   0
+#endif
+
 #define OPTST_PERSISTENT_MASK (~OPTST_MUTABLE_MASK)
 
 #define SELECTED_OPT( pod )   ((pod)->fOptState  & OPTST_SELECTED_MASK)
@@ -186,22 +199,22 @@ typedef enum {
  *  Define the processing state flags
  */
 typedef enum {
-        OPTPROC_LONGOPT_ID       =   0, /* Process long style options      */
-        OPTPROC_SHORTOPT_ID      =   1, /* Process short style "flags"     */
-        OPTPROC_ERRSTOP_ID       =   2, /* Stop on argument errors         */
-        OPTPROC_DISABLEDOPT_ID   =   3, /* Current option is disabled      */
-        OPTPROC_NO_REQ_OPT_ID    =   4, /* no options are required         */
-        OPTPROC_NUM_OPT_ID       =   5, /* there is a number option        */
-        OPTPROC_INITDONE_ID      =   6, /* have initializations been done? */
-        OPTPROC_NEGATIONS_ID     =   7, /* any negation options?           */
-        OPTPROC_ENVIRON_ID       =   8, /* check environment?              */
-        OPTPROC_NO_ARGS_ID       =   9, /* Disallow remaining arguments    */
-        OPTPROC_ARGS_REQ_ID      =  10, /* Require arguments after options */
-        OPTPROC_REORDER_ID       =  11, /* reorder operands after options  */
-        OPTPROC_GNUUSAGE_ID      =  12, /* emit usage in GNU style         */
-        OPTPROC_TRANSLATE_ID     =  13, /* Translate strings in tOptions   */
-        OPTPROC_HAS_IMMED_ID     =  14, /* program defines immed options   */
-        OPTPROC_PRESETTING_ID    =  19  /* opt processing in preset state  */
+    OPTPROC_LONGOPT_ID       =   0, /* Process long style options      */
+    OPTPROC_SHORTOPT_ID      =   1, /* Process short style "flags"     */
+    OPTPROC_ERRSTOP_ID       =   2, /* Stop on argument errors         */
+    OPTPROC_DISABLEDOPT_ID   =   3, /* Current option is disabled      */
+    OPTPROC_NO_REQ_OPT_ID    =   4, /* no options are required         */
+    OPTPROC_NUM_OPT_ID       =   5, /* there is a number option        */
+    OPTPROC_INITDONE_ID      =   6, /* have initializations been done? */
+    OPTPROC_NEGATIONS_ID     =   7, /* any negation options?           */
+    OPTPROC_ENVIRON_ID       =   8, /* check environment?              */
+    OPTPROC_NO_ARGS_ID       =   9, /* Disallow remaining arguments    */
+    OPTPROC_ARGS_REQ_ID      =  10, /* Require arguments after options */
+    OPTPROC_REORDER_ID       =  11, /* reorder operands after options  */
+    OPTPROC_GNUUSAGE_ID      =  12, /* emit usage in GNU style         */
+    OPTPROC_TRANSLATE_ID     =  13, /* Translate strings in tOptions   */
+    OPTPROC_HAS_IMMED_ID     =  14, /* program defines immed options   */
+    OPTPROC_PRESETTING_ID    =  19  /* opt processing in preset state  */
 } optproc_state_enum_t;
 
 #define OPTPROC_NONE         0U
@@ -350,7 +363,7 @@ struct optSpecIndex {
 typedef void (tOptionXlateProc)(void);
 
 struct options {
-    const int           structVersion;
+    int const           structVersion;
     int                 origArgCt;
     char**              origArgVect;
     unsigned int        fOptSet;
@@ -364,7 +377,7 @@ struct options {
     char const* const   pzCopyright;
     char const* const   pzCopyNotice;
     char const* const   pzFullVersion;
-    char const* const*  papzHomeList;
+    char const* const* const papzHomeList;
     char const* const   pzUsageTitle;
     char const* const   pzExplain;
     char const* const   pzDetail;
@@ -378,8 +391,8 @@ struct options {
     tOptionXlateProc*   pTransProc;
 
     tOptSpecIndex       specOptIdx;
-    const int           optCt;
-    const int           presetOptCt;
+    int const           optCt;
+    int const           presetOptCt;
 };
 
 /*
@@ -498,7 +511,7 @@ extern token_list_t* ao_string_tokenize( char const* );
 extern const tOptionValue* configFileLoad( char const* );
 
 
-/* From: configfile.c line 880
+/* From: configfile.c line 883
  *
  * optionFileLoad - Load the locatable config files, in order
  *
@@ -653,7 +666,7 @@ extern const tOptionValue* optionNextValue( const tOptionValue*, const tOptionVa
 extern void optionOnlyUsage( tOptions*, int );
 
 
-/* From: autoopts.c line 993
+/* From: autoopts.c line 1012
  *
  * optionProcess - this is the main option processing routine
  *
index 57fc2603a29dbcc3363e000a103eb7e4d92b4bbb..5aaaa01a66ffda2b0f0629a383fc113720b3c20b 100644 (file)
@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (usage-txt.h)
  *  
- *  It has been AutoGen-ed  Saturday February 17, 2007 at 12:49:33 PM PST
+ *  It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:33 PM PDT
  *  From the definitions    usage-txt.def
  *  and the template file   usage-txt.tpl
  *
index 86fff8e270b5dbb0d4e2cf062284241638a41088..b3bd58ff425397c332c2ecbdcbaf8abd421f3ab9 100644 (file)
@@ -7,7 +7,7 @@
  * Author:           Gary V Vaughan <gvaughan@oranda.demon.co.uk>
  * Created:          Mon Jun 30 15:54:46 1997
  *
- * $Id: compat.h,v 4.15 2007/02/04 22:17:39 bkorb Exp $
+ * $Id: compat.h,v 4.16 2007/04/27 01:10:47 bkorb Exp $
  */
 #ifndef COMPAT_H_GUARD
 #define COMPAT_H_GUARD 1
 #  define MAXPATHLEN PATH_MAX
 #endif /* !MAXPATHLEN && PATH_MAX */
 
+#if !defined (MAXPATHLEN) && defined(_MAX_PATH)
+#  define PATH_MAX _MAX_PATH
+#  define MAXPATHLEN _MAX_PATH
+#endif
+
 #if !defined (MAXPATHLEN)
 #  define MAXPATHLEN ((size_t)4096)
 #endif /* MAXPATHLEN */
index d4f3d2a820624196fc566235ef0682cd30fdca02..2612980bf5a0b3c628c5e3b81790c1a06f8efbc5 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Time-stamp:        "2006-10-14 14:55:09 bkorb"
  *             by: bkorb
- * Last Committed:    $Date: 2006/10/14 22:39:49 $
+ * Last Committed:    $Date: 2007/04/28 22:19:23 $
  */
 #ifndef WINDOWS_CONFIG_HACKERY
 #define WINDOWS_CONFIG_HACKERY 1
@@ -92,6 +92,7 @@ typedef unsigned long uintptr_t;
 /* Include Windows headers */
 #include <windows.h>
 #include <winsock2.h>
+#include <limits.h>
 
 /*
  * Compatibility declarations for Windows, assuming SYS_WINNT
index f3016dcda7943e102160fc5e7d49eff5b53dc783..e0b8a7487aa35f16f97dfc98f9322463b18b3762 100644 (file)
@@ -1,6 +1,6 @@
 /*
- *  $Id: configfile.c,v 1.20 2007/02/04 17:44:12 bkorb Exp $
- *  Time-stamp:      "2007-01-13 12:49:10 bkorb"
+ *  $Id: configfile.c,v 1.21 2007/04/15 19:01:18 bkorb Exp $
+ *  Time-stamp:      "2007-04-15 11:22:46 bkorb"
  *
  *  configuration/rc/ini file handling.
  */
@@ -869,11 +869,14 @@ internalFileLoad( tOptions* pOpts )
          *  IF we are now to skip config files AND we are presetting,
          *  THEN change direction.  We must go the other way.
          */
-        if (SKIP_RC_FILES(pOpts) && PRESETTING(inc)) {
-            idx -= inc;  /* go back and reprocess current file */
-            inc =  DIRECTION_PROCESS;
+        {
+            tOptDesc * pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts+1;
+            if (DISABLED_OPT(pOD) && PRESETTING(inc)) {
+                idx -= inc;  /* go back and reprocess current file */
+                inc =  DIRECTION_PROCESS;
+            }
         }
-    } /* For every path in the home list, ... */
+    } /* twice for every path in the home list, ... */
 }
 
 
@@ -937,11 +940,10 @@ void
 optionLoadOpt( tOptions* pOpts, tOptDesc* pOptDesc )
 {
     /*
-     *  IF the option is not being disabled,
-     *  THEN load the file.  There must be a file.
-     *  (If it is being disabled, then the disablement processing
-     *  already took place.  It must be done to suppress preloading
-     *  of ini/rc files.)
+     *  IF the option is not being disabled, THEN load the file.  There must
+     *  be a file.  (If it is being disabled, then the disablement processing
+     *  already took place.  It must be done to suppress preloading of ini/rc
+     *  files.)
      */
     if (! DISABLED_OPT( pOptDesc )) {
         struct stat sb;
@@ -951,7 +953,7 @@ optionLoadOpt( tOptions* pOpts, tOptDesc* pOptDesc )
 
             fprintf( stderr, zFSErrOptLoad, errno, strerror( errno ),
                      pOptDesc->optArg.argString );
-            (*pOpts->pUsageProc)( pOpts, EXIT_FAILURE );
+            exit(EX_NOINPUT);
             /* NOT REACHED */
         }
 
@@ -960,7 +962,7 @@ optionLoadOpt( tOptions* pOpts, tOptDesc* pOptDesc )
                 return;
 
             fprintf( stderr, zNotFile, pOptDesc->optArg.argString );
-            (*pOpts->pUsageProc)( pOpts, EXIT_FAILURE );
+            exit(EX_NOINPUT);
             /* NOT REACHED */
         }
 
@@ -1223,7 +1225,7 @@ validateOptionsStruct( tOptions* pOpts, char const* pzProgram )
 {
     if (pOpts == NULL) {
         fputs( zAO_Bad, stderr );
-        exit( EXIT_FAILURE );
+        exit( EX_CONFIG );
     }
 
     /*
index 4060c46538b450d02f6132a68bd8e9b5d6fc3665..9fb155011216cdf9724ce24155c8a7935a35dcda 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  $Id: environment.c,v 4.12 2007/02/04 17:44:12 bkorb Exp $
- * Time-stamp:      "2007-01-13 10:02:07 bkorb"
+ *  $Id: environment.c,v 4.13 2007/04/15 19:01:18 bkorb Exp $
+ * Time-stamp:      "2007-04-15 11:50:35 bkorb"
  *
  *  This file contains all of the routines that must be linked into
  *  an executable to use the generated option processing.  The optional
@@ -54,6 +54,9 @@
 
 /* = = = START-STATIC-FORWARD = = = */
 /* static forward declarations maintained by :mkfwd */
+static void
+checkEnvOpt(tOptState * os, char * env_name,
+            tOptions* pOpts, teEnvPresetType type);
 /* = = = END-STATIC-FORWARD = = = */
 
 /*
@@ -145,6 +148,66 @@ doPrognameEnv( tOptions* pOpts, teEnvPresetType type )
     pOpts->fOptSet     = sv_flag;
 }
 
+static void
+checkEnvOpt(tOptState * os, char * env_name,
+            tOptions* pOpts, teEnvPresetType type)
+{
+    os->pzOptArg = getenv( env_name );
+    if (os->pzOptArg == NULL)
+        return;
+
+    os->flags    = OPTST_PRESET | OPTST_ALLOC_ARG | os->pOD->fOptState;
+    os->optType  = TOPT_UNDEFINED;
+
+    if (  (os->pOD->pz_DisablePfx != NULL)
+       && (streqvcmp( os->pzOptArg, os->pOD->pz_DisablePfx ) == 0)) {
+        os->flags |= OPTST_DISABLED;
+        os->pzOptArg = NULL;
+    }
+
+    switch (type) {
+    case ENV_IMM:
+        /*
+         *  Process only immediate actions
+         */
+        if (DO_IMMEDIATELY(os->flags))
+            break;
+        return;
+
+    case ENV_NON_IMM:
+        /*
+         *  Process only NON immediate actions
+         */
+        if (DO_NORMALLY(os->flags) || DO_SECOND_TIME(os->flags))
+            break;
+        return;
+
+    default: /* process everything */
+        break;
+    }
+
+    /*
+     *  Make sure the option value string is persistent and consistent.
+     *
+     *  The interpretation of the option value depends
+     *  on the type of value argument the option takes
+     */
+    if (os->pzOptArg != NULL) {
+        if (OPTST_GET_ARGTYPE(os->pOD->fOptState) == OPARG_TYPE_NONE) {
+            os->pzOptArg = NULL;
+        } else if (  (os->pOD->fOptState & OPTST_ARG_OPTIONAL)
+                     && (*os->pzOptArg == NUL)) {
+            os->pzOptArg = NULL;
+        } else if (*os->pzOptArg == NUL) {
+            os->pzOptArg = zNil;
+        } else {
+            AGDUPSTR( os->pzOptArg, os->pzOptArg, "option argument" );
+            os->flags |= OPTST_ALLOC_ARG;
+        }
+    }
+
+    handleOption( pOpts, os );
+}
 
 /*
  *  doEnvPresets - check for preset values from the envrionment
@@ -194,60 +257,16 @@ doEnvPresets( tOptions* pOpts, teEnvPresetType type )
          *  Set up the option state
          */
         strcpy( pzFlagName, st.pOD->pz_NAME );
-        st.pzOptArg = getenv( zEnvName );
-        if (st.pzOptArg == NULL)
-            continue;
-        st.flags    = OPTST_PRESET | OPTST_ALLOC_ARG | st.pOD->fOptState;
-        st.optType  = TOPT_UNDEFINED;
-
-        if (  (st.pOD->pz_DisablePfx != NULL)
-           && (streqvcmp( st.pzOptArg, st.pOD->pz_DisablePfx ) == 0)) {
-            st.flags |= OPTST_DISABLED;
-            st.pzOptArg = NULL;
-        }
-
-        switch (type) {
-        case ENV_IMM:
-            /*
-             *  Process only immediate actions
-             */
-            if (DO_IMMEDIATELY(st.flags))
-                break;
-            continue;
-
-        case ENV_NON_IMM:
-            /*
-             *  Process only NON immediate actions
-             */
-            if (DO_NORMALLY(st.flags) || DO_SECOND_TIME(st.flags))
-                break;
-            continue;
-
-        default: /* process everything */
-            break;
-        }
-
-        /*
-         *  Make sure the option value string is persistent and consistent.
-         *
-         *  The interpretation of the option value depends
-         *  on the type of value argument the option takes
-         */
-        if (st.pzOptArg != NULL) {
-            if (OPTST_GET_ARGTYPE(st.pOD->fOptState) == OPARG_TYPE_NONE) {
-                st.pzOptArg = NULL;
-            } else if (  (st.pOD->fOptState & OPTST_ARG_OPTIONAL)
-                      && (*st.pzOptArg == NUL)) {
-                    st.pzOptArg = NULL;
-            } else if (*st.pzOptArg == NUL) {
-                st.pzOptArg = zNil;
-            } else {
-                AGDUPSTR( st.pzOptArg, st.pzOptArg, "option argument" );
-                st.flags |= OPTST_ALLOC_ARG;
-            }
-        }
+        checkEnvOpt(&st, zEnvName, pOpts, type);
+    }
 
-        handleOption( pOpts, &st );
+    /*
+     *  Special handling for ${PROGNAME_LOAD_OPTS}
+     */
+    if (pOpts->specOptIdx.save_opts != 0) {
+        st.pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts + 1;
+        strcpy( pzFlagName, st.pOD->pz_NAME );
+        checkEnvOpt(&st, zEnvName, pOpts, type);
     }
 }
 
index a3fcd0fe200bce99b12733aeddc86e1cabc974a3..de098a565ac586379e7598f75415129acc59099f 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (genshell.c)
  *  
- *  It has been AutoGen-ed  Saturday February 17, 2007 at 12:49:35 PM PST
+ *  It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:35 PM PDT
  *  From the definitions    genshell.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -20,7 +20,7 @@
  *
  * This source file is copyrighted and licensed under the following terms:
  *
- * genshellopt copyright 1999-2006 Bruce Korb - all rights reserved
+ * genshellopt copyright 1999-2007 Bruce Korb - all rights reserved
  *
  * genshellopt is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -49,7 +49,7 @@
 extern "C" {
 #endif
 tSCC zCopyright[] =
-       "genshellopt copyright (c) 1999-2006 Bruce Korb, all rights reserved";
+       "genshellopt copyright (c) 1999-2007 Bruce Korb, all rights reserved";
 tSCC zCopyrightNotice[] =
        "genshellopt is free software; you can redistribute it and/or\n\
 modify it under the terms of the GNU Lesser General Public\n\
@@ -145,12 +145,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zShellText, zShell_NAME, zShell_Name,
      /* disablement strs */ zNotShell_Name, zNotShell_Pfx },
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+#  define VERSION_OPT_FLAGS     OPTST_IMM | OPTST_NO_INIT
+#else
+#  define VERSION_OPT_FLAGS     OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+                                OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
+#endif
+
   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL | OPTST_IMM, 0,
+     /* opt state flags  */ VERSION_OPT_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -158,11 +164,14 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
      /* disablement strs */ NULL, NULL },
 
+#undef VERSION_OPT_FLAGS
+
+
   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -174,7 +183,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -204,7 +213,7 @@ If the script file already exists and contains Automated Option Processing\n\
 text, the second line of the file through the ending tag will be replaced\n\
 by the newly generated text.  The first `#!' line will be regenerated.\n";
 tSCC    zFullVersion[] = GENSHELLOPT_FULL_VERSION;
-/* extracted from optcode.tpl near line 378 */
+/* extracted from optcode.tpl near line 408 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -241,7 +250,7 @@ tOptions genshelloptOptions = {
       NO_EQUIVALENT /* index of '-#' option */,
       NO_EQUIVALENT /* index of default opt */
     },
-    OPTION_CT, 2 /* user option count */
+    5 /* full option count */, 2 /* user option count */
 };
 
 /*
@@ -254,7 +263,7 @@ doUsageOpt(
 {
     USAGE( EXIT_SUCCESS );
 }
-/* extracted from optcode.tpl near line 475 */
+/* extracted from optcode.tpl near line 514 */
 
 #if ENABLE_NLS
 #include <stdio.h>
index af177d1779b4d6195f5ea2f304459b82dd1dd95b..b57677dce59f178d3fc502900f065903eaea769c 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (genshell.h)
  *  
- *  It has been AutoGen-ed  Saturday February 17, 2007 at 12:49:35 PM PST
+ *  It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:35 PM PDT
  *  From the definitions    genshell.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -20,7 +20,7 @@
  *
  * This source file is copyrighted and licensed under the following terms:
  *
- * genshellopt copyright 1999-2006 Bruce Korb - all rights reserved
+ * genshellopt copyright 1999-2007 Bruce Korb - all rights reserved
  *
  * genshellopt is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -55,7 +55,7 @@
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 114688
+#define AO_TEMPLATE_VERSION 118784
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
@@ -117,7 +117,7 @@ typedef enum {
                 genshelloptOptions.pzCurOpt  = NULL )
 #define START_OPT       RESTART_OPT(1)
 #define USAGE(c)        (*genshelloptOptions.pUsageProc)( &genshelloptOptions, c )
-/* extracted from opthead.tpl near line 345 */
+/* extracted from opthead.tpl near line 360 */
 
 /* * * * * *
  *
index 85f555ba05e658d4e305c74302f754b7beb741b5..adc3235d25d3cfec027b7b15e8ce425a83578f3c 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  Saturday February 17, 2007 at 12:49:37 PM PST
+dnl It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:37 PM PDT
 dnl From the definitions    libopts.def
 dnl and the template file   conftest.tpl
 dnl
@@ -25,7 +25,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
   AC_CHECK_HEADERS(dlfcn.h errno.h fcntl.h libgen.h memory.h netinet/in.h \
     setjmp.h sys/mman.h sys/param.h sys/poll.h sys/procset.h sys/select.h \
     sys/socket.h sys/stropts.h sys/time.h sys/un.h sys/wait.h unistd.h    \
-    utime.h )
+    utime.h sysexits.h)
   
   # --------------------------------------------
   # Verify certain entries from AC_CHECK_HEADERS
@@ -370,6 +370,23 @@ return (fp == NULL) ? 1 : fclose(fp); }],
 ]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_TEXT
 
 
+AC_DEFUN([LIBOPTS_DISABLE_OPTIONAL_ARGS],[
+  AC_ARG_ENABLE([optional-args],
+    AC_HELP_STRING([--disable-optional-args], [not wanting optional option args]),
+    [libopts_cv_enable_optional_args=${enable_optional_args}],
+    AC_CACHE_CHECK([whether not wanting optional option args], libopts_cv_enable_optional_args,
+      libopts_cv_enable_optional_args=yes)
+  ) # end of AC_ARG_ENABLE
+
+  if test "X${libopts_cv_enable_optional_args}" = Xno
+  then
+    AC_DEFINE([NO_OPTIONAL_OPT_ARGS], [1],
+          [Define this if optional arguments are disallowed])
+  fi
+  
+]) # end of AC_DEFUN of LIBOPTS_DISABLE_OPTIONAL_ARGS
+
+
 AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   INVOKE_LIBOPTS_MACROS_FIRST
   # Check to see if a reg expr header is specified.
@@ -396,6 +413,9 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   # Check to see if fopen accepts "t" mode.
   LIBOPTS_RUN_FOPEN_TEXT
 
+  # Check to see if not wanting optional option args.
+  LIBOPTS_DISABLE_OPTIONAL_ARGS
+
 ]) # end AC_DEFUN of INVOKE_LIBOPTS_MACROS
 
 dnl @synopsis  LIBOPTS_CHECK
index 384ef257a1b50d46e785a44295d8cece35049464..c417c63d5c5fc7f40cc85b652d832850c08aadc3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: pgusage.c,v 4.11 2006/09/24 02:11:16 bkorb Exp $
+ *  $Id: pgusage.c,v 4.12 2007/04/28 22:19:23 bkorb Exp $
  * Time-stamp:      "2006-07-16 08:13:26 bkorb"
  *
  *   Automated Options Paged Usage module.
@@ -10,7 +10,7 @@
  */
 
 /*
- *  Automated Options copyright 1992-2006 Bruce Korb
+ *  Automated Options copyright 1992-2007 Bruce Korb
  *
  *  Automated Options is free software.
  *  You may redistribute it and/or modify it under the terms of the
index 0ab75f65a4165b9dd2299e4ac0374848db394e41..e87ab87bd089dda57e7204f43b05d5db1a7471ff 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- buffer-read-only: t -*- vi: set ro:
  *
  * Prototypes for autoopts
- * Generated Sat Feb 17 12:49:36 PST 2007
+ * Generated Sat May  5 12:02:36 PDT 2007
  */
 #ifndef AUTOOPTS_PROTO_H_GUARD
 #define AUTOOPTS_PROTO_H_GUARD 1
index a6fd5634fa67c5763985a898fda16ad370ac1aa8..22b0888032c7841a28a6e21c6a62018d49f6fa67 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  save.c  $Id: save.c,v 4.17 2007/02/04 17:44:12 bkorb Exp $
- * Time-stamp:      "2007-01-13 10:32:27 bkorb"
+ *  save.c  $Id: save.c,v 4.18 2007/04/15 19:01:18 bkorb Exp $
+ * Time-stamp:      "2007-04-15 11:11:10 bkorb"
  *
  *  This module's routines will take the currently set options and
  *  store them into an ".rc" file for re-interpretation the next
index 8ca6860c662f57a599a8bfc47c8fe9076d241937..ead71337276eaabc8920991336805c53b477ca7b 100644 (file)
@@ -1,13 +1,13 @@
 
 /*
- *  sort.c  $Id: sort.c,v 4.9 2006/10/21 15:42:49 bkorb Exp $
+ *  sort.c  $Id: sort.c,v 4.10 2007/04/28 22:19:23 bkorb Exp $
  * Time-stamp:      "2006-10-18 11:29:04 bkorb"
  *
  *  This module implements argument sorting.
  */
 
 /*
- *  Automated Options copyright 1992-2006 Bruce Korb
+ *  Automated Options copyright 1992-2007 Bruce Korb
  *
  *  Automated Options is free software.
  *  You may redistribute it and/or modify it under the terms of the
index 166ba8abd0c8431689db93dffb55d2f45a336dcd..8249794e0e00282eb464c7803ceba3279ef63b61 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  $Id: streqvcmp.c,v 4.9 2006/09/24 02:11:16 bkorb Exp $
+ *  $Id: streqvcmp.c,v 4.10 2007/04/28 22:19:23 bkorb Exp $
  * Time-stamp:      "2006-07-26 18:25:53 bkorb"
  *
  *  String Equivalence Comparison
@@ -12,7 +12,7 @@
  */
 
 /*
- *  Automated Options copyright 1992-2006 Bruce Korb
+ *  Automated Options copyright 1992-2007 Bruce Korb
  *
  *  Automated Options is free software.
  *  You may redistribute it and/or modify it under the terms of the
index d8b9b6476c81a2d1fd4a192cadce24521166f081..960339b63cbc43b1f090c4f87dae193d88d60a43 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
- *  usage.c  $Id: usage.c,v 4.13 2006/11/27 01:52:23 bkorb Exp $
- * Time-stamp:      "2006-07-01 12:41:02 bkorb"
+ *  usage.c  $Id: usage.c,v 4.15 2007/04/28 22:19:23 bkorb Exp $
+ * Time-stamp:      "2007-04-15 11:02:46 bkorb"
  *
  *  This module implements the default usage procedure for
  *  Automated Options.  It may be overridden, of course.
@@ -13,7 +13,7 @@
  */
 
 /*
- *  Automated Options copyright 1992-2006 Bruce Korb
+ *  Automated Options copyright 1992-2007 Bruce Korb
  *
  *  Automated Options is free software.
  *  You may redistribute it and/or modify it under the terms of the
@@ -169,12 +169,18 @@ optionOnlyUsage(
  *  formats.  The descriptor specifies the default, but AUTOOPTS_USAGE will
  *  over-ride this, providing the value of it is set to either "gnu" or
  *  "autoopts".  This routine will @strong{not} return.
+ *
+ *  If "exitCode" is "EX_USAGE" (normally 64), then output will to to stdout
+ *  and the actual exit code will be "EXIT_SUCCESS".
 =*/
 void
 optionUsage(
     tOptions* pOptions,
-    int       exitCode )
+    int       usage_exit_code )
 {
+    int actual_exit_code =
+        (usage_exit_code == EX_USAGE) ? EXIT_SUCCESS : usage_exit_code;
+
     displayEnum = AG_FALSE;
 
     /*
@@ -183,7 +189,7 @@ optionUsage(
      *  on successful exit (help was requested), otherwise error out.
      */
     if (option_usage_fp == NULL)
-        option_usage_fp = (exitCode != EXIT_SUCCESS) ? stderr : stdout;
+        option_usage_fp = (actual_exit_code != EXIT_SUCCESS) ? stderr : stdout;
 
     fprintf( option_usage_fp, pOptions->pzUsageTitle, pOptions->pzProgName );
 
@@ -207,13 +213,13 @@ optionUsage(
              *  option, we do *NOT* want to emit the column headers.
              *  Otherwise, we do.
              */
-            if (  (exitCode != EXIT_SUCCESS)
+            if (  (usage_exit_code != EXIT_SUCCESS)
                || ((pOptions->pOptDesc->fOptState & OPTST_DOCUMENT) == 0) )
 
                 fputs( pOptTitle, option_usage_fp );
         }
 
-        printOptionUsage( pOptions, exitCode, pOptTitle );
+        printOptionUsage( pOptions, usage_exit_code, pOptTitle );
     }
 
     /*
@@ -241,14 +247,14 @@ optionUsage(
      *  IF the user is asking for help (thus exiting with SUCCESS),
      *  THEN see what additional information we can provide.
      */
-    if (exitCode == EXIT_SUCCESS)
+    if (usage_exit_code == EXIT_SUCCESS)
         printProgramDetails( pOptions );
 
     if (pOptions->pzBugAddr != NULL)
         fprintf( option_usage_fp, zPlsSendBugs, pOptions->pzBugAddr );
     fflush( option_usage_fp );
 
-    exit( exitCode );
+    exit( actual_exit_code );
 }
 
 
@@ -344,12 +350,15 @@ printExtendedUsage(
     /*
      *  IF this particular option can NOT be preset
      *    AND some form of presetting IS allowed,
+     *    AND it is not an auto-managed option (e.g. --help, et al.)
      *  THEN advise that this option may not be preset.
      */
     if (  ((pOD->fOptState & OPTST_NO_INIT) != 0)
        && (  (pOptions->papzHomeList != NULL)
           || (pOptions->pzPROGNAME != NULL)
-       )  )
+          )
+       && (pOD->optIndex < pOptions->presetOptCt)
+       )
 
         fputs( zNoPreset, option_usage_fp );
 
@@ -509,7 +518,7 @@ printOneUsage(
 
  bogus_desc:
     fprintf( stderr, zInvalOptDesc, pOD->pz_Name );
-    exit( EXIT_FAILURE );
+    exit( EX_SOFTWARE );
 }
 
 
index a3936540fc03b754cf11b4d4ff6345c25667f259..85949d5d3f3b2638cbcc85419e94e418ceca4047 100644 (file)
@@ -1,13 +1,13 @@
 
-/*  $Id: version.c,v 4.9 2006/09/24 02:11:16 bkorb Exp $
- * Time-stamp:      "2006-09-22 18:15:00 bkorb"
+/*  $Id: version.c,v 4.10 2007/04/28 22:19:23 bkorb Exp $
+ * Time-stamp:      "2007-04-28 10:08:34 bkorb"
  *
  *  This module implements the default usage procedure for
  *  Automated Options.  It may be overridden, of course.
  */
 
 static char const zAOV[] =
-    "Automated Options version %s, copyright (c) 1999-2006 Bruce Korb\n";
+    "Automated Options version %s, copyright (c) 1999-2007 Bruce Korb\n";
 
 /*  Automated Options is free software.
  *  You may redistribute it and/or modify it under the terms of the
@@ -79,9 +79,14 @@ printVersion( tOptions* pOpts, tOptDesc* pOD, FILE* fp )
 {
     char swCh;
 
-    if (pOD->optArg.argString == NULL)
+    /*
+     *  IF the optional argument flag is off, or the argument is not provided,
+     *  then just print the version.
+     */
+    if (  ((pOD->fOptState & OPTST_ARG_OPTIONAL) == 0)
+       || (pOD->optArg.argString == NULL))
          swCh = 'v';
-    else swCh = pOD->optArg.argString[0];
+    else swCh = tolower(pOD->optArg.argString[0]);
 
     if (pOpts->pzFullVersion != NULL) {
         fputs( pOpts->pzFullVersion, fp );
@@ -89,17 +94,15 @@ printVersion( tOptions* pOpts, tOptDesc* pOD, FILE* fp )
 
     } else {
         char const *pz = pOpts->pzUsageTitle;
-        do { fputc( *pz, fp ); } while (*(pz++) != '\n');
+        do { fputc(*pz, fp); } while (*(pz++) != '\n');
     }
 
     switch (swCh) {
-    case NUL:
+    case NUL: /* arg provided, but empty */
     case 'v':
-    case 'V':
         break;
 
     case 'c':
-    case 'C':
         if (pOpts->pzCopyright != NULL) {
             fputs( pOpts->pzCopyright, fp );
             fputc( '\n', fp );
@@ -110,7 +113,6 @@ printVersion( tOptions* pOpts, tOptDesc* pOD, FILE* fp )
         break;
 
     case 'n':
-    case 'N':
         if (pOpts->pzCopyright != NULL) {
             fputs( pOpts->pzCopyright, fp );
             fputc( '\n', fp );
index 1d5f4eb085d6896477dc7967ef395e415272f2cd..e14f38a74948cb8d70292ab23f6daaa9b64b194f 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (sntp-opts.c)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 07:04:00 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:25:04 AM EDT
  *  From the definitions    sntp-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -435,12 +435,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zAdjtimeText, zAdjtime_NAME, zAdjtime_Name,
      /* disablement strs */ NULL, NULL },
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+#  define VERSION_OPT_FLAGS     OPTST_IMM | OPTST_NO_INIT
+#else
+#  define VERSION_OPT_FLAGS     OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+                                OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
+#endif
+
   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL | OPTST_IMM, 0,
+     /* opt state flags  */ VERSION_OPT_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -448,11 +454,14 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
      /* disablement strs */ NULL, NULL },
 
+#undef VERSION_OPT_FLAGS
+
+
   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -464,7 +473,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -477,7 +486,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL, 0,
+                          | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -489,8 +498,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, NOLIMIT, 0,
-     /* opt state flags  */ OPTST_DISABLE_IMM | \
-                       OPTST_SET_ARGTYPE(OPARG_TYPE_STRING), 0,
+     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) \
+                         | OPTST_DISABLE_IMM, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -525,7 +534,7 @@ job.\n\
 NTP is the Network Time Protocol (RFC 1305) and SNTP is the\n\
 Simple Network Time Protocol (RFC 2030, which supersedes RFC 1769).\n";
 tSCC    zFullVersion[] = SNTP_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 378 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 408 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -563,7 +572,7 @@ tOptions sntpOptions = {
       NO_EQUIVALENT /* index of '-#' option */,
       NO_EQUIVALENT /* index of default opt */
     },
-    OPTION_CT, 8 /* user option count */
+    13 /* full option count */, 8 /* user option count */
 };
 
 /*
@@ -592,7 +601,7 @@ main( int argc, char** argv )
     return res;
 }
 #endif  /* defined TEST_SNTP_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 475 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 514 */
 
 #if ENABLE_NLS
 #include <stdio.h>
index 494c29414dada85fba8d17f689526c41f72593d9..5d6c6739a5f2afb33c154f56d3e0d1bcb0a7c595 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (sntp-opts.h)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 07:03:59 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:25:03 AM EDT
  *  From the definitions    sntp-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 114688
+#define AO_TEMPLATE_VERSION 118784
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
@@ -234,10 +234,10 @@ typedef enum {
 #define VALUE_OPT_ADJTIME        'a'
 
 #define VALUE_OPT_VERSION       'v'
-#define VALUE_OPT_SAVE_OPTS     '>'
-#define VALUE_OPT_LOAD_OPTS     '<'
 #define VALUE_OPT_HELP          '?'
 #define VALUE_OPT_MORE_HELP     '!'
+#define VALUE_OPT_SAVE_OPTS     '>'
+#define VALUE_OPT_LOAD_OPTS     '<'
 #define SET_OPT_SAVE_OPTS(a)   STMTS( \
         DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
         DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
@@ -252,7 +252,7 @@ typedef enum {
                 sntpOptions.pzCurOpt  = NULL )
 #define START_OPT       RESTART_OPT(1)
 #define USAGE(c)        (*sntpOptions.pUsageProc)( &sntpOptions, c )
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 345 */
+/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
 
 /* * * * * *
  *
index 59907d1a05c8d0e82dc9e983f415fbb3700169ac..8e0d4e597eaa69005b497c4b2007abb0096c2988 100644 (file)
@@ -7,7 +7,7 @@
 # 
 # DO NOT EDIT THIS FILE   (sntp-opts.texi)
 # 
-# It has been AutoGen-ed  Saturday April 14, 2007 at 07:04:03 PM EDT
+# It has been AutoGen-ed  Saturday May 19, 2007 at 12:52:59 AM EDT
 # From the definitions    sntp-opts.def
 # and the template file   aginfo.tpl
 @end ignore
index 6e703eb076e48118bd6318f0238528821e0030b9..79427f039c019965ffca253398fbc6f77449f156 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (ntp-keygen-opts.c)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 07:04:10 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:25:07 AM EDT
  *  From the definitions    ntp-keygen-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -38,7 +38,7 @@ tSCC zCopyright[] =
        "ntp-keygen copyright (c) 1970-2006 ntp.org, all rights reserved";
 tSCC zCopyrightNotice[] =
        
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from /deacon/backroom/ntp-stable-hms/include/copyright.def near line 8 */
 "see html/copyright.html";
 extern tUsageProc optionUsage;
 
@@ -721,12 +721,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zMv_KeysText, zMv_Keys_NAME, zMv_Keys_Name,
      /* disablement strs */ NULL, NULL },
 
+#ifdef NO_OPTIONAL_OPT_ARGS
+#  define VERSION_OPT_FLAGS     OPTST_IMM | OPTST_NO_INIT
+#else
+#  define VERSION_OPT_FLAGS     OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+                                OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
+#endif
+
   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL | OPTST_IMM, 0,
+     /* opt state flags  */ VERSION_OPT_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -734,11 +740,14 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
      /* disablement strs */ NULL, NULL },
 
+#undef VERSION_OPT_FLAGS
+
+
   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -750,7 +759,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ OPTST_IMM, 0,
+     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -763,7 +772,7 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
-                          | OPTST_ARG_OPTIONAL, 0,
+                          | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL,  NULL,
@@ -775,8 +784,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* equiv idx value  */ NO_EQUIVALENT, 0,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, NOLIMIT, 0,
-     /* opt state flags  */ OPTST_DISABLE_IMM | \
-                       OPTST_SET_ARGTYPE(OPARG_TYPE_STRING), 0,
+     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) \
+                         | OPTST_DISABLE_IMM, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
      /* must/cannot opts */ NULL, NULL,
@@ -805,7 +814,7 @@ tSCC    zDetail[]     = "\n\
 If there is no new host key, look for an existing one.\n\
 If one is not found, create it.\n";
 tSCC    zFullVersion[] = NTP_KEYGEN_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 378 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 408 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -843,7 +852,7 @@ tOptions ntp_keygenOptions = {
       NO_EQUIVALENT /* index of '-#' option */,
       NO_EQUIVALENT /* index of default opt */
     },
-    OPTION_CT, 19 /* user option count */
+    24 /* full option count */, 19 /* user option count */
 };
 
 /*
@@ -869,7 +878,7 @@ doOptSet_Debug_Level(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from ../include/debug-opt.def, line 29 */
+    /* extracted from /deacon/backroom/ntp-stable-hms/include/debug-opt.def, line 29 */
 DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
 }
 #endif /* defined DEBUG */
@@ -945,7 +954,7 @@ main( int argc, char** argv )
     return res;
 }
 #endif  /* defined TEST_NTP_KEYGEN_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 475 */
+/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 514 */
 
 #if ENABLE_NLS
 #include <stdio.h>
index a675db5654b5eaca97658c50e6e82ee708602f8b..9650ce87fdcd1a1a9938b67a40763fc136eec6fd 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (ntp-keygen-opts.h)
  *  
- *  It has been AutoGen-ed  Saturday April 14, 2007 at 07:04:10 PM EDT
+ *  It has been AutoGen-ed  Saturday May 19, 2007 at 02:25:06 AM EDT
  *  From the definitions    ntp-keygen-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 28:0:3 templates.
+ * Generated from AutoOpts 29:0:4 templates.
  */
 
 /*
@@ -42,7 +42,7 @@
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 114688
+#define AO_TEMPLATE_VERSION 118784
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
@@ -269,10 +269,10 @@ typedef enum {
 #endif /* OPENSSL */
 
 #define VALUE_OPT_VERSION       'v'
-#define VALUE_OPT_SAVE_OPTS     '>'
-#define VALUE_OPT_LOAD_OPTS     '<'
 #define VALUE_OPT_HELP          '?'
 #define VALUE_OPT_MORE_HELP     '!'
+#define VALUE_OPT_SAVE_OPTS     '>'
+#define VALUE_OPT_LOAD_OPTS     '<'
 #define SET_OPT_SAVE_OPTS(a)   STMTS( \
         DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
         DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
@@ -287,7 +287,7 @@ typedef enum {
                 ntp_keygenOptions.pzCurOpt  = NULL )
 #define START_OPT       RESTART_OPT(1)
 #define USAGE(c)        (*ntp_keygenOptions.pUsageProc)( &ntp_keygenOptions, c )
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 345 */
+/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
 
 /* * * * * *
  *
index eb510ea9ddf5d951a53aa684556a49e1f50f53fa..efd0ac9c29366917ba170d31285bd911af395c3a 100644 (file)
@@ -7,7 +7,7 @@
 # 
 # DO NOT EDIT THIS FILE   (ntp-keygen-opts.texi)
 # 
-# It has been AutoGen-ed  Saturday April 14, 2007 at 07:04:12 PM EDT
+# It has been AutoGen-ed  Saturday May 19, 2007 at 02:23:44 AM EDT
 # From the definitions    ntp-keygen-opts.def
 # and the template file   aginfo.tpl
 @end ignore
@@ -53,7 +53,7 @@ This is the automatically generated usage text for ntp-keygen:
 @exampleindent 0
 @example
 Using OpenSSL version 90704f
-ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.5p20
+ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.5p29
 USAGE:  ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
   Flg Arg Option-Name    Description
    -c Str certificate    certificate scheme
@@ -91,7 +91,7 @@ or by a single hyphen and the flag character.
 
 The following option preset mechanisms are supported:
  - reading file /users/stenn/.ntprc
- - reading file /deacon/backroom/snaps/ntp-stable/util/.ntprc
+ - reading file /deacon/backroom/ntp-stable-hms/util/.ntprc
  - examining environment variables named NTP_KEYGEN_*
 
 If there is no new host key, look for an existing one.
index 23faf3ee4fd4799dc7e5b3ac1e9a49b57c151dc6..760a84816c35c810fc89ff7aa1955f87c20c1182 100644 (file)
@@ -1,7 +1,7 @@
-.TH NTP-KEYGEN 1 2007-04-14 "(ntp 4.2.4p2-RC1)" "Programmer's Manual"
+.TH NTP-KEYGEN 1 2007-05-19 "(ntp 4.2.4p2-RC1)" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (ntp-keygen.1)
 .\"  
-.\"  It has been AutoGen-ed  Saturday April 14, 2007 at 07:04:12 PM EDT
+.\"  It has been AutoGen-ed  Saturday May 19, 2007 at 02:23:42 AM EDT
 .\"  From the definitions    ntp-keygen-opts.def
 .\"  and the template file   agman1.tpl
 .\"