]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Updated to autogen-5.16.18 and libopts-42.1.17
authorHarlan Stenn <stenn@ntp.org>
Sun, 5 Mar 2023 06:23:04 +0000 (00:23 -0600)
committerHarlan Stenn <stenn@ntp.org>
Sun, 5 Mar 2023 06:23:04 +0000 (00:23 -0600)
bk: 64043548elVcdgzfbNZL79oDAvgIKw

115 files changed:
html/copyright.html
ntpd/ntpd-opts.c
ntpd/ntpd-opts.h
ntpd/ntpdsim-opts.c
ntpd/ntpdsim-opts.h
ntpdc/ntpdc-opts.c
ntpdc/ntpdc-opts.h
ntpq/ntpq-opts.c
ntpq/ntpq-opts.h
ntpsnmpd/ntpsnmpd-opts.c
ntpsnmpd/ntpsnmpd-opts.h
scripts/calc_tickadj/calc_tickadj-opts
scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
scripts/calc_tickadj/calc_tickadj.html
scripts/calc_tickadj/calc_tickadj.man.in
scripts/calc_tickadj/calc_tickadj.mdoc.in
scripts/calc_tickadj/invoke-calc_tickadj.texi
scripts/invoke-plot_summary.texi
scripts/invoke-summary.texi
scripts/ntp-wait/invoke-ntp-wait.texi
scripts/ntp-wait/ntp-wait-opts
scripts/ntp-wait/ntp-wait.1ntp-waitman
scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
scripts/ntp-wait/ntp-wait.man.in
scripts/ntp-wait/ntp-wait.mdoc.in
scripts/ntpsweep/invoke-ntpsweep.texi
scripts/ntpsweep/ntpsweep-opts
scripts/ntpsweep/ntpsweep.1ntpsweepman
scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
scripts/ntpsweep/ntpsweep.man.in
scripts/ntpsweep/ntpsweep.mdoc.in
scripts/ntptrace/invoke-ntptrace.texi
scripts/ntptrace/ntptrace-opts
scripts/ntptrace/ntptrace.1ntptraceman
scripts/ntptrace/ntptrace.1ntptracemdoc
scripts/ntptrace/ntptrace.man.in
scripts/ntptrace/ntptrace.mdoc.in
scripts/plot_summary-opts
scripts/plot_summary.1plot_summaryman
scripts/plot_summary.1plot_summarymdoc
scripts/plot_summary.man.in
scripts/plot_summary.mdoc.in
scripts/summary-opts
scripts/summary.1summaryman
scripts/summary.1summarymdoc
scripts/summary.man.in
scripts/summary.mdoc.in
scripts/update-leap/invoke-update-leap.texi
scripts/update-leap/update-leap-opts
scripts/update-leap/update-leap.1update-leapman
scripts/update-leap/update-leap.1update-leapmdoc
scripts/update-leap/update-leap.man.in
scripts/update-leap/update-leap.mdoc.in
sntp/include/autogen-version.def
sntp/include/copyright.def
sntp/libopts/COPYING.gplv3
sntp/libopts/COPYING.lgplv3
sntp/libopts/COPYING.mbsd
sntp/libopts/Makefile.am
sntp/libopts/README
sntp/libopts/ag-char-map.h
sntp/libopts/alias.c
sntp/libopts/ao-strs.c
sntp/libopts/ao-strs.h
sntp/libopts/autoopts.c
sntp/libopts/autoopts.h
sntp/libopts/autoopts/options.h
sntp/libopts/autoopts/project.h
sntp/libopts/autoopts/usage-txt.h
sntp/libopts/boolean.c
sntp/libopts/check.c
sntp/libopts/compat/compat.h
sntp/libopts/compat/pathfind.c
sntp/libopts/compat/windows-config.h
sntp/libopts/configfile.c
sntp/libopts/cook.c
sntp/libopts/enum.c
sntp/libopts/env.c
sntp/libopts/file.c
sntp/libopts/find.c
sntp/libopts/genshell.c
sntp/libopts/genshell.h
sntp/libopts/gettext.h
sntp/libopts/init.c
sntp/libopts/intprops.h
sntp/libopts/libopts.c
sntp/libopts/load.c
sntp/libopts/m4/libopts.m4
sntp/libopts/m4/liboptschk.m4
sntp/libopts/m4/stdnoreturn.m4
sntp/libopts/makeshell.c
sntp/libopts/nested.c
sntp/libopts/numeric.c
sntp/libopts/option-value-type.c
sntp/libopts/option-xat-attribute.c
sntp/libopts/parse-duration.c
sntp/libopts/parse-duration.h
sntp/libopts/pgusage.c
sntp/libopts/proto.h
sntp/libopts/putshell.c
sntp/libopts/reset.c
sntp/libopts/restore.c
sntp/libopts/save.c
sntp/libopts/sort.c
sntp/libopts/stack.c
sntp/libopts/stdnoreturn.in.h
sntp/libopts/streqvcmp.c
sntp/libopts/text_mmap.c
sntp/libopts/time.c
sntp/libopts/tokenize.c
sntp/libopts/usage.c
sntp/libopts/version.c
util/ntp-keygen-opts.c
util/ntp-keygen-opts.h

index 93604b7d03684139fc43b3f8d7e128d206988c31..f2c691b828b623b768b9ca66ea9c384dbd638bba 100644 (file)
@@ -9,7 +9,7 @@
 <h3>Copyright Notice</h3>
 <img src="pic/sheepb.jpg" alt="jpg" align="left"> "Clone me," says Dolly sheepishly.
 <p>Last update:
-  <!-- #BeginDate format:En2m -->4-Feb-2020  23:47<!-- #EndDate -->
+  <!-- #BeginDate format:En2m -->2-Mar-2023  05:21<!-- #EndDate -->
     UTC</p>
 <br clear="left">
 </p>
 *                                                                     *
 ***********************************************************************
 </pre>
-<p>Content starting in 2011 from Harlan Stenn, Danny Mayer, and Martin Burnicki is:</p>
+<p>Content starting in 2011 from Harlan Stenn, Juergen Perlinger, Dave Hart, Danny Mayer, Martin Burnicki, and possibly others is:</p>
 <pre>
 ***********************************************************************
 *                                                                     *
-* Copyright (c) Network Time Foundation 2011-2020                     *
+* Copyright (c) Network Time Foundation 2011-2023                     *
 *                                                                     *
 * All Rights Reserved                                                 *
 *                                                                     *
index 42b2a7722cc178ab15239825559c8001c4be8dd5..6ed7e65a957091c1d2d0af2057d4e3a2fa349ccb 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpd-opts.c)
  *
- *  It has been AutoGen-ed  June 23, 2020 at 02:20:04 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:23 PM by AutoGen 5.18.16
  *  From the definitions    ntpd-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This source file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntpd program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
 #define OPTION_CODE_COMPILE 1
 #include "ntpd-opts.h"
 #include <sys/types.h>
+#include <sys/stat.h>
 
+#include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #ifdef  __cplusplus
 extern "C" {
@@ -76,7 +81,7 @@ extern FILE * option_usage_fp;
  */
 static char const ntpd_opt_strs[3132] =
 /*     0 */ "ntpd 4.2.8p15\n"
-            "Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+            "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
@@ -1273,7 +1278,7 @@ static tOptDesc optDesc[OPTION_CT] = {
 #define zDetail         (NULL)
 /** The full version string for ntpd. */
 #define zFullVersion    (ntpd_opt_strs+3118)
-/* extracted from optcode.tlib near line 364 */
+/* extracted from optcode.tlib near line 342 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -1305,7 +1310,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od)
     ex_code = NTPD_EXIT_SUCCESS;
     optionUsage(&ntpdOptions, ex_code);
     /* NOTREACHED */
-    exit(1);
+    exit(NTPD_EXIT_FAILURE);
     (void)opts;
     (void)od;
 }
@@ -1518,19 +1523,19 @@ static void bogus_function(void) {
      extract the correct strings.  These strings are actually referenced
      by a field name in the ntpdOptions structure noted in the
      comments below.  The literal text is defined in ntpd_opt_strs.
-   
+
      NOTE: the strings below are segmented with respect to the source string
      ntpd_opt_strs.  The strings above are handed off for translation
      at run time a paragraph at a time.  Consequently, they are presented here
      for translation a paragraph at a time.
-   
+
      ALSO: often the description for an option will reference another option
      by name.  These are set off with apostrophe quotes (I hope).  Do not
      translate option names.
    */
   /* referenced via ntpdOptions.pzCopyright */
   puts(_("ntpd 4.2.8p15\n\
-Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -1688,234 +1693,230 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
   /* LIBOPTS-MESSAGES: */
 #line 67 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 93 "../autoopts.c"
+#line 89 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 53 "../init.c"
+#line 48 "../init.c"
   puts(_("AutoOpts function called without option descriptor\n"));
-#line 86 "../init.c"
+#line 81 "../init.c"
   puts(_("\tThis exceeds the compiled library version:  "));
-#line 84 "../init.c"
+#line 79 "../init.c"
   puts(_("Automated Options Processing Error!\n"
        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
-#line 80 "../autoopts.c"
+#line 78 "../autoopts.c"
   puts(_("realloc of %d bytes at 0x%p failed\n"));
-#line 88 "../init.c"
+#line 83 "../init.c"
   puts(_("\tThis is less than the minimum library version:  "));
 #line 121 "../version.c"
   puts(_("Automated Options version %s\n"
-       "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
-#line 87 "../makeshell.c"
+       "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
+#line 49 "../makeshell.c"
   puts(_("(AutoOpts bug):  %s.\n"));
 #line 90 "../reset.c"
   puts(_("optionResetOpt() called, but reset-option not configured"));
-#line 292 "../usage.c"
+#line 241 "../usage.c"
   puts(_("could not locate the 'help' option"));
-#line 336 "../autoopts.c"
+#line 330 "../autoopts.c"
   puts(_("optionProcess() was called with invalid data"));
-#line 748 "../usage.c"
+#line 697 "../usage.c"
   puts(_("invalid argument type specified"));
-#line 598 "../find.c"
+#line 568 "../find.c"
   puts(_("defaulted to option with optional arg"));
 #line 76 "../alias.c"
   puts(_("aliasing option is out of range."));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
-#line 108 "../find.c"
+#line 78 "../find.c"
   puts(_("  The following options match:\n"));
-#line 293 "../find.c"
+#line 263 "../find.c"
   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
 #line 161 "../check.c"
   puts(_("%s: Command line arguments required\n"));
 #line 43 "../alias.c"
   puts(_("%d %s%s options allowed\n"));
-#line 94 "../makeshell.c"
+#line 56 "../makeshell.c"
   puts(_("%s error %d (%s) calling %s for '%s'\n"));
-#line 306 "../makeshell.c"
+#line 268 "../makeshell.c"
   puts(_("interprocess pipe"));
-#line 168 "../version.c"
+#line 171 "../version.c"
   puts(_("error: version option argument '%c' invalid.  Use:\n"
        "\t'v' - version only\n"
        "\t'c' - version and copyright\n"
        "\t'n' - version and full copyright notice\n"));
 #line 58 "../check.c"
   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
-#line 217 "../find.c"
+#line 187 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
-#line 430 "../find.c"
+#line 400 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
 #line 38 "../alias.c"
   puts(_("-equivalence"));
-#line 469 "../find.c"
+#line 439 "../find.c"
   puts(_("%s: illegal option -- %c\n"));
 #line 110 "../reset.c"
   puts(_("%s: illegal option -- %c\n"));
-#line 271 "../find.c"
+#line 241 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 755 "../find.c"
+#line 740 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
 #line 118 "../reset.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 335 "../find.c"
+#line 305 "../find.c"
   puts(_("%s: unknown vendor extension option -- %s\n"));
-#line 159 "../enum.c"
+#line 135 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 169 "../enum.c"
+#line 145 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 747 "../usage.c"
+#line 696 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 1081 "../usage.c"
+#line 1030 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 385 "../find.c"
+#line 355 "../find.c"
   puts(_("%s: invalid option name: %s\n"));
-#line 527 "../find.c"
+#line 497 "../find.c"
   puts(_("%s: The '%s' option requires an argument.\n"));
-#line 156 "../autoopts.c"
+#line 150 "../autoopts.c"
   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
        "\t'%s' and '%s'."));
 #line 94 "../check.c"
   puts(_("%s error:  The %s option is required\n"));
-#line 632 "../find.c"
+#line 602 "../find.c"
   puts(_("%s: The '%s' option cannot have an argument.\n"));
 #line 151 "../check.c"
   puts(_("%s: Command line arguments are not allowed.\n"));
-#line 535 "../save.c"
+#line 568 "../save.c"
   puts(_("error %d (%s) creating %s\n"));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
 #line 93 "../reset.c"
   puts(_("%s error: The '%s' option requires an argument.\n"));
-#line 184 "../save.c"
+#line 122 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
-#line 238 "../save.c"
+#line 175 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
 #line 143 "../restore.c"
   puts(_("%s error: no saved option state\n"));
-#line 231 "../autoopts.c"
+#line 225 "../autoopts.c"
   puts(_("'%s' is not a command line option.\n"));
-#line 111 "../time.c"
+#line 113 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
-#line 132 "../save.c"
-  puts(_("'%s' not defined\n"));
 #line 50 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
 #line 92 "../check.c"
   puts(_("%s error:  The %s option must appear %d times.\n"));
-#line 164 "../numeric.c"
+#line 165 "../numeric.c"
   puts(_("%s error:  '%s' is not a recognizable number.\n"));
-#line 200 "../enum.c"
+#line 176 "../enum.c"
   puts(_("%s error:  %s exceeds %s keyword count\n"));
-#line 330 "../usage.c"
+#line 279 "../usage.c"
   puts(_("Try '%s %s' for more information.\n"));
 #line 45 "../alias.c"
   puts(_("one %s%s option allowed\n"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("standard output"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard output"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard output"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard output"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard error"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard error"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard error"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard error"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("write"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("write"));
-#line 273 "../usage.c"
+#line 222 "../usage.c"
   puts(_("write"));
-#line 414 "../usage.c"
+#line 363 "../usage.c"
   puts(_("write"));
-#line 624 "../usage.c"
+#line 573 "../usage.c"
   puts(_("write"));
-#line 174 "../version.c"
+#line 177 "../version.c"
   puts(_("write"));
 #line 60 "../numeric.c"
   puts(_("%s error:  %s option value %ld is out of range.\n"));
 #line 44 "../check.c"
   puts(_("%s error:  %s option requires the %s option\n"));
-#line 131 "../save.c"
-  puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 183 "../save.c"
+#line 121 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 237 "../save.c"
+#line 174 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 256 "../save.c"
+#line 193 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 534 "../save.c"
+#line 567 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   /* END-LIBOPTS-MESSAGES */
 
   /* USAGE-TEXT: */
-#line 873 "../usage.c"
+#line 822 "../usage.c"
   puts(_("\t\t\t\t- an alternate for '%s'\n"));
-#line 1148 "../usage.c"
+#line 1097 "../usage.c"
   puts(_("Version, usage and configuration options:"));
-#line 924 "../usage.c"
+#line 873 "../usage.c"
   puts(_("\t\t\t\t- default option for unnamed options\n"));
-#line 837 "../usage.c"
+#line 786 "../usage.c"
   puts(_("\t\t\t\t- disabled as '--%s'\n"));
-#line 1117 "../usage.c"
+#line 1066 "../usage.c"
   puts(_(" --- %-14s %s\n"));
-#line 1115 "../usage.c"
+#line 1064 "../usage.c"
   puts(_("This option has been disabled"));
-#line 864 "../usage.c"
+#line 813 "../usage.c"
   puts(_("\t\t\t\t- enabled by default\n"));
 #line 40 "../alias.c"
   puts(_("%s error:  only "));
-#line 1194 "../usage.c"
+#line 1143 "../usage.c"
   puts(_(" - examining environment variables named %s_*\n"));
 #line 168 "../file.c"
   puts(_("\t\t\t\t- file must not pre-exist\n"));
 #line 172 "../file.c"
   puts(_("\t\t\t\t- file must pre-exist\n"));
-#line 380 "../usage.c"
+#line 329 "../usage.c"
   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
        "hyphen and the flag character.\n"));
-#line 921 "../makeshell.c"
+#line 882 "../makeshell.c"
   puts(_("\n"
        "= = = = = = = =\n\n"
        "This incarnation of genshell will produce\n"
        "a shell script to parse the options for %s:\n\n"));
-#line 166 "../enum.c"
+#line 142 "../enum.c"
   puts(_("  or an integer mask with any of the lower %d bits set\n"));
-#line 897 "../usage.c"
+#line 846 "../usage.c"
   puts(_("\t\t\t\t- is a set membership option\n"));
-#line 918 "../usage.c"
+#line 867 "../usage.c"
   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
-#line 382 "../usage.c"
+#line 331 "../usage.c"
   puts(_("Options are specified by single or double hyphens and their name.\n"));
-#line 904 "../usage.c"
+#line 853 "../usage.c"
   puts(_("\t\t\t\t- may appear multiple times\n"));
-#line 891 "../usage.c"
+#line 840 "../usage.c"
   puts(_("\t\t\t\t- may not be preset\n"));
-#line 1309 "../usage.c"
+#line 1258 "../usage.c"
   puts(_("   Arg Option-Name    Description\n"));
-#line 1245 "../usage.c"
+#line 1194 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1303 "../usage.c"
+#line 1252 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1304 "../usage.c"
+#line 1253 "../usage.c"
   puts(_(" %3s %s"));
-#line 1310 "../usage.c"
+#line 1259 "../usage.c"
   puts(_(" %3s %s"));
-#line 387 "../usage.c"
+#line 336 "../usage.c"
   puts(_("The '-#<number>' option may omit the hash char\n"));
-#line 383 "../usage.c"
+#line 332 "../usage.c"
   puts(_("All arguments are named options.\n"));
-#line 971 "../usage.c"
+#line 920 "../usage.c"
   puts(_(" - reading file %s"));
-#line 409 "../usage.c"
+#line 358 "../usage.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
 #line 100 "../version.c"
@@ -1924,17 +1925,17 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
 #line 129 "../version.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
-#line 903 "../usage.c"
+#line 852 "../usage.c"
   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
-#line 944 "../usage.c"
+#line 893 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 1192 "../usage.c"
+#line 1141 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 682 "../usage.c"
+#line 631 "../usage.c"
   puts(_("prohibits these options:\n"));
-#line 677 "../usage.c"
+#line 626 "../usage.c"
   puts(_("prohibits the option '%s'\n"));
 #line 81 "../numeric.c"
   puts(_("%s%ld to %ld"));
@@ -1952,28 +1953,28 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
 #line 77 "../numeric.c"
   puts(_("%sless than or equal to %ld"));
-#line 390 "../usage.c"
+#line 339 "../usage.c"
   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
-#line 652 "../usage.c"
+#line 601 "../usage.c"
   puts(_("requires the option '%s'\n"));
-#line 655 "../usage.c"
+#line 604 "../usage.c"
   puts(_("requires these options:\n"));
-#line 1321 "../usage.c"
+#line 1270 "../usage.c"
   puts(_("   Arg Option-Name   Req?  Description\n"));
-#line 1315 "../usage.c"
+#line 1264 "../usage.c"
   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
-#line 167 "../enum.c"
+#line 143 "../enum.c"
   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
        "will set them all.  Multiple entries may be passed as an option\n"
        "argument list.\n"));
-#line 910 "../usage.c"
+#line 859 "../usage.c"
   puts(_("\t\t\t\t- may appear up to %d times\n"));
-#line 77 "../enum.c"
+#line 52 "../enum.c"
   puts(_("The valid \"%s\" option keywords are:\n"));
-#line 1152 "../usage.c"
+#line 1101 "../usage.c"
   puts(_("The next option supports vendor supported extra options:"));
-#line 773 "../usage.c"
+#line 722 "../usage.c"
   puts(_("These additional options are:"));
   /* END-USAGE-TEXT */
 }
index 07cdc2e3e54b9781d191480a0d45eaa084e1be36..b22ec392d60a666d6e483ddeb028ed79fdc745fb 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpd-opts.h)
  *
- *  It has been AutoGen-ed  June 23, 2020 at 02:20:04 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:22 PM by AutoGen 5.18.16
  *  From the definitions    ntpd-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This header file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntpd program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -45,6 +45,8 @@
 #define AUTOOPTS_NTPD_OPTS_H_GUARD 1
 #include "config.h"
 #include <autoopts/options.h>
+#include <stdarg.h>
+#include <stdnoreturn.h>
 
 /**
  *  Ensure that the library used for compiling this generated header is at
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 167937
+#define AO_TEMPLATE_VERSION 172033
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
   Choke Me.
 #endif
 
+#if GCC_VERSION > 40400
+#define NOT_REACHED __builtin_unreachable();
+#else
+#define NOT_REACHED
+#endif
+
 /**
  *  Enumeration of each option type for ntpd
  */
@@ -457,6 +465,7 @@ static inline char* aoGetsText(char const* pz) {
 # endif
 #endif  /* ENABLE_NLS */
 
+
 #ifdef  __cplusplus
 }
 #endif
index c88768f2ac7b072c7763e5b3ce7f46557d8f1cff..e31f4e3f0eab616f8ec1689864412c8329895571 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpdsim-opts.c)
  *
- *  It has been AutoGen-ed  April  5, 2019 at 01:12:34 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:20 PM by AutoGen 5.18.16
  *  From the definitions    ntpdsim-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This source file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntpdsim program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
 #define OPTION_CODE_COMPILE 1
 #include "ntpdsim-opts.h"
 #include <sys/types.h>
+#include <sys/stat.h>
 
+#include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #ifdef  __cplusplus
 extern "C" {
@@ -75,8 +80,8 @@ extern FILE * option_usage_fp;
  *  static const strings for ntpdsim options
  */
 static char const ntpdsim_opt_strs[3245] =
-/*     0 */ "ntpdsim 4.2.8p13\n"
-            "Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+/*     0 */ "ntpdsim 4.2.8p15\n"
+            "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
@@ -211,14 +216,14 @@ static char const ntpdsim_opt_strs[3245] =
 /*  3039 */ "no-load-opts\0"
 /*  3052 */ "no\0"
 /*  3055 */ "NTPDSIM\0"
-/*  3063 */ "ntpdsim - NTP daemon simulation program - Ver. 4.2.8p13\n"
+/*  3063 */ "ntpdsim - NTP daemon simulation program - Ver. 4.2.8p15\n"
             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
 /*  3177 */ "$HOME\0"
 /*  3183 */ ".\0"
 /*  3185 */ ".ntprc\0"
 /*  3192 */ "http://bugs.ntp.org, bugs@ntp.org\0"
 /*  3226 */ "\n\0"
-/*  3228 */ "ntpdsim 4.2.8p13";
+/*  3228 */ "ntpdsim 4.2.8p15";
 
 /**
  *  ipv4 option description with
@@ -1317,7 +1322,7 @@ static char const * const apzHomeList[3] = {
 #define zDetail         (ntpdsim_opt_strs+3226)
 /** The full version string for ntpdsim. */
 #define zFullVersion    (ntpdsim_opt_strs+3228)
-/* extracted from optcode.tlib near line 364 */
+/* extracted from optcode.tlib near line 342 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -1349,7 +1354,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od)
     ex_code = NTPDSIM_EXIT_SUCCESS;
     optionUsage(&ntpdsimOptions, ex_code);
     /* NOTREACHED */
-    exit(1);
+    exit(NTPDSIM_EXIT_FAILURE);
     (void)opts;
     (void)od;
 }
@@ -1563,19 +1568,19 @@ static void bogus_function(void) {
      extract the correct strings.  These strings are actually referenced
      by a field name in the ntpdsimOptions structure noted in the
      comments below.  The literal text is defined in ntpdsim_opt_strs.
-   
+
      NOTE: the strings below are segmented with respect to the source string
      ntpdsim_opt_strs.  The strings above are handed off for translation
      at run time a paragraph at a time.  Consequently, they are presented here
      for translation a paragraph at a time.
-   
+
      ALSO: often the description for an option will reference another option
      by name.  These are set off with apostrophe quotes (I hope).  Do not
      translate option names.
    */
   /* referenced via ntpdsimOptions.pzCopyright */
-  puts(_("ntpdsim 4.2.8p13\n\
-Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+  puts(_("ntpdsim 4.2.8p15\n\
+Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -1721,14 +1726,14 @@ implied warranty.\n"));
   puts(_("load options from a config file"));
 
   /* referenced via ntpdsimOptions.pzUsageTitle */
-  puts(_("ntpdsim - NTP daemon simulation program - Ver. 4.2.8p13\n\
+  puts(_("ntpdsim - NTP daemon simulation program - Ver. 4.2.8p15\n\
 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
 
   /* referenced via ntpdsimOptions.pzDetail */
   puts(_("\n"));
 
   /* referenced via ntpdsimOptions.pzFullVersion */
-  puts(_("ntpdsim 4.2.8p13"));
+  puts(_("ntpdsim 4.2.8p15"));
 
   /* referenced via ntpdsimOptions.pzFullUsage */
   puts(_("<<<NOT-FOUND>>>"));
@@ -1738,234 +1743,230 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
   /* LIBOPTS-MESSAGES: */
 #line 67 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 93 "../autoopts.c"
+#line 89 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 53 "../init.c"
+#line 48 "../init.c"
   puts(_("AutoOpts function called without option descriptor\n"));
-#line 86 "../init.c"
+#line 81 "../init.c"
   puts(_("\tThis exceeds the compiled library version:  "));
-#line 84 "../init.c"
+#line 79 "../init.c"
   puts(_("Automated Options Processing Error!\n"
        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
-#line 80 "../autoopts.c"
+#line 78 "../autoopts.c"
   puts(_("realloc of %d bytes at 0x%p failed\n"));
-#line 88 "../init.c"
+#line 83 "../init.c"
   puts(_("\tThis is less than the minimum library version:  "));
 #line 121 "../version.c"
   puts(_("Automated Options version %s\n"
-       "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
-#line 87 "../makeshell.c"
+       "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
+#line 49 "../makeshell.c"
   puts(_("(AutoOpts bug):  %s.\n"));
 #line 90 "../reset.c"
   puts(_("optionResetOpt() called, but reset-option not configured"));
-#line 292 "../usage.c"
+#line 241 "../usage.c"
   puts(_("could not locate the 'help' option"));
-#line 336 "../autoopts.c"
+#line 330 "../autoopts.c"
   puts(_("optionProcess() was called with invalid data"));
-#line 748 "../usage.c"
+#line 697 "../usage.c"
   puts(_("invalid argument type specified"));
-#line 598 "../find.c"
+#line 568 "../find.c"
   puts(_("defaulted to option with optional arg"));
 #line 76 "../alias.c"
   puts(_("aliasing option is out of range."));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
-#line 108 "../find.c"
+#line 78 "../find.c"
   puts(_("  The following options match:\n"));
-#line 293 "../find.c"
+#line 263 "../find.c"
   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
 #line 161 "../check.c"
   puts(_("%s: Command line arguments required\n"));
 #line 43 "../alias.c"
   puts(_("%d %s%s options allowed\n"));
-#line 94 "../makeshell.c"
+#line 56 "../makeshell.c"
   puts(_("%s error %d (%s) calling %s for '%s'\n"));
-#line 306 "../makeshell.c"
+#line 268 "../makeshell.c"
   puts(_("interprocess pipe"));
-#line 168 "../version.c"
+#line 171 "../version.c"
   puts(_("error: version option argument '%c' invalid.  Use:\n"
        "\t'v' - version only\n"
        "\t'c' - version and copyright\n"
        "\t'n' - version and full copyright notice\n"));
 #line 58 "../check.c"
   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
-#line 217 "../find.c"
+#line 187 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
-#line 430 "../find.c"
+#line 400 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
 #line 38 "../alias.c"
   puts(_("-equivalence"));
-#line 469 "../find.c"
+#line 439 "../find.c"
   puts(_("%s: illegal option -- %c\n"));
 #line 110 "../reset.c"
   puts(_("%s: illegal option -- %c\n"));
-#line 271 "../find.c"
+#line 241 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 755 "../find.c"
+#line 740 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
 #line 118 "../reset.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 335 "../find.c"
+#line 305 "../find.c"
   puts(_("%s: unknown vendor extension option -- %s\n"));
-#line 159 "../enum.c"
+#line 135 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 169 "../enum.c"
+#line 145 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 747 "../usage.c"
+#line 696 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 1081 "../usage.c"
+#line 1030 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 385 "../find.c"
+#line 355 "../find.c"
   puts(_("%s: invalid option name: %s\n"));
-#line 527 "../find.c"
+#line 497 "../find.c"
   puts(_("%s: The '%s' option requires an argument.\n"));
-#line 156 "../autoopts.c"
+#line 150 "../autoopts.c"
   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
        "\t'%s' and '%s'."));
 #line 94 "../check.c"
   puts(_("%s error:  The %s option is required\n"));
-#line 632 "../find.c"
+#line 602 "../find.c"
   puts(_("%s: The '%s' option cannot have an argument.\n"));
 #line 151 "../check.c"
   puts(_("%s: Command line arguments are not allowed.\n"));
-#line 535 "../save.c"
+#line 568 "../save.c"
   puts(_("error %d (%s) creating %s\n"));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
 #line 93 "../reset.c"
   puts(_("%s error: The '%s' option requires an argument.\n"));
-#line 184 "../save.c"
+#line 122 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
-#line 238 "../save.c"
+#line 175 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
 #line 143 "../restore.c"
   puts(_("%s error: no saved option state\n"));
-#line 231 "../autoopts.c"
+#line 225 "../autoopts.c"
   puts(_("'%s' is not a command line option.\n"));
-#line 111 "../time.c"
+#line 113 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
-#line 132 "../save.c"
-  puts(_("'%s' not defined\n"));
 #line 50 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
 #line 92 "../check.c"
   puts(_("%s error:  The %s option must appear %d times.\n"));
-#line 164 "../numeric.c"
+#line 165 "../numeric.c"
   puts(_("%s error:  '%s' is not a recognizable number.\n"));
-#line 200 "../enum.c"
+#line 176 "../enum.c"
   puts(_("%s error:  %s exceeds %s keyword count\n"));
-#line 330 "../usage.c"
+#line 279 "../usage.c"
   puts(_("Try '%s %s' for more information.\n"));
 #line 45 "../alias.c"
   puts(_("one %s%s option allowed\n"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("standard output"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard output"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard output"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard output"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard error"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard error"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard error"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard error"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("write"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("write"));
-#line 273 "../usage.c"
+#line 222 "../usage.c"
   puts(_("write"));
-#line 414 "../usage.c"
+#line 363 "../usage.c"
   puts(_("write"));
-#line 624 "../usage.c"
+#line 573 "../usage.c"
   puts(_("write"));
-#line 174 "../version.c"
+#line 177 "../version.c"
   puts(_("write"));
 #line 60 "../numeric.c"
   puts(_("%s error:  %s option value %ld is out of range.\n"));
 #line 44 "../check.c"
   puts(_("%s error:  %s option requires the %s option\n"));
-#line 131 "../save.c"
-  puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 183 "../save.c"
+#line 121 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 237 "../save.c"
+#line 174 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 256 "../save.c"
+#line 193 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 534 "../save.c"
+#line 567 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   /* END-LIBOPTS-MESSAGES */
 
   /* USAGE-TEXT: */
-#line 873 "../usage.c"
+#line 822 "../usage.c"
   puts(_("\t\t\t\t- an alternate for '%s'\n"));
-#line 1148 "../usage.c"
+#line 1097 "../usage.c"
   puts(_("Version, usage and configuration options:"));
-#line 924 "../usage.c"
+#line 873 "../usage.c"
   puts(_("\t\t\t\t- default option for unnamed options\n"));
-#line 837 "../usage.c"
+#line 786 "../usage.c"
   puts(_("\t\t\t\t- disabled as '--%s'\n"));
-#line 1117 "../usage.c"
+#line 1066 "../usage.c"
   puts(_(" --- %-14s %s\n"));
-#line 1115 "../usage.c"
+#line 1064 "../usage.c"
   puts(_("This option has been disabled"));
-#line 864 "../usage.c"
+#line 813 "../usage.c"
   puts(_("\t\t\t\t- enabled by default\n"));
 #line 40 "../alias.c"
   puts(_("%s error:  only "));
-#line 1194 "../usage.c"
+#line 1143 "../usage.c"
   puts(_(" - examining environment variables named %s_*\n"));
 #line 168 "../file.c"
   puts(_("\t\t\t\t- file must not pre-exist\n"));
 #line 172 "../file.c"
   puts(_("\t\t\t\t- file must pre-exist\n"));
-#line 380 "../usage.c"
+#line 329 "../usage.c"
   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
        "hyphen and the flag character.\n"));
-#line 921 "../makeshell.c"
+#line 882 "../makeshell.c"
   puts(_("\n"
        "= = = = = = = =\n\n"
        "This incarnation of genshell will produce\n"
        "a shell script to parse the options for %s:\n\n"));
-#line 166 "../enum.c"
+#line 142 "../enum.c"
   puts(_("  or an integer mask with any of the lower %d bits set\n"));
-#line 897 "../usage.c"
+#line 846 "../usage.c"
   puts(_("\t\t\t\t- is a set membership option\n"));
-#line 918 "../usage.c"
+#line 867 "../usage.c"
   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
-#line 382 "../usage.c"
+#line 331 "../usage.c"
   puts(_("Options are specified by single or double hyphens and their name.\n"));
-#line 904 "../usage.c"
+#line 853 "../usage.c"
   puts(_("\t\t\t\t- may appear multiple times\n"));
-#line 891 "../usage.c"
+#line 840 "../usage.c"
   puts(_("\t\t\t\t- may not be preset\n"));
-#line 1309 "../usage.c"
+#line 1258 "../usage.c"
   puts(_("   Arg Option-Name    Description\n"));
-#line 1245 "../usage.c"
+#line 1194 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1303 "../usage.c"
+#line 1252 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1304 "../usage.c"
+#line 1253 "../usage.c"
   puts(_(" %3s %s"));
-#line 1310 "../usage.c"
+#line 1259 "../usage.c"
   puts(_(" %3s %s"));
-#line 387 "../usage.c"
+#line 336 "../usage.c"
   puts(_("The '-#<number>' option may omit the hash char\n"));
-#line 383 "../usage.c"
+#line 332 "../usage.c"
   puts(_("All arguments are named options.\n"));
-#line 971 "../usage.c"
+#line 920 "../usage.c"
   puts(_(" - reading file %s"));
-#line 409 "../usage.c"
+#line 358 "../usage.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
 #line 100 "../version.c"
@@ -1974,17 +1975,17 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
 #line 129 "../version.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
-#line 903 "../usage.c"
+#line 852 "../usage.c"
   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
-#line 944 "../usage.c"
+#line 893 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 1192 "../usage.c"
+#line 1141 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 682 "../usage.c"
+#line 631 "../usage.c"
   puts(_("prohibits these options:\n"));
-#line 677 "../usage.c"
+#line 626 "../usage.c"
   puts(_("prohibits the option '%s'\n"));
 #line 81 "../numeric.c"
   puts(_("%s%ld to %ld"));
@@ -2002,28 +2003,28 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
 #line 77 "../numeric.c"
   puts(_("%sless than or equal to %ld"));
-#line 390 "../usage.c"
+#line 339 "../usage.c"
   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
-#line 652 "../usage.c"
+#line 601 "../usage.c"
   puts(_("requires the option '%s'\n"));
-#line 655 "../usage.c"
+#line 604 "../usage.c"
   puts(_("requires these options:\n"));
-#line 1321 "../usage.c"
+#line 1270 "../usage.c"
   puts(_("   Arg Option-Name   Req?  Description\n"));
-#line 1315 "../usage.c"
+#line 1264 "../usage.c"
   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
-#line 167 "../enum.c"
+#line 143 "../enum.c"
   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
        "will set them all.  Multiple entries may be passed as an option\n"
        "argument list.\n"));
-#line 910 "../usage.c"
+#line 859 "../usage.c"
   puts(_("\t\t\t\t- may appear up to %d times\n"));
-#line 77 "../enum.c"
+#line 52 "../enum.c"
   puts(_("The valid \"%s\" option keywords are:\n"));
-#line 1152 "../usage.c"
+#line 1101 "../usage.c"
   puts(_("The next option supports vendor supported extra options:"));
-#line 773 "../usage.c"
+#line 722 "../usage.c"
   puts(_("These additional options are:"));
   /* END-USAGE-TEXT */
 }
index 319e77c62eff370cd95deb6bb02f58bec4d80dd2..ddb4a94d559562ef869839921eb61fb8bddd3a7f 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpdsim-opts.h)
  *
- *  It has been AutoGen-ed  April  5, 2019 at 01:12:34 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:20 PM by AutoGen 5.18.16
  *  From the definitions    ntpdsim-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This header file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntpdsim program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -45,6 +45,8 @@
 #define AUTOOPTS_NTPDSIM_OPTS_H_GUARD 1
 #include "config.h"
 #include <autoopts/options.h>
+#include <stdarg.h>
+#include <stdnoreturn.h>
 
 /**
  *  Ensure that the library used for compiling this generated header is at
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 167937
+#define AO_TEMPLATE_VERSION 172033
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
   Choke Me.
 #endif
 
+#if GCC_VERSION > 40400
+#define NOT_REACHED __builtin_unreachable();
+#else
+#define NOT_REACHED
+#endif
+
 /**
  *  Enumeration of each option type for ntpdsim
  */
@@ -108,9 +116,9 @@ typedef enum {
 /** count of all options for ntpdsim */
 #define OPTION_CT    40
 /** ntpdsim version */
-#define NTPDSIM_VERSION       "4.2.8p13"
+#define NTPDSIM_VERSION       "4.2.8p15"
 /** Full ntpdsim version text */
-#define NTPDSIM_FULL_VERSION  "ntpdsim 4.2.8p13"
+#define NTPDSIM_FULL_VERSION  "ntpdsim 4.2.8p15"
 
 /**
  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
@@ -468,6 +476,7 @@ static inline char* aoGetsText(char const* pz) {
 # endif
 #endif  /* ENABLE_NLS */
 
+
 #ifdef  __cplusplus
 }
 #endif
index 1c06949f4cc2343359f0cb4888e3663907d04db4..bda2bd9deb7360921ed11ee7e3c8485f92a35d99 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpdc-opts.c)
  *
- *  It has been AutoGen-ed  June 27, 2022 at 12:00:57 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:25 PM by AutoGen 5.18.16
  *  From the definitions    ntpdc-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This source file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntpdc program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
 #define OPTION_CODE_COMPILE 1
 #include "ntpdc-opts.h"
 #include <sys/types.h>
+#include <sys/stat.h>
 
+#include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #ifdef  __cplusplus
 extern "C" {
@@ -70,7 +75,7 @@ extern FILE * option_usage_fp;
  */
 static char const ntpdc_opt_strs[2004] =
 /*     0 */ "ntpdc 4.2.8p15\n"
-            "Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+            "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
@@ -567,7 +572,7 @@ static char const * const apzHomeList[3] = {
 #define zDetail         (NULL)
 /** The full version string for ntpdc. */
 #define zFullVersion    (ntpdc_opt_strs+1989)
-/* extracted from optcode.tlib near line 364 */
+/* extracted from optcode.tlib near line 342 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -599,7 +604,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od)
     ex_code = NTPDC_EXIT_SUCCESS;
     optionUsage(&ntpdcOptions, ex_code);
     /* NOTREACHED */
-    exit(1);
+    exit(NTPDC_EXIT_FAILURE);
     (void)opts;
     (void)od;
 }
@@ -812,19 +817,19 @@ static void bogus_function(void) {
      extract the correct strings.  These strings are actually referenced
      by a field name in the ntpdcOptions structure noted in the
      comments below.  The literal text is defined in ntpdc_opt_strs.
-   
+
      NOTE: the strings below are segmented with respect to the source string
      ntpdc_opt_strs.  The strings above are handed off for translation
      at run time a paragraph at a time.  Consequently, they are presented here
      for translation a paragraph at a time.
-   
+
      ALSO: often the description for an option will reference another option
      by name.  These are set off with apostrophe quotes (I hope).  Do not
      translate option names.
    */
   /* referenced via ntpdcOptions.pzCopyright */
   puts(_("ntpdc 4.2.8p15\n\
-Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -909,234 +914,230 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
   /* LIBOPTS-MESSAGES: */
 #line 67 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 93 "../autoopts.c"
+#line 89 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 53 "../init.c"
+#line 48 "../init.c"
   puts(_("AutoOpts function called without option descriptor\n"));
-#line 86 "../init.c"
+#line 81 "../init.c"
   puts(_("\tThis exceeds the compiled library version:  "));
-#line 84 "../init.c"
+#line 79 "../init.c"
   puts(_("Automated Options Processing Error!\n"
        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
-#line 80 "../autoopts.c"
+#line 78 "../autoopts.c"
   puts(_("realloc of %d bytes at 0x%p failed\n"));
-#line 88 "../init.c"
+#line 83 "../init.c"
   puts(_("\tThis is less than the minimum library version:  "));
 #line 121 "../version.c"
   puts(_("Automated Options version %s\n"
-       "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
-#line 87 "../makeshell.c"
+       "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
+#line 49 "../makeshell.c"
   puts(_("(AutoOpts bug):  %s.\n"));
 #line 90 "../reset.c"
   puts(_("optionResetOpt() called, but reset-option not configured"));
-#line 292 "../usage.c"
+#line 241 "../usage.c"
   puts(_("could not locate the 'help' option"));
-#line 336 "../autoopts.c"
+#line 330 "../autoopts.c"
   puts(_("optionProcess() was called with invalid data"));
-#line 748 "../usage.c"
+#line 697 "../usage.c"
   puts(_("invalid argument type specified"));
-#line 598 "../find.c"
+#line 568 "../find.c"
   puts(_("defaulted to option with optional arg"));
 #line 76 "../alias.c"
   puts(_("aliasing option is out of range."));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
-#line 108 "../find.c"
+#line 78 "../find.c"
   puts(_("  The following options match:\n"));
-#line 293 "../find.c"
+#line 263 "../find.c"
   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
 #line 161 "../check.c"
   puts(_("%s: Command line arguments required\n"));
 #line 43 "../alias.c"
   puts(_("%d %s%s options allowed\n"));
-#line 94 "../makeshell.c"
+#line 56 "../makeshell.c"
   puts(_("%s error %d (%s) calling %s for '%s'\n"));
-#line 306 "../makeshell.c"
+#line 268 "../makeshell.c"
   puts(_("interprocess pipe"));
-#line 168 "../version.c"
+#line 171 "../version.c"
   puts(_("error: version option argument '%c' invalid.  Use:\n"
        "\t'v' - version only\n"
        "\t'c' - version and copyright\n"
        "\t'n' - version and full copyright notice\n"));
 #line 58 "../check.c"
   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
-#line 217 "../find.c"
+#line 187 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
-#line 430 "../find.c"
+#line 400 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
 #line 38 "../alias.c"
   puts(_("-equivalence"));
-#line 469 "../find.c"
+#line 439 "../find.c"
   puts(_("%s: illegal option -- %c\n"));
 #line 110 "../reset.c"
   puts(_("%s: illegal option -- %c\n"));
-#line 271 "../find.c"
+#line 241 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 755 "../find.c"
+#line 740 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
 #line 118 "../reset.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 335 "../find.c"
+#line 305 "../find.c"
   puts(_("%s: unknown vendor extension option -- %s\n"));
-#line 159 "../enum.c"
+#line 135 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 169 "../enum.c"
+#line 145 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 747 "../usage.c"
+#line 696 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 1081 "../usage.c"
+#line 1030 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 385 "../find.c"
+#line 355 "../find.c"
   puts(_("%s: invalid option name: %s\n"));
-#line 527 "../find.c"
+#line 497 "../find.c"
   puts(_("%s: The '%s' option requires an argument.\n"));
-#line 156 "../autoopts.c"
+#line 150 "../autoopts.c"
   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
        "\t'%s' and '%s'."));
 #line 94 "../check.c"
   puts(_("%s error:  The %s option is required\n"));
-#line 632 "../find.c"
+#line 602 "../find.c"
   puts(_("%s: The '%s' option cannot have an argument.\n"));
 #line 151 "../check.c"
   puts(_("%s: Command line arguments are not allowed.\n"));
-#line 535 "../save.c"
+#line 568 "../save.c"
   puts(_("error %d (%s) creating %s\n"));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
 #line 93 "../reset.c"
   puts(_("%s error: The '%s' option requires an argument.\n"));
-#line 184 "../save.c"
+#line 122 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
-#line 238 "../save.c"
+#line 175 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
 #line 143 "../restore.c"
   puts(_("%s error: no saved option state\n"));
-#line 231 "../autoopts.c"
+#line 225 "../autoopts.c"
   puts(_("'%s' is not a command line option.\n"));
-#line 111 "../time.c"
+#line 113 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
-#line 132 "../save.c"
-  puts(_("'%s' not defined\n"));
 #line 50 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
 #line 92 "../check.c"
   puts(_("%s error:  The %s option must appear %d times.\n"));
-#line 164 "../numeric.c"
+#line 165 "../numeric.c"
   puts(_("%s error:  '%s' is not a recognizable number.\n"));
-#line 200 "../enum.c"
+#line 176 "../enum.c"
   puts(_("%s error:  %s exceeds %s keyword count\n"));
-#line 330 "../usage.c"
+#line 279 "../usage.c"
   puts(_("Try '%s %s' for more information.\n"));
 #line 45 "../alias.c"
   puts(_("one %s%s option allowed\n"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("standard output"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard output"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard output"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard output"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard error"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard error"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard error"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard error"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("write"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("write"));
-#line 273 "../usage.c"
+#line 222 "../usage.c"
   puts(_("write"));
-#line 414 "../usage.c"
+#line 363 "../usage.c"
   puts(_("write"));
-#line 624 "../usage.c"
+#line 573 "../usage.c"
   puts(_("write"));
-#line 174 "../version.c"
+#line 177 "../version.c"
   puts(_("write"));
 #line 60 "../numeric.c"
   puts(_("%s error:  %s option value %ld is out of range.\n"));
 #line 44 "../check.c"
   puts(_("%s error:  %s option requires the %s option\n"));
-#line 131 "../save.c"
-  puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 183 "../save.c"
+#line 121 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 237 "../save.c"
+#line 174 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 256 "../save.c"
+#line 193 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 534 "../save.c"
+#line 567 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   /* END-LIBOPTS-MESSAGES */
 
   /* USAGE-TEXT: */
-#line 873 "../usage.c"
+#line 822 "../usage.c"
   puts(_("\t\t\t\t- an alternate for '%s'\n"));
-#line 1148 "../usage.c"
+#line 1097 "../usage.c"
   puts(_("Version, usage and configuration options:"));
-#line 924 "../usage.c"
+#line 873 "../usage.c"
   puts(_("\t\t\t\t- default option for unnamed options\n"));
-#line 837 "../usage.c"
+#line 786 "../usage.c"
   puts(_("\t\t\t\t- disabled as '--%s'\n"));
-#line 1117 "../usage.c"
+#line 1066 "../usage.c"
   puts(_(" --- %-14s %s\n"));
-#line 1115 "../usage.c"
+#line 1064 "../usage.c"
   puts(_("This option has been disabled"));
-#line 864 "../usage.c"
+#line 813 "../usage.c"
   puts(_("\t\t\t\t- enabled by default\n"));
 #line 40 "../alias.c"
   puts(_("%s error:  only "));
-#line 1194 "../usage.c"
+#line 1143 "../usage.c"
   puts(_(" - examining environment variables named %s_*\n"));
 #line 168 "../file.c"
   puts(_("\t\t\t\t- file must not pre-exist\n"));
 #line 172 "../file.c"
   puts(_("\t\t\t\t- file must pre-exist\n"));
-#line 380 "../usage.c"
+#line 329 "../usage.c"
   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
        "hyphen and the flag character.\n"));
-#line 921 "../makeshell.c"
+#line 882 "../makeshell.c"
   puts(_("\n"
        "= = = = = = = =\n\n"
        "This incarnation of genshell will produce\n"
        "a shell script to parse the options for %s:\n\n"));
-#line 166 "../enum.c"
+#line 142 "../enum.c"
   puts(_("  or an integer mask with any of the lower %d bits set\n"));
-#line 897 "../usage.c"
+#line 846 "../usage.c"
   puts(_("\t\t\t\t- is a set membership option\n"));
-#line 918 "../usage.c"
+#line 867 "../usage.c"
   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
-#line 382 "../usage.c"
+#line 331 "../usage.c"
   puts(_("Options are specified by single or double hyphens and their name.\n"));
-#line 904 "../usage.c"
+#line 853 "../usage.c"
   puts(_("\t\t\t\t- may appear multiple times\n"));
-#line 891 "../usage.c"
+#line 840 "../usage.c"
   puts(_("\t\t\t\t- may not be preset\n"));
-#line 1309 "../usage.c"
+#line 1258 "../usage.c"
   puts(_("   Arg Option-Name    Description\n"));
-#line 1245 "../usage.c"
+#line 1194 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1303 "../usage.c"
+#line 1252 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1304 "../usage.c"
+#line 1253 "../usage.c"
   puts(_(" %3s %s"));
-#line 1310 "../usage.c"
+#line 1259 "../usage.c"
   puts(_(" %3s %s"));
-#line 387 "../usage.c"
+#line 336 "../usage.c"
   puts(_("The '-#<number>' option may omit the hash char\n"));
-#line 383 "../usage.c"
+#line 332 "../usage.c"
   puts(_("All arguments are named options.\n"));
-#line 971 "../usage.c"
+#line 920 "../usage.c"
   puts(_(" - reading file %s"));
-#line 409 "../usage.c"
+#line 358 "../usage.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
 #line 100 "../version.c"
@@ -1145,17 +1146,17 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
 #line 129 "../version.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
-#line 903 "../usage.c"
+#line 852 "../usage.c"
   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
-#line 944 "../usage.c"
+#line 893 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 1192 "../usage.c"
+#line 1141 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 682 "../usage.c"
+#line 631 "../usage.c"
   puts(_("prohibits these options:\n"));
-#line 677 "../usage.c"
+#line 626 "../usage.c"
   puts(_("prohibits the option '%s'\n"));
 #line 81 "../numeric.c"
   puts(_("%s%ld to %ld"));
@@ -1173,28 +1174,28 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
 #line 77 "../numeric.c"
   puts(_("%sless than or equal to %ld"));
-#line 390 "../usage.c"
+#line 339 "../usage.c"
   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
-#line 652 "../usage.c"
+#line 601 "../usage.c"
   puts(_("requires the option '%s'\n"));
-#line 655 "../usage.c"
+#line 604 "../usage.c"
   puts(_("requires these options:\n"));
-#line 1321 "../usage.c"
+#line 1270 "../usage.c"
   puts(_("   Arg Option-Name   Req?  Description\n"));
-#line 1315 "../usage.c"
+#line 1264 "../usage.c"
   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
-#line 167 "../enum.c"
+#line 143 "../enum.c"
   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
        "will set them all.  Multiple entries may be passed as an option\n"
        "argument list.\n"));
-#line 910 "../usage.c"
+#line 859 "../usage.c"
   puts(_("\t\t\t\t- may appear up to %d times\n"));
-#line 77 "../enum.c"
+#line 52 "../enum.c"
   puts(_("The valid \"%s\" option keywords are:\n"));
-#line 1152 "../usage.c"
+#line 1101 "../usage.c"
   puts(_("The next option supports vendor supported extra options:"));
-#line 773 "../usage.c"
+#line 722 "../usage.c"
   puts(_("These additional options are:"));
   /* END-USAGE-TEXT */
 }
index ffa1d0d096f83cfc69c60442ed38237a64f3e2b9..4001ce6f9e093350cfd3116ac2abdd25cdbe11f8 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpdc-opts.h)
  *
- *  It has been AutoGen-ed  June 27, 2022 at 12:00:57 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:25 PM by AutoGen 5.18.16
  *  From the definitions    ntpdc-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This header file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntpdc program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -45,6 +45,8 @@
 #define AUTOOPTS_NTPDC_OPTS_H_GUARD 1
 #include "config.h"
 #include <autoopts/options.h>
+#include <stdarg.h>
+#include <stdnoreturn.h>
 
 /**
  *  Ensure that the library used for compiling this generated header is at
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 167937
+#define AO_TEMPLATE_VERSION 172033
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
   Choke Me.
 #endif
 
+#if GCC_VERSION > 40400
+#define NOT_REACHED __builtin_unreachable();
+#else
+#define NOT_REACHED
+#endif
+
 /**
  *  Enumeration of each option type for ntpdc
  */
@@ -293,6 +301,7 @@ static inline char* aoGetsText(char const* pz) {
 # endif
 #endif  /* ENABLE_NLS */
 
+
 #ifdef  __cplusplus
 }
 #endif
index 8ecbff4e1b0851604b89af498b449b8e7d492cdf..c54542f29378a32bbb4410d83f56547a6aeeab5d 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpq-opts.c)
  *
- *  It has been AutoGen-ed  June 27, 2022 at 12:01:04 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:26 PM by AutoGen 5.18.16
  *  From the definitions    ntpq-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This source file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntpq program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
 #define OPTION_CODE_COMPILE 1
 #include "ntpq-opts.h"
 #include <sys/types.h>
+#include <sys/stat.h>
 
+#include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #ifdef  __cplusplus
 extern "C" {
@@ -70,7 +75,7 @@ extern FILE * option_usage_fp;
  */
 static char const ntpq_opt_strs[2067] =
 /*     0 */ "ntpq 4.2.8p15\n"
-            "Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+            "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
@@ -588,7 +593,7 @@ static char const * const apzHomeList[3] = {
 #define zDetail         (NULL)
 /** The full version string for ntpq. */
 #define zFullVersion    (ntpq_opt_strs+2048)
-/* extracted from optcode.tlib near line 364 */
+/* extracted from optcode.tlib near line 342 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -620,7 +625,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od)
     ex_code = NTPQ_EXIT_SUCCESS;
     optionUsage(&ntpqOptions, ex_code);
     /* NOTREACHED */
-    exit(1);
+    exit(NTPQ_EXIT_FAILURE);
     (void)opts;
     (void)od;
 }
@@ -857,19 +862,19 @@ static void bogus_function(void) {
      extract the correct strings.  These strings are actually referenced
      by a field name in the ntpqOptions structure noted in the
      comments below.  The literal text is defined in ntpq_opt_strs.
-   
+
      NOTE: the strings below are segmented with respect to the source string
      ntpq_opt_strs.  The strings above are handed off for translation
      at run time a paragraph at a time.  Consequently, they are presented here
      for translation a paragraph at a time.
-   
+
      ALSO: often the description for an option will reference another option
      by name.  These are set off with apostrophe quotes (I hope).  Do not
      translate option names.
    */
   /* referenced via ntpqOptions.pzCopyright */
   puts(_("ntpq 4.2.8p15\n\
-Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -954,234 +959,230 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
   /* LIBOPTS-MESSAGES: */
 #line 67 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 93 "../autoopts.c"
+#line 89 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 53 "../init.c"
+#line 48 "../init.c"
   puts(_("AutoOpts function called without option descriptor\n"));
-#line 86 "../init.c"
+#line 81 "../init.c"
   puts(_("\tThis exceeds the compiled library version:  "));
-#line 84 "../init.c"
+#line 79 "../init.c"
   puts(_("Automated Options Processing Error!\n"
        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
-#line 80 "../autoopts.c"
+#line 78 "../autoopts.c"
   puts(_("realloc of %d bytes at 0x%p failed\n"));
-#line 88 "../init.c"
+#line 83 "../init.c"
   puts(_("\tThis is less than the minimum library version:  "));
 #line 121 "../version.c"
   puts(_("Automated Options version %s\n"
-       "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
-#line 87 "../makeshell.c"
+       "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
+#line 49 "../makeshell.c"
   puts(_("(AutoOpts bug):  %s.\n"));
 #line 90 "../reset.c"
   puts(_("optionResetOpt() called, but reset-option not configured"));
-#line 292 "../usage.c"
+#line 241 "../usage.c"
   puts(_("could not locate the 'help' option"));
-#line 336 "../autoopts.c"
+#line 330 "../autoopts.c"
   puts(_("optionProcess() was called with invalid data"));
-#line 748 "../usage.c"
+#line 697 "../usage.c"
   puts(_("invalid argument type specified"));
-#line 598 "../find.c"
+#line 568 "../find.c"
   puts(_("defaulted to option with optional arg"));
 #line 76 "../alias.c"
   puts(_("aliasing option is out of range."));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
-#line 108 "../find.c"
+#line 78 "../find.c"
   puts(_("  The following options match:\n"));
-#line 293 "../find.c"
+#line 263 "../find.c"
   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
 #line 161 "../check.c"
   puts(_("%s: Command line arguments required\n"));
 #line 43 "../alias.c"
   puts(_("%d %s%s options allowed\n"));
-#line 94 "../makeshell.c"
+#line 56 "../makeshell.c"
   puts(_("%s error %d (%s) calling %s for '%s'\n"));
-#line 306 "../makeshell.c"
+#line 268 "../makeshell.c"
   puts(_("interprocess pipe"));
-#line 168 "../version.c"
+#line 171 "../version.c"
   puts(_("error: version option argument '%c' invalid.  Use:\n"
        "\t'v' - version only\n"
        "\t'c' - version and copyright\n"
        "\t'n' - version and full copyright notice\n"));
 #line 58 "../check.c"
   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
-#line 217 "../find.c"
+#line 187 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
-#line 430 "../find.c"
+#line 400 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
 #line 38 "../alias.c"
   puts(_("-equivalence"));
-#line 469 "../find.c"
+#line 439 "../find.c"
   puts(_("%s: illegal option -- %c\n"));
 #line 110 "../reset.c"
   puts(_("%s: illegal option -- %c\n"));
-#line 271 "../find.c"
+#line 241 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 755 "../find.c"
+#line 740 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
 #line 118 "../reset.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 335 "../find.c"
+#line 305 "../find.c"
   puts(_("%s: unknown vendor extension option -- %s\n"));
-#line 159 "../enum.c"
+#line 135 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 169 "../enum.c"
+#line 145 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 747 "../usage.c"
+#line 696 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 1081 "../usage.c"
+#line 1030 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 385 "../find.c"
+#line 355 "../find.c"
   puts(_("%s: invalid option name: %s\n"));
-#line 527 "../find.c"
+#line 497 "../find.c"
   puts(_("%s: The '%s' option requires an argument.\n"));
-#line 156 "../autoopts.c"
+#line 150 "../autoopts.c"
   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
        "\t'%s' and '%s'."));
 #line 94 "../check.c"
   puts(_("%s error:  The %s option is required\n"));
-#line 632 "../find.c"
+#line 602 "../find.c"
   puts(_("%s: The '%s' option cannot have an argument.\n"));
 #line 151 "../check.c"
   puts(_("%s: Command line arguments are not allowed.\n"));
-#line 535 "../save.c"
+#line 568 "../save.c"
   puts(_("error %d (%s) creating %s\n"));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
 #line 93 "../reset.c"
   puts(_("%s error: The '%s' option requires an argument.\n"));
-#line 184 "../save.c"
+#line 122 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
-#line 238 "../save.c"
+#line 175 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
 #line 143 "../restore.c"
   puts(_("%s error: no saved option state\n"));
-#line 231 "../autoopts.c"
+#line 225 "../autoopts.c"
   puts(_("'%s' is not a command line option.\n"));
-#line 111 "../time.c"
+#line 113 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
-#line 132 "../save.c"
-  puts(_("'%s' not defined\n"));
 #line 50 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
 #line 92 "../check.c"
   puts(_("%s error:  The %s option must appear %d times.\n"));
-#line 164 "../numeric.c"
+#line 165 "../numeric.c"
   puts(_("%s error:  '%s' is not a recognizable number.\n"));
-#line 200 "../enum.c"
+#line 176 "../enum.c"
   puts(_("%s error:  %s exceeds %s keyword count\n"));
-#line 330 "../usage.c"
+#line 279 "../usage.c"
   puts(_("Try '%s %s' for more information.\n"));
 #line 45 "../alias.c"
   puts(_("one %s%s option allowed\n"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("standard output"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard output"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard output"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard output"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard error"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard error"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard error"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard error"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("write"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("write"));
-#line 273 "../usage.c"
+#line 222 "../usage.c"
   puts(_("write"));
-#line 414 "../usage.c"
+#line 363 "../usage.c"
   puts(_("write"));
-#line 624 "../usage.c"
+#line 573 "../usage.c"
   puts(_("write"));
-#line 174 "../version.c"
+#line 177 "../version.c"
   puts(_("write"));
 #line 60 "../numeric.c"
   puts(_("%s error:  %s option value %ld is out of range.\n"));
 #line 44 "../check.c"
   puts(_("%s error:  %s option requires the %s option\n"));
-#line 131 "../save.c"
-  puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 183 "../save.c"
+#line 121 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 237 "../save.c"
+#line 174 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 256 "../save.c"
+#line 193 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 534 "../save.c"
+#line 567 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   /* END-LIBOPTS-MESSAGES */
 
   /* USAGE-TEXT: */
-#line 873 "../usage.c"
+#line 822 "../usage.c"
   puts(_("\t\t\t\t- an alternate for '%s'\n"));
-#line 1148 "../usage.c"
+#line 1097 "../usage.c"
   puts(_("Version, usage and configuration options:"));
-#line 924 "../usage.c"
+#line 873 "../usage.c"
   puts(_("\t\t\t\t- default option for unnamed options\n"));
-#line 837 "../usage.c"
+#line 786 "../usage.c"
   puts(_("\t\t\t\t- disabled as '--%s'\n"));
-#line 1117 "../usage.c"
+#line 1066 "../usage.c"
   puts(_(" --- %-14s %s\n"));
-#line 1115 "../usage.c"
+#line 1064 "../usage.c"
   puts(_("This option has been disabled"));
-#line 864 "../usage.c"
+#line 813 "../usage.c"
   puts(_("\t\t\t\t- enabled by default\n"));
 #line 40 "../alias.c"
   puts(_("%s error:  only "));
-#line 1194 "../usage.c"
+#line 1143 "../usage.c"
   puts(_(" - examining environment variables named %s_*\n"));
 #line 168 "../file.c"
   puts(_("\t\t\t\t- file must not pre-exist\n"));
 #line 172 "../file.c"
   puts(_("\t\t\t\t- file must pre-exist\n"));
-#line 380 "../usage.c"
+#line 329 "../usage.c"
   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
        "hyphen and the flag character.\n"));
-#line 921 "../makeshell.c"
+#line 882 "../makeshell.c"
   puts(_("\n"
        "= = = = = = = =\n\n"
        "This incarnation of genshell will produce\n"
        "a shell script to parse the options for %s:\n\n"));
-#line 166 "../enum.c"
+#line 142 "../enum.c"
   puts(_("  or an integer mask with any of the lower %d bits set\n"));
-#line 897 "../usage.c"
+#line 846 "../usage.c"
   puts(_("\t\t\t\t- is a set membership option\n"));
-#line 918 "../usage.c"
+#line 867 "../usage.c"
   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
-#line 382 "../usage.c"
+#line 331 "../usage.c"
   puts(_("Options are specified by single or double hyphens and their name.\n"));
-#line 904 "../usage.c"
+#line 853 "../usage.c"
   puts(_("\t\t\t\t- may appear multiple times\n"));
-#line 891 "../usage.c"
+#line 840 "../usage.c"
   puts(_("\t\t\t\t- may not be preset\n"));
-#line 1309 "../usage.c"
+#line 1258 "../usage.c"
   puts(_("   Arg Option-Name    Description\n"));
-#line 1245 "../usage.c"
+#line 1194 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1303 "../usage.c"
+#line 1252 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1304 "../usage.c"
+#line 1253 "../usage.c"
   puts(_(" %3s %s"));
-#line 1310 "../usage.c"
+#line 1259 "../usage.c"
   puts(_(" %3s %s"));
-#line 387 "../usage.c"
+#line 336 "../usage.c"
   puts(_("The '-#<number>' option may omit the hash char\n"));
-#line 383 "../usage.c"
+#line 332 "../usage.c"
   puts(_("All arguments are named options.\n"));
-#line 971 "../usage.c"
+#line 920 "../usage.c"
   puts(_(" - reading file %s"));
-#line 409 "../usage.c"
+#line 358 "../usage.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
 #line 100 "../version.c"
@@ -1190,17 +1191,17 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
 #line 129 "../version.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
-#line 903 "../usage.c"
+#line 852 "../usage.c"
   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
-#line 944 "../usage.c"
+#line 893 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 1192 "../usage.c"
+#line 1141 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 682 "../usage.c"
+#line 631 "../usage.c"
   puts(_("prohibits these options:\n"));
-#line 677 "../usage.c"
+#line 626 "../usage.c"
   puts(_("prohibits the option '%s'\n"));
 #line 81 "../numeric.c"
   puts(_("%s%ld to %ld"));
@@ -1218,28 +1219,28 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
 #line 77 "../numeric.c"
   puts(_("%sless than or equal to %ld"));
-#line 390 "../usage.c"
+#line 339 "../usage.c"
   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
-#line 652 "../usage.c"
+#line 601 "../usage.c"
   puts(_("requires the option '%s'\n"));
-#line 655 "../usage.c"
+#line 604 "../usage.c"
   puts(_("requires these options:\n"));
-#line 1321 "../usage.c"
+#line 1270 "../usage.c"
   puts(_("   Arg Option-Name   Req?  Description\n"));
-#line 1315 "../usage.c"
+#line 1264 "../usage.c"
   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
-#line 167 "../enum.c"
+#line 143 "../enum.c"
   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
        "will set them all.  Multiple entries may be passed as an option\n"
        "argument list.\n"));
-#line 910 "../usage.c"
+#line 859 "../usage.c"
   puts(_("\t\t\t\t- may appear up to %d times\n"));
-#line 77 "../enum.c"
+#line 52 "../enum.c"
   puts(_("The valid \"%s\" option keywords are:\n"));
-#line 1152 "../usage.c"
+#line 1101 "../usage.c"
   puts(_("The next option supports vendor supported extra options:"));
-#line 773 "../usage.c"
+#line 722 "../usage.c"
   puts(_("These additional options are:"));
   /* END-USAGE-TEXT */
 }
index 2fef0f697f2e391f2d2d5fba3fffc418250f2a82..5c8aaf7ec049cc52aabe9a09f7646f91257039e1 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpq-opts.h)
  *
- *  It has been AutoGen-ed  June 27, 2022 at 12:01:04 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:26 PM by AutoGen 5.18.16
  *  From the definitions    ntpq-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This header file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntpq program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -45,6 +45,8 @@
 #define AUTOOPTS_NTPQ_OPTS_H_GUARD 1
 #include "config.h"
 #include <autoopts/options.h>
+#include <stdarg.h>
+#include <stdnoreturn.h>
 
 /**
  *  Ensure that the library used for compiling this generated header is at
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 167937
+#define AO_TEMPLATE_VERSION 172033
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
   Choke Me.
 #endif
 
+#if GCC_VERSION > 40400
+#define NOT_REACHED __builtin_unreachable();
+#else
+#define NOT_REACHED
+#endif
+
 /**
  *  Enumeration of each option type for ntpq
  */
@@ -306,6 +314,7 @@ static inline char* aoGetsText(char const* pz) {
 # endif
 #endif  /* ENABLE_NLS */
 
+
 #ifdef  __cplusplus
 }
 #endif
index 8716879a1251b0750ff356e9a86eb6311c7861be..320b9884179cde8ac080b3164fb115a5592685cb 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpsnmpd-opts.c)
  *
- *  It has been AutoGen-ed  June 23, 2020 at 02:20:57 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:28 PM by AutoGen 5.18.16
  *  From the definitions    ntpsnmpd-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This source file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntpsnmpd program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
 #define OPTION_CODE_COMPILE 1
 #include "ntpsnmpd-opts.h"
 #include <sys/types.h>
+#include <sys/stat.h>
 
+#include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #ifdef  __cplusplus
 extern "C" {
@@ -62,7 +67,7 @@ extern FILE * option_usage_fp;
  */
 static char const ntpsnmpd_opt_strs[1613] =
 /*     0 */ "ntpsnmpd 4.2.8p15\n"
-            "Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+            "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
@@ -319,7 +324,7 @@ static char const * const apzHomeList[3] = {
 #define zDetail         (NULL)
 /** The full version string for ntpsnmpd. */
 #define zFullVersion    (ntpsnmpd_opt_strs+1595)
-/* extracted from optcode.tlib near line 364 */
+/* extracted from optcode.tlib near line 342 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -351,7 +356,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od)
     ex_code = NTPSNMPD_EXIT_SUCCESS;
     optionUsage(&ntpsnmpdOptions, ex_code);
     /* NOTREACHED */
-    exit(1);
+    exit(NTPSNMPD_EXIT_FAILURE);
     (void)opts;
     (void)od;
 }
@@ -543,19 +548,19 @@ static void bogus_function(void) {
      extract the correct strings.  These strings are actually referenced
      by a field name in the ntpsnmpdOptions structure noted in the
      comments below.  The literal text is defined in ntpsnmpd_opt_strs.
-   
+
      NOTE: the strings below are segmented with respect to the source string
      ntpsnmpd_opt_strs.  The strings above are handed off for translation
      at run time a paragraph at a time.  Consequently, they are presented here
      for translation a paragraph at a time.
-   
+
      ALSO: often the description for an option will reference another option
      by name.  These are set off with apostrophe quotes (I hope).  Do not
      translate option names.
    */
   /* referenced via ntpsnmpdOptions.pzCopyright */
   puts(_("ntpsnmpd 4.2.8p15\n\
-Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -616,234 +621,230 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
   /* LIBOPTS-MESSAGES: */
 #line 67 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 93 "../autoopts.c"
+#line 89 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 53 "../init.c"
+#line 48 "../init.c"
   puts(_("AutoOpts function called without option descriptor\n"));
-#line 86 "../init.c"
+#line 81 "../init.c"
   puts(_("\tThis exceeds the compiled library version:  "));
-#line 84 "../init.c"
+#line 79 "../init.c"
   puts(_("Automated Options Processing Error!\n"
        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
-#line 80 "../autoopts.c"
+#line 78 "../autoopts.c"
   puts(_("realloc of %d bytes at 0x%p failed\n"));
-#line 88 "../init.c"
+#line 83 "../init.c"
   puts(_("\tThis is less than the minimum library version:  "));
 #line 121 "../version.c"
   puts(_("Automated Options version %s\n"
-       "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
-#line 87 "../makeshell.c"
+       "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
+#line 49 "../makeshell.c"
   puts(_("(AutoOpts bug):  %s.\n"));
 #line 90 "../reset.c"
   puts(_("optionResetOpt() called, but reset-option not configured"));
-#line 292 "../usage.c"
+#line 241 "../usage.c"
   puts(_("could not locate the 'help' option"));
-#line 336 "../autoopts.c"
+#line 330 "../autoopts.c"
   puts(_("optionProcess() was called with invalid data"));
-#line 748 "../usage.c"
+#line 697 "../usage.c"
   puts(_("invalid argument type specified"));
-#line 598 "../find.c"
+#line 568 "../find.c"
   puts(_("defaulted to option with optional arg"));
 #line 76 "../alias.c"
   puts(_("aliasing option is out of range."));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
-#line 108 "../find.c"
+#line 78 "../find.c"
   puts(_("  The following options match:\n"));
-#line 293 "../find.c"
+#line 263 "../find.c"
   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
 #line 161 "../check.c"
   puts(_("%s: Command line arguments required\n"));
 #line 43 "../alias.c"
   puts(_("%d %s%s options allowed\n"));
-#line 94 "../makeshell.c"
+#line 56 "../makeshell.c"
   puts(_("%s error %d (%s) calling %s for '%s'\n"));
-#line 306 "../makeshell.c"
+#line 268 "../makeshell.c"
   puts(_("interprocess pipe"));
-#line 168 "../version.c"
+#line 171 "../version.c"
   puts(_("error: version option argument '%c' invalid.  Use:\n"
        "\t'v' - version only\n"
        "\t'c' - version and copyright\n"
        "\t'n' - version and full copyright notice\n"));
 #line 58 "../check.c"
   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
-#line 217 "../find.c"
+#line 187 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
-#line 430 "../find.c"
+#line 400 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
 #line 38 "../alias.c"
   puts(_("-equivalence"));
-#line 469 "../find.c"
+#line 439 "../find.c"
   puts(_("%s: illegal option -- %c\n"));
 #line 110 "../reset.c"
   puts(_("%s: illegal option -- %c\n"));
-#line 271 "../find.c"
+#line 241 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 755 "../find.c"
+#line 740 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
 #line 118 "../reset.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 335 "../find.c"
+#line 305 "../find.c"
   puts(_("%s: unknown vendor extension option -- %s\n"));
-#line 159 "../enum.c"
+#line 135 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 169 "../enum.c"
+#line 145 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 747 "../usage.c"
+#line 696 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 1081 "../usage.c"
+#line 1030 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 385 "../find.c"
+#line 355 "../find.c"
   puts(_("%s: invalid option name: %s\n"));
-#line 527 "../find.c"
+#line 497 "../find.c"
   puts(_("%s: The '%s' option requires an argument.\n"));
-#line 156 "../autoopts.c"
+#line 150 "../autoopts.c"
   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
        "\t'%s' and '%s'."));
 #line 94 "../check.c"
   puts(_("%s error:  The %s option is required\n"));
-#line 632 "../find.c"
+#line 602 "../find.c"
   puts(_("%s: The '%s' option cannot have an argument.\n"));
 #line 151 "../check.c"
   puts(_("%s: Command line arguments are not allowed.\n"));
-#line 535 "../save.c"
+#line 568 "../save.c"
   puts(_("error %d (%s) creating %s\n"));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
 #line 93 "../reset.c"
   puts(_("%s error: The '%s' option requires an argument.\n"));
-#line 184 "../save.c"
+#line 122 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
-#line 238 "../save.c"
+#line 175 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
 #line 143 "../restore.c"
   puts(_("%s error: no saved option state\n"));
-#line 231 "../autoopts.c"
+#line 225 "../autoopts.c"
   puts(_("'%s' is not a command line option.\n"));
-#line 111 "../time.c"
+#line 113 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
-#line 132 "../save.c"
-  puts(_("'%s' not defined\n"));
 #line 50 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
 #line 92 "../check.c"
   puts(_("%s error:  The %s option must appear %d times.\n"));
-#line 164 "../numeric.c"
+#line 165 "../numeric.c"
   puts(_("%s error:  '%s' is not a recognizable number.\n"));
-#line 200 "../enum.c"
+#line 176 "../enum.c"
   puts(_("%s error:  %s exceeds %s keyword count\n"));
-#line 330 "../usage.c"
+#line 279 "../usage.c"
   puts(_("Try '%s %s' for more information.\n"));
 #line 45 "../alias.c"
   puts(_("one %s%s option allowed\n"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("standard output"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard output"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard output"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard output"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard error"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard error"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard error"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard error"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("write"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("write"));
-#line 273 "../usage.c"
+#line 222 "../usage.c"
   puts(_("write"));
-#line 414 "../usage.c"
+#line 363 "../usage.c"
   puts(_("write"));
-#line 624 "../usage.c"
+#line 573 "../usage.c"
   puts(_("write"));
-#line 174 "../version.c"
+#line 177 "../version.c"
   puts(_("write"));
 #line 60 "../numeric.c"
   puts(_("%s error:  %s option value %ld is out of range.\n"));
 #line 44 "../check.c"
   puts(_("%s error:  %s option requires the %s option\n"));
-#line 131 "../save.c"
-  puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 183 "../save.c"
+#line 121 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 237 "../save.c"
+#line 174 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 256 "../save.c"
+#line 193 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 534 "../save.c"
+#line 567 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   /* END-LIBOPTS-MESSAGES */
 
   /* USAGE-TEXT: */
-#line 873 "../usage.c"
+#line 822 "../usage.c"
   puts(_("\t\t\t\t- an alternate for '%s'\n"));
-#line 1148 "../usage.c"
+#line 1097 "../usage.c"
   puts(_("Version, usage and configuration options:"));
-#line 924 "../usage.c"
+#line 873 "../usage.c"
   puts(_("\t\t\t\t- default option for unnamed options\n"));
-#line 837 "../usage.c"
+#line 786 "../usage.c"
   puts(_("\t\t\t\t- disabled as '--%s'\n"));
-#line 1117 "../usage.c"
+#line 1066 "../usage.c"
   puts(_(" --- %-14s %s\n"));
-#line 1115 "../usage.c"
+#line 1064 "../usage.c"
   puts(_("This option has been disabled"));
-#line 864 "../usage.c"
+#line 813 "../usage.c"
   puts(_("\t\t\t\t- enabled by default\n"));
 #line 40 "../alias.c"
   puts(_("%s error:  only "));
-#line 1194 "../usage.c"
+#line 1143 "../usage.c"
   puts(_(" - examining environment variables named %s_*\n"));
 #line 168 "../file.c"
   puts(_("\t\t\t\t- file must not pre-exist\n"));
 #line 172 "../file.c"
   puts(_("\t\t\t\t- file must pre-exist\n"));
-#line 380 "../usage.c"
+#line 329 "../usage.c"
   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
        "hyphen and the flag character.\n"));
-#line 921 "../makeshell.c"
+#line 882 "../makeshell.c"
   puts(_("\n"
        "= = = = = = = =\n\n"
        "This incarnation of genshell will produce\n"
        "a shell script to parse the options for %s:\n\n"));
-#line 166 "../enum.c"
+#line 142 "../enum.c"
   puts(_("  or an integer mask with any of the lower %d bits set\n"));
-#line 897 "../usage.c"
+#line 846 "../usage.c"
   puts(_("\t\t\t\t- is a set membership option\n"));
-#line 918 "../usage.c"
+#line 867 "../usage.c"
   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
-#line 382 "../usage.c"
+#line 331 "../usage.c"
   puts(_("Options are specified by single or double hyphens and their name.\n"));
-#line 904 "../usage.c"
+#line 853 "../usage.c"
   puts(_("\t\t\t\t- may appear multiple times\n"));
-#line 891 "../usage.c"
+#line 840 "../usage.c"
   puts(_("\t\t\t\t- may not be preset\n"));
-#line 1309 "../usage.c"
+#line 1258 "../usage.c"
   puts(_("   Arg Option-Name    Description\n"));
-#line 1245 "../usage.c"
+#line 1194 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1303 "../usage.c"
+#line 1252 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1304 "../usage.c"
+#line 1253 "../usage.c"
   puts(_(" %3s %s"));
-#line 1310 "../usage.c"
+#line 1259 "../usage.c"
   puts(_(" %3s %s"));
-#line 387 "../usage.c"
+#line 336 "../usage.c"
   puts(_("The '-#<number>' option may omit the hash char\n"));
-#line 383 "../usage.c"
+#line 332 "../usage.c"
   puts(_("All arguments are named options.\n"));
-#line 971 "../usage.c"
+#line 920 "../usage.c"
   puts(_(" - reading file %s"));
-#line 409 "../usage.c"
+#line 358 "../usage.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
 #line 100 "../version.c"
@@ -852,17 +853,17 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
 #line 129 "../version.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
-#line 903 "../usage.c"
+#line 852 "../usage.c"
   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
-#line 944 "../usage.c"
+#line 893 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 1192 "../usage.c"
+#line 1141 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 682 "../usage.c"
+#line 631 "../usage.c"
   puts(_("prohibits these options:\n"));
-#line 677 "../usage.c"
+#line 626 "../usage.c"
   puts(_("prohibits the option '%s'\n"));
 #line 81 "../numeric.c"
   puts(_("%s%ld to %ld"));
@@ -880,28 +881,28 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
 #line 77 "../numeric.c"
   puts(_("%sless than or equal to %ld"));
-#line 390 "../usage.c"
+#line 339 "../usage.c"
   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
-#line 652 "../usage.c"
+#line 601 "../usage.c"
   puts(_("requires the option '%s'\n"));
-#line 655 "../usage.c"
+#line 604 "../usage.c"
   puts(_("requires these options:\n"));
-#line 1321 "../usage.c"
+#line 1270 "../usage.c"
   puts(_("   Arg Option-Name   Req?  Description\n"));
-#line 1315 "../usage.c"
+#line 1264 "../usage.c"
   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
-#line 167 "../enum.c"
+#line 143 "../enum.c"
   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
        "will set them all.  Multiple entries may be passed as an option\n"
        "argument list.\n"));
-#line 910 "../usage.c"
+#line 859 "../usage.c"
   puts(_("\t\t\t\t- may appear up to %d times\n"));
-#line 77 "../enum.c"
+#line 52 "../enum.c"
   puts(_("The valid \"%s\" option keywords are:\n"));
-#line 1152 "../usage.c"
+#line 1101 "../usage.c"
   puts(_("The next option supports vendor supported extra options:"));
-#line 773 "../usage.c"
+#line 722 "../usage.c"
   puts(_("These additional options are:"));
   /* END-USAGE-TEXT */
 }
index 0921e356e5e6763e8874657f72c5978bdea3f219..1fd19a06abef7f7877e3f1e8ded126b6174c48b9 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpsnmpd-opts.h)
  *
- *  It has been AutoGen-ed  June 23, 2020 at 02:20:57 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:28 PM by AutoGen 5.18.16
  *  From the definitions    ntpsnmpd-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This header file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntpsnmpd program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -45,6 +45,8 @@
 #define AUTOOPTS_NTPSNMPD_OPTS_H_GUARD 1
 #include "config.h"
 #include <autoopts/options.h>
+#include <stdarg.h>
+#include <stdnoreturn.h>
 
 /**
  *  Ensure that the library used for compiling this generated header is at
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 167937
+#define AO_TEMPLATE_VERSION 172033
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
   Choke Me.
 #endif
 
+#if GCC_VERSION > 40400
+#define NOT_REACHED __builtin_unreachable();
+#else
+#define NOT_REACHED
+#endif
+
 /**
  *  Enumeration of each option type for ntpsnmpd
  */
@@ -235,6 +243,7 @@ static inline char* aoGetsText(char const* pz) {
 # endif
 #endif  /* ENABLE_NLS */
 
+
 #ifdef  __cplusplus
 }
 #endif
index 6def9fb03a67443754c06547c294d5290e70369d..e342098ea2c0867d81224237052b29357682dcc4 100644 (file)
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (calc_tickadj-opts)
 #
-# It has been AutoGen-ed  April  5, 2019 at 01:12:39 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:25:29 PM by AutoGen 5.18.16
 # From the definitions    calc_tickadj-opts.def
 # and the template file   perlopt
 
@@ -39,7 +39,7 @@ sub processOptions {
         'help|?', 'more-help'));
 
     $usage = <<'USAGE';
-calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.8p13
+calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.8p15
 USAGE: calc_tickadj [ -<flag> [<val>] | --<name>[{=| }<val>] ]... 
 
     -d, --drift-file=str         Ntp drift file to use
index 691a06cf9196fca2b63fc1de90a818e866d952e2..2ca507b25641c3e9aa6072db22dd5c4d65d88fc2 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH calc_tickadj 1calc_tickadjman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH calc_tickadj 1calc_tickadjman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:27 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:24:59 AM by AutoGen 5.18.16
 .\" From the definitions calc_tickadj-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 1ee73c1a212e7e4bab6f80986880accb41028f76..0babd94770b882ba7dff95650f1a98e49e7bb7b7 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (calc_tickadj-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:28 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:00 AM by AutoGen 5.18.16
 .\"  From the definitions    calc_tickadj-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index a29110e9ede1ab4ebb22fcfde8d407e28a4f2c0c..61fa237ed5f9e1b49945a395e9d083e31d6c3229 100644 (file)
@@ -149,7 +149,7 @@ used to select the program, defaulting to <samp>more</samp>.  Both will exit
 with a status code of 0.
 </p>
 <div class="example">
-<pre class="example">calc_tickadj - Calculates &quot;optimal&quot; value for tick given ntp drift file. - Ver. 4.2.8p13
+<pre class="example">calc_tickadj - Calculates &quot;optimal&quot; value for tick given ntp drift file. - Ver. 4.2.8p15
 USAGE: calc_tickadj [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... 
 
     -d, --drift-file=str         Ntp drift file to use
index 691a06cf9196fca2b63fc1de90a818e866d952e2..2ca507b25641c3e9aa6072db22dd5c4d65d88fc2 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH calc_tickadj 1calc_tickadjman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH calc_tickadj 1calc_tickadjman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:27 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:24:59 AM by AutoGen 5.18.16
 .\" From the definitions calc_tickadj-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 1ee73c1a212e7e4bab6f80986880accb41028f76..0babd94770b882ba7dff95650f1a98e49e7bb7b7 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (calc_tickadj-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:28 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:00 AM by AutoGen 5.18.16
 .\"  From the definitions    calc_tickadj-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index 14ede3c6ab59c46a0f0f975aefa645549fac5255..3c140e6a21250e996f08830e1dac136946e5df7b 100644 (file)
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-calc_tickadj.texi)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:29 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:18:24 PM by AutoGen 5.18.16
 # From the definitions    calc_tickadj-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -63,7 +63,7 @@ with a status code of 0.
 
 @exampleindent 0
 @example
-calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.8p13
+calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.8p15
 USAGE: calc_tickadj [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... 
 
     -d, --drift-file=str         Ntp drift file to use
index bbaa8cd979e1d147bbcb243ba790495df752724b..d40736ff5bc12da8dd5098094907cf67f3846767 100644 (file)
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-plot_summary.texi)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:46 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:18:28 PM by AutoGen 5.18.16
 # From the definitions    plot_summary-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
index cc80112a0c2c7f949ac03e5dda975e752ed731e4..c131fa72f6de1e1251d0a0452c99aaa616e492e4 100644 (file)
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-summary.texi)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:50 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:18:30 PM by AutoGen 5.18.16
 # From the definitions    summary-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
index 3a0f61f79a8a197a924bf73ab87710021e925645..00369b01804e28f4fd4b05b3091ded559bdfac05 100644 (file)
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntp-wait.texi)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:32 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  2, 2023 at 05:25:05 AM by AutoGen 5.18.16
 # From the definitions    ntp-wait-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
index 125e5920349f6cb2a9adc821b0eb18d3ffc5e86d..c712c7a5e683e246ba3e43176ae9435f94bfa616 100644 (file)
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (ntp-wait-opts)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:30 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  2, 2023 at 05:25:03 AM by AutoGen 5.18.16
 # From the definitions    ntp-wait-opts.def
 # and the template file   perlopt
 
index 930f5606785769e32504f67838ea1dff6900eb35..16e103f72024605e46fd8444fe08ea5197cdfc18 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntp-wait 1ntp-waitman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH ntp-wait 1ntp-waitman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:33 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:07 AM by AutoGen 5.18.16
 .\" From the definitions ntp-wait-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 882ec9bd6811cb7675aabc42e73d141a6d5f8c54..befe44c6eaf7481e5d0bfe11694666890d0840af 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt NTP_WAIT 1ntp-waitmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntp-wait-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:30 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:04 AM by AutoGen 5.18.16
 .\"  From the definitions    ntp-wait-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index 0fdf23a7b9647b20cccd8ad38fad7bb0b5943dda..90816ef94da52d0285d8f40f3dd8a7a919141f36 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntp-wait @NTP_WAIT_MS@ "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH ntp-wait @NTP_WAIT_MS@ "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:33 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:07 AM by AutoGen 5.18.16
 .\" From the definitions ntp-wait-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 27b572f3ac60b2d64af82eb7f9876afe5cb4bae8..8c2212df0affefdf25fbc43d904687d5c08be28f 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt NTP_WAIT @NTP_WAIT_MS@ User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntp-wait-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:30 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:04 AM by AutoGen 5.18.16
 .\"  From the definitions    ntp-wait-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index f75dd010c98aa21441cfb6d3effd0a50b207ad35..403715be10cf1b3e9b890d355a7286f4a25fc592 100644 (file)
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntpsweep.texi)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:34 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:18:26 PM by AutoGen 5.18.16
 # From the definitions    ntpsweep-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
index 2c243e7ec5e2ef48ebcae8b7f503d97229817611..e6f1061d9b29a7327cb8651800af6357fc315e74 100644 (file)
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (ntpsweep-opts)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:34 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:25:29 PM by AutoGen 5.18.16
 # From the definitions    ntpsweep-opts.def
 # and the template file   perlopt
 
index 9f9fca1ddbf8727bd79d650d2c9b245b12f54e00..0dbc4dc6c414f695e832e223d2a0c99c31d4fb61 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpsweep 1ntpsweepman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH ntpsweep 1ntpsweepman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:37 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:12 AM by AutoGen 5.18.16
 .\" From the definitions ntpsweep-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 72550bcc3eb7138a104a9d7edd5f74fa1188bbf3..9b5f9c235ba33e6eee6876cfa1557eae51a567c9 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt NTPSWEEP 1ntpsweepmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpsweep-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:36 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:10 AM by AutoGen 5.18.16
 .\"  From the definitions    ntpsweep-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index 9f9fca1ddbf8727bd79d650d2c9b245b12f54e00..0dbc4dc6c414f695e832e223d2a0c99c31d4fb61 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpsweep 1ntpsweepman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH ntpsweep 1ntpsweepman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:37 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:12 AM by AutoGen 5.18.16
 .\" From the definitions ntpsweep-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 72550bcc3eb7138a104a9d7edd5f74fa1188bbf3..9b5f9c235ba33e6eee6876cfa1557eae51a567c9 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt NTPSWEEP 1ntpsweepmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpsweep-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:36 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:10 AM by AutoGen 5.18.16
 .\"  From the definitions    ntpsweep-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index 11b73e91e49fe3d043bd308dde41fbfe746e0aea..5f88f957c4b8eb36c06617e8eb762e7e2c897c0a 100644 (file)
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntptrace.texi)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:39 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:27:44 PM by AutoGen 5.18.16
 # From the definitions    ntptrace-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
index 8ab36622e9eeab211f0a2b2f4bc2a95e2666c07a..853e0dce950ded2ec0013bcebb4fb504a6dbab5e 100644 (file)
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (ntptrace-opts)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:38 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:25:30 PM by AutoGen 5.18.16
 # From the definitions    ntptrace-opts.def
 # and the template file   perlopt
 
index 56dc6b2189a2a903c145d2a31f30dbd154c109d1..2af282eb4a048307b552519b2b39ca46e131ec5f 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntptrace 1ntptraceman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH ntptrace 1ntptraceman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:41 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:17 AM by AutoGen 5.18.16
 .\" From the definitions ntptrace-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 62ae7b1078b19999b0b5dfd269c95a445b04b8e4..b501e251f9dc1411fca40ad0654d1f3d85c23b76 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt NTPTRACE 1ntptracemdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntptrace-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:38 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:14 AM by AutoGen 5.18.16
 .\"  From the definitions    ntptrace-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index 3686ffd61ff28680348212223ba77bfd5ce1bdf4..82dd3717cfd15f96a688761b7b5bb7dfb0c091c3 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntptrace @NTPTRACE_MS@ "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH ntptrace @NTPTRACE_MS@ "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:41 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:17 AM by AutoGen 5.18.16
 .\" From the definitions ntptrace-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 47bac3124f41548652cb57329aa1e9a2163377a6..cfb9564e0284532fcd8c26889d724cbdb5aea109 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt NTPTRACE @NTPTRACE_MS@ User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntptrace-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:38 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:14 AM by AutoGen 5.18.16
 .\"  From the definitions    ntptrace-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index 4f5f5755bf433bceacb831b2390322ac04d34ace..d49ed8106cf92aebc1dae2e84f6f1a1cbb10cc56 100644 (file)
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (plot_summary-opts)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:46 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:25:30 PM by AutoGen 5.18.16
 # From the definitions    plot_summary-opts.def
 # and the template file   perlopt
 
index 366b14d88d6bef1d4e6cf22332c11dd2761424d5..db71a31edb776e86c231aa7dfaec92fbeaa63c24 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH plot_summary 1plot_summaryman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH plot_summary 1plot_summaryman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:47 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:25 AM by AutoGen 5.18.16
 .\" From the definitions plot_summary-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 144b95a839cdb5c17a738a618900897c4f4a7648..8c52af45369f4e6584a7592d0ef44ddf6c60edc5 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (plot_summary-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:48 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:27 AM by AutoGen 5.18.16
 .\"  From the definitions    plot_summary-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index 366b14d88d6bef1d4e6cf22332c11dd2761424d5..db71a31edb776e86c231aa7dfaec92fbeaa63c24 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH plot_summary 1plot_summaryman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH plot_summary 1plot_summaryman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:47 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:25 AM by AutoGen 5.18.16
 .\" From the definitions plot_summary-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 144b95a839cdb5c17a738a618900897c4f4a7648..8c52af45369f4e6584a7592d0ef44ddf6c60edc5 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (plot_summary-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:48 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:27 AM by AutoGen 5.18.16
 .\"  From the definitions    plot_summary-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index 0fc894eb209ef43d66bdd370445ac15705e410bf..92a9de66801fa067e4b3c08aa678d2507794cb90 100644 (file)
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (summary-opts)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:46 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:25:30 PM by AutoGen 5.18.16
 # From the definitions    summary-opts.def
 # and the template file   perlopt
 
index d91e6f9015f06d1de055a712ea74b031730e4718..5b10d3909467ca8db5b4e9f45393945b2984e67f 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH summary 1summaryman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH summary 1summaryman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:51 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:30 AM by AutoGen 5.18.16
 .\" From the definitions summary-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 4759a2abbe78a09221e9980e92cde669b98bd93c..c1bad23c180955e578077ddf5fa5b149533206ee 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt SUMMARY 1summarymdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (summary-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:52 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:31 AM by AutoGen 5.18.16
 .\"  From the definitions    summary-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index d91e6f9015f06d1de055a712ea74b031730e4718..5b10d3909467ca8db5b4e9f45393945b2984e67f 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH summary 1summaryman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH summary 1summaryman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:51 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:30 AM by AutoGen 5.18.16
 .\" From the definitions summary-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index 4759a2abbe78a09221e9980e92cde669b98bd93c..c1bad23c180955e578077ddf5fa5b149533206ee 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt SUMMARY 1summarymdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (summary-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:52 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:31 AM by AutoGen 5.18.16
 .\"  From the definitions    summary-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index 5b74cbf35adeec54a3c4a5e8368815d2aa397743..aa893b87acfce40fff98b71844a615346a56d526 100644 (file)
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-update-leap.texi)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:43 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  2, 2023 at 05:25:20 AM by AutoGen 5.18.16
 # From the definitions    update-leap-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
index b0dae49eef44e2768de319294d75210d4238f474..d836c1272cf9ead466157208d0f71d10e7ce2358 100644 (file)
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (update-leap-opts)
 #
-# It has been AutoGen-ed  June 23, 2020 at 02:21:46 AM by AutoGen 5.18.5
+# It has been AutoGen-ed  March  4, 2023 at 09:25:30 PM by AutoGen 5.18.16
 # From the definitions    update-leap-opts.def
 # and the template file   perlopt
 
index cebca7f66452e9b1bb59de306ad8c2ebcc5aaf7d..72a7c73af3e4c41c6dad6284434b4ea7093ce0da 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH update-leap 1update-leapman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH update-leap 1update-leapman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:45 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:22 AM by AutoGen 5.18.16
 .\" From the definitions update-leap-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index ab83b9ea98d11827eabf7b1457da49425bc5ca0e..a55d03063707eab2b0fa595000d35f4c7fc30ff8 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt UPDATE_LEAP 1update-leapmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (update-leap-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:42 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:18 AM by AutoGen 5.18.16
 .\"  From the definitions    update-leap-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index cebca7f66452e9b1bb59de306ad8c2ebcc5aaf7d..72a7c73af3e4c41c6dad6284434b4ea7093ce0da 100644 (file)
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH update-leap 1update-leapman "23 Jun 2020" "ntp (4.2.8p15)" "User Commands"
+.TH update-leap 1update-leapman "02 Mar 2023" "ntp (4.2.8p15)" "User Commands"
 .\"
 .\" EDIT THIS FILE WITH CAUTION (in-mem file)
 .\"
-.\" It has been AutoGen-ed June 23, 2020 at 02:21:45 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 2, 2023 at 05:25:22 AM by AutoGen 5.18.16
 .\" From the definitions update-leap-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
index ab83b9ea98d11827eabf7b1457da49425bc5ca0e..a55d03063707eab2b0fa595000d35f4c7fc30ff8 100644 (file)
@@ -1,9 +1,9 @@
-.Dd June 23 2020
+.Dd March 2 2023
 .Dt UPDATE_LEAP 1update-leapmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (update-leap-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  June 23, 2020 at 02:21:42 AM by AutoGen 5.18.5
+.\"  It has been AutoGen-ed  March  2, 2023 at 05:25:18 AM by AutoGen 5.18.16
 .\"  From the definitions    update-leap-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
index e494f0ef4d1fa213ac8aa38038d91a0b4af70238..762a00823428b7a273d9d9dd1ac88951c921a848 100644 (file)
@@ -1,4 +1,4 @@
-#assert (version-compare >= autogen-version "5.18.5")
+#assert (version-compare >= autogen-version "5.18.16")
 // >= is usually what we want.
 // > is when we need a pre* version
 guard-option-names;
index 9334ac8da8160a692cb07a1e2b56d358364dcd63..07b0b9870f0189542e811ba60660083eb41af3ad 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: Text -*- */
 
 copyright = {
-    date  = "1992-2020";
+    date  = "1992-2023";
     owner = "The University of Delaware and Network Time Foundation";
     eaddr = "http://bugs.ntp.org, bugs@ntp.org";
     type  = ntp;
index 26d6fd2e7b11fb4d0750107654fbbb137cca034a..7718bd18f4302f5b6476e60e33bd9b4cad523ae4 100644 (file)
@@ -1,7 +1,7 @@
                     GNU GENERAL PUBLIC LICENSE
                        Version 3, 29 June 2007
 
- Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
index b6db23288f8c4bff339ee332e952e1a5702c05b1..f7b8c6397624834101038e1b4726f4ac819b4be1 100644 (file)
@@ -1,7 +1,7 @@
                   GNU LESSER GENERAL PUBLIC LICENSE
                        Version 3, 29 June 2007
 
- Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -10,7 +10,7 @@
 the terms and conditions of version 3 of the GNU General Public
 License, supplemented by the additional permissions listed below.
 
-  0. Additional Definitions. 
+  0. Additional Definitions.
 
   As used herein, "this License" refers to version 3 of the GNU Lesser
 General Public License, and the "GNU GPL" refers to version 3 of the GNU
@@ -111,7 +111,7 @@ the following:
        a copy of the Library already present on the user's computer
        system, and (b) will operate properly with a modified version
        of the Library that is interface-compatible with the Linked
-       Version. 
+       Version.
 
    e) Provide Installation Information, but only if you would otherwise
    be required to provide such information under section 6 of the
index 74948befa59e2103389f3515ca054c712a136148..b74eb002794868af647ff64ea1f32b70eb954677 100644 (file)
@@ -1,4 +1,4 @@
-Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
 
index c67460cd65d5423e919bbc603d3e518708634091..8248ba76aa4c8ae9485f5e326e43812926fbb587 100644 (file)
@@ -7,23 +7,19 @@ noinst_LTLIBRARIES      = libopts.la
 endif
 libopts_la_SOURCES      = libopts.c
 libopts_la_CPPFLAGS     = -I$(srcdir)
-libopts_la_LDFLAGS      = -version-info  41:0:16
+libopts_la_LDFLAGS      = -version-info  42:1:17
 EXTRA_DIST             =
 BUILT_SOURCES          =
 MOSTLYCLEANFILES       =
 
-AM_CFLAGS      = $(NTP_HARD_CFLAGS)
-AM_CPPFLAGS    = $(NTP_HARD_CPPFLAGS)
-AM_LDFLAGS     = $(NTP_HARD_LDFLAGS)
-
 libopts.c:             $(BUILT_SOURCES)
-       @: do-nothing rule to avoid default SCCS get
+@: do-nothing rule to avoid default SCCS get
 
 
 # Makefile fragment from gnulib-s stdnoreturn module:
 #
-_NORETURN_H=$(srcdir)/compat/_Noreturn.h
-EXTRA_DIST += $(srcdir)/compat/_Noreturn.h
+_NORETURN_H=$(srcdir)/_Noreturn.h
+EXTRA_DIST += _Noreturn.h
 BUILT_SOURCES += $(STDNORETURN_H)
 if GL_GENERATE_STDNORETURN_H
 stdnoreturn.h: stdnoreturn.in.h $(top_builddir)/config.status $(_NORETURN_H)
@@ -42,23 +38,24 @@ EXTRA_DIST += stdnoreturn.in.h
 
 EXTRA_DIST += \
     COPYING.gplv3           COPYING.lgplv3          COPYING.mbsd  \
-    MakeDefs.inc            README                  ag-char-map.h  \
-    alias.c                 ao-strs.c               ao-strs.h  \
-    autoopts/project.h      autoopts/options.h      autoopts/usage-txt.h  \
-    autoopts.c              autoopts.h              boolean.c  \
-    check.c                 compat/snprintf.c       compat/strchr.c  \
-    compat/strdup.c         compat/_Noreturn.h      compat/pathfind.c  \
-    compat/compat.h         compat/windows-config.h configfile.c  \
+    MakeDefs.inc            README                  _Noreturn.h  \
+    ag-char-map.h           alias.c                 ao-strs.c  \
+    ao-strs.h               autoopts.c              autoopts.h  \
+    autoopts/options.h      autoopts/project.h      autoopts/usage-txt.h  \
+    boolean.c               check.c                 compat/compat.h  \
+    compat/pathfind.c       compat/snprintf.c       compat/strchr.c  \
+    compat/strdup.c         compat/windows-config.h configfile.c  \
     cook.c                  enum.c                  env.c  \
     file.c                  find.c                  genshell.c  \
     genshell.h              gettext.h               init.c  \
-    intprops.h              load.c                  m4/stdnoreturn.m4  \
-    m4/liboptschk.m4        m4/libopts.m4           makeshell.c  \
+    intprops.h              load.c                  m4/libopts.m4  \
+    m4/liboptschk.m4        m4/stdnoreturn.m4       makeshell.c  \
     nested.c                numeric.c               option-value-type.c  \
     option-value-type.h     option-xat-attribute.c  option-xat-attribute.h  \
     parse-duration.c        parse-duration.h        pgusage.c  \
     proto.h                 putshell.c              reset.c  \
-    restore.c               save.c                  sort.c  \
-    stack.c                 stdnoreturn.in.h        streqvcmp.c  \
-    text_mmap.c             time.c                  tokenize.c  \
-    usage.c                 version.c
+    restore.c               save-flags.c            save-flags.h  \
+    save.c                  sort.c                  stack.c  \
+    stdnoreturn.in.h        streqvcmp.c             text_mmap.c  \
+    time.c                  tokenize.c              usage.c  \
+    version.c
index 98e4f3c677c8fc8863c2ccae29f6675ff787bbe7..5c8b9d7673dbe775580dcb6de698696a191b8135 100644 (file)
@@ -115,7 +115,7 @@ These macros work as follows:
 
 LICENSING:
 
-This material is Copyright (C) 1992-2015 by Bruce Korb.  You are
+This material is Copyright (C) 1992-2018 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 License (see: COPYING.mbsd).  Both of
index e905118ca2423d6737d32f620228adeabc0442fc..cced2303ab5e9b08c7c7073015dec63641fc1dc2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  29 bits for 46 character classifications
- *  generated by char-mapper on 04/25/15 at 09:53:03
+ *  generated by char-mapper on 08/26/18 at 10:44:22
  *
  *  This file contains the character classifications
  *  used by AutoGen and AutoOpts for identifying tokens.
@@ -8,7 +8,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
index 49e1f1fdd1a9f542ecd695860f4269758dfad0a5..231f275d50432d68a403cdb6b52f60e6d527c267 100644 (file)
@@ -12,7 +12,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -31,7 +31,7 @@
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-LOCAL tSuccess
+static tSuccess
 too_many_occurrences(tOptions * opts, tOptDesc * od)
 {
     if ((opts->fOptSet & OPTPROC_ERRSTOP) != 0) {
index 857aa73528b953a8084f4f74aadc41691681c5e6..7f59372601714ed29b0e983dcba305ae712a8490 100644 (file)
@@ -6,7 +6,7 @@
  * From the definitions    ao-strs.def
  * and the template file   strings
  *
- *  Copyright (C) 2011-2015 Bruce Korb, all rights reserved.
+ *  Copyright (C) 2011-2018 Bruce Korb, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the
  *  Modified (3 clause) Berkeley Software Distribution License
  */
 #include "ao-strs.h"
 
-char const ao_strs_strtable[6633] =
+char const ao_strs_strtable[6714] =
 /*     0 */ "-_^\0"
 /*     4 */ "  %s%s\n\0"
-/*    12 */ "auto-options\0"
-/*    25 */ "program\0"
-/*    33 */ "%%-%ds %%s\n\0"
-/*    45 */ "\n"
+/*    12 */ "<?auto-options\0"
+/*    27 */ "<?program\0"
+/*    37 */ "%%-%ds %%s\n\0"
+/*    49 */ "<?program %s>\n\0"
+/*    64 */ "\n"
             "%s\n\n\0"
-/*    51 */ "=file\0"
-/*    57 */ "=Mbr\0"
-/*    62 */ "=Cplx\0"
-/*    68 */ "[=arg]\0"
-/*    75 */ "--%2$s%1$s\0"
-/*    86 */ "=Tim\0"
-/*    91 */ "none\0"
-/*    96 */ "#  preset/initialization file\n"
+/*    70 */ "=file\0"
+/*    76 */ "=Mbr\0"
+/*    81 */ "=Cplx\0"
+/*    87 */ "[=arg]\0"
+/*    94 */ "--%2$s%1$s\0"
+/*   105 */ "=Tim\0"
+/*   110 */ "none\0"
+/*   115 */ "#  preset/initialization file\n"
             "#  %s#\n\0"
-/*   134 */ " %3s %-14s %s\0"
-/*   148 */ "%s\0"
-/*   151 */ "T/F\0"
-/*   155 */ "\n"
+/*   153 */ " %3s %-14s %s\0"
+/*   167 */ "%s\0"
+/*   170 */ "T/F\0"
+/*   174 */ "\n"
             "%s\n\n"
             "%s\0"
-/*   163 */ "Fil\0"
-/*   167 */ "KWd\0"
-/*   171 */ "Mbr\0"
-/*   175 */ "Cpx\0"
-/*   179 */ "no \0"
-/*   183 */ "Num\0"
-/*   187 */ "opt\0"
-/*   191 */ "YES\0"
-/*   195 */ "Str\0"
-/*   199 */ "Tim\0"
-/*   203 */ "\t\t\t\t- \0"
-/*   210 */ "\t\t\t\t  \0"
-/*   217 */ "\t\t\t\t-- and \0"
-/*   229 */ "\t\t\t\t%s\n\0"
-/*   237 */ "      \0"
-/*   244 */ "     \0"
-/*   250 */ "   \0"
-/*   254 */ "  \0"
-/*   257 */ "all\0"
-/*   261 */ " \t\n"
+/*   182 */ "Fil\0"
+/*   186 */ "KWd\0"
+/*   190 */ "Mbr\0"
+/*   194 */ "Cpx\0"
+/*   198 */ "no \0"
+/*   202 */ "Num\0"
+/*   206 */ "opt\0"
+/*   210 */ "YES\0"
+/*   214 */ "Str\0"
+/*   218 */ "Tim\0"
+/*   222 */ "\t\t\t\t- \0"
+/*   229 */ "\t\t\t\t  \0"
+/*   236 */ "\t\t\t\t-- and \0"
+/*   248 */ "\t\t\t\t%s\n\0"
+/*   256 */ "      \0"
+/*   263 */ "     \0"
+/*   269 */ "   \0"
+/*   273 */ "  \0"
+/*   276 */ "all\0"
+/*   280 */ " \t\n"
             ":=\0"
-/*   267 */ "%s_%s_%d=\0"
-/*   277 */ "''\0"
-/*   280 */ "        ;;\n\n\0"
-/*   293 */ "'\n\n\0"
-/*   297 */ "</%s>\n\0"
-/*   304 */ "  %s\n\0"
-/*   310 */ "%%-%ds\0"
-/*   317 */ "\n"
+/*   286 */ "%s_%s_%d=\0"
+/*   296 */ "''\0"
+/*   299 */ "        ;;\n\n\0"
+/*   312 */ "'\n\n\0"
+/*   316 */ "</%s>\n\0"
+/*   323 */ "  %s\n\0"
+/*   329 */ "%%-%ds\0"
+/*   336 */ "\n"
             "export %s_%s_%d\n\0"
-/*   335 */ "false\0"
-/*   341 */ "    -* )\n\0"
-/*   351 */ "flag\0"
-/*   356 */ "INVALID-%d\0"
-/*   367 */ "*INVALID*\0"
-/*   377 */ "\\n\\\n\0"
-/*   382 */ "    --* )\n\0"
-/*   393 */ "--\0"
-/*   396 */ "LONGUSAGE\0"
-/*   406 */ "            %s\n\0"
-/*   422 */ "\\%03o\0"
-/*   428 */ "more\0"
-/*   433 */ "<%s type=nested>\n\0"
-/*   451 */ "%s\n\0"
-/*   455 */ "%s\n"
+/*   354 */ "false\0"
+/*   360 */ "    -* )\n\0"
+/*   370 */ "flag\0"
+/*   375 */ "INVALID-%d\0"
+/*   386 */ "*INVALID*\0"
+/*   396 */ "\\n\\\n\0"
+/*   401 */ "    --* )\n\0"
+/*   412 */ "--\0"
+/*   415 */ "LONGUSAGE\0"
+/*   425 */ "            %s\n\0"
+/*   441 */ "\\%03o\0"
+/*   447 */ "more\0"
+/*   452 */ "<%s type=nested>\n\0"
+/*   470 */ "%s\n\0"
+/*   474 */ "%s\n"
             "  \0"
-/*   461 */ "OPT_ARG_NEEDED=NO\0"
-/*   479 */ "<%s/>\n\0"
-/*   486 */ "OPT_ARG_NEEDED=OK\0"
-/*   504 */ "\t\0"
-/*   506 */ "<%s>\0"
-/*   511 */ "option\0"
-/*   518 */ "\n"
+/*   480 */ "OPT_ARG_NEEDED=NO\0"
+/*   498 */ "<%s/>\n\0"
+/*   505 */ "OPT_ARG_NEEDED=OK\0"
+/*   523 */ "\t\0"
+/*   525 */ "<%s>\0"
+/*   530 */ "option\0"
+/*   537 */ "\n"
             "export %s_%s\n\0"
-/*   533 */ "%s_%s=\0"
-/*   540 */ " | \0"
-/*   544 */ "PAGER\0"
-/*   550 */ " + \0"
-/*   554 */ "  puts(_(%s));\n\0"
-/*   570 */ "\\'\0"
-/*   573 */ "'%s'\0"
-/*   578 */ " -- %s\0"
-/*   585 */ "%s_%s_TEXT='\0"
-/*   598 */ "#! %s\n\0"
-/*   605 */ "\n"
+/*   552 */ "%s_%s=\0"
+/*   559 */ " | \0"
+/*   563 */ "PAGER\0"
+/*   569 */ "%1$s %2$s ; rm -f %2$s\0"
+/*   592 */ " + \0"
+/*   596 */ "  puts(_(%s));\n\0"
+/*   612 */ "\\'\0"
+/*   615 */ "'%s'\0"
+/*   620 */ " -- %s\0"
+/*   627 */ "%s_%s_TEXT='\0"
+/*   640 */ "#! %s\n\0"
+/*   647 */ "\n"
             "env | grep '^%s_'\n\0"
-/*   625 */ "=%1$lu # 0x%1$lX\n\0"
-/*   643 */ "stdout\0"
-/*   650 */ "%A %B %e, %Y at %r %Z\0"
-/*   672 */ "%s/use-%u.XXXXXX\0"
-/*   689 */ "true\0"
-/*   694 */ "<%s type=%s>\0"
-/*   707 */ "VERSION\0"
-/*   715 */ "#x%02X;\0"
-/*   723 */ "OPT_ARG_NEEDED=YES\0"
-/*   742 */ "'\\''\0"
-/*   747 */ " '%s'\0"
-/*   753 */ "\n"
+/*   667 */ "=%1$lu # 0x%1$lX\n\0"
+/*   685 */ "stdout\0"
+/*   692 */ "%A %B %e, %Y at %r %Z\0"
+/*   714 */ "TMPDIR\0"
+/*   721 */ "%s/use-%u.XXXXXX\0"
+/*   738 */ "true\0"
+/*   743 */ "<%s type=%s>\0"
+/*   756 */ "VERSION\0"
+/*   764 */ "#x%02X;\0"
+/*   772 */ "OPT_ARG_NEEDED=YES\0"
+/*   791 */ "\n"
+            "# %s -- %s\n\0"
+/*   804 */ "# DEFAULT: \0"
+/*   816 */ "'\\''\0"
+/*   821 */ " '%s'\0"
+/*   827 */ "libopts misguessed length of string\n\0"
+/*   864 */ "\n"
             "OPTION_CT=0\n\0"
-/*   767 */ "set --\0"
-/*   774 */ "            ;;\n\n\0"
-/*   791 */ "        '%c' )\n\0"
-/*   807 */ "        '%s' )\n\0"
-/*   823 */ "        '%s' | \\\n\0"
-/*   841 */ "TMPDIR\0"
-/*   848 */ "/tmp\0"
-/*   853 */ "%1$s %2$s ; rm -f %2$s\0"
-/*   876 */ "<%1$s type=boolean>%2$s</%1$s>\n\0"
-/*   908 */ "#  From the %s option definitions\n"
+/*   878 */ "set --\0"
+/*   885 */ "/tmp\0"
+/*   890 */ "            ;;\n\n\0"
+/*   907 */ "        '%c' )\n\0"
+/*   923 */ "        '%s' )\n\0"
+/*   939 */ "        '%s' | \\\n\0"
+/*   957 */ "<%1$s type=boolean>%2$s</%1$s>\n\0"
+/*   989 */ "#  From the %s option definitions\n"
             "#\n\0"
-/*   945 */ "echo 'Warning:  Cannot load options files' >&2\0"
-/*   992 */ "echo 'Warning:  Cannot save options files' >&2\0"
-/*  1039 */ "echo 'Warning:  Cannot suppress the loading of options files' >&2\0"
-/*  1105 */ "<%1$s type=integer>0x%2$lX</%1$s>\n\0"
-/*  1140 */ "%1$s_%2$s_TEXT='no %2$s text'\n\0"
-/*  1171 */ "%1$s_%2$s_MODE='%3$s'\n"
+/*  1026 */ "echo 'Warning:  Cannot load options files' >&2\0"
+/*  1073 */ "echo 'Warning:  Cannot save options files' >&2\0"
+/*  1120 */ "echo 'Warning:  Cannot suppress the loading of options files' >&2\0"
+/*  1186 */ "<%1$s type=integer>0x%2$lX</%1$s>\n\0"
+/*  1221 */ "%1$s_%2$s_TEXT='no %2$s text'\n\0"
+/*  1252 */ "%1$s_%2$s_MODE='%3$s'\n"
             "export %1$s_%2$s_MODE\n\0"
-/*  1216 */ "%1$s_%2$s='%3$s'\n"
+/*  1297 */ "%1$s_%2$s='%3$s'\n"
             "export %1$s_%2$s\n\0"
-/*  1251 */ "%1$s_%2$s_CT=%3$d\n"
+/*  1332 */ "%1$s_%2$s_CT=%3$d\n"
             "export %1$s_%2$s_CT\n\0"
-/*  1290 */ "OPTION_CT=%d\n"
+/*  1371 */ "OPTION_CT=%d\n"
             "export OPTION_CT\n\0"
-/*  1321 */ "%1$s_%2$s=%3$s\n"
+/*  1402 */ "%1$s_%2$s=%3$s\n"
             "export %1$s_%2$s\n\0"
-/*  1354 */ "%1$s_%2$s=%3$d # 0x%3$X\n"
+/*  1435 */ "%1$s_%2$s=%3$d # 0x%3$X\n"
             "export %1$s_%2$s\n\0"
-/*  1396 */ "        case \"${OPT_CODE}\" in\n\0"
-/*  1427 */ "            if [ $%1$s_%2$s_CT -gt %3$u ] ; then\n"
+/*  1477 */ "        case \"${OPT_CODE}\" in\n\0"
+/*  1508 */ "            if [ $%1$s_%2$s_CT -gt %3$u ] ; then\n"
             "                echo 'Error:  more than %3$d %2$s options'\n"
             "                echo \"$%1$s_USAGE_TEXT\"\n"
             "                exit 1\n"
             "            fi >&2\n\0"
-/*  1618 */ "test ${%1$s_%2$s_CT-0} -ge %3$u || {\n"
+/*  1699 */ "test ${%1$s_%2$s_CT-0} -ge %3$u || {\n"
             "    echo %1$s_%2$s has not been set\n"
             "    exit 1\n"
             "} 1>&2\n\0"
-/*  1710 */ "test -n \"$%1$s_%2$s\" || {\n"
+/*  1791 */ "test -n \"$%1$s_%2$s\" || {\n"
             "    echo %1$s_%2$s has not been set\n"
             "    exit 1\n"
             "} 1>&2\n\0"
-/*  1791 */ "            echo \"$%s_%s_TEXT\"\n"
+/*  1872 */ "            echo \"$%s_%s_TEXT\"\n"
             "            exit 0\n\0"
-/*  1842 */ "\n"
+/*  1923 */ "\n"
             "# # # # # # # # # #\n"
             "#\n"
             "#  END OF AUTOMATED OPTION PROCESSING\n"
             "#\n"
             "# # # # # # # # # # -- do not modify this marker --\n\0"
-/*  1958 */ "    if [ -n \"${OPT_ARG_VAL}\" ]\n"
+/*  2039 */ "    if [ -n \"${OPT_ARG_VAL}\" ]\n"
             "    then\n"
             "        eval %1$s_${OPT_NAME}${OPT_ELEMENT}=\"'${OPT_ARG_VAL}'\"\n"
             "        export %1$s_${OPT_NAME}${OPT_ELEMENT}\n"
@@ -205,15 +210,15 @@ char const ao_strs_strtable[6633] =
             "unset OPT_NAME    || :\n"
             "unset OPT_CODE    || :\n"
             "unset OPT_ARG_VAL || :\n\0"
-/*  2337 */ "        OPT_CODE=`echo \"X${OPT_ARG}\"|sed 's/^X-*//'`\n"
+/*  2418 */ "        OPT_CODE=`echo \"X${OPT_ARG}\"|sed 's/^X-*//'`\n"
             "        shift\n"
             "        OPT_ARG=$1\n"
             "        case \"${OPT_CODE}\" in *=* )\n"
             "            OPT_ARG_VAL=`echo \"${OPT_CODE}\"|sed 's/^[^=]*=//'`\n"
             "            OPT_CODE=`echo \"${OPT_CODE}\"|sed 's/=.*$//'` ;; esac\n\0"
-/*  2588 */ "        OPT_CODE=`echo \"X${OPT_ARG}\" | sed 's/X-\\(.\\).*/\\1/'`\n"
+/*  2669 */ "        OPT_CODE=`echo \"X${OPT_ARG}\" | sed 's/X-\\(.\\).*/\\1/'`\n"
             "        OPT_ARG=` echo \"X${OPT_ARG}\" | sed 's/X-.//'`\n\0"
-/*  2705 */ "\n"
+/*  2786 */ "\n"
             "ARG_COUNT=$#\n"
             "OPT_PROCESS=true\n"
             "OPT_ARG=$1\n"
@@ -226,7 +231,7 @@ char const ao_strs_strtable[6633] =
             "        OPT_PROCESS=false\n"
             "        shift\n"
             "        ;;\n\0"
-/*  2912 */ "        case \"${OPT_ARG_NEEDED}\" in\n"
+/*  2993 */ "        case \"${OPT_ARG_NEEDED}\" in\n"
             "        NO )\n"
             "            OPT_ARG_VAL=''\n"
             "            ;;\n"
@@ -254,10 +259,10 @@ char const ao_strs_strtable[6633] =
             "            fi\n"
             "            ;;\n"
             "        esac\n\0"
-/*  3691 */ "            %1$s_%2$s_CT=`expr ${%1$s_%2$s_CT} + 1`\n"
+/*  3772 */ "            %1$s_%2$s_CT=`expr ${%1$s_%2$s_CT} + 1`\n"
             "            OPT_ELEMENT=\"_${%1$s_%2$s_CT}\"\n"
             "            OPT_NAME='%2$s'\n\0"
-/*  3815 */ "\n"
+/*  3896 */ "\n"
             "if test -z \"${%1$s_%2$s}\"\n"
             "then\n"
             "  %1$s_%2$s_CT=0\n"
@@ -267,16 +272,16 @@ char const ao_strs_strtable[6633] =
             "  %1$s_%2$s_1=${%1$s_%2$s}\n"
             "  export %1$s_%2$s_CT %1$s_%2$s_1\n"
             "fi\n\0"
-/*  3973 */ "    * )\n"
+/*  4054 */ "    * )\n"
             "         OPT_PROCESS=false\n"
             "         ;;\n"
             "    esac\n\0"
-/*  4030 */ "            %1$s_%2$s_CT=0\n"
+/*  4111 */ "            %1$s_%2$s_CT=0\n"
             "            OPT_ELEMENT=''\n"
             "            %1$s_%2$s='%3$s'\n"
             "            export %1$s_%2$s\n"
             "            OPT_NAME='%2$s'\n\0"
-/*  4171 */ "            if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n"
+/*  4252 */ "            if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n"
             "                echo 'Error:  duplicate %2$s option'\n"
             "                echo \"$%1$s_USAGE_TEXT\"\n"
             "                exit 1\n"
@@ -285,7 +290,7 @@ char const ao_strs_strtable[6633] =
             "            %1$s_%2$s='%3$s'\n"
             "            export %1$s_%2$s\n"
             "            OPT_NAME='%2$s'\n\0"
-/*  4488 */ "\n"
+/*  4569 */ "\n"
             "ARG_COUNT=$#\n"
             "OPT_ARG=$1\n"
             "while [ $# -gt 0 ]\n"
@@ -293,7 +298,7 @@ char const ao_strs_strtable[6633] =
             "    OPT_ELEMENT=''\n"
             "    OPT_ARG_VAL=''\n"
             "    OPT_ARG=${1}\n\0"
-/*  4591 */ "        case \"${OPT_ARG_NEEDED}\" in\n"
+/*  4672 */ "        case \"${OPT_ARG_NEEDED}\" in\n"
             "        NO )\n"
             "            if [ -n \"${OPT_ARG}\" ]\n"
             "            then\n"
@@ -338,33 +343,33 @@ char const ao_strs_strtable[6633] =
             "            fi\n"
             "            ;;\n"
             "        esac\n\0"
-/*  5745 */ "            echo \"$%s_LONGUSAGE_TEXT\" | ${PAGER-more}\n"
+/*  5826 */ "            echo \"$%s_LONGUSAGE_TEXT\" | ${PAGER-more}\n"
             "            exit 0\n\0"
-/*  5819 */ "%s OF %s\n"
+/*  5900 */ "%s OF %s\n"
             "#\n"
             "#  From here to the next `-- do not modify this marker --',\n"
             "#  the text has been generated %s\n\0"
-/*  5925 */ "            eval %1$s_%2$s${OPT_ELEMENT}=true\n"
+/*  6006 */ "            eval %1$s_%2$s${OPT_ELEMENT}=true\n"
             "            export %1$s_%2$s${OPT_ELEMENT}\n\0"
-/*  6015 */ "            if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n"
+/*  6096 */ "            if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n"
             "                echo 'Error:  duplicate %2$s option'\n"
             "                echo \"$%1$s_USAGE_TEXT\"\n"
             "                exit 1\n"
             "            fi >&2\n"
             "            %1$s_%2$s_set=true\n"
             "            OPT_NAME='%2$s'\n\0"
-/*  6274 */ "\n"
+/*  6355 */ "\n"
             "%1$s_%2$s=${%1$s_%2$s-'%3$s'}\n"
             "%1$s_%2$s_set=false\n"
             "export %1$s_%2$s\n\0"
-/*  6343 */ "\n"
+/*  6424 */ "\n"
             "%1$s_%2$s=${%1$s_%2$s}\n"
             "%1$s_%2$s_set=false\n"
             "export %1$s_%2$s\n\0"
-/*  6405 */ "# # # # # # # # # # -- do not modify this marker --\n"
+/*  6486 */ "# # # # # # # # # # -- do not modify this marker --\n"
             "#\n"
             "#  DO NOT EDIT THIS SECTION\n\0"
-/*  6488 */ "        * )\n"
+/*  6569 */ "        * )\n"
             "            echo Unknown %s: \"${OPT_CODE}\" >&2\n"
             "            echo \"$%s_USAGE_TEXT\" >&2\n"
             "            exit 1\n"
index 864fc48ac5c4ecb190d8f0f3d7492c3da09fbe56..95036ef726b3b928b70b8673979171a4305281bf 100644 (file)
@@ -6,7 +6,7 @@
  * From the definitions    ao-strs.def
  * and the template file   strings
  *
- *  Copyright (C) 2011-2015 Bruce Korb, all rights reserved.
+ *  Copyright (C) 2011-2018 Bruce Korb, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the
  *  Modified (3 clause) Berkeley Software Distribution License
 #ifndef STRINGS_AO_STRS_H_GUARD
 #define STRINGS_AO_STRS_H_GUARD 1
 /*
- * 142 strings in ao_strs_strtable string table
+ * 146 strings in ao_strs_strtable string table
  */
-#define ARG_BREAK_STR         (ao_strs_strtable+261)
+#define ARG_BREAK_STR         (ao_strs_strtable+280)
 #define ARG_BREAK_STR_LEN     5
-#define ARG_BY_NUM_FMT        (ao_strs_strtable+267)
+#define ARG_BY_NUM_FMT        (ao_strs_strtable+286)
 #define ARG_BY_NUM_FMT_LEN    9
-#define BOOL_ATR_FMT          (ao_strs_strtable+876)
+#define BOOL_ATR_FMT          (ao_strs_strtable+957)
 #define BOOL_ATR_FMT_LEN      31
-#define CHK_MAX_COUNT         (ao_strs_strtable+1427)
+#define CHK_MAX_COUNT         (ao_strs_strtable+1508)
 #define CHK_MAX_COUNT_LEN     190
-#define CHK_MIN_COUNT         (ao_strs_strtable+1618)
+#define CHK_MIN_COUNT         (ao_strs_strtable+1699)
 #define CHK_MIN_COUNT_LEN     91
-#define CHK_ONE_REQUIRED      (ao_strs_strtable+1710)
+#define CHK_ONE_REQUIRED      (ao_strs_strtable+1791)
 #define CHK_ONE_REQUIRED_LEN  80
-#define ECHO_N_EXIT           (ao_strs_strtable+1791)
+#define ECHO_N_EXIT           (ao_strs_strtable+1872)
 #define ECHO_N_EXIT_LEN       50
-#define EMPTY_ARG             (ao_strs_strtable+277)
+#define EMPTY_ARG             (ao_strs_strtable+296)
 #define EMPTY_ARG_LEN         2
-#define END_MARK              (ao_strs_strtable+1842)
+#define END_MARK              (ao_strs_strtable+1923)
 #define END_MARK_LEN          115
-#define END_OPT_SEL_STR       (ao_strs_strtable+280)
+#define END_OPT_SEL_STR       (ao_strs_strtable+299)
 #define END_OPT_SEL_STR_LEN   12
-#define END_PRE_FMT           (ao_strs_strtable+908)
+#define END_PRE_FMT           (ao_strs_strtable+989)
 #define END_PRE_FMT_LEN       36
-#define END_SET_TEXT          (ao_strs_strtable+293)
+#define END_SET_TEXT          (ao_strs_strtable+312)
 #define END_SET_TEXT_LEN      3
-#define END_XML_FMT           (ao_strs_strtable+297)
+#define END_XML_FMT           (ao_strs_strtable+316)
 #define END_XML_FMT_LEN       6
-#define ENUM_ERR_LINE         (ao_strs_strtable+304)
+#define ENUM_ERR_LINE         (ao_strs_strtable+323)
 #define ENUM_ERR_LINE_LEN     5
-#define ENUM_ERR_WIDTH        (ao_strs_strtable+310)
+#define ENUM_ERR_WIDTH        (ao_strs_strtable+329)
 #define ENUM_ERR_WIDTH_LEN    6
-#define EXPORT_ARG_FMT        (ao_strs_strtable+317)
+#define EXPORT_ARG_FMT        (ao_strs_strtable+336)
 #define EXPORT_ARG_FMT_LEN    17
-#define FALSE_STR             (ao_strs_strtable+335)
+#define FALSE_STR             (ao_strs_strtable+354)
 #define FALSE_STR_LEN         5
-#define FINISH_LOOP           (ao_strs_strtable+1958)
+#define FINISH_LOOP           (ao_strs_strtable+2039)
 #define FINISH_LOOP_LEN       378
-#define FLAG_OPT_MARK         (ao_strs_strtable+341)
+#define FLAG_OPT_MARK         (ao_strs_strtable+360)
 #define FLAG_OPT_MARK_LEN     9
-#define FLAG_STR              (ao_strs_strtable+351)
+#define FLAG_STR              (ao_strs_strtable+370)
 #define FLAG_STR_LEN          4
-#define INIT_LOPT_STR         (ao_strs_strtable+2337)
+#define INIT_LOPT_STR         (ao_strs_strtable+2418)
 #define INIT_LOPT_STR_LEN     250
-#define INIT_OPT_STR          (ao_strs_strtable+2588)
+#define INIT_OPT_STR          (ao_strs_strtable+2669)
 #define INIT_OPT_STR_LEN      116
-#define INVALID_FMT           (ao_strs_strtable+356)
+#define INVALID_FMT           (ao_strs_strtable+375)
 #define INVALID_FMT_LEN       10
-#define INVALID_STR           (ao_strs_strtable+367)
+#define INVALID_STR           (ao_strs_strtable+386)
 #define INVALID_STR_LEN       9
-#define LINE_SPLICE           (ao_strs_strtable+377)
+#define LINE_SPLICE           (ao_strs_strtable+396)
 #define LINE_SPLICE_LEN       4
-#define LONG_OPT_MARK         (ao_strs_strtable+382)
-#define LONG_OPT_MARKER       (ao_strs_strtable+393)
+#define LONG_OPT_MARK         (ao_strs_strtable+401)
+#define LONG_OPT_MARKER       (ao_strs_strtable+412)
 #define LONG_OPT_MARKER_LEN   2
 #define LONG_OPT_MARK_LEN     10
-#define LONG_USE_STR          (ao_strs_strtable+396)
+#define LONG_USE_STR          (ao_strs_strtable+415)
 #define LONG_USE_STR_LEN      9
-#define LOOP_STR              (ao_strs_strtable+2705)
+#define LOOP_STR              (ao_strs_strtable+2786)
 #define LOOP_STR_LEN          206
-#define LOPT_ARG_FMT          (ao_strs_strtable+2912)
+#define LOPT_ARG_FMT          (ao_strs_strtable+2993)
 #define LOPT_ARG_FMT_LEN      778
-#define LVL3_CMD              (ao_strs_strtable+406)
+#define LVL3_CMD              (ao_strs_strtable+425)
 #define LVL3_CMD_LEN          15
-#define MK_STR_OCT_FMT        (ao_strs_strtable+422)
+#define MK_STR_OCT_FMT        (ao_strs_strtable+441)
 #define MK_STR_OCT_FMT_LEN    5
-#define MORE_STR              (ao_strs_strtable+428)
+#define MORE_STR              (ao_strs_strtable+447)
 #define MORE_STR_LEN          4
-#define MULTI_ARG_FMT         (ao_strs_strtable+3691)
+#define MULTI_ARG_FMT         (ao_strs_strtable+3772)
 #define MULTI_ARG_FMT_LEN     123
-#define MULTI_DEF_FMT         (ao_strs_strtable+3815)
+#define MULTI_DEF_FMT         (ao_strs_strtable+3896)
 #define MULTI_DEF_FMT_LEN     157
-#define NESTED_OPT_FMT        (ao_strs_strtable+433)
+#define NESTED_OPT_FMT        (ao_strs_strtable+452)
 #define NESTED_OPT_FMT_LEN    17
-#define NLSTR_FMT             (ao_strs_strtable+451)
+#define NLSTR_FMT             (ao_strs_strtable+470)
 #define NLSTR_FMT_LEN         3
-#define NLSTR_SPACE_FMT       (ao_strs_strtable+455)
+#define NLSTR_SPACE_FMT       (ao_strs_strtable+474)
 #define NLSTR_SPACE_FMT_LEN   5
-#define NONE_STR              (ao_strs_strtable+91)
+#define NONE_STR              (ao_strs_strtable+110)
 #define NONE_STR_LEN          4
-#define NOT_FOUND_STR         (ao_strs_strtable+3973)
+#define NOT_FOUND_STR         (ao_strs_strtable+4054)
 #define NOT_FOUND_STR_LEN     56
-#define NO_ARG_NEEDED         (ao_strs_strtable+461)
+#define NO_ARG_NEEDED         (ao_strs_strtable+480)
 #define NO_ARG_NEEDED_LEN     17
-#define NO_LOAD_WARN          (ao_strs_strtable+945)
+#define NO_LOAD_WARN          (ao_strs_strtable+1026)
 #define NO_LOAD_WARN_LEN      46
-#define NO_MULTI_ARG_FMT      (ao_strs_strtable+4030)
+#define NO_MULTI_ARG_FMT      (ao_strs_strtable+4111)
 #define NO_MULTI_ARG_FMT_LEN  140
-#define NO_SAVE_OPTS          (ao_strs_strtable+992)
+#define NO_SAVE_OPTS          (ao_strs_strtable+1073)
 #define NO_SAVE_OPTS_LEN      46
-#define NO_SGL_ARG_FMT        (ao_strs_strtable+4171)
+#define NO_SGL_ARG_FMT        (ao_strs_strtable+4252)
 #define NO_SGL_ARG_FMT_LEN    316
-#define NO_SUPPRESS_LOAD      (ao_strs_strtable+1039)
+#define NO_SUPPRESS_LOAD      (ao_strs_strtable+1120)
 #define NO_SUPPRESS_LOAD_LEN  65
-#define NULL_ATR_FMT          (ao_strs_strtable+479)
+#define NULL_ATR_FMT          (ao_strs_strtable+498)
 #define NULL_ATR_FMT_LEN      6
-#define NUMB_ATR_FMT          (ao_strs_strtable+1105)
+#define NUMB_ATR_FMT          (ao_strs_strtable+1186)
 #define NUMB_ATR_FMT_LEN      34
-#define OK_NEED_OPT_ARG       (ao_strs_strtable+486)
+#define OK_NEED_OPT_ARG       (ao_strs_strtable+505)
 #define OK_NEED_OPT_ARG_LEN   17
-#define ONE_TAB_STR           (ao_strs_strtable+504)
+#define ONE_TAB_STR           (ao_strs_strtable+523)
 #define ONE_TAB_STR_LEN       1
-#define ONLY_OPTS_LOOP        (ao_strs_strtable+4488)
+#define ONLY_OPTS_LOOP        (ao_strs_strtable+4569)
 #define ONLY_OPTS_LOOP_LEN    102
-#define OPEN_CLOSE_FMT        (ao_strs_strtable+479)
+#define OPEN_CLOSE_FMT        (ao_strs_strtable+498)
 #define OPEN_CLOSE_FMT_LEN    6
-#define OPEN_XML_FMT          (ao_strs_strtable+506)
+#define OPEN_XML_FMT          (ao_strs_strtable+525)
 #define OPEN_XML_FMT_LEN      4
-#define OPTION_STR            (ao_strs_strtable+511)
+#define OPTION_STR            (ao_strs_strtable+530)
 #define OPTION_STR_LEN        6
-#define OPT_ARG_FMT           (ao_strs_strtable+4591)
+#define OPT_ARG_FMT           (ao_strs_strtable+4672)
 #define OPT_ARG_FMT_LEN       1153
-#define OPT_END_FMT           (ao_strs_strtable+518)
+#define OPT_END_FMT           (ao_strs_strtable+537)
 #define OPT_END_FMT_LEN       14
-#define OPT_VAL_FMT           (ao_strs_strtable+533)
+#define OPT_VAL_FMT           (ao_strs_strtable+552)
 #define OPT_VAL_FMT_LEN       6
-#define OR_STR                (ao_strs_strtable+540)
+#define OR_STR                (ao_strs_strtable+559)
 #define OR_STR_LEN            3
-#define PAGER_NAME            (ao_strs_strtable+544)
+#define PAGER_NAME            (ao_strs_strtable+563)
 #define PAGER_NAME_LEN        5
-#define PAGE_USAGE_FMT        (ao_strs_strtable+853)
+#define PAGE_USAGE_FMT        (ao_strs_strtable+569)
 #define PAGE_USAGE_FMT_LEN    22
-#define PAGE_USAGE_TEXT       (ao_strs_strtable+5745)
+#define PAGE_USAGE_TEXT       (ao_strs_strtable+5826)
 #define PAGE_USAGE_TEXT_LEN   73
-#define PLUS_STR              (ao_strs_strtable+550)
+#define PLUS_STR              (ao_strs_strtable+592)
 #define PLUS_STR_LEN          3
-#define PREAMBLE_FMT          (ao_strs_strtable+5819)
+#define PREAMBLE_FMT          (ao_strs_strtable+5900)
 #define PREAMBLE_FMT_LEN      105
-#define PUTS_FMT              (ao_strs_strtable+554)
+#define PUTS_FMT              (ao_strs_strtable+596)
 #define PUTS_FMT_LEN          15
-#define QUOT_APOS             (ao_strs_strtable+570)
+#define QUOT_APOS             (ao_strs_strtable+612)
 #define QUOT_APOS_LEN         2
-#define QUOT_ARG_FMT          (ao_strs_strtable+573)
+#define QUOT_ARG_FMT          (ao_strs_strtable+615)
 #define QUOT_ARG_FMT_LEN      4
-#define SET_MULTI_ARG         (ao_strs_strtable+5925)
+#define SET_MULTI_ARG         (ao_strs_strtable+6006)
 #define SET_MULTI_ARG_LEN     89
-#define SET_NO_TEXT_FMT       (ao_strs_strtable+1140)
+#define SET_NO_TEXT_FMT       (ao_strs_strtable+1221)
 #define SET_NO_TEXT_FMT_LEN   30
-#define SET_OFF_FMT           (ao_strs_strtable+578)
+#define SET_OFF_FMT           (ao_strs_strtable+620)
 #define SET_OFF_FMT_LEN       6
-#define SET_TEXT_FMT          (ao_strs_strtable+585)
+#define SET_TEXT_FMT          (ao_strs_strtable+627)
 #define SET_TEXT_FMT_LEN      12
-#define SGL_ARG_FMT           (ao_strs_strtable+6015)
+#define SGL_ARG_FMT           (ao_strs_strtable+6096)
 #define SGL_ARG_FMT_LEN       258
-#define SGL_DEF_FMT           (ao_strs_strtable+6274)
+#define SGL_DEF_FMT           (ao_strs_strtable+6355)
 #define SGL_DEF_FMT_LEN       68
-#define SGL_NO_DEF_FMT        (ao_strs_strtable+6343)
+#define SGL_NO_DEF_FMT        (ao_strs_strtable+6424)
 #define SGL_NO_DEF_FMT_LEN    61
-#define SHELL_MAGIC           (ao_strs_strtable+598)
+#define SHELL_MAGIC           (ao_strs_strtable+640)
 #define SHELL_MAGIC_LEN       6
-#define SHOW_PROG_ENV         (ao_strs_strtable+605)
+#define SHOW_PROG_ENV         (ao_strs_strtable+647)
 #define SHOW_PROG_ENV_LEN     19
-#define SHOW_VAL_FMT          (ao_strs_strtable+625)
+#define SHOW_VAL_FMT          (ao_strs_strtable+667)
 #define SHOW_VAL_FMT_LEN      17
-#define START_MARK            (ao_strs_strtable+6405)
+#define START_MARK            (ao_strs_strtable+6486)
 #define START_MARK_LEN        82
-#define STDOUT                (ao_strs_strtable+643)
+#define STDOUT                (ao_strs_strtable+685)
 #define STDOUT_LEN            6
-#define TIME_FMT              (ao_strs_strtable+650)
+#define TIME_FMT              (ao_strs_strtable+692)
 #define TIME_FMT_LEN          21
-#define TMPDIR                (ao_strs_strtable+841)
+#define TMPDIR                (ao_strs_strtable+714)
 #define TMPDIR_LEN            6
-#define TMP_FILE_FMT          (ao_strs_strtable+672)
+#define TMP_FILE_FMT          (ao_strs_strtable+721)
 #define TMP_FILE_FMT_LEN      16
-#define TMP_USAGE_FMT         (ao_strs_strtable+672)
+#define TMP_USAGE_FMT         (ao_strs_strtable+721)
 #define TMP_USAGE_FMT_LEN     16
-#define TRUE_STR              (ao_strs_strtable+689)
+#define TRUE_STR              (ao_strs_strtable+738)
 #define TRUE_STR_LEN          4
-#define TWO_SPACES_STR        (ao_strs_strtable+254)
+#define TWO_SPACES_STR        (ao_strs_strtable+273)
 #define TWO_SPACES_STR_LEN    2
-#define TYPE_ATR_FMT          (ao_strs_strtable+694)
+#define TYPE_ATR_FMT          (ao_strs_strtable+743)
 #define TYPE_ATR_FMT_LEN      12
-#define UNK_OPT_FMT           (ao_strs_strtable+6488)
+#define UNK_OPT_FMT           (ao_strs_strtable+6569)
 #define UNK_OPT_FMT_LEN       144
-#define VER_STR               (ao_strs_strtable+707)
+#define VER_STR               (ao_strs_strtable+756)
 #define VER_STR_LEN           7
-#define XML_HEX_BYTE_FMT      (ao_strs_strtable+715)
+#define XML_HEX_BYTE_FMT      (ao_strs_strtable+764)
 #define XML_HEX_BYTE_FMT_LEN  7
-#define YES_NEED_OPT_ARG      (ao_strs_strtable+723)
+#define YES_NEED_OPT_ARG      (ao_strs_strtable+772)
 #define YES_NEED_OPT_ARG_LEN  18
-#define apostrophe            (ao_strs_strtable+742)
+#define ao_default_use        (ao_strs_strtable+804)
+#define ao_default_use_LEN    11
+#define ao_name_use_fmt       (ao_strs_strtable+791)
+#define ao_name_use_fmt_LEN   12
+#define apostrophe            (ao_strs_strtable+816)
 #define apostrophe_LEN        4
-#define arg_fmt               (ao_strs_strtable+747)
+#define arg_fmt               (ao_strs_strtable+821)
 #define arg_fmt_LEN           5
-#define init_optct            (ao_strs_strtable+753)
+#define init_optct            (ao_strs_strtable+864)
 #define init_optct_LEN        13
-#define set_dash              (ao_strs_strtable+767)
+#define misguess_len          (ao_strs_strtable+827)
+#define misguess_len_LEN      36
+#define set_dash              (ao_strs_strtable+878)
 #define set_dash_LEN          6
-#define tmp_dir               (ao_strs_strtable+848)
+#define tmp_dir               (ao_strs_strtable+885)
 #define tmp_dir_LEN           4
-#define zAll                  (ao_strs_strtable+257)
+#define zAll                  (ao_strs_strtable+276)
 #define zAll_LEN              3
 #define zCfgAO_Flags          (ao_strs_strtable+12)
-#define zCfgAO_Flags_LEN      12
-#define zCfgProg              (ao_strs_strtable+25)
-#define zCfgProg_LEN          7
-#define zEquivMode            (ao_strs_strtable+1171)
+#define zCfgAO_Flags_LEN      14
+#define zCfgProg              (ao_strs_strtable+27)
+#define zCfgProg_LEN          9
+#define zEquivMode            (ao_strs_strtable+1252)
 #define zEquivMode_LEN        44
-#define zFiveSpaces           (ao_strs_strtable+244)
+#define zFiveSpaces           (ao_strs_strtable+263)
 #define zFiveSpaces_LEN       5
-#define zFmtFmt               (ao_strs_strtable+33)
+#define zFmtFmt               (ao_strs_strtable+37)
 #define zFmtFmt_LEN           11
-#define zFullOptFmt           (ao_strs_strtable+1216)
+#define zFmtProg              (ao_strs_strtable+49)
+#define zFmtProg_LEN          14
+#define zFullOptFmt           (ao_strs_strtable+1297)
 #define zFullOptFmt_LEN       34
-#define zGnuBreak             (ao_strs_strtable+45)
+#define zGnuBreak             (ao_strs_strtable+64)
 #define zGnuBreak_LEN         5
-#define zGnuFileArg           (ao_strs_strtable+51)
+#define zGnuFileArg           (ao_strs_strtable+70)
 #define zGnuFileArg_LEN       5
-#define zGnuKeyLArg           (ao_strs_strtable+57)
+#define zGnuKeyLArg           (ao_strs_strtable+76)
 #define zGnuKeyLArg_LEN       4
-#define zGnuNestArg           (ao_strs_strtable+62)
+#define zGnuNestArg           (ao_strs_strtable+81)
 #define zGnuNestArg_LEN       5
-#define zGnuOptArg            (ao_strs_strtable+68)
+#define zGnuOptArg            (ao_strs_strtable+87)
 #define zGnuOptArg_LEN        6
-#define zGnuOptFmt            (ao_strs_strtable+75)
+#define zGnuOptFmt            (ao_strs_strtable+94)
 #define zGnuOptFmt_LEN        10
-#define zGnuTimeArg           (ao_strs_strtable+86)
+#define zGnuTimeArg           (ao_strs_strtable+105)
 #define zGnuTimeArg_LEN       4
-#define zNone                 (ao_strs_strtable+91)
+#define zNone                 (ao_strs_strtable+110)
 #define zNone_LEN             4
-#define zOptCookieCt          (ao_strs_strtable+1251)
+#define zOptCookieCt          (ao_strs_strtable+1332)
 #define zOptCookieCt_LEN      38
-#define zOptCtFmt             (ao_strs_strtable+1290)
+#define zOptCtFmt             (ao_strs_strtable+1371)
 #define zOptCtFmt_LEN         30
-#define zOptDisabl            (ao_strs_strtable+1321)
+#define zOptDisabl            (ao_strs_strtable+1402)
 #define zOptDisabl_LEN        32
-#define zOptNumFmt            (ao_strs_strtable+1354)
+#define zOptNumFmt            (ao_strs_strtable+1435)
 #define zOptNumFmt_LEN        41
-#define zOptionCase           (ao_strs_strtable+1396)
+#define zOptionCase           (ao_strs_strtable+1477)
 #define zOptionCase_LEN       30
-#define zOptionEndSelect      (ao_strs_strtable+774)
+#define zOptionEndSelect      (ao_strs_strtable+890)
 #define zOptionEndSelect_LEN  16
-#define zOptionFlag           (ao_strs_strtable+791)
+#define zOptionFlag           (ao_strs_strtable+907)
 #define zOptionFlag_LEN       15
-#define zOptionFullName       (ao_strs_strtable+807)
+#define zOptionFullName       (ao_strs_strtable+923)
 #define zOptionFullName_LEN   15
-#define zOptionPartName       (ao_strs_strtable+823)
+#define zOptionPartName       (ao_strs_strtable+939)
 #define zOptionPartName_LEN   17
-#define zPresetFile           (ao_strs_strtable+96)
+#define zPresetFile           (ao_strs_strtable+115)
 #define zPresetFile_LEN       37
-#define zReqOptFmt            (ao_strs_strtable+134)
+#define zReqOptFmt            (ao_strs_strtable+153)
 #define zReqOptFmt_LEN        13
 #define zSepChars             (ao_strs_strtable+0)
 #define zSepChars_LEN         3
-#define zShrtGnuOptFmt        (ao_strs_strtable+148)
+#define zShrtGnuOptFmt        (ao_strs_strtable+167)
 #define zShrtGnuOptFmt_LEN    2
-#define zSixSpaces            (ao_strs_strtable+237)
+#define zSixSpaces            (ao_strs_strtable+256)
 #define zSixSpaces_LEN        6
-#define zStdBoolArg           (ao_strs_strtable+151)
+#define zStdBoolArg           (ao_strs_strtable+170)
 #define zStdBoolArg_LEN       3
-#define zStdBreak             (ao_strs_strtable+155)
+#define zStdBreak             (ao_strs_strtable+174)
 #define zStdBreak_LEN         7
-#define zStdFileArg           (ao_strs_strtable+163)
+#define zStdFileArg           (ao_strs_strtable+182)
 #define zStdFileArg_LEN       3
-#define zStdKeyArg            (ao_strs_strtable+167)
+#define zStdKeyArg            (ao_strs_strtable+186)
 #define zStdKeyArg_LEN        3
-#define zStdKeyLArg           (ao_strs_strtable+171)
+#define zStdKeyLArg           (ao_strs_strtable+190)
 #define zStdKeyLArg_LEN       3
-#define zStdNestArg           (ao_strs_strtable+175)
+#define zStdNestArg           (ao_strs_strtable+194)
 #define zStdNestArg_LEN       3
-#define zStdNoArg             (ao_strs_strtable+179)
+#define zStdNoArg             (ao_strs_strtable+198)
 #define zStdNoArg_LEN         3
-#define zStdNumArg            (ao_strs_strtable+183)
+#define zStdNumArg            (ao_strs_strtable+202)
 #define zStdNumArg_LEN        3
-#define zStdOptArg            (ao_strs_strtable+187)
+#define zStdOptArg            (ao_strs_strtable+206)
 #define zStdOptArg_LEN        3
-#define zStdReqArg            (ao_strs_strtable+191)
+#define zStdReqArg            (ao_strs_strtable+210)
 #define zStdReqArg_LEN        3
-#define zStdStrArg            (ao_strs_strtable+195)
+#define zStdStrArg            (ao_strs_strtable+214)
 #define zStdStrArg_LEN        3
-#define zStdTimeArg           (ao_strs_strtable+199)
+#define zStdTimeArg           (ao_strs_strtable+218)
 #define zStdTimeArg_LEN       3
-#define zTabHyp               (ao_strs_strtable+203)
-#define zTabHypAnd            (ao_strs_strtable+217)
+#define zTabHyp               (ao_strs_strtable+222)
+#define zTabHypAnd            (ao_strs_strtable+236)
 #define zTabHypAnd_LEN        11
 #define zTabHyp_LEN           6
-#define zTabSpace             (ao_strs_strtable+210)
+#define zTabSpace             (ao_strs_strtable+229)
 #define zTabSpace_LEN         6
-#define zTabout               (ao_strs_strtable+229)
+#define zTabout               (ao_strs_strtable+248)
 #define zTabout_LEN           7
-#define zThreeSpaces          (ao_strs_strtable+250)
+#define zThreeSpaces          (ao_strs_strtable+269)
 #define zThreeSpaces_LEN      3
-#define zTwoSpaces            (ao_strs_strtable+254)
+#define zTwoSpaces            (ao_strs_strtable+273)
 #define zTwoSpaces_LEN        2
 #define zambig_file           (ao_strs_strtable+4)
 #define zambig_file_LEN       7
-extern char const ao_strs_strtable[6633];
+extern char const ao_strs_strtable[6714];
 
 #endif /* STRINGS_AO_STRS_H_GUARD */
index 4b15acafbb6320ce0142e37b529bf2cf55b8d08e..643d277239520a90c05ced57f1e4158e1c40a792 100644 (file)
@@ -13,7 +13,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -35,7 +35,7 @@
 /**
  * The number of tab characters to skip when printing continuation lines.
  */
-static unsigned int tab_skip_ct          = 0;
+  static unsigned int tab_skip_ct          = 0;
 
 #ifndef HAVE_PATHFIND
 #  define  pathfind(_p, _n, _m) option_pathfind(_p, _n, _m)
@@ -59,7 +59,7 @@ static unsigned int tab_skip_ct          = 0;
 #  include "compat/strchr.c"
 #endif
 
-LOCAL void *
+static void *
 ao_malloc(size_t sz)
 {
     void * res = malloc(sz);
@@ -69,10 +69,8 @@ ao_malloc(size_t sz)
     }
     return res;
 }
-#undef  malloc
-#define malloc(_s)        ao_malloc(_s)
 
-LOCAL void *
+static void *
 ao_realloc(void *p, size_t sz)
 {
     void * res = (p == NULL) ? malloc(sz) : realloc(p, sz);
@@ -82,10 +80,8 @@ ao_realloc(void *p, size_t sz)
     }
     return res;
 }
-#undef  realloc
-#define realloc(_p,_s)    ao_realloc(_p,_s)
 
-LOCAL char *
+static char *
 ao_strdup(char const *str)
 {
     char * res = strdup(str);
@@ -95,8 +91,6 @@ ao_strdup(char const *str)
     }
     return res;
 }
-#undef  strdup
-#define strdup(_p)        ao_strdup(_p)
 
 /**
  *  handle an option.
@@ -104,7 +98,7 @@ ao_strdup(char const *str)
  *  This routine handles equivalencing, sets the option state flags and
  *  invokes the handler procedure, if any.
  */
-LOCAL tSuccess
+static tSuccess
 handle_opt(tOptions * opts, tOptState * o_st)
 {
     /*
@@ -217,7 +211,7 @@ handle_opt(tOptions * opts, tOptState * o_st)
  * @param opts the program option descriptor
  * @param o_st  the state of the next found option
  */
-LOCAL tSuccess
+static tSuccess
 next_opt(tOptions * opts, tOptState * o_st)
 {
     {
@@ -244,7 +238,7 @@ next_opt(tOptions * opts, tOptState * o_st)
  *  @param[in,out] opts   program options descriptor
  *  @returns SUCCESS or FAILURE
  */
-LOCAL tSuccess
+static tSuccess
 regular_opts(tOptions * opts)
 {
     /* assert:  opts->fOptSet & OPTPROC_IMMEDIATE == 0 */
index 6f75f9e44e55d69af141f01b5b88ac86e7ae237d..36bb43f29d220b37e4135d10add9942906beac65 100644 (file)
@@ -11,7 +11,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -41,6 +41,9 @@
 #  ifdef PATH_MAX
 #    define AG_PATH_MAX         ((size_t)PATH_MAX)
 #  else
+#    ifdef __gnu_hurd__
+#      define size_t unsigned long
+#    endif
 #    define AG_PATH_MAX         ((size_t)4096)
 #  endif
 #else
@@ -460,6 +463,13 @@ static char const * program_pkgdatadir   = pkgdatadir_default;
 static tOptionLoadMode option_load_mode  = OPTION_LOAD_UNCOOKED;
 static tePagerState pagerState           = PAGER_STATE_INITIAL;
 
+static noreturn void option_exits(int exit_code);
+static noreturn void fserr_exit(char const * prog, char const * op,
+                                char const * fname);
+static          void fserr_warn(char const * prog, char const * op,
+                                char const * fname);
+static noreturn void ao_bug(char const * msg);
+
        FILE *       option_usage_fp      = NULL;
 
 static char const * pz_enum_err_fmt;
index 09aac10bce73a9ddad161f61a66e2f4691e06974..08dc546214e00c74b3f8530a89978ab46452a0b3 100644 (file)
@@ -9,11 +9,11 @@
  *  This file defines all the global structures and special values
  *  used in the automated option processing library.
  *
- *  Automated Options Copyright (C) 1992-2015 by Bruce Korb
+ *  Automated Options Copyright (C) 1992-2018 by Bruce Korb
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -64,7 +64,7 @@
 
 #  if defined(HAVE_STDBOOL_H)
 #    include <stdbool.h>
-#  else
+#  elif ! defined(bool)
      typedef enum { false = 0, true = 1 } _Bool;
 #    define bool _Bool
 
  * @{
  */
 /// autoopts structure version
-#define OPTIONS_STRUCT_VERSION      167937
+#define OPTIONS_STRUCT_VERSION      172033
 /// autoopts structure version string
-#define OPTIONS_VERSION_STRING      "41:0:16"
+#define OPTIONS_VERSION_STRING      "42:1:17"
 /// minimum version the autoopts library supports
 #define OPTIONS_MINIMUM_VERSION     102400
 /// minimum version the autoopts library supports as a string
 #define OPTIONS_MIN_VER_STRING      "25:0:0"
 /// the display version of the autoopts library, as a string
-#define OPTIONS_DOTTED_VERSION      "41.0"
+#define OPTIONS_DOTTED_VERSION      "42.1"
 /// convert a version/release number pair to an integer value
 #define OPTIONS_VER_TO_NUM(_v, _r)  (((_v) * 4096) + (_r))
 /// @}
@@ -140,7 +140,8 @@ typedef enum {
     OPARG_TYPE_FLOAT        =  9, ///< opt arg is a floating point num
     OPARG_TYPE_DOUBLE       = 10, ///< opt arg is a double prec. float
     OPARG_TYPE_LONG_DOUBLE  = 11, ///< opt arg is a long double prec.
-    OPARG_TYPE_LONG_LONG    = 12  ///< opt arg is a long long int
+    OPARG_TYPE_LONG_LONG    = 12, ///< opt arg is a long long int
+    OPARG_TYPE_STATIC       = 13  ///< 
 } teOptArgType;
 
 /**
@@ -641,6 +642,7 @@ struct options {
     void *                      pSavedState;
 
     /// The procedure to call to print usage text
+    /* __attribute__((__noreturn__)) */
     // coverity[+kill]
     tpUsageProc                 pUsageProc;
     /// The procedure to call to translate translatable option messages
index 1e7f156ec6e866acc815ceba5459a29d00193812..1f196efa0f92dd83248be1225b332d92d2b94c94 100644 (file)
@@ -4,7 +4,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -71,6 +71,10 @@ typedef int tSuccess;
 #  define MODE extern
 #endif
 
+#undef NUL
+#define NUL '\0'
+
+#define MOD_LOCAL static
 #define parse_duration option_parse_duration
 
 #endif /* AUTOGEN_PROJECT_H */
index f5831e6d299697a2169110f5112fe4fe6b35bbac..e94337d69b81ea3476a6d0658fad71cad39db6ac 100644 (file)
@@ -8,7 +8,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2017 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -29,7 +29,7 @@
 /** @file usage-txt.h
  *
  *  This file handles all the bookkeeping required for tracking all the little
- *  tiny strings used by the AutoOpts library.  There are 108
+ *  tiny strings used by the AutoOpts library.  There are 107
  *  of them.  This is not versioned because it is entirely internal to the
  *  library and accessed by client code only in a very well-controlled way:
  *  they may substitute translated strings using a procedure that steps through
@@ -47,7 +47,7 @@ typedef struct {
   char *        utpz_GnuKeyArg;
   char *        utpz_GnuNumArg;
   char *        utpz_GnuStrArg;
-  char const *  apz_str[104];
+  char const *  apz_str[103];
 } usage_text_t;
 
 /*
@@ -55,7 +55,7 @@ typedef struct {
  *  strings and the text array containing untranslatable strings.
  */
 extern usage_text_t option_xlateable_txt;
-extern char const option_lib_text[4285];
+extern char const option_lib_text[4267];
 
 #if defined(AUTOOPTS_INTERNAL)
 /*
@@ -110,67 +110,66 @@ extern char const option_lib_text[4285];
 #define zNoState              (option_xlateable_txt.apz_str[ 40])
 #define zNotCmdOpt            (option_xlateable_txt.apz_str[ 41])
 #define zNotDate              (option_xlateable_txt.apz_str[ 42])
-#define zNotDef               (option_xlateable_txt.apz_str[ 43])
-#define zNotDuration          (option_xlateable_txt.apz_str[ 44])
-#define zneed_more            (option_xlateable_txt.apz_str[ 45])
-#define zNotNumber            (option_xlateable_txt.apz_str[ 46])
-#define znum_too_large        (option_xlateable_txt.apz_str[ 47])
-#define zoffer_usage_fmt      (option_xlateable_txt.apz_str[ 48])
-#define zonly_one             (option_xlateable_txt.apz_str[ 49])
-#define zstdout_name          (option_xlateable_txt.apz_str[ 50])
-#define zstderr_name          (option_xlateable_txt.apz_str[ 51])
-#define zwriting              (option_xlateable_txt.apz_str[ 52])
-#define zRangeErr             (option_xlateable_txt.apz_str[ 53])
-#define zneed_fmt             (option_xlateable_txt.apz_str[ 54])
-#define zsave_warn            (option_xlateable_txt.apz_str[ 55])
-#define zalt_opt              (option_xlateable_txt.apz_str[ 56])
-#define zAuto                 (option_xlateable_txt.apz_str[ 57])
-#define zDefaultOpt           (option_xlateable_txt.apz_str[ 58])
-#define zDis                  (option_xlateable_txt.apz_str[ 59])
-#define zDisabledOpt          (option_xlateable_txt.apz_str[ 60])
-#define zDisabledWhy          (option_xlateable_txt.apz_str[ 61])
-#define zEnab                 (option_xlateable_txt.apz_str[ 62])
-#define ztoo_often_fmt        (option_xlateable_txt.apz_str[ 63])
-#define zExamineFmt           (option_xlateable_txt.apz_str[ 64])
-#define zFileCannotExist      (option_xlateable_txt.apz_str[ 65])
-#define zFileMustExist        (option_xlateable_txt.apz_str[ 66])
-#define zFlagOkay             (option_xlateable_txt.apz_str[ 67])
-#define zGenshell             (option_xlateable_txt.apz_str[ 68])
-#define zLowerBits            (option_xlateable_txt.apz_str[ 69])
-#define zMembers              (option_xlateable_txt.apz_str[ 70])
-#define zMust                 (option_xlateable_txt.apz_str[ 71])
-#define zNoFlags              (option_xlateable_txt.apz_str[ 72])
-#define zNoLim                (option_xlateable_txt.apz_str[ 73])
-#define zNoPreset             (option_xlateable_txt.apz_str[ 74])
-#define zNoRq_NoShrtTtl       (option_xlateable_txt.apz_str[ 75])
-#define zNoRq_ShrtTtl         (option_xlateable_txt.apz_str[ 76])
-#define zNrmOptFmt            (option_xlateable_txt.apz_str[ 77])
-#define zNumberOpt            (option_xlateable_txt.apz_str[ 78])
-#define zOptsOnly             (option_xlateable_txt.apz_str[ 79])
-#define zPathFmt              (option_xlateable_txt.apz_str[ 80])
-#define zPlsSendBugs          (option_xlateable_txt.apz_str[ 81])
-#define zPreset               (option_xlateable_txt.apz_str[ 82])
-#define zPresetIntro          (option_xlateable_txt.apz_str[ 83])
-#define zProhib               (option_xlateable_txt.apz_str[ 84])
-#define zProhibOne            (option_xlateable_txt.apz_str[ 85])
-#define zRange                (option_xlateable_txt.apz_str[ 86])
-#define zRangeAbove           (option_xlateable_txt.apz_str[ 87])
-#define zRangeExact           (option_xlateable_txt.apz_str[ 88])
-#define zRangeLie             (option_xlateable_txt.apz_str[ 89])
-#define zRangeOnly            (option_xlateable_txt.apz_str[ 90])
-#define zRangeOr              (option_xlateable_txt.apz_str[ 91])
-#define zRangeScaled          (option_xlateable_txt.apz_str[ 92])
-#define zRangeUpto            (option_xlateable_txt.apz_str[ 93])
-#define zReorder              (option_xlateable_txt.apz_str[ 94])
-#define zReqOne               (option_xlateable_txt.apz_str[ 95])
-#define zReqThese             (option_xlateable_txt.apz_str[ 96])
-#define zReq_NoShrtTtl        (option_xlateable_txt.apz_str[ 97])
-#define zReq_ShrtTtl          (option_xlateable_txt.apz_str[ 98])
-#define zSetMemberSettings    (option_xlateable_txt.apz_str[ 99])
-#define zUpTo                 (option_xlateable_txt.apz_str[100])
-#define zValidKeys            (option_xlateable_txt.apz_str[101])
-#define zVendIntro            (option_xlateable_txt.apz_str[102])
-#define zVendOptsAre          (option_xlateable_txt.apz_str[103])
+#define zNotDuration          (option_xlateable_txt.apz_str[ 43])
+#define zneed_more            (option_xlateable_txt.apz_str[ 44])
+#define zNotNumber            (option_xlateable_txt.apz_str[ 45])
+#define znum_too_large        (option_xlateable_txt.apz_str[ 46])
+#define zoffer_usage_fmt      (option_xlateable_txt.apz_str[ 47])
+#define zonly_one             (option_xlateable_txt.apz_str[ 48])
+#define zstdout_name          (option_xlateable_txt.apz_str[ 49])
+#define zstderr_name          (option_xlateable_txt.apz_str[ 50])
+#define zwriting              (option_xlateable_txt.apz_str[ 51])
+#define zRangeErr             (option_xlateable_txt.apz_str[ 52])
+#define zneed_fmt             (option_xlateable_txt.apz_str[ 53])
+#define zsave_warn            (option_xlateable_txt.apz_str[ 54])
+#define zalt_opt              (option_xlateable_txt.apz_str[ 55])
+#define zAuto                 (option_xlateable_txt.apz_str[ 56])
+#define zDefaultOpt           (option_xlateable_txt.apz_str[ 57])
+#define zDis                  (option_xlateable_txt.apz_str[ 58])
+#define zDisabledOpt          (option_xlateable_txt.apz_str[ 59])
+#define zDisabledWhy          (option_xlateable_txt.apz_str[ 60])
+#define zEnab                 (option_xlateable_txt.apz_str[ 61])
+#define ztoo_often_fmt        (option_xlateable_txt.apz_str[ 62])
+#define zExamineFmt           (option_xlateable_txt.apz_str[ 63])
+#define zFileCannotExist      (option_xlateable_txt.apz_str[ 64])
+#define zFileMustExist        (option_xlateable_txt.apz_str[ 65])
+#define zFlagOkay             (option_xlateable_txt.apz_str[ 66])
+#define zGenshell             (option_xlateable_txt.apz_str[ 67])
+#define zLowerBits            (option_xlateable_txt.apz_str[ 68])
+#define zMembers              (option_xlateable_txt.apz_str[ 69])
+#define zMust                 (option_xlateable_txt.apz_str[ 70])
+#define zNoFlags              (option_xlateable_txt.apz_str[ 71])
+#define zNoLim                (option_xlateable_txt.apz_str[ 72])
+#define zNoPreset             (option_xlateable_txt.apz_str[ 73])
+#define zNoRq_NoShrtTtl       (option_xlateable_txt.apz_str[ 74])
+#define zNoRq_ShrtTtl         (option_xlateable_txt.apz_str[ 75])
+#define zNrmOptFmt            (option_xlateable_txt.apz_str[ 76])
+#define zNumberOpt            (option_xlateable_txt.apz_str[ 77])
+#define zOptsOnly             (option_xlateable_txt.apz_str[ 78])
+#define zPathFmt              (option_xlateable_txt.apz_str[ 79])
+#define zPlsSendBugs          (option_xlateable_txt.apz_str[ 80])
+#define zPreset               (option_xlateable_txt.apz_str[ 81])
+#define zPresetIntro          (option_xlateable_txt.apz_str[ 82])
+#define zProhib               (option_xlateable_txt.apz_str[ 83])
+#define zProhibOne            (option_xlateable_txt.apz_str[ 84])
+#define zRange                (option_xlateable_txt.apz_str[ 85])
+#define zRangeAbove           (option_xlateable_txt.apz_str[ 86])
+#define zRangeExact           (option_xlateable_txt.apz_str[ 87])
+#define zRangeLie             (option_xlateable_txt.apz_str[ 88])
+#define zRangeOnly            (option_xlateable_txt.apz_str[ 89])
+#define zRangeOr              (option_xlateable_txt.apz_str[ 90])
+#define zRangeScaled          (option_xlateable_txt.apz_str[ 91])
+#define zRangeUpto            (option_xlateable_txt.apz_str[ 92])
+#define zReorder              (option_xlateable_txt.apz_str[ 93])
+#define zReqOne               (option_xlateable_txt.apz_str[ 94])
+#define zReqThese             (option_xlateable_txt.apz_str[ 95])
+#define zReq_NoShrtTtl        (option_xlateable_txt.apz_str[ 96])
+#define zReq_ShrtTtl          (option_xlateable_txt.apz_str[ 97])
+#define zSetMemberSettings    (option_xlateable_txt.apz_str[ 98])
+#define zUpTo                 (option_xlateable_txt.apz_str[ 99])
+#define zValidKeys            (option_xlateable_txt.apz_str[100])
+#define zVendIntro            (option_xlateable_txt.apz_str[101])
+#define zVendOptsAre          (option_xlateable_txt.apz_str[102])
 
   /*
    *  First, set up the strings.  Some of these are writable.  These are all in
@@ -181,7 +180,7 @@ static char eng_zGnuBoolArg[]  = "=T/F";
 static char eng_zGnuKeyArg[]   = "=KWd";
 static char eng_zGnuNumArg[]   = "=num";
 static char eng_zGnuStrArg[]   = "=str";
-char const option_lib_text[4285] =
+char const option_lib_text[4267] =
 /*     0 */ "allocation of %d bytes failed\n\0"
 /*    31 */ "AutoOpts function called without option descriptor\n\0"
 /*    83 */ "\tThis exceeds the compiled library version:  \0"
@@ -190,7 +189,7 @@ char const option_lib_text[4285] =
 /*   228 */ "realloc of %d bytes at 0x%p failed\n\0"
 /*   264 */ "\tThis is less than the minimum library version:  \0"
 /*   314 */ "Automated Options version %s\n"
-            "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n\0"
+            "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n\0"
 /*   405 */ "(AutoOpts bug):  %s.\n\0"
 /*   427 */ "optionResetOpt() called, but reset-option not configured\0"
 /*   484 */ "could not locate the 'help' option\0"
@@ -231,76 +230,75 @@ char const option_lib_text[4285] =
 /*  1771 */ "%s error: no saved option state\n\0"
 /*  1804 */ "'%s' is not a command line option.\n\0"
 /*  1840 */ "%s error:  '%s' is not a recognizable date/time.\n\0"
-/*  1890 */ "'%s' not defined\n\0"
-/*  1908 */ "%s error:  '%s' is not a recognizable time duration.\n\0"
-/*  1962 */ "%s error:  The %s option must appear %d times.\n\0"
-/*  2010 */ "%s error:  '%s' is not a recognizable number.\n\0"
-/*  2057 */ "%s error:  %s exceeds %s keyword count\n\0"
-/*  2097 */ "Try '%s %s' for more information.\n\0"
-/*  2132 */ "one %s%s option allowed\n\0"
-/*  2157 */ "standard output\0"
-/*  2173 */ "standard error\0"
-/*  2188 */ "write\0"
-/*  2194 */ "%s error:  %s option value %ld is out of range.\n\0"
-/*  2243 */ "%s error:  %s option requires the %s option\n\0"
-/*  2288 */ "%s warning:  cannot save options - %s not regular file\n\0"
-/*  2344 */ "\t\t\t\t- an alternate for '%s'\n\0"
-/*  2373 */ "Version, usage and configuration options:\0"
-/*  2415 */ "\t\t\t\t- default option for unnamed options\n\0"
-/*  2457 */ "\t\t\t\t- disabled as '--%s'\n\0"
-/*  2483 */ " --- %-14s %s\n\0"
-/*  2498 */ "This option has been disabled\0"
-/*  2528 */ "\t\t\t\t- enabled by default\n\0"
-/*  2554 */ "%s error:  only \0"
-/*  2571 */ " - examining environment variables named %s_*\n\0"
-/*  2618 */ "\t\t\t\t- file must not pre-exist\n\0"
-/*  2649 */ "\t\t\t\t- file must pre-exist\n\0"
-/*  2676 */ "Options are specified by doubled hyphens and their name or by a single\n"
+/*  1890 */ "%s error:  '%s' is not a recognizable time duration.\n\0"
+/*  1944 */ "%s error:  The %s option must appear %d times.\n\0"
+/*  1992 */ "%s error:  '%s' is not a recognizable number.\n\0"
+/*  2039 */ "%s error:  %s exceeds %s keyword count\n\0"
+/*  2079 */ "Try '%s %s' for more information.\n\0"
+/*  2114 */ "one %s%s option allowed\n\0"
+/*  2139 */ "standard output\0"
+/*  2155 */ "standard error\0"
+/*  2170 */ "write\0"
+/*  2176 */ "%s error:  %s option value %ld is out of range.\n\0"
+/*  2225 */ "%s error:  %s option requires the %s option\n\0"
+/*  2270 */ "%s warning:  cannot save options - %s not regular file\n\0"
+/*  2326 */ "\t\t\t\t- an alternate for '%s'\n\0"
+/*  2355 */ "Version, usage and configuration options:\0"
+/*  2397 */ "\t\t\t\t- default option for unnamed options\n\0"
+/*  2439 */ "\t\t\t\t- disabled as '--%s'\n\0"
+/*  2465 */ " --- %-14s %s\n\0"
+/*  2480 */ "This option has been disabled\0"
+/*  2510 */ "\t\t\t\t- enabled by default\n\0"
+/*  2536 */ "%s error:  only \0"
+/*  2553 */ " - examining environment variables named %s_*\n\0"
+/*  2600 */ "\t\t\t\t- file must not pre-exist\n\0"
+/*  2631 */ "\t\t\t\t- file must pre-exist\n\0"
+/*  2658 */ "Options are specified by doubled hyphens and their name or by a single\n"
             "hyphen and the flag character.\n\0"
-/*  2779 */ "\n"
+/*  2761 */ "\n"
             "= = = = = = = =\n\n"
             "This incarnation of genshell will produce\n"
             "a shell script to parse the options for %s:\n\n\0"
-/*  2885 */ "  or an integer mask with any of the lower %d bits set\n\0"
-/*  2941 */ "\t\t\t\t- is a set membership option\n\0"
-/*  2975 */ "\t\t\t\t- must appear between %d and %d times\n\0"
-/*  3018 */ "Options are specified by single or double hyphens and their name.\n\0"
-/*  3085 */ "\t\t\t\t- may appear multiple times\n\0"
-/*  3118 */ "\t\t\t\t- may not be preset\n\0"
-/*  3143 */ "   Arg Option-Name    Description\n\0"
-/*  3178 */ "  Flg Arg Option-Name    Description\n\0"
-/*  3216 */ " %3s %s\0"
-/*  3224 */ "The '-#<number>' option may omit the hash char\n\0"
-/*  3272 */ "All arguments are named options.\n\0"
-/*  3306 */ " - reading file %s\0"
-/*  3325 */ "\n"
+/*  2867 */ "  or an integer mask with any of the lower %d bits set\n\0"
+/*  2923 */ "\t\t\t\t- is a set membership option\n\0"
+/*  2957 */ "\t\t\t\t- must appear between %d and %d times\n\0"
+/*  3000 */ "Options are specified by single or double hyphens and their name.\n\0"
+/*  3067 */ "\t\t\t\t- may appear multiple times\n\0"
+/*  3100 */ "\t\t\t\t- may not be preset\n\0"
+/*  3125 */ "   Arg Option-Name    Description\n\0"
+/*  3160 */ "  Flg Arg Option-Name    Description\n\0"
+/*  3198 */ " %3s %s\0"
+/*  3206 */ "The '-#<number>' option may omit the hash char\n\0"
+/*  3254 */ "All arguments are named options.\n\0"
+/*  3288 */ " - reading file %s\0"
+/*  3307 */ "\n"
             "Please send bug reports to:  <%s>\n\0"
-/*  3361 */ "\t\t\t\t- may NOT appear - preset only\n\0"
-/*  3397 */ "\n"
+/*  3343 */ "\t\t\t\t- may NOT appear - preset only\n\0"
+/*  3379 */ "\n"
             "The following option preset mechanisms are supported:\n\0"
-/*  3453 */ "prohibits these options:\n\0"
-/*  3479 */ "prohibits the option '%s'\n\0"
-/*  3506 */ "%s%ld to %ld\0"
-/*  3519 */ "%sgreater than or equal to %ld\0"
-/*  3550 */ "%s%ld exactly\0"
-/*  3564 */ "%sit must lie in one of the ranges:\n\0"
-/*  3601 */ "%sit must be in the range:\n\0"
-/*  3629 */ ", or\n\0"
-/*  3635 */ "%sis scalable with a suffix: k/K/m/M/g/G/t/T\n\0"
-/*  3681 */ "%sless than or equal to %ld\0"
-/*  3709 */ "Operands and options may be intermixed.  They will be reordered.\n\0"
-/*  3775 */ "requires the option '%s'\n\0"
-/*  3801 */ "requires these options:\n\0"
-/*  3826 */ "   Arg Option-Name   Req?  Description\n\0"
-/*  3866 */ "  Flg Arg Option-Name   Req?  Description\n\0"
-/*  3909 */ "or you may use a numeric representation.  Preceding these with a '!'\n"
+/*  3435 */ "prohibits these options:\n\0"
+/*  3461 */ "prohibits the option '%s'\n\0"
+/*  3488 */ "%s%ld to %ld\0"
+/*  3501 */ "%sgreater than or equal to %ld\0"
+/*  3532 */ "%s%ld exactly\0"
+/*  3546 */ "%sit must lie in one of the ranges:\n\0"
+/*  3583 */ "%sit must be in the range:\n\0"
+/*  3611 */ ", or\n\0"
+/*  3617 */ "%sis scalable with a suffix: k/K/m/M/g/G/t/T\n\0"
+/*  3663 */ "%sless than or equal to %ld\0"
+/*  3691 */ "Operands and options may be intermixed.  They will be reordered.\n\0"
+/*  3757 */ "requires the option '%s'\n\0"
+/*  3783 */ "requires these options:\n\0"
+/*  3808 */ "   Arg Option-Name   Req?  Description\n\0"
+/*  3848 */ "  Flg Arg Option-Name   Req?  Description\n\0"
+/*  3891 */ "or you may use a numeric representation.  Preceding these with a '!'\n"
             "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
             "will set them all.  Multiple entries may be passed as an option\n"
             "argument list.\n\0"
-/*  4128 */ "\t\t\t\t- may appear up to %d times\n\0"
-/*  4161 */ "The valid \"%s\" option keywords are:\n\0"
-/*  4198 */ "The next option supports vendor supported extra options:\0"
-/*  4255 */ "These additional options are:";
+/*  4110 */ "\t\t\t\t- may appear up to %d times\n\0"
+/*  4143 */ "The valid \"%s\" option keywords are:\n\0"
+/*  4180 */ "The next option supports vendor supported extra options:\0"
+/*  4237 */ "These additional options are:";
 
 /*
  *  Now, define (and initialize) the structure that contains
@@ -308,7 +306,7 @@ char const option_lib_text[4285] =
  *  Aren't you glad you don't maintain this by hand?
  */
 usage_text_t option_xlateable_txt = {
-  108,
+  107,
   eng_zGnuBoolArg, eng_zGnuKeyArg,  eng_zGnuNumArg,  eng_zGnuStrArg,
     {
     option_lib_text +    0, option_lib_text +   31, option_lib_text +   83,
@@ -325,27 +323,27 @@ usage_text_t option_xlateable_txt = {
     option_lib_text + 1490, option_lib_text + 1528, option_lib_text + 1574,
     option_lib_text + 1619, option_lib_text + 1646, option_lib_text + 1695,
     option_lib_text + 1744, option_lib_text + 1771, option_lib_text + 1804,
-    option_lib_text + 1840, option_lib_text + 1890, option_lib_text + 1908,
-    option_lib_text + 1962, option_lib_text + 2010, option_lib_text + 2057,
-    option_lib_text + 2097, option_lib_text + 2132, option_lib_text + 2157,
-    option_lib_text + 2173, option_lib_text + 2188, option_lib_text + 2194,
-    option_lib_text + 2243, option_lib_text + 2288, option_lib_text + 2344,
-    option_lib_text + 2373, option_lib_text + 2415, option_lib_text + 2457,
-    option_lib_text + 2483, option_lib_text + 2498, option_lib_text + 2528,
-    option_lib_text + 2554, option_lib_text + 2571, option_lib_text + 2618,
-    option_lib_text + 2649, option_lib_text + 2676, option_lib_text + 2779,
-    option_lib_text + 2885, option_lib_text + 2941, option_lib_text + 2975,
-    option_lib_text + 3018, option_lib_text + 3085, option_lib_text + 3118,
-    option_lib_text + 3143, option_lib_text + 3178, option_lib_text + 3216,
-    option_lib_text + 3224, option_lib_text + 3272, option_lib_text + 3306,
-    option_lib_text + 3325, option_lib_text + 3361, option_lib_text + 3397,
-    option_lib_text + 3453, option_lib_text + 3479, option_lib_text + 3506,
-    option_lib_text + 3519, option_lib_text + 3550, option_lib_text + 3564,
-    option_lib_text + 3601, option_lib_text + 3629, option_lib_text + 3635,
-    option_lib_text + 3681, option_lib_text + 3709, option_lib_text + 3775,
-    option_lib_text + 3801, option_lib_text + 3826, option_lib_text + 3866,
-    option_lib_text + 3909, option_lib_text + 4128, option_lib_text + 4161,
-    option_lib_text + 4198, option_lib_text + 4255
+    option_lib_text + 1840, option_lib_text + 1890, option_lib_text + 1944,
+    option_lib_text + 1992, option_lib_text + 2039, option_lib_text + 2079,
+    option_lib_text + 2114, option_lib_text + 2139, option_lib_text + 2155,
+    option_lib_text + 2170, option_lib_text + 2176, option_lib_text + 2225,
+    option_lib_text + 2270, option_lib_text + 2326, option_lib_text + 2355,
+    option_lib_text + 2397, option_lib_text + 2439, option_lib_text + 2465,
+    option_lib_text + 2480, option_lib_text + 2510, option_lib_text + 2536,
+    option_lib_text + 2553, option_lib_text + 2600, option_lib_text + 2631,
+    option_lib_text + 2658, option_lib_text + 2761, option_lib_text + 2867,
+    option_lib_text + 2923, option_lib_text + 2957, option_lib_text + 3000,
+    option_lib_text + 3067, option_lib_text + 3100, option_lib_text + 3125,
+    option_lib_text + 3160, option_lib_text + 3198, option_lib_text + 3206,
+    option_lib_text + 3254, option_lib_text + 3288, option_lib_text + 3307,
+    option_lib_text + 3343, option_lib_text + 3379, option_lib_text + 3435,
+    option_lib_text + 3461, option_lib_text + 3488, option_lib_text + 3501,
+    option_lib_text + 3532, option_lib_text + 3546, option_lib_text + 3583,
+    option_lib_text + 3611, option_lib_text + 3617, option_lib_text + 3663,
+    option_lib_text + 3691, option_lib_text + 3757, option_lib_text + 3783,
+    option_lib_text + 3808, option_lib_text + 3848, option_lib_text + 3891,
+    option_lib_text + 4110, option_lib_text + 4143, option_lib_text + 4180,
+    option_lib_text + 4237
   } };
 #endif /* AUTOOPTS_INTERNAL */
 
@@ -364,234 +362,230 @@ static void dummy_func(void) {
   /* LIBOPTS-MESSAGES: */
 #line 67 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 93 "../autoopts.c"
+#line 89 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 53 "../init.c"
+#line 48 "../init.c"
   puts(_("AutoOpts function called without option descriptor\n"));
-#line 86 "../init.c"
+#line 81 "../init.c"
   puts(_("\tThis exceeds the compiled library version:  "));
-#line 84 "../init.c"
+#line 79 "../init.c"
   puts(_("Automated Options Processing Error!\n"
        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
-#line 80 "../autoopts.c"
+#line 78 "../autoopts.c"
   puts(_("realloc of %d bytes at 0x%p failed\n"));
-#line 88 "../init.c"
+#line 83 "../init.c"
   puts(_("\tThis is less than the minimum library version:  "));
 #line 121 "../version.c"
   puts(_("Automated Options version %s\n"
-       "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
-#line 87 "../makeshell.c"
+       "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
+#line 49 "../makeshell.c"
   puts(_("(AutoOpts bug):  %s.\n"));
 #line 90 "../reset.c"
   puts(_("optionResetOpt() called, but reset-option not configured"));
-#line 292 "../usage.c"
+#line 241 "../usage.c"
   puts(_("could not locate the 'help' option"));
-#line 336 "../autoopts.c"
+#line 330 "../autoopts.c"
   puts(_("optionProcess() was called with invalid data"));
-#line 748 "../usage.c"
+#line 697 "../usage.c"
   puts(_("invalid argument type specified"));
-#line 598 "../find.c"
+#line 568 "../find.c"
   puts(_("defaulted to option with optional arg"));
 #line 76 "../alias.c"
   puts(_("aliasing option is out of range."));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
-#line 108 "../find.c"
+#line 78 "../find.c"
   puts(_("  The following options match:\n"));
-#line 293 "../find.c"
+#line 263 "../find.c"
   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
 #line 161 "../check.c"
   puts(_("%s: Command line arguments required\n"));
 #line 43 "../alias.c"
   puts(_("%d %s%s options allowed\n"));
-#line 94 "../makeshell.c"
+#line 56 "../makeshell.c"
   puts(_("%s error %d (%s) calling %s for '%s'\n"));
-#line 306 "../makeshell.c"
+#line 268 "../makeshell.c"
   puts(_("interprocess pipe"));
-#line 168 "../version.c"
+#line 171 "../version.c"
   puts(_("error: version option argument '%c' invalid.  Use:\n"
        "\t'v' - version only\n"
        "\t'c' - version and copyright\n"
        "\t'n' - version and full copyright notice\n"));
 #line 58 "../check.c"
   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
-#line 217 "../find.c"
+#line 187 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
-#line 430 "../find.c"
+#line 400 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
 #line 38 "../alias.c"
   puts(_("-equivalence"));
-#line 469 "../find.c"
+#line 439 "../find.c"
   puts(_("%s: illegal option -- %c\n"));
 #line 110 "../reset.c"
   puts(_("%s: illegal option -- %c\n"));
-#line 271 "../find.c"
+#line 241 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 755 "../find.c"
+#line 740 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
 #line 118 "../reset.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 335 "../find.c"
+#line 305 "../find.c"
   puts(_("%s: unknown vendor extension option -- %s\n"));
-#line 159 "../enum.c"
+#line 135 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 169 "../enum.c"
+#line 145 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 747 "../usage.c"
+#line 696 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 1081 "../usage.c"
+#line 1030 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 385 "../find.c"
+#line 355 "../find.c"
   puts(_("%s: invalid option name: %s\n"));
-#line 527 "../find.c"
+#line 497 "../find.c"
   puts(_("%s: The '%s' option requires an argument.\n"));
-#line 156 "../autoopts.c"
+#line 150 "../autoopts.c"
   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
        "\t'%s' and '%s'."));
 #line 94 "../check.c"
   puts(_("%s error:  The %s option is required\n"));
-#line 632 "../find.c"
+#line 602 "../find.c"
   puts(_("%s: The '%s' option cannot have an argument.\n"));
 #line 151 "../check.c"
   puts(_("%s: Command line arguments are not allowed.\n"));
-#line 535 "../save.c"
+#line 568 "../save.c"
   puts(_("error %d (%s) creating %s\n"));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
 #line 93 "../reset.c"
   puts(_("%s error: The '%s' option requires an argument.\n"));
-#line 184 "../save.c"
+#line 122 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
-#line 238 "../save.c"
+#line 175 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
 #line 143 "../restore.c"
   puts(_("%s error: no saved option state\n"));
-#line 231 "../autoopts.c"
+#line 225 "../autoopts.c"
   puts(_("'%s' is not a command line option.\n"));
-#line 111 "../time.c"
+#line 113 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
-#line 132 "../save.c"
-  puts(_("'%s' not defined\n"));
 #line 50 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
 #line 92 "../check.c"
   puts(_("%s error:  The %s option must appear %d times.\n"));
-#line 164 "../numeric.c"
+#line 165 "../numeric.c"
   puts(_("%s error:  '%s' is not a recognizable number.\n"));
-#line 200 "../enum.c"
+#line 176 "../enum.c"
   puts(_("%s error:  %s exceeds %s keyword count\n"));
-#line 330 "../usage.c"
+#line 279 "../usage.c"
   puts(_("Try '%s %s' for more information.\n"));
 #line 45 "../alias.c"
   puts(_("one %s%s option allowed\n"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("standard output"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard output"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard output"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard output"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard error"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard error"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard error"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard error"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("write"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("write"));
-#line 273 "../usage.c"
+#line 222 "../usage.c"
   puts(_("write"));
-#line 414 "../usage.c"
+#line 363 "../usage.c"
   puts(_("write"));
-#line 624 "../usage.c"
+#line 573 "../usage.c"
   puts(_("write"));
-#line 174 "../version.c"
+#line 177 "../version.c"
   puts(_("write"));
 #line 60 "../numeric.c"
   puts(_("%s error:  %s option value %ld is out of range.\n"));
 #line 44 "../check.c"
   puts(_("%s error:  %s option requires the %s option\n"));
-#line 131 "../save.c"
+#line 121 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 183 "../save.c"
+#line 174 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 237 "../save.c"
+#line 193 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 256 "../save.c"
-  puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 534 "../save.c"
+#line 567 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   /* END-LIBOPTS-MESSAGES */
 
   /* USAGE-TEXT: */
-#line 873 "../usage.c"
+#line 822 "../usage.c"
   puts(_("\t\t\t\t- an alternate for '%s'\n"));
-#line 1148 "../usage.c"
+#line 1097 "../usage.c"
   puts(_("Version, usage and configuration options:"));
-#line 924 "../usage.c"
+#line 873 "../usage.c"
   puts(_("\t\t\t\t- default option for unnamed options\n"));
-#line 837 "../usage.c"
+#line 786 "../usage.c"
   puts(_("\t\t\t\t- disabled as '--%s'\n"));
-#line 1117 "../usage.c"
+#line 1066 "../usage.c"
   puts(_(" --- %-14s %s\n"));
-#line 1115 "../usage.c"
+#line 1064 "../usage.c"
   puts(_("This option has been disabled"));
-#line 864 "../usage.c"
+#line 813 "../usage.c"
   puts(_("\t\t\t\t- enabled by default\n"));
 #line 40 "../alias.c"
   puts(_("%s error:  only "));
-#line 1194 "../usage.c"
+#line 1143 "../usage.c"
   puts(_(" - examining environment variables named %s_*\n"));
 #line 168 "../file.c"
   puts(_("\t\t\t\t- file must not pre-exist\n"));
 #line 172 "../file.c"
   puts(_("\t\t\t\t- file must pre-exist\n"));
-#line 380 "../usage.c"
+#line 329 "../usage.c"
   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
        "hyphen and the flag character.\n"));
-#line 921 "../makeshell.c"
+#line 882 "../makeshell.c"
   puts(_("\n"
        "= = = = = = = =\n\n"
        "This incarnation of genshell will produce\n"
        "a shell script to parse the options for %s:\n\n"));
-#line 166 "../enum.c"
+#line 142 "../enum.c"
   puts(_("  or an integer mask with any of the lower %d bits set\n"));
-#line 897 "../usage.c"
+#line 846 "../usage.c"
   puts(_("\t\t\t\t- is a set membership option\n"));
-#line 918 "../usage.c"
+#line 867 "../usage.c"
   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
-#line 382 "../usage.c"
+#line 331 "../usage.c"
   puts(_("Options are specified by single or double hyphens and their name.\n"));
-#line 904 "../usage.c"
+#line 853 "../usage.c"
   puts(_("\t\t\t\t- may appear multiple times\n"));
-#line 891 "../usage.c"
+#line 840 "../usage.c"
   puts(_("\t\t\t\t- may not be preset\n"));
-#line 1309 "../usage.c"
+#line 1258 "../usage.c"
   puts(_("   Arg Option-Name    Description\n"));
-#line 1245 "../usage.c"
+#line 1194 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1303 "../usage.c"
+#line 1252 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1304 "../usage.c"
+#line 1253 "../usage.c"
   puts(_(" %3s %s"));
-#line 1310 "../usage.c"
+#line 1259 "../usage.c"
   puts(_(" %3s %s"));
-#line 387 "../usage.c"
+#line 336 "../usage.c"
   puts(_("The '-#<number>' option may omit the hash char\n"));
-#line 383 "../usage.c"
+#line 332 "../usage.c"
   puts(_("All arguments are named options.\n"));
-#line 971 "../usage.c"
+#line 920 "../usage.c"
   puts(_(" - reading file %s"));
-#line 409 "../usage.c"
+#line 358 "../usage.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
 #line 100 "../version.c"
@@ -600,17 +594,17 @@ static void dummy_func(void) {
 #line 129 "../version.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
-#line 903 "../usage.c"
+#line 852 "../usage.c"
   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
-#line 944 "../usage.c"
+#line 893 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 1192 "../usage.c"
+#line 1141 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 682 "../usage.c"
+#line 631 "../usage.c"
   puts(_("prohibits these options:\n"));
-#line 677 "../usage.c"
+#line 626 "../usage.c"
   puts(_("prohibits the option '%s'\n"));
 #line 81 "../numeric.c"
   puts(_("%s%ld to %ld"));
@@ -628,28 +622,28 @@ static void dummy_func(void) {
   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
 #line 77 "../numeric.c"
   puts(_("%sless than or equal to %ld"));
-#line 390 "../usage.c"
+#line 339 "../usage.c"
   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
-#line 652 "../usage.c"
+#line 601 "../usage.c"
   puts(_("requires the option '%s'\n"));
-#line 655 "../usage.c"
+#line 604 "../usage.c"
   puts(_("requires these options:\n"));
-#line 1321 "../usage.c"
+#line 1270 "../usage.c"
   puts(_("   Arg Option-Name   Req?  Description\n"));
-#line 1315 "../usage.c"
+#line 1264 "../usage.c"
   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
-#line 167 "../enum.c"
+#line 143 "../enum.c"
   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
        "will set them all.  Multiple entries may be passed as an option\n"
        "argument list.\n"));
-#line 910 "../usage.c"
+#line 859 "../usage.c"
   puts(_("\t\t\t\t- may appear up to %d times\n"));
-#line 77 "../enum.c"
+#line 52 "../enum.c"
   puts(_("The valid \"%s\" option keywords are:\n"));
-#line 1152 "../usage.c"
+#line 1101 "../usage.c"
   puts(_("The next option supports vendor supported extra options:"));
-#line 773 "../usage.c"
+#line 722 "../usage.c"
   puts(_("These additional options are:"));
   /* END-USAGE-TEXT */
 }
index 2bea8e7f2aebeef321d9e9c605af0e31b2ea5938..80e0b0e97c2485f0b007f3774a7b7a1377bfecb2 100644 (file)
@@ -13,7 +13,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -64,8 +64,8 @@ optionBooleanVal(tOptions * opts, tOptDesc * od)
         long  val = strtol(od->optArg.argString, &pz, 0);
         if ((val != 0) || (*pz != NUL))
             break;
-        /* FALLTHROUGH */
     }
+    /* FALLTHROUGH */
     case 'N':
     case 'n':
     case 'F':
index eff8ec0133542dd980e4f1dbc2da48562d958643..7e75e7eca6d506e01017d7d2bf0a8fa8ae88f6ee 100644 (file)
@@ -9,7 +9,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -100,7 +100,7 @@ occurs_enough(tOptions * pOpts, tOptDesc * pOD)
  *
  *  Make sure that the argument list passes our consistency tests.
  */
-LOCAL bool
+static bool
 is_consistent(tOptions * pOpts)
 {
     tOptDesc * pOD   = pOpts->pOptDesc;
index 561d55db3c3e14d9982c4b9db23910943b9e99fa..70a5652a23b75bf83c80e00716709f111f7127e6 100644 (file)
@@ -1,9 +1,9 @@
-/*  -*- Mode: C -*- 
+/*  -*- Mode: C -*-
  *
  *  compat.h is free software.
  *  This file is part of AutoGen and AutoOpts.
  *
- *  AutoGen Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoGen Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
 #  include <unistd.h>
 #endif
 
-#ifdef HAVE_STDBOOL_H
+#if defined(HAVE_STDBOOL_H)
 #  include <stdbool.h>
-#else
+#elif ! defined(bool)
    typedef enum { false = 0, true = 1 } _Bool;
 #  define bool _Bool
 
index d343dcc643de2ac06259c816b29681ac4cd9aff6..5c477caf07a6261c0a768c375c97ab27d28d4ac4 100644 (file)
@@ -115,15 +115,9 @@ make_absolute( char const * string, char const * dot_path )
 
     if (!dot_path || *string == '/') {
         result = strdup( string );
-       if (result == NULL) {
-       return NULL;    /* couldn't allocate memory    */
-       }
     } else {
         if (dot_path && dot_path[0]) {
             result = malloc( 2 + strlen( dot_path ) + strlen( string ) );
-               if (result == NULL) {
-               return NULL;    /* couldn't allocate memory    */
-               }               
             strcpy( result, dot_path );
             result_len = (int)strlen(result);
             if (result[result_len - 1] != '/') {
@@ -132,9 +126,6 @@ make_absolute( char const * string, char const * dot_path )
             }
         } else {
             result = malloc( 3 + strlen( string ) );
-               if (result == NULL) {
-               return NULL;    /* couldn't allocate memory    */
-               }
             result[0] = '.'; result[1] = '/'; result[2] = '\0';
             result_len = 2;
         }
@@ -164,9 +155,7 @@ canonicalize_pathname( char *path )
 
     /* The result cannot be larger than the input PATH. */
     result = strdup( path );
-       if (result == NULL) {
-       return NULL;    /* couldn't allocate memory    */
-       }
+
     stub_char = (*path == '/') ? '/' : '.';
 
     /* Walk along RESULT looking for things to compact. */
index fb4e048e648216218beb60b4240c154e35ddcb9e..7ce1636416418c1a05093e6b2447753bd08a15d0 100644 (file)
@@ -9,7 +9,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
index 8244371e56be7883288ae957eb0445c7418c5a2b..783a9d8acde5bd692c0d1558652e57ceece35d31 100644 (file)
@@ -9,7 +9,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-/* = = = START-STATIC-FORWARD = = = */
-static void
-file_preset(tOptions * opts, char const * fname, int dir);
-
-static char *
-handle_comment(char * txt);
-
-static char *
-handle_cfg(tOptions * opts, tOptState * ost, char * txt, int dir);
-
-static char *
-handle_directive(tOptions * opts, char * txt);
-
-static char *
-aoflags_directive(tOptions * opts, char * txt);
-
-static char *
-program_directive(tOptions * opts, char * txt);
-
-static char *
-handle_section(tOptions * opts, char * txt);
-
-static int
-parse_xml_encoding(char ** ppz);
-
-static char *
-trim_xml_text(char * intxt, char const * pznm, tOptionLoadMode mode);
-
-static void
-cook_xml_text(char * pzData);
-
-static char *
-handle_struct(tOptions * opts, tOptState * ost, char * txt, int dir);
-
-static char const *
-parse_keyword(tOptions * opts, char const * txt, tOptionValue * typ);
-
-static char const *
-parse_set_mem(tOptions * opts, char const * txt, tOptionValue * typ);
-
-static char const *
-parse_value(char const * txt, tOptionValue * typ);
-/* = = = END-STATIC-FORWARD = = = */
-
 /**
  *  Skip over some unknown attribute
  *  @param[in] txt   start of skpped text
@@ -182,9 +138,9 @@ optionFindValue(const tOptDesc * odesc, char const * name, char const * val)
     }
 
     else do {
-        tArgList *    argl  = odesc->optCookie;
-        int           argct = argl->useCt;
-        const void ** poptv = VOIDP(argl->apzArgs);
+        tArgList * argl  = odesc->optCookie;
+        int        argct = argl->useCt;
+        void **    poptv = (void **)(argl->apzArgs);
 
         if (argct == 0) {
             errno = ENOENT;
@@ -192,7 +148,7 @@ optionFindValue(const tOptDesc * odesc, char const * name, char const * val)
         }
 
         if (name == NULL) {
-            res = (const tOptionValue *)*poptv;
+            res = (tOptionValue *)*poptv;
             break;
         }
 
@@ -249,7 +205,7 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal,
                     char const * pzName, char const * pzVal)
 {
     bool old_found = false;
-    const tOptionValue * res = NULL;
+    tOptionValue * res = NULL;
 
     (void)pzName;
     (void)pzVal;
@@ -264,12 +220,12 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal,
     }
 
     else do {
-        tArgList *    argl  = odesc->optCookie;
-        int           ct    = argl->useCt;
-        const void ** poptv = VOIDP(argl->apzArgs);
+        tArgList * argl = odesc->optCookie;
+        int        ct   = argl->useCt;
+        void **   poptv = (void **)argl->apzArgs;
 
         while (--ct >= 0) {
-            const tOptionValue * pOV = *(poptv++);
+            tOptionValue * pOV = *(poptv++);
             if (old_found) {
                 res = pOV;
                 break;
@@ -315,8 +271,8 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal,
 tOptionValue const *
 optionGetValue(tOptionValue const * oov, char const * vname)
 {
-    tArgList *           arg_list;
-    const tOptionValue * res = NULL;
+    tArgList *     arg_list;
+    tOptionValue * res = NULL;
 
     if ((oov == NULL) || (oov->valType != OPARG_TYPE_HIERARCHY)) {
         errno = EINVAL;
@@ -325,14 +281,14 @@ optionGetValue(tOptionValue const * oov, char const * vname)
     arg_list = oov->v.nestVal;
 
     if (arg_list->useCt > 0) {
-        int           ct     = arg_list->useCt;
-        const void ** ovlist = VOIDP(arg_list->apzArgs);
+        int     ct     = arg_list->useCt;
+        void ** ovlist = (void **)(arg_list->apzArgs);
 
         if (vname == NULL) {
-            res = (const tOptionValue *)*ovlist;
+            res = (tOptionValue *)*ovlist;
 
         } else do {
-            const tOptionValue * opt_val = *(ovlist++);
+            tOptionValue * opt_val = *(ovlist++);
             if (strcmp(opt_val->pzName, vname) == 0) {
                 res = opt_val;
                 break;
@@ -374,9 +330,9 @@ optionGetValue(tOptionValue const * oov, char const * vname)
 tOptionValue const *
 optionNextValue(tOptionValue const * ov_list,tOptionValue const * oov )
 {
-    tArgList *           arg_list;
-    const tOptionValue * res = NULL;
-    int                  err = EINVAL;
+    tArgList *     arg_list;
+    tOptionValue * res = NULL;
+    int            err = EINVAL;
 
     if ((ov_list == NULL) || (ov_list->valType != OPARG_TYPE_HIERARCHY)) {
         errno = EINVAL;
@@ -384,18 +340,18 @@ optionNextValue(tOptionValue const * ov_list,tOptionValue const * oov )
     }
     arg_list = ov_list->v.nestVal;
     {
-        int           ct     = arg_list->useCt;
-        const void ** o_list = VOIDP(arg_list->apzArgs);
+        int     ct    = arg_list->useCt;
+        void ** o_list = (void **)(arg_list->apzArgs);
 
         while (ct-- > 0) {
-            const tOptionValue * nov = *(o_list++);
+            tOptionValue * nov = *(o_list++);
             if (nov == oov) {
                 if (ct == 0) {
                     err = ENOENT;
 
                 } else {
                     err = 0;
-                    res = (const tOptionValue *)*o_list;
+                    res = (tOptionValue *)*o_list;
                 }
                 break;
             }
@@ -466,6 +422,7 @@ file_preset(tOptions * opts, char const * fname, int dir)
                 ftext = strchr(ftext + 2, '>');
                 if (ftext++ != NULL)
                     break;
+                /* FALLTHROUGH */
 
             default:
                 ftext = NULL;
@@ -626,9 +583,9 @@ handle_directive(tOptions * opts, char * txt)
 
     for (ix = 0; ix < dir_ct; ix++) {
         size_t len = strlen(dir_names[ix]);
-        if (  (strncmp(txt + 2, dir_names[ix], len) == 0)
-           && (! IS_VALUE_NAME_CHAR(txt[len+2])) )
-            return dir_disp[ix](opts, txt + len + 2);
+        if (  (strncmp(txt, dir_names[ix], len) == 0)
+           && (! IS_VALUE_NAME_CHAR(txt[len])) )
+            return dir_disp[ix](opts, txt + len);
     }
 
     /*
@@ -681,44 +638,35 @@ aoflags_directive(tOptions * opts, char * txt)
 static char *
 program_directive(tOptions * opts, char * txt)
 {
-    static char const ttlfmt[] = "<?";
-    size_t ttl_len  = sizeof(ttlfmt) + strlen(zCfgProg);
-    char * ttl      = AGALOC(ttl_len, "prog title");
     size_t name_len = strlen(opts->pzProgName);
 
-    memcpy(ttl, ttlfmt, sizeof(ttlfmt) - 1);
-    memcpy(ttl + sizeof(ttlfmt) - 1, zCfgProg, ttl_len - (sizeof(ttlfmt) - 1));
-
-    do  {
-        txt = SPN_WHITESPACE_CHARS(txt+1);
+    for (;; txt += zCfgProg_LEN) {
+        txt = SPN_WHITESPACE_CHARS(txt);
 
         if (  (strneqvcmp(txt, opts->pzProgName, (int)name_len) == 0)
-           && (IS_END_XML_TOKEN_CHAR(txt[name_len])) ) {
-            txt += name_len;
-            break;
-        }
+           && (IS_END_XML_TOKEN_CHAR(txt[name_len])) )
 
-        txt = strstr(txt, ttl);
-    } while (txt != NULL);
+            return txt + name_len;
 
-    AGFREE(ttl);
-    if (txt != NULL)
-        for (;;) {
-            if (*txt == NUL) {
-                txt = NULL;
-                break;
-            }
-            if (*(txt++) == '>')
-                break;
-        }
+        txt = strstr(txt, zCfgProg);
+        if (txt == NULL)
+            return txt;
+    }
 
-    return txt;
+    for (;;) {
+        if (*txt == NUL)
+            return NULL;
+
+        if (*(txt++) == '>')
+            return txt;
+    }
 }
 
 /**
  *  "txt" points to a '[' character.
  *  The "traditional" [PROG_NAME] segmentation of the config file.
  *  Do not ever mix with the "<?program prog-name>" variation.
+ *  The templates reject program names over 16 characters.
  *
  *  @param[in,out] opts  program option descriptor
  *  @param[in]     txt   scanning pointer
@@ -736,8 +684,10 @@ handle_section(tOptions * opts, char * txt)
         return NULL;
 
     {
-        char z[24];
-        sprintf(z, "[%s]", opts->pzPROGNAME);
+        char z[24] = "[";
+        memcpy(z+1, opts->pzPROGNAME, len);
+        z[++len] = ']';
+        z[++len] = NUL;
         txt = strstr(txt, z);
     }
 
@@ -839,16 +789,22 @@ parse_xml_encoding(char ** ppz)
 static char *
 trim_xml_text(char * intxt, char const * pznm, tOptionLoadMode mode)
 {
-    static char const fmt[] = "</%s>";
-    size_t len = strlen(pznm) + sizeof(fmt) - 2 /* for %s */;
+    size_t nm_len = strlen(pznm);
     char * etext;
 
     {
         char z[64], *pz = z;
-        if (len >= sizeof(z))
-            pz = AGALOC(len, "scan name");
 
-        len = (size_t)sprintf(pz, fmt, pznm);
+        if (nm_len + 4 >= sizeof(z))
+            pz = AGALOC(nm_len + 4, "scan name");
+
+        pz[0] = '<';
+        pz[1] = '/';
+        memcpy(pz+2, pznm, nm_len);
+        nm_len  += 2;
+        pz[nm_len++] = '>';
+        pz[nm_len]   = NUL;
+
         *intxt = ' ';
         etext = strstr(intxt, pz);
         if (pz != z) AGFREE(pz);
@@ -858,7 +814,7 @@ trim_xml_text(char * intxt, char const * pznm, tOptionLoadMode mode)
         return etext;
 
     {
-        char * result = etext + len;
+        char * result = etext + nm_len;
 
         if (mode != OPTION_LOAD_UNCOOKED)
             etext = SPN_WHITESPACE_BACK(intxt, etext);
@@ -997,7 +953,7 @@ handle_struct(tOptions * opts, tOptState * ost, char * txt, int dir)
  *  scanning the "homerc" list, or from a specific file request.
  *  (see "optionFileLoad()", the implementation for --load-opts)
  */
-LOCAL void
+static void
 intern_file_load(tOptions * opts)
 {
     uint32_t  svfl;
@@ -1198,7 +1154,7 @@ optionLoadOpt(tOptions * opts, tOptDesc * odesc)
  *
  * @returns NULL on failure, otherwise the scan point
  */
-LOCAL char const *
+static char const *
 parse_attrs(tOptions * opts, char const * txt, tOptionLoadMode * pMode,
             tOptionValue * pType)
 {
index 65260a27222d5ab0b869b3e27a8b3883d695d406..5240540f3a68f96cc8c8f97279f39f27607b5fcc 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-/* = = = START-STATIC-FORWARD = = = */
-static bool
-contiguous_quote(char ** pps, char * pq, int * lnct_p);
-/* = = = END-STATIC-FORWARD = = = */
-
 /*=export_func  ao_string_cook_escape_char
  * private:
  *
@@ -135,6 +130,18 @@ ao_string_cook_escape_char(char const * pzIn, char * pRes, uint_t nl)
     return res;
 }
 
+/**
+ * count newlines between start and end
+ */
+static char *
+nl_count(char * start, char * end, int * lnct_p)
+{
+    while (start < end) {
+        if (*(start++) == NL)
+            (*lnct_p)++;
+    }
+    return end;
+}
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  *
@@ -168,38 +175,22 @@ contiguous_quote(char ** pps, char * pq, int * lnct_p)
              */
             switch (ps[1]) {
             default:
-                *pps = NULL;
-                return false;
+                goto fail_return;
 
             case '/':
                 /*
                  *  Skip to end of line
                  */
                 ps = strchr(ps, NL);
-                if (ps == NULL) {
-                    *pps = NULL;
-                    return false;
-                }
+                if (ps == NULL)
+                    goto fail_return;
                 break;
 
             case '*':
-            {
-                char * p = strstr( ps+2, "*/" );
-                /*
-                 *  Skip to terminating star slash
-                 */
-                if (p == NULL) {
-                    *pps = NULL;
-                    return false;
-                }
-
-                while (ps < p) {
-                    if (*(ps++) == NL)
-                        (*lnct_p)++;
-                }
-
-                ps = p + 2;
-            }
+                ps = nl_count(ps + 2, strstr(ps + 2, "*/"), lnct_p);
+                if (ps == NULL)
+                    goto fail_return;
+                ps += 2;
             }
             continue;
 
@@ -212,6 +203,10 @@ contiguous_quote(char ** pps, char * pq, int * lnct_p)
             return false;
         }
     }
+
+ fail_return:
+    *pps = NULL;
+    return false;
 }
 
 /*=export_func  ao_string_cook
index e9bba83644cb0c8692a6e01e4d7671189594c71e..7f92e0b0222a68590299b2c1e4953cea3a98634a 100644 (file)
@@ -14,7 +14,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-/* = = = START-STATIC-FORWARD = = = */
-static void
-enum_err(tOptions * pOpts, tOptDesc * pOD,
-         char const * const * paz_names, int name_ct);
-
-static uintptr_t
-find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
-          char const * const *  paz_names, unsigned int name_ct);
-
-static void
-set_memb_shell(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names,
-               unsigned int name_ct);
-
-static void
-set_memb_names(tOptions * opts, tOptDesc * od, char const * const * nm_list,
-               unsigned int nm_ct);
-
-static uintptr_t
-check_membership_start(tOptDesc * od, char const ** argp, bool * invert);
-
-static uintptr_t
-find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len,
-                char const * const * nm_list, unsigned int nm_ct);
-/* = = = END-STATIC-FORWARD = = = */
-
 static void
 enum_err(tOptions * pOpts, tOptDesc * pOD,
          char const * const * paz_names, int name_ct)
@@ -130,9 +105,10 @@ enum_err(tOptions * pOpts, tOptDesc * pOD,
      */
     else {
         unsigned int ent_no = 0;
-        char  zFmt[16];  /* format for all-but-last entries on a line */
+        char fmt[16];  /* format for all-but-last entries on a line */
 
-        sprintf(zFmt, ENUM_ERR_WIDTH, (int)max_len);
+        if (snprintf(fmt, 16, ENUM_ERR_WIDTH, (int)max_len) >= 16)
+            option_exits(EXIT_FAILURE);
         max_len = 78 / max_len; /* max_len is now max entries on a line */
         fputs(TWO_SPACES_STR, option_usage_fp);
 
@@ -150,7 +126,7 @@ enum_err(tOptions * pOpts, tOptDesc * pOD,
             }
 
             else
-                fprintf(option_usage_fp, zFmt, *(paz_names++) );
+                fprintf(option_usage_fp, fmt, *(paz_names++) );
         }
         fprintf(option_usage_fp, NLSTR_FMT, *paz_names);
     }
@@ -189,12 +165,12 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
      *  The result gets stashed in a char * pointer.
      */
     uintptr_t   res = name_ct;
-    size_t      len = strlen(name);
+    size_t      len = strlen((char *)name);
     uintptr_t   idx;
 
     if (IS_DEC_DIGIT_CHAR(*name)) {
-        char * pz;
-        unsigned long val = strtoul(name, &pz, 0);
+        char * pz = VOIDP(name);
+        unsigned long val = strtoul(pz, &pz, 0);
         if ((*pz == NUL) && (val < name_ct))
             return (uintptr_t)val;
         pz_enum_err_fmt = znum_too_large;
@@ -215,7 +191,7 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
      *  Multiple partial matches means we have an ambiguous match.
      */
     for (idx = 0; idx < name_ct; idx++) {
-        if (strncmp(paz_names[idx], name, len) == 0) {
+        if (strncmp((char *)paz_names[idx], (char *)name, len) == 0) {
             if (paz_names[idx][len] == NUL)
                 return idx;  /* full match */
 
@@ -500,7 +476,7 @@ find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len,
         if (shift_ct >= nm_ct)
             return 0UL;
 
-        return (uintptr_t)1U << shift_ct;
+        return 1UL << shift_ct;
     }
 }
 
index 36ae2e535a6c430721ad444e0f826380fe5a0b61..16f0e9513d47cc289f904b3a3a08510452d20e6c 100644 (file)
@@ -13,7 +13,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-/* = = = START-STATIC-FORWARD = = = */
-static void
-do_env_opt(tOptState * os, char * env_name,
-            tOptions * pOpts, teEnvPresetType type);
-/* = = = END-STATIC-FORWARD = = = */
-
 /*
  *  doPrognameEnv - check for preset values from the ${PROGNAME}
  *  environment variable.  This is accomplished by parsing the text into
  *  tokens, temporarily replacing the arg vector and calling
  *  immediate_opts and/or regular_opts.
  */
-LOCAL void
+static void
 doPrognameEnv(tOptions * pOpts, teEnvPresetType type)
 {
     char const *        env_opts = getenv(pOpts->pzPROGNAME);
@@ -187,7 +181,7 @@ do_env_opt(tOptState * os, char * env_name,
  *  env_presets - check for preset values from the envrionment
  *  This routine should process in all, immediate or normal modes....
  */
-LOCAL void
+static void
 env_presets(tOptions * pOpts, teEnvPresetType type)
 {
     int        ct;
index 7d92875d84c33e6069fa2056dfd45043605a8a07..14efe8fe337146ba89464c8f57b1dce5a0165ec1 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
index 97a24df47216ce5bf0b13f6b9915810d1d1a209e..03ae103731409aee6db68613a80a7a80cf52a8e6 100644 (file)
@@ -12,7 +12,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-/* = = = START-STATIC-FORWARD = = = */
-static int
-parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz);
-
-static void
-opt_ambiguities(tOptions * opts, char const * name, int nm_len);
-
-static int
-opt_match_ct(tOptions * opts, char const * name, int nm_len,
-             int * ixp, bool * disable);
-
-static tSuccess
-opt_set(tOptions * opts, char * arg, int idx, bool disable, tOptState * st);
-
-static tSuccess
-opt_unknown(tOptions * opts, char const * name, char * arg, tOptState * st);
-
-static tSuccess
-opt_ambiguous(tOptions * opts, char const * name, int match_ct);
-
-static tSuccess
-get_opt_arg_must(tOptions * opts, tOptState * o_st);
-
-static tSuccess
-get_opt_arg_may(tOptions * pOpts, tOptState * o_st);
-
-static tSuccess
-get_opt_arg_none(tOptions * pOpts, tOptState * o_st);
-/* = = = END-STATIC-FORWARD = = = */
-
 /**
  * find the name and name length we are looking for
  */
@@ -80,7 +50,7 @@ parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz)
 
             buf[res] = NUL;
             *nm_pp   = buf;
-            *arg_pp  = VOIDP(p);
+            *arg_pp  = (char *)p;
             return res;
 
         default:
@@ -367,7 +337,7 @@ optionVendorOption(tOptions * pOpts, tOptDesc * pOD)
  *
  * @return success status
  */
-LOCAL tSuccess
+static tSuccess
 opt_find_long(tOptions * opts, char const * opt_name, tOptState * state)
 {
     char    name_buf[128];
@@ -408,7 +378,7 @@ opt_find_long(tOptions * opts, char const * opt_name, tOptState * state)
  * @param optValue   option flag character
  * @param pOptState  state about current option
  */
-LOCAL tSuccess
+static tSuccess
 opt_find_short(tOptions * pOpts, uint_t optValue, tOptState * pOptState)
 {
     tOptDesc * pRes = pOpts->pOptDesc;
@@ -638,6 +608,7 @@ get_opt_arg_none(tOptions * pOpts, tOptState * o_st)
      */
     else
         pOpts->pzCurOpt = NULL;
+
     return SUCCESS;
 }
 
@@ -648,7 +619,7 @@ get_opt_arg_none(tOptions * pOpts, tOptState * o_st)
  *  @param[in,out] o_st  the option processing state
  *  @returns SUCCESS or FAILURE
  */
-LOCAL tSuccess
+static tSuccess
 get_opt_arg(tOptions * opts, tOptState * o_st)
 {
     o_st->flags |= (o_st->pOD->fOptState & OPTST_PERSISTENT_MASK);
@@ -658,10 +629,24 @@ get_opt_arg(tOptions * opts, tOptState * o_st)
      * are handled with the "none" procedure.  Otherwise, check the
      * optional flag and call either the "may" or "must" function.
      */
-    if (  ((o_st->flags & OPTST_DISABLED) != 0)
-       || (OPTST_GET_ARGTYPE(o_st->flags) == OPARG_TYPE_NONE))
+    if ((o_st->flags & OPTST_DISABLED) != 0)
         return get_opt_arg_none(opts, o_st);
-    
+
+    switch (OPTST_GET_ARGTYPE(o_st->flags)) {
+    case OPARG_TYPE_STATIC:
+    {
+        /*
+         * Propagate the static arg
+         */
+        tSuccess res = get_opt_arg_none(opts, o_st);
+        o_st->pzOptArg = o_st->pOD->optArg.argString;
+        return res;
+    }
+
+    case OPARG_TYPE_NONE:
+        return get_opt_arg_none(opts, o_st);
+    }
+
     if (o_st->flags & OPTST_ARG_OPTIONAL)
         return get_opt_arg_may( opts, o_st);
     
@@ -675,7 +660,7 @@ get_opt_arg(tOptions * opts, tOptState * o_st)
  *  @param[in,out] o_st  the option processing state
  *  @returns SUCCESS or FAILURE
  */
-LOCAL tSuccess
+static tSuccess
 find_opt(tOptions * opts, tOptState * o_st)
 {
     /*
index 0f05b3efbc446892639f5937e210bdc98f540afd..05182a6014f1631ccc2adecdb116db5e94a73678 100644 (file)
@@ -6,7 +6,7 @@
  *  From the definitions    genshell.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:0:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This source file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -19,7 +19,7 @@
  * The genshellopt program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1999-2014 Bruce Korb, all rights reserved.
+ *  Copyright (C) 1999-2018 Bruce Korb, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the GNU Lesser General Public License,
  *  version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
 #define OPTION_CODE_COMPILE 1
 #include "genshell.h"
 #include <sys/types.h>
+#include <sys/stat.h>
 
+#include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #ifdef  __cplusplus
 extern "C" {
@@ -66,7 +71,7 @@ extern tUsageProc genshelloptUsage;
  */
 static char const genshellopt_opt_strs[1769] =
 /*     0 */ "genshellopt 1\n"
-            "Copyright (C) 1999-2014 Bruce Korb, all rights reserved.\n"
+            "Copyright (C) 1999-2018 Bruce Korb, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the GNU Lesser General Public License,\n"
             "version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n\0"
@@ -258,7 +263,7 @@ static tOptDesc optDesc[GENSHELL_OPTION_CT] = {
 #define zDetail         (genshellopt_opt_strs+1534)
 /** The full version string for genshellopt. */
 #define zFullVersion    (genshellopt_opt_strs+1755)
-/* extracted from optcode.tlib near line 364 */
+/* extracted from optcode.tlib near line 342 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -290,7 +295,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od)
     ex_code = GENSHELLOPT_EXIT_SUCCESS;
     genshelloptUsage(&genshelloptOptions, ex_code);
     /* NOTREACHED */
-    exit(1);
+    exit(GENSHELLOPT_EXIT_FAILURE);
     (void)opts;
     (void)od;
 }
@@ -481,19 +486,19 @@ static void bogus_function(void) {
      extract the correct strings.  These strings are actually referenced
      by a field name in the genshelloptOptions structure noted in the
      comments below.  The literal text is defined in genshellopt_opt_strs.
-   
+
      NOTE: the strings below are segmented with respect to the source string
      genshellopt_opt_strs.  The strings above are handed off for translation
      at run time a paragraph at a time.  Consequently, they are presented here
      for translation a paragraph at a time.
-   
+
      ALSO: often the description for an option will reference another option
      by name.  These are set off with apostrophe quotes (I hope).  Do not
      translate option names.
    */
   /* referenced via genshelloptOptions.pzCopyright */
   puts(_("genshellopt 1\n\
-Copyright (C) 1999-2014 Bruce Korb, all rights reserved.\n\
+Copyright (C) 1999-2018 Bruce Korb, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the GNU Lesser General Public License,\n\
 version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n"));
@@ -551,234 +556,230 @@ by the newly generated text.  The first '#!' line will be regenerated.\n"));
   /* LIBOPTS-MESSAGES: */
 #line 67 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 93 "../autoopts.c"
+#line 89 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 53 "../init.c"
+#line 48 "../init.c"
   puts(_("AutoOpts function called without option descriptor\n"));
-#line 86 "../init.c"
+#line 81 "../init.c"
   puts(_("\tThis exceeds the compiled library version:  "));
-#line 84 "../init.c"
+#line 79 "../init.c"
   puts(_("Automated Options Processing Error!\n"
        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
-#line 80 "../autoopts.c"
+#line 78 "../autoopts.c"
   puts(_("realloc of %d bytes at 0x%p failed\n"));
-#line 88 "../init.c"
+#line 83 "../init.c"
   puts(_("\tThis is less than the minimum library version:  "));
 #line 121 "../version.c"
   puts(_("Automated Options version %s\n"
-       "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
-#line 87 "../makeshell.c"
+       "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
+#line 49 "../makeshell.c"
   puts(_("(AutoOpts bug):  %s.\n"));
 #line 90 "../reset.c"
   puts(_("optionResetOpt() called, but reset-option not configured"));
-#line 292 "../usage.c"
+#line 241 "../usage.c"
   puts(_("could not locate the 'help' option"));
-#line 336 "../autoopts.c"
+#line 330 "../autoopts.c"
   puts(_("optionProcess() was called with invalid data"));
-#line 748 "../usage.c"
+#line 697 "../usage.c"
   puts(_("invalid argument type specified"));
-#line 598 "../find.c"
+#line 568 "../find.c"
   puts(_("defaulted to option with optional arg"));
 #line 76 "../alias.c"
   puts(_("aliasing option is out of range."));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
-#line 108 "../find.c"
+#line 78 "../find.c"
   puts(_("  The following options match:\n"));
-#line 293 "../find.c"
+#line 263 "../find.c"
   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
 #line 161 "../check.c"
   puts(_("%s: Command line arguments required\n"));
 #line 43 "../alias.c"
   puts(_("%d %s%s options allowed\n"));
-#line 94 "../makeshell.c"
+#line 56 "../makeshell.c"
   puts(_("%s error %d (%s) calling %s for '%s'\n"));
-#line 306 "../makeshell.c"
+#line 268 "../makeshell.c"
   puts(_("interprocess pipe"));
-#line 168 "../version.c"
+#line 171 "../version.c"
   puts(_("error: version option argument '%c' invalid.  Use:\n"
        "\t'v' - version only\n"
        "\t'c' - version and copyright\n"
        "\t'n' - version and full copyright notice\n"));
 #line 58 "../check.c"
   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
-#line 217 "../find.c"
+#line 187 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
-#line 430 "../find.c"
+#line 400 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
 #line 38 "../alias.c"
   puts(_("-equivalence"));
-#line 469 "../find.c"
+#line 439 "../find.c"
   puts(_("%s: illegal option -- %c\n"));
 #line 110 "../reset.c"
   puts(_("%s: illegal option -- %c\n"));
-#line 271 "../find.c"
+#line 241 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 755 "../find.c"
+#line 740 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
 #line 118 "../reset.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 335 "../find.c"
+#line 305 "../find.c"
   puts(_("%s: unknown vendor extension option -- %s\n"));
-#line 159 "../enum.c"
+#line 135 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 169 "../enum.c"
+#line 145 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 747 "../usage.c"
+#line 696 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 1081 "../usage.c"
+#line 1030 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 385 "../find.c"
+#line 355 "../find.c"
   puts(_("%s: invalid option name: %s\n"));
-#line 527 "../find.c"
+#line 497 "../find.c"
   puts(_("%s: The '%s' option requires an argument.\n"));
-#line 156 "../autoopts.c"
+#line 150 "../autoopts.c"
   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
        "\t'%s' and '%s'."));
 #line 94 "../check.c"
   puts(_("%s error:  The %s option is required\n"));
-#line 632 "../find.c"
+#line 602 "../find.c"
   puts(_("%s: The '%s' option cannot have an argument.\n"));
 #line 151 "../check.c"
   puts(_("%s: Command line arguments are not allowed.\n"));
-#line 535 "../save.c"
+#line 568 "../save.c"
   puts(_("error %d (%s) creating %s\n"));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
 #line 93 "../reset.c"
   puts(_("%s error: The '%s' option requires an argument.\n"));
-#line 184 "../save.c"
+#line 122 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
-#line 238 "../save.c"
+#line 175 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
 #line 143 "../restore.c"
   puts(_("%s error: no saved option state\n"));
-#line 231 "../autoopts.c"
+#line 225 "../autoopts.c"
   puts(_("'%s' is not a command line option.\n"));
-#line 111 "../time.c"
+#line 113 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
-#line 132 "../save.c"
-  puts(_("'%s' not defined\n"));
 #line 50 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
 #line 92 "../check.c"
   puts(_("%s error:  The %s option must appear %d times.\n"));
-#line 164 "../numeric.c"
+#line 165 "../numeric.c"
   puts(_("%s error:  '%s' is not a recognizable number.\n"));
-#line 200 "../enum.c"
+#line 176 "../enum.c"
   puts(_("%s error:  %s exceeds %s keyword count\n"));
-#line 330 "../usage.c"
+#line 279 "../usage.c"
   puts(_("Try '%s %s' for more information.\n"));
 #line 45 "../alias.c"
   puts(_("one %s%s option allowed\n"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("standard output"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard output"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard output"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard output"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard error"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard error"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard error"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard error"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("write"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("write"));
-#line 273 "../usage.c"
+#line 222 "../usage.c"
   puts(_("write"));
-#line 414 "../usage.c"
+#line 363 "../usage.c"
   puts(_("write"));
-#line 624 "../usage.c"
+#line 573 "../usage.c"
   puts(_("write"));
-#line 174 "../version.c"
+#line 177 "../version.c"
   puts(_("write"));
 #line 60 "../numeric.c"
   puts(_("%s error:  %s option value %ld is out of range.\n"));
 #line 44 "../check.c"
   puts(_("%s error:  %s option requires the %s option\n"));
-#line 131 "../save.c"
-  puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 183 "../save.c"
+#line 121 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 237 "../save.c"
+#line 174 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 256 "../save.c"
+#line 193 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 534 "../save.c"
+#line 567 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   /* END-LIBOPTS-MESSAGES */
 
   /* USAGE-TEXT: */
-#line 873 "../usage.c"
+#line 822 "../usage.c"
   puts(_("\t\t\t\t- an alternate for '%s'\n"));
-#line 1148 "../usage.c"
+#line 1097 "../usage.c"
   puts(_("Version, usage and configuration options:"));
-#line 924 "../usage.c"
+#line 873 "../usage.c"
   puts(_("\t\t\t\t- default option for unnamed options\n"));
-#line 837 "../usage.c"
+#line 786 "../usage.c"
   puts(_("\t\t\t\t- disabled as '--%s'\n"));
-#line 1117 "../usage.c"
+#line 1066 "../usage.c"
   puts(_(" --- %-14s %s\n"));
-#line 1115 "../usage.c"
+#line 1064 "../usage.c"
   puts(_("This option has been disabled"));
-#line 864 "../usage.c"
+#line 813 "../usage.c"
   puts(_("\t\t\t\t- enabled by default\n"));
 #line 40 "../alias.c"
   puts(_("%s error:  only "));
-#line 1194 "../usage.c"
+#line 1143 "../usage.c"
   puts(_(" - examining environment variables named %s_*\n"));
 #line 168 "../file.c"
   puts(_("\t\t\t\t- file must not pre-exist\n"));
 #line 172 "../file.c"
   puts(_("\t\t\t\t- file must pre-exist\n"));
-#line 380 "../usage.c"
+#line 329 "../usage.c"
   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
        "hyphen and the flag character.\n"));
-#line 921 "../makeshell.c"
+#line 882 "../makeshell.c"
   puts(_("\n"
        "= = = = = = = =\n\n"
        "This incarnation of genshell will produce\n"
        "a shell script to parse the options for %s:\n\n"));
-#line 166 "../enum.c"
+#line 142 "../enum.c"
   puts(_("  or an integer mask with any of the lower %d bits set\n"));
-#line 897 "../usage.c"
+#line 846 "../usage.c"
   puts(_("\t\t\t\t- is a set membership option\n"));
-#line 918 "../usage.c"
+#line 867 "../usage.c"
   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
-#line 382 "../usage.c"
+#line 331 "../usage.c"
   puts(_("Options are specified by single or double hyphens and their name.\n"));
-#line 904 "../usage.c"
+#line 853 "../usage.c"
   puts(_("\t\t\t\t- may appear multiple times\n"));
-#line 891 "../usage.c"
+#line 840 "../usage.c"
   puts(_("\t\t\t\t- may not be preset\n"));
-#line 1309 "../usage.c"
+#line 1258 "../usage.c"
   puts(_("   Arg Option-Name    Description\n"));
-#line 1245 "../usage.c"
+#line 1194 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1303 "../usage.c"
+#line 1252 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1304 "../usage.c"
+#line 1253 "../usage.c"
   puts(_(" %3s %s"));
-#line 1310 "../usage.c"
+#line 1259 "../usage.c"
   puts(_(" %3s %s"));
-#line 387 "../usage.c"
+#line 336 "../usage.c"
   puts(_("The '-#<number>' option may omit the hash char\n"));
-#line 383 "../usage.c"
+#line 332 "../usage.c"
   puts(_("All arguments are named options.\n"));
-#line 971 "../usage.c"
+#line 920 "../usage.c"
   puts(_(" - reading file %s"));
-#line 409 "../usage.c"
+#line 358 "../usage.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
 #line 100 "../version.c"
@@ -787,17 +788,17 @@ by the newly generated text.  The first '#!' line will be regenerated.\n"));
 #line 129 "../version.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
-#line 903 "../usage.c"
+#line 852 "../usage.c"
   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
-#line 944 "../usage.c"
+#line 893 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 1192 "../usage.c"
+#line 1141 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 682 "../usage.c"
+#line 631 "../usage.c"
   puts(_("prohibits these options:\n"));
-#line 677 "../usage.c"
+#line 626 "../usage.c"
   puts(_("prohibits the option '%s'\n"));
 #line 81 "../numeric.c"
   puts(_("%s%ld to %ld"));
@@ -815,28 +816,28 @@ by the newly generated text.  The first '#!' line will be regenerated.\n"));
   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
 #line 77 "../numeric.c"
   puts(_("%sless than or equal to %ld"));
-#line 390 "../usage.c"
+#line 339 "../usage.c"
   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
-#line 652 "../usage.c"
+#line 601 "../usage.c"
   puts(_("requires the option '%s'\n"));
-#line 655 "../usage.c"
+#line 604 "../usage.c"
   puts(_("requires these options:\n"));
-#line 1321 "../usage.c"
+#line 1270 "../usage.c"
   puts(_("   Arg Option-Name   Req?  Description\n"));
-#line 1315 "../usage.c"
+#line 1264 "../usage.c"
   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
-#line 167 "../enum.c"
+#line 143 "../enum.c"
   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
        "will set them all.  Multiple entries may be passed as an option\n"
        "argument list.\n"));
-#line 910 "../usage.c"
+#line 859 "../usage.c"
   puts(_("\t\t\t\t- may appear up to %d times\n"));
-#line 77 "../enum.c"
+#line 52 "../enum.c"
   puts(_("The valid \"%s\" option keywords are:\n"));
-#line 1152 "../usage.c"
+#line 1101 "../usage.c"
   puts(_("The next option supports vendor supported extra options:"));
-#line 773 "../usage.c"
+#line 722 "../usage.c"
   puts(_("These additional options are:"));
   /* END-USAGE-TEXT */
 }
index 44825567bc7ff6bc108e31965dab68841c6ffcc6..994af16909273d6a1094ed611f2397779cfa440f 100644 (file)
@@ -6,7 +6,7 @@
  *  From the definitions    genshell.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:0:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This header file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -19,7 +19,7 @@
  * The genshellopt program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1999-2014 Bruce Korb, all rights reserved.
+ *  Copyright (C) 1999-2018 Bruce Korb, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the GNU Lesser General Public License,
  *  version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
@@ -47,6 +47,8 @@
 #ifndef AUTOOPTS_GENSHELL_H_GUARD
 #define AUTOOPTS_GENSHELL_H_GUARD 1
 #include <autoopts/options.h>
+#include <stdarg.h>
+#include <stdnoreturn.h>
 
 /**
  *  Ensure that the library used for compiling this generated header is at
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 167937
+#define AO_TEMPLATE_VERSION 172033
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
   Choke Me.
 #endif
 
+#if GCC_VERSION > 40400
+#define NOT_REACHED __builtin_unreachable();
+#else
+#define NOT_REACHED
+#endif
+
 /**
  *  Enumeration of each option type for genshellopt
  */
@@ -150,6 +158,12 @@ typedef enum {
 #ifdef  __cplusplus
 extern "C" {
 #endif
+/*
+ *  global exported definitions
+ */
+#define ch_t  unsigned char
+#define cc_t  const unsigned char
+#define cch_t char const
 
 
 /* * * * * *
@@ -201,6 +215,7 @@ static inline char* aoGetsText(char const* pz) {
 # endif
 #endif  /* ENABLE_NLS */
 
+
 #ifdef  __cplusplus
 }
 #endif
index 7d3ea3cbf16040c2cbdbea249fb616e4fe7b0be6..87ec81930d6cec1726229cca2200d66523475185 100644 (file)
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2015 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2018 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBGETTEXT_H
 #define _LIBGETTEXT_H 1
 
-/* NLS can be disabled through the configure --disable-nls option.  */
-#if ENABLE_NLS
+/* NLS can be disabled through the configure --disable-nls option
+   or through "#define ENABLE NLS 0" before including this file.  */
+#if defined ENABLE_NLS && ENABLE_NLS
 
 /* Get declarations of GNU message catalog functions.  */
 # include <libintl.h>
@@ -184,7 +185,8 @@ npgettext_aux (const char *domain,
 #include <string.h>
 
 #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
-     /* || __STDC_VERSION__ >= 199901L */ )
+     /* || __STDC_VERSION__ == 199901L
+        || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ )
 # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
 #else
 # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
@@ -225,15 +227,17 @@ dcpgettext_expr (const char *domain,
   if (msg_ctxt_id != NULL)
 #endif
     {
+      int found_translation;
       memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
       msg_ctxt_id[msgctxt_len - 1] = '\004';
       memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
       translation = dcgettext (domain, msg_ctxt_id, category);
+      found_translation = (translation != msg_ctxt_id);
 #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
       if (msg_ctxt_id != buf)
         free (msg_ctxt_id);
 #endif
-      if (translation != msg_ctxt_id)
+      if (found_translation)
         return translation;
     }
   return msgid;
@@ -271,15 +275,17 @@ dcnpgettext_expr (const char *domain,
   if (msg_ctxt_id != NULL)
 #endif
     {
+      int found_translation;
       memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
       msg_ctxt_id[msgctxt_len - 1] = '\004';
       memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
       translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+      found_translation = !(translation == msg_ctxt_id || translation == msgid_plural);
 #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
       if (msg_ctxt_id != buf)
         free (msg_ctxt_id);
 #endif
-      if (!(translation == msg_ctxt_id || translation == msgid_plural))
+      if (found_translation)
         return translation;
     }
   return (n == 1 ? msgid : msgid_plural);
index 81d4eee32d0c9ca981d7e8ae8c047ce173d63a02..b65e593914a882fc61cadd584765c634b132b602 100644 (file)
@@ -9,7 +9,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-/* = = = START-STATIC-FORWARD = = = */
-static tSuccess
-do_presets(tOptions * opts);
-/* = = = END-STATIC-FORWARD = = = */
-
 /**
  *  Make sure the option descriptor is there and that we understand it.
  *  This should be called from any user entry point where one needs to
@@ -46,7 +41,7 @@ do_presets(tOptions * opts);
  *  @param[in]     pname  name of program, from argv[]
  *  @returns SUCCESS or FAILURE
  */
-LOCAL tSuccess
+static tSuccess
 validate_struct(tOptions * opts, char const * pname)
 {
     if (opts == NULL) {
@@ -97,14 +92,15 @@ validate_struct(tOptions * opts, char const * pname)
      */
     if (opts->pzProgName == NULL) {
         char const *  pz = strrchr(pname, DIRCH);
-        char const ** pp = VOIDP(&(opts->pzProgName));
+        char const ** pp =
+            (char const **)(void **)&(opts->pzProgName);
 
         if (pz != NULL)
             *pp = pz+1;
         else
             *pp = pname;
 
-        pz = pathfind(getenv("PATH"), pname, "rx");
+        pz = pathfind(getenv("PATH"), (char *)pname, "rx");
         if (pz != NULL)
             pname = VOIDP(pz);
 
@@ -141,7 +137,7 @@ validate_struct(tOptions * opts, char const * pname)
  *  @param pOpts   program options descriptor
  *  @returns SUCCESS or FAILURE
  */
-LOCAL tSuccess
+static tSuccess
 immediate_opts(tOptions * opts)
 {
     tSuccess  res;
@@ -246,7 +242,7 @@ do_presets(tOptions * opts)
  * @param[in]     a_ct  program argument count
  * @param[in]     a_v   program argument vector
  */
-LOCAL bool
+static bool
 ao_initialize(tOptions * opts, int a_ct, char ** a_v)
 {
     if ((opts->fOptSet & OPTPROC_INITDONE) != 0)
index 2ae151b92953d8d65237393540c023258145cee6..af456ff589c577e3a554debda6b3fe103abfc3cd 100644 (file)
@@ -1,10 +1,10 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2005, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2001-2018 Free Software Foundation, Inc.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as published by
-   the Free Software Foundation; either version 2.1 of the License, or
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as published
+   by the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -13,7 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
 
 #include <limits.h>
 
-/* Return an integer value, converted to the same type as the integer
-   expression E after integer type promotion.  V is the unconverted value.  */
+/* Return a value with the common real type of E and V and the value of V.  */
 #define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
 
 /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
-   <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>.  */
+   <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>.  */
 #define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
 
 /* The extra casts in the following macros work around compiler bugs,
    an integer.  */
 #define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
 
-/* True if negative values of the signed integer type T use two's
-   complement, ones' complement, or signed magnitude representation,
-   respectively.  Much GNU code assumes two's complement, but some
-   people like to be portable to all possible C hosts.  */
-#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
-#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
-#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
-
-/* True if the signed integer expression E uses two's complement.  */
-#define _GL_INT_TWOS_COMPLEMENT(e) (~ _GL_INT_CONVERT (e, 0) == -1)
-
-/* True if the arithmetic type T is signed.  */
+/* True if the real type T is signed.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
 
-/* Return 1 if the integer expression E, after integer promotion, has
-   a signed type.  */
-#define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+/* Return 1 if the real expression E, after promotion, has a
+   signed or floating type.  */
+#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
 
 
-/* Minimum and maximum values for integer types and expressions.  These
-   macros have undefined behavior if T is signed and has padding bits.
-   If this is a problem for you, please let us know how to fix it for
-   your host.  */
+/* Minimum and maximum values for integer types and expressions.  */
+
+/* The width in bits of the integer type or expression T.
+   Padding bits are not supported; this is checked at compile-time below.  */
+#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
 
 /* The maximum and minimum values for the integer type T.  */
-#define TYPE_MINIMUM(t)                                                 \
-  ((t) (! TYPE_SIGNED (t)                                               \
-        ? (t) 0                                                         \
-        : TYPE_SIGNED_MAGNITUDE (t)                                     \
-        ? ~ (t) 0                                                       \
-        : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
 #define TYPE_MAXIMUM(t)                                                 \
   ((t) (! TYPE_SIGNED (t)                                               \
         ? (t) -1                                                        \
-        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+        : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
 
 /* The maximum and minimum values for the type of the expression E,
    after integer promotion.  E should not have side effects.  */
 #define _GL_INT_MINIMUM(e)                                              \
-  (_GL_INT_SIGNED (e)                                                   \
-   ? - _GL_INT_TWOS_COMPLEMENT (e) - _GL_SIGNED_INT_MAXIMUM (e)         \
+  (EXPR_SIGNED (e)                                                      \
+   ? ~ _GL_SIGNED_INT_MAXIMUM (e)                                       \
    : _GL_INT_CONVERT (e, 0))
 #define _GL_INT_MAXIMUM(e)                                              \
-  (_GL_INT_SIGNED (e)                                                   \
+  (EXPR_SIGNED (e)                                                      \
    ? _GL_SIGNED_INT_MAXIMUM (e)                                         \
    : _GL_INT_NEGATE_CONVERT (e, 1))
 #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
-  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
+  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
 
+/* Work around OpenVMS incompatibility with C99.  */
+#if !defined LLONG_MAX && defined __INT64_MAX
+# define LLONG_MAX __INT64_MAX
+# define LLONG_MIN __INT64_MIN
+#endif
+
+/* This include file assumes that signed types are two's complement without
+   padding bits; the above macros have undefined behavior otherwise.
+   If this is a problem for you, please let us know how to fix it for your host.
+   This assumption is tested by the intprops-tests module.  */
 
-/* Return 1 if the __typeof__ keyword works.  This could be done by
+/* Does the __typeof__ keyword work?  This could be done by
    'configure', but for now it's easier to do it by hand.  */
-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+#if (2 <= __GNUC__ \
+     || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
      || (0x5110 <= __SUNPRO_C && !__STDC__))
 # define _GL_HAVE___TYPEOF__ 1
 #else
    signed, this macro may overestimate the true bound by one byte when
    applied to unsigned types of size 2, 4, 16, ... bytes.  */
 #define INT_STRLEN_BOUND(t)                                     \
-  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
-                          - _GL_SIGNED_TYPE_OR_EXPR (t))        \
+  (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
    + _GL_SIGNED_TYPE_OR_EXPR (t))
 
 /* Bound on buffer size needed to represent an integer type or expression T,
 /* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
    See above for restrictions.  Avoid && and || as they tickle
    bugs in Sun C 5.11 2010/08/13 and other compilers; see
-   <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>.  */
+   <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00401.html>.  */
 #define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max)     \
   ((b) < 0                                              \
    ? ((a) < 0                                           \
    ? (a) < (min) >> (b)                                 \
    : (max) >> (b) < (a))
 
+/* True if __builtin_add_overflow (A, B, P) works when P is non-null.  */
+#if 5 <= __GNUC__ && !defined __ICC
+# define _GL_HAS_BUILTIN_OVERFLOW 1
+#else
+# define _GL_HAS_BUILTIN_OVERFLOW 0
+#endif
+
+/* True if __builtin_add_overflow_p (A, B, C) works.  */
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
 
 /* The _GL*_OVERFLOW macros have the same restrictions as the
    *_RANGE_OVERFLOW macros, except that they do not assume that operands
    (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
    that the result (e.g., A + B) has that type.  */
-#define _GL_ADD_OVERFLOW(a, b, min, max)                                \
-  ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
-   : (a) < 0 ? (b) <= (a) + (b)                                         \
-   : (b) < 0 ? (a) <= (a) + (b)                                         \
-   : (a) + (b) < (b))
-#define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
-  ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max)             \
-   : (a) < 0 ? 1                                                        \
-   : (b) < 0 ? (a) - (b) <= (a)                                         \
-   : (a) < (b))
-#define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
-  (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a))))       \
-   || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#if _GL_HAS_BUILTIN_OVERFLOW_P
+# define _GL_ADD_OVERFLOW(a, b, min, max)                               \
+   __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                          \
+   __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                          \
+   __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
+#else
+# define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+   ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
+    : (a) < 0 ? (b) <= (a) + (b)                                         \
+    : (b) < 0 ? (a) <= (a) + (b)                                         \
+    : (a) + (b) < (b))
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
+   ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max)             \
+    : (a) < 0 ? 1                                                        \
+    : (b) < 0 ? (a) - (b) <= (a)                                         \
+    : (a) < (b))
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
+   (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a))))       \
+    || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#endif
 #define _GL_DIVIDE_OVERFLOW(a, b, min, max)                             \
   ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max)  \
    : (a) < 0 ? (b) <= (a) + (b) - 1                                     \
     : (a) % - (b))                                                      \
    == 0)
 
-
-/* Integer overflow checks.
+/* Check for integer overflow, and report low order bits of answer.
 
    The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
    might not yield numerically correct answers due to arithmetic overflow.
-   They work correctly on all known practical hosts, and do not rely
+   The INT_<op>_WRAPV macros also store the low-order bits of the answer.
+   These macros work correctly on all known practical hosts, and do not rely
    on undefined behavior due to signed arithmetic overflow.
 
-   Example usage:
+   Example usage, assuming A and B are long int:
 
-     long int i = ...;
-     long int j = ...;
-     if (INT_MULTIPLY_OVERFLOW (i, j))
-       printf ("multiply would overflow");
+     if (INT_MULTIPLY_OVERFLOW (a, b))
+       printf ("result would overflow\n");
      else
-       printf ("product is %ld", i * j);
+       printf ("result is %ld (no overflow)\n", a * b);
+
+   Example usage with WRAPV flavor:
+
+     long int result;
+     bool overflow = INT_MULTIPLY_WRAPV (a, b, &result);
+     printf ("result is %ld (%s)\n", result,
+             overflow ? "after overflow" : "no overflow");
+
+   Restrictions on these macros:
 
    These macros do not check for all possible numerical problems or
    undefined or unspecified behavior: they do not check for division
    These macros may evaluate their arguments zero or multiple times, so the
    arguments should not have side effects.
 
+   The WRAPV macros are not constant expressions.  They support only
+   +, binary -, and *.  The result type must be signed.
+
    These macros are tuned for their last argument being a constant.
 
    Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
 #define INT_SUBTRACT_OVERFLOW(a, b) \
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
-#define INT_NEGATE_OVERFLOW(a) \
-  INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#if _GL_HAS_BUILTIN_OVERFLOW_P
+# define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
+#else
+# define INT_NEGATE_OVERFLOW(a) \
+   INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#endif
 #define INT_MULTIPLY_OVERFLOW(a, b) \
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
 #define INT_DIVIDE_OVERFLOW(a, b) \
                       _GL_INT_MINIMUM (0 * (b) + (a)),          \
                       _GL_INT_MAXIMUM (0 * (b) + (a)))
 
+/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
+   Return 1 if the result overflows.  See above for restrictions.  */
+#define INT_ADD_WRAPV(a, b, r) \
+  _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW)
+#define INT_SUBTRACT_WRAPV(a, b, r) \
+  _GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW)
+#define INT_MULTIPLY_WRAPV(a, b, r) \
+  _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
+
+/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
+   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+   https://llvm.org/bugs/show_bug.cgi?id=25390
+   For now, assume all versions of GCC-like compilers generate bogus
+   warnings for _Generic.  This matters only for older compilers that
+   lack __builtin_add_overflow.  */
+#if __GNUC__
+# define _GL__GENERIC_BOGUS 1
+#else
+# define _GL__GENERIC_BOGUS 0
+#endif
+
+/* Store the low-order bits of A <op> B into *R, where OP specifies
+   the operation.  BUILTIN is the builtin operation, and OVERFLOW the
+   overflow predicate.  Return 1 if the result overflows.  See above
+   for restrictions.  */
+#if _GL_HAS_BUILTIN_OVERFLOW
+# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
+#elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+   (_Generic \
+    (*(r), \
+     signed char: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                        signed char, SCHAR_MIN, SCHAR_MAX), \
+     short int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                        short int, SHRT_MIN, SHRT_MAX), \
+     int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                        int, INT_MIN, INT_MAX), \
+     long int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                        long int, LONG_MIN, LONG_MAX), \
+     long long int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+                        long long int, LLONG_MIN, LLONG_MAX)))
+#else
+# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+   (sizeof *(r) == sizeof (signed char) \
+    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                       signed char, SCHAR_MIN, SCHAR_MAX) \
+    : sizeof *(r) == sizeof (short int) \
+    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                       short int, SHRT_MIN, SHRT_MAX) \
+    : sizeof *(r) == sizeof (int) \
+    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                       int, INT_MIN, INT_MAX) \
+    : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
+# ifdef LLONG_MAX
+#  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+    (sizeof *(r) == sizeof (long int) \
+     ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                        long int, LONG_MIN, LONG_MAX) \
+     : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+                        long long int, LLONG_MIN, LLONG_MAX))
+# else
+#  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+    _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                     long int, LONG_MIN, LONG_MAX)
+# endif
+#endif
+
+/* Store the low-order bits of A <op> B into *R, where the operation
+   is given by OP.  Use the unsigned type UT for calculation to avoid
+   overflow problems.  *R's type is T, with extrema TMIN and TMAX.
+   T must be a signed integer type.  Return 1 if the result overflows.  */
+#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
+  (sizeof ((a) op (b)) < sizeof (t) \
+   ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \
+   : _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax))
+#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \
+  ((overflow (a, b) \
+    || (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \
+    || (tmax) < ((a) op (b))) \
+   ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \
+   : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0))
+
+/* Return the low-order bits of A <op> B, where the operation is given
+   by OP.  Use the unsigned type UT for calculation to avoid undefined
+   behavior on signed integer overflow, and convert the result to type T.
+   UT is at least as wide as T and is no narrower than unsigned int,
+   T is two's complement, and there is no padding or trap representations.
+   Assume that converting UT to T yields the low-order bits, as is
+   done in all known two's-complement C compilers.  E.g., see:
+   https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html
+
+   According to the C standard, converting UT to T yields an
+   implementation-defined result or signal for values outside T's
+   range.  However, code that works around this theoretical problem
+   runs afoul of a compiler bug in Oracle Studio 12.3 x86.  See:
+   https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html
+   As the compiler bug is real, don't try to work around the
+   theoretical problem.  */
+
+#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \
+  ((t) ((ut) (a) op (ut) (b)))
+
 #endif /* _GL_INTPROPS_H */
index 97bc359ed8c52925eed7b24fa94283a4e6aa2dc2..457edc433afcf794ed1447d18c4b487f3c1f33fa 100644 (file)
@@ -1,9 +1,9 @@
 #define  AUTOOPTS_INTERNAL 1
 #include "autoopts/project.h"
-#define  LOCAL static
+
 #include "ao-strs.h"
 static char const ao_ver_string[] =
-    "41:0:16\n";
+    "42:1:17\n";
 #include "autoopts/options.h"
 #include "autoopts/usage-txt.h"
 #include "genshell.h"
@@ -11,12 +11,14 @@ static char const ao_ver_string[] =
 #include "option-value-type.h"
 #include "ao-strs.h"
 #include "ag-char-map.h"
+#include "save-flags.h"
 #include "autoopts.h"
 #include "proto.h"
 #include "parse-duration.c"
 #include "ao-strs.c"
 #include "option-value-type.c"
 #include "option-xat-attribute.c"
+#include "save-flags.c"
 #include "autoopts.c"
 #include "alias.c"
 #include "boolean.c"
index ccda5b4e870dc358a187198582baa2ffaaa30d15..59d124ebd4ac6d08c4c552fb760cdf3ea8fd86b2 100644 (file)
@@ -12,7 +12,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-/* = = = START-STATIC-FORWARD = = = */
-static bool
-get_realpath(char * buf, size_t b_sz);
-
-static bool
-add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path);
-
-static bool
-add_env_val(char * buf, int buf_sz, char const * name);
-
-static char *
-assemble_arg_val(char * txt, tOptionLoadMode mode);
-
-static char *
-trim_quotes(char * arg);
-
-static bool
-direction_ok(opt_state_mask_t f, int dir);
-/* = = = END-STATIC-FORWARD = = = */
-
 static bool
 get_realpath(char * buf, size_t b_sz)
 {
@@ -207,6 +187,8 @@ add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path)
     char const *   path;
     char const *   pz;
     int     skip = 2;
+    size_t  fname_len;
+    size_t  dir_len;  //!< length of the directory portion of the path to the exe
 
     switch (fname[2]) {
     case DIRCH:
@@ -225,7 +207,7 @@ add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path)
     if (strchr(prg_path, DIRCH) != NULL)
         path = prg_path;
     else {
-        path = pathfind(getenv("PATH"), prg_path, "rx");
+        path = pathfind(getenv("PATH"), (char *)prg_path, "rx");
 
         if (path == NULL)
             return false;
@@ -240,17 +222,19 @@ add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path)
     if (pz == NULL)
         return false;
 
-    fname += skip;
+    fname    += skip;
+    fname_len = strlen(fname) + 1; // + NUL byte
+    dir_len   = (pz - path) + 1;   // + dir sep character
 
     /*
      *  Concatenate the file name to the end of the executable path.
      *  The result may be either a file or a directory.
      */
-    if ((unsigned)(pz - path) + 1 + strlen(fname) >= (unsigned)b_sz)
+    if (dir_len + fname_len > (unsigned)b_sz)
         return false;
 
-    memcpy(buf, path, (size_t)((pz - path)+1));
-    strcpy(buf + (pz - path) + 1, fname);
+    memcpy(buf, path, dir_len);
+    memcpy(buf + dir_len, fname, fname_len);
 
     /*
      *  If the "path" path was gotten from "pathfind()", then it was
@@ -289,10 +273,16 @@ add_env_val(char * buf, int buf_sz, char const * name)
     if (dir_part == NULL)
         return false;
 
-    if (strlen(dir_part) + 1 + strlen(name) >= (unsigned)buf_sz)
-        return false;
+    {
+        size_t dir_len = strlen(dir_part);
+        size_t nm_len  = strlen(name) + 1;
+        
+        if (dir_len + nm_len >= (unsigned)buf_sz)
+            return false;
+        memcpy(buf, dir_part, dir_len);
+        memcpy(buf + dir_len, name, nm_len);
+    }
 
-    sprintf(buf, "%s%s", dir_part, name);
     return true;
 }
 
@@ -304,10 +294,10 @@ add_env_val(char * buf, int buf_sz, char const * name)
  * @param[in,out] txt  the input and output string
  * @param[in]     mode the handling mode (cooking method)
  */
-LOCAL void
+static void
 munge_str(char * txt, tOptionLoadMode mode)
 {
-    char * pzE;
+    char * end;
 
     if (mode == OPTION_LOAD_KEEP)
         return;
@@ -316,13 +306,13 @@ munge_str(char * txt, tOptionLoadMode mode)
         char * src = SPN_WHITESPACE_CHARS(txt+1);
         size_t l   = strlen(src) + 1;
         memmove(txt, src, l);
-        pzE = txt + l - 1;
+        end = txt + l - 1;
 
     } else
-        pzE = txt + strlen(txt);
+        end = txt + strlen(txt);
 
-    pzE  = SPN_WHITESPACE_BACK(txt, pzE);
-    *pzE = NUL;
+    end  = SPN_WHITESPACE_BACK(txt, end);
+    *end = NUL;
 
     if (mode == OPTION_LOAD_UNCOOKED)
         return;
@@ -333,7 +323,7 @@ munge_str(char * txt, tOptionLoadMode mode)
     case '\'': break;
     }
 
-    switch (pzE[-1]) {
+    switch (end[-1]) {
     default: return;
     case '"':
     case '\'': break;
@@ -435,7 +425,7 @@ direction_ok(opt_state_mask_t f, int dir)
         if (PRESETTING(dir)) {
             /*
              *  We are in the presetting direction with an option we handle
-             *  immediately for disablement, but normally for disablement.
+             *  immediately for disablement, but normally for handling.
              *  Therefore, skip if NOT disabled.
              */
             if ((f & OPTST_DISABLED) != 0)
@@ -443,7 +433,7 @@ direction_ok(opt_state_mask_t f, int dir)
         } else {
             /*
              *  We are in the processing direction with an option we handle
-             *  immediately for disablement, but normally for disablement.
+             *  immediately for disablement, but normally for handling.
              *  Therefore, skip if disabled.
              */
             if ((f & OPTST_DISABLED) == 0)
@@ -476,7 +466,7 @@ direction_ok(opt_state_mask_t f, int dir)
  * @param[in]     direction  current processing direction (preset or not)
  * @param[in]     load_mode  option loading mode (OPTION_LOAD_*)
  */
-LOCAL void
+static void
 load_opt_line(tOptions * opts, tOptState * opt_state, char * line,
               tDirection direction, tOptionLoadMode load_mode )
 {
index f8b2c38e16d8241c97392c2443feb899d316edb1..23738cab47feb0c8a61650b3415f07aace3d9a37 100644 (file)
@@ -1,11 +1,4 @@
-dnl  -*- buffer-read-only: t -*- vi: set ro:
-dnl
-dnl DO NOT EDIT THIS FILE   (libopts.m4)
-dnl
-dnl It has been AutoGen-ed
-dnl From the definitions    libopts.def
-dnl and the template file   conftest.tpl
-dnl
+
 dnl do always before generated macros:
 dnl
 AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
@@ -114,6 +107,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
   AC_PROG_SED
   [while :
   do
+      test -x "$POSIX_SHELL" && break
       POSIX_SHELL=`which bash`
       test -x "$POSIX_SHELL" && break
       POSIX_SHELL=`which dash`
@@ -235,9 +229,9 @@ int main() {
     fputs( "error: regex -->.<-- did not match\n", stderr );
     return 1;
   }
-  return 0; }])],
+  return 0; }] )],
     [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no],
-    [libopts_cv_with_libregex=no]) # end of AC_RUN_IFELSE 
+    [libopts_cv_with_libregex=no]) # end of AC_RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex
   fi ## disabled by request
   AC_MSG_RESULT([${libopts_cv_with_libregex}])
@@ -265,7 +259,7 @@ AC_DEFUN([LIBOPTS_RUN_PATHFIND],[
 int main (int argc, char ** argv) {
    char * pz = pathfind( getenv( "PATH" ), "sh", "x" );
    return (pz == 0) ? 1 : 0;
-}])],
+}] )],
     [libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind
@@ -313,7 +307,7 @@ choke me!!
 @%:@endif
    char *pz = realpath(argv@<:@0@:>@, zPath);
    return (pz == zPath) ? 0 : 1;
-}])],
+}] )],
     [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath
@@ -346,7 +340,7 @@ int main() {
   tm.tm_yday  = 239; /* days since January 1 @<:@0, 365@:>@ */
   tm.tm_isdst =  1;  /* flag for daylight savings time */
   strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
-  return (strcmp( t_buf, z ) != 0); }])],
+  return (strcmp( t_buf, z ) != 0); }] )],
     [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime
@@ -366,7 +360,7 @@ AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[
   AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
 int main (int argc, char ** argv) {
 FILE * fp = fopen("conftest.@S|@ac_ext", "rb");
-return (fp == NULL) ? 1 : fclose(fp); }])],
+return (fp == NULL) ? 1 : fclose(fp); }] )],
     [libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary
@@ -389,7 +383,7 @@ AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[
   AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
 int main (int argc, char ** argv) {
 FILE * fp = fopen("conftest.@S|@ac_ext", "rt");
-return (fp == NULL) ? 1 : fclose(fp); }])],
+return (fp == NULL) ? 1 : fclose(fp); }] )],
     [libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text
@@ -461,7 +455,7 @@ dnl the config tests that the library needs.  Invoke the
 dnl "INVOKE_LIBOPTS_MACROS" macro iff we are building libopts.
 dnl
 dnl  This file is part of AutoGen.
-dnl  AutoGen Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+dnl  AutoGen Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
 dnl
 dnl  AutoGen is free software: you can redistribute it and/or modify it
 dnl  under the terms of the GNU General Public License as published by the
index 34d5658c2ff1a0dcc3aba7eea1fca04067c9d62d..9d107d696212354486b184ef83bfc6905fa9269a 100644 (file)
@@ -1,5 +1,5 @@
 # liboptschk.m4 serial 2 (autogen - 5.11.4)
-dnl Copyright (C) 2005-2015 by Bruce Korb - all rights reserved
+dnl Copyright (C) 2005-2018 by Bruce Korb - all rights reserved
 dnl
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 003941164f112b3fc21246d2b2bd97527e08def6..a7ce376428eb6b4fbbf536ce91ad5966bc85d2de 100644 (file)
@@ -1,6 +1,6 @@
 # Check for stdnoreturn.h that conforms to C11.
 
-dnl Copyright 2012-2015 Free Software Foundation, Inc.
+dnl Copyright 2012-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,33 +9,43 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_STDNORETURN_H],
 [
-  AC_CACHE_CHECK([for working stdnoreturn.h],
-    [gl_cv_header_working_stdnoreturn_h],
-    [AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-          [[#include <stdlib.h>
-            #include <stdnoreturn.h>
-            /* Do not check for 'noreturn' after the return type.
-               C11 allows it, but it's rarely done that way
-               and circa-2012 bleeding-edge GCC rejects it when given
-               -Werror=old-style-declaration.  */
-            noreturn void foo1 (void) { exit (0); }
-            _Noreturn void foo2 (void) { exit (0); }
-            int testit (int argc, char **argv) {
-              if (argc & 1)
-                return 0;
-              (argv[0][0] ? foo1 : foo2) ();
-            }
-          ]])],
-       [gl_cv_header_working_stdnoreturn_h=yes],
-       [gl_cv_header_working_stdnoreturn_h=no])])
-
-  if test $gl_cv_header_working_stdnoreturn_h = yes; then
-    STDNORETURN_H=''
-  else
-    STDNORETURN_H='stdnoreturn.h'
-  fi
-
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    cygwin*)
+      dnl Regardless whether a working <stdnoreturn.h> exists or not,
+      dnl we need our own <stdnoreturn.h>, because of the definition
+      dnl of _Noreturn done by gnulib-common.m4.
+      STDNORETURN_H='stdnoreturn.h'
+      ;;
+    *)
+      AC_CACHE_CHECK([for working stdnoreturn.h],
+        [gl_cv_header_working_stdnoreturn_h],
+        [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <stdlib.h>
+                #include <stdnoreturn.h>
+                /* Do not check for 'noreturn' after the return type.
+                   C11 allows it, but it's rarely done that way
+                   and circa-2012 bleeding-edge GCC rejects it when given
+                   -Werror=old-style-declaration.  */
+                noreturn void foo1 (void) { exit (0); }
+                _Noreturn void foo2 (void) { exit (0); }
+                int testit (int argc, char **argv)
+                {
+                  if (argc & 1)
+                    return 0;
+                  (argv[0][0] ? foo1 : foo2) ();
+                }
+              ]])],
+           [gl_cv_header_working_stdnoreturn_h=yes],
+           [gl_cv_header_working_stdnoreturn_h=no])])
+      if test $gl_cv_header_working_stdnoreturn_h = yes; then
+        STDNORETURN_H=''
+      else
+        STDNORETURN_H='stdnoreturn.h'
+      fi
+      ;;
+  esac
   AC_SUBST([STDNORETURN_H])
   AM_CONDITIONAL([GL_GENERATE_STDNORETURN_H], [test -n "$STDNORETURN_H"])
 ])
index fbe8e171de0d322916c4d2f20f178e2b2a05297d..10ed12005aa7c6e6a4e96dcbd0ed3626dd418e7b 100644 (file)
@@ -11,7 +11,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
 #define UPPER(_c) (toupper(to_uchar(_c)))
 #define LOWER(_c) (tolower(to_uchar(_c)))
 
-/* = = = START-STATIC-FORWARD = = = */
-static void
-emit_var_text(char const * prog, char const * var, int fdin);
-
-static void
-text_to_var(tOptions * opts, teTextTo which, tOptDesc * od);
-
-static void
-emit_usage(tOptions * opts);
-
-static void
-emit_wrapup(tOptions * opts);
-
-static void
-emit_setup(tOptions * opts);
-
-static void
-emit_action(tOptions * opts, tOptDesc * od);
-
-static void
-emit_inaction(tOptions * opts, tOptDesc * od);
-
-static void
-emit_flag(tOptions * opts);
-
-static void
-emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts);
-
-static void
-emit_long(tOptions * opts);
-
-static char *
-load_old_output(char const * fname, char const * pname);
-
-static void
-open_out(char const * fname, char const * pname);
-/* = = = END-STATIC-FORWARD = = = */
-
-LOCAL noreturn void
+noreturn static void
 option_exits(int exit_code)
 {
     if (print_exit)
@@ -81,21 +43,21 @@ option_exits(int exit_code)
     exit(exit_code);
 }
 
-LOCAL noreturn void
+noreturn static void
 ao_bug(char const * msg)
 {
     fprintf(stderr, zao_bug_msg, msg);
     option_exits(EX_SOFTWARE);
 }
 
-LOCAL void
+static void
 fserr_warn(char const * prog, char const * op, char const * fname)
 {
     fprintf(stderr, zfserr_fmt, prog, errno, strerror(errno),
             op, fname);
 }
 
-LOCAL noreturn void
+noreturn static void
 fserr_exit(char const * prog, char const * op, char const * fname)
 {
     fserr_warn(prog, op, fname);
@@ -322,11 +284,11 @@ text_to_var(tOptions * opts, teTextTo which, tOptDesc * od)
         switch (which) {
         case TT_LONGUSAGE:
             (*(opts->pUsageProc))(opts, EXIT_SUCCESS);
-            /* NOTREACHED */
+            /* FALLTHROUGH */ /* NOTREACHED */
 
         case TT_USAGE:
             (*(opts->pUsageProc))(opts, EXIT_FAILURE);
-            /* NOTREACHED */
+            /* FALLTHROUGH */ /* NOTREACHED */
 
         case TT_VERSION:
             if (od->fOptState & OPTST_ALLOC_ARG) {
@@ -335,13 +297,13 @@ text_to_var(tOptions * opts, teTextTo which, tOptDesc * od)
             }
             od->optArg.argString = "c";
             optionPrintVersion(opts, od);
-            /* NOTREACHED */
+            /* FALLTHROUGH */ /* NOTREACHED */
 
         default:
             option_exits(EXIT_FAILURE);
-            /* NOTREACHED */
+            /* FALLTHROUGH */ /* NOTREACHED */
         }
-        /* NOTREACHED */
+        /* FALLTHROUGH */ /* NOTREACHED */
 
     default:
         close(fdpair[1]);
@@ -401,7 +363,7 @@ emit_usage(tOptions * opts)
 
         /* Copy the program name into the time/name buffer */
         for (;;) {
-            if ((*pzPN++ = (char)tolower((unsigned char)*pz++)) == NUL)
+            if ((*pzPN++ = (char)tolower(*pz++)) == NUL)
                 break;
         }
 
@@ -671,8 +633,8 @@ emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts)
                 continue;
 
             match_ct = 0;
-            while (  toupper((unsigned char)od->pz_DisableName[match_ct])
-                  == toupper((unsigned char)name[match_ct]))
+            while (  toupper(od->pz_DisableName[match_ct])
+                  == toupper(name[match_ct]))
                 match_ct++;
             if (match_ct > min_match_ct)
                 min_match_ct = match_ct;
@@ -885,13 +847,12 @@ genshelloptUsage(tOptions * opts, int exit_cd)
     switch (fork()) {
     case -1:
         optionUsage(opts, EXIT_FAILURE);
-        /* NOTREACHED */
+        /* FALLTHROUGH */ /* NOTREACHED */
 
     case 0:
         pagerState = PAGER_STATE_CHILD;
         optionUsage(opts, EXIT_SUCCESS);
-        /* NOTREACHED */
-        _exit(EXIT_FAILURE);
+        /* FALLTHROUGH */ /* NOTREACHED */
 
     default:
     {
@@ -930,6 +891,7 @@ genshelloptUsage(tOptions * opts, int exit_cd)
         /*FALLTHROUGH*/
     case -1:
         optionUsage(optionParseShellOptions, EXIT_FAILURE);
+        /* FALLTHROUGH */ /* NOTREACHED */
 
     default:
     {
index aaf089f543d889e1a02c9158cf69bd3becb003a4..e7604506781bb342e42ccd973cf69963d546b57f 100644 (file)
@@ -12,7 +12,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -37,7 +37,7 @@ typedef struct {
     char    xml_txt[8];
 } xml_xlate_t;
 
-static xml_xlate_t const xml_xlate[] = {
+  static xml_xlate_t const xml_xlate[] = {
     { '&', 4, "amp;"  },
     { '<', 3, "lt;"   },
     { '>', 3, "gt;"   },
@@ -49,48 +49,6 @@ static xml_xlate_t const xml_xlate[] = {
 #define ENOMSG ENOENT
 #endif
 
-/* = = = START-STATIC-FORWARD = = = */
-static void
-remove_continuation(char * src);
-
-static char const *
-scan_q_str(char const * pzTxt);
-
-static tOptionValue *
-add_string(void ** pp, char const * name, size_t nm_len,
-           char const * val, size_t d_len);
-
-static tOptionValue *
-add_bool(void ** pp, char const * name, size_t nm_len,
-         char const * val, size_t d_len);
-
-static tOptionValue *
-add_number(void ** pp, char const * name, size_t nm_len,
-           char const * val, size_t d_len);
-
-static tOptionValue *
-add_nested(void ** pp, char const * name, size_t nm_len,
-           char * val, size_t d_len);
-
-static char const *
-scan_name(char const * name, tOptionValue * res);
-
-static char const *
-unnamed_xml(char const * txt);
-
-static char const *
-scan_xml_name(char const * name, size_t * nm_len, tOptionValue * val);
-
-static char const *
-find_end_xml(char const * src, size_t nm_len, char const * val, size_t * len);
-
-static char const *
-scan_xml(char const * xml_name, tOptionValue * res_val);
-
-static void
-sort_list(tArgList * arg_list);
-/* = = = END-STATIC-FORWARD = = = */
-
 /**
  *  Backslashes are used for line continuations.  We keep the newline
  *  characters, but trim out the backslash:
@@ -638,7 +596,7 @@ bail_scan_xml:
  *  an internal call, so it is not validated.  The caller is responsible for
  *  knowing what they are doing.
  */
-LOCAL void
+static void
 unload_arg_list(tArgList * arg_list)
 {
     int ct = arg_list->useCt;
@@ -743,7 +701,7 @@ sort_list(tArgList * arg_list)
  *  @code{ENOMSG} no configuration values were found
  *  @end itemize
 =*/
-LOCAL tOptionValue *
+static tOptionValue *
 optionLoadNested(char const * text, char const * name, size_t nm_len)
 {
     tOptionValue * res_val;
@@ -783,12 +741,23 @@ optionLoadNested(char const * text, char const * name, size_t nm_len)
             text = scan_name(text, res_val);
 
         else switch (*text) {
-        case NUL: goto scan_done;
-        case '<': text = scan_xml(text, res_val);
-                  if (text == NULL) goto woops;
-                  if (*text == ',') text++; break;
-        case '#': text = strchr(text, NL);  break;
-        default:  goto woops;
+        case NUL:
+            goto scan_done;
+
+        case '<':
+            text = scan_xml(text, res_val);
+            if (text == NULL)
+                goto woops;
+            if (*text == ',')
+                text++;
+            break;
+
+        case '#':
+            text = strchr(text, NL);
+            break;
+
+        default:
+            goto woops;
         }
     } while (text != NULL); scan_done:;
 
@@ -855,11 +824,10 @@ optionNestedVal(tOptions * opts, tOptDesc * od)
 /**
  * get_special_char
  */
-LOCAL int
+static int
 get_special_char(char const ** ppz, int * ct)
 {
     char const * pz = *ppz;
-    char *       rz;
 
     if (*ct < 3)
         return '&';
@@ -873,8 +841,7 @@ get_special_char(char const ** ppz, int * ct)
             base = 16;
             pz++;
         }
-        retch = (int)strtoul(pz, &rz, base);
-        pz = rz;
+        retch = (int)strtoul(pz, (char **)&pz, base);
         if (*pz != ';')
             return '&';
         base = (int)(++pz - *ppz);
@@ -909,7 +876,7 @@ get_special_char(char const ** ppz, int * ct)
 /**
  * emit_special_char
  */
-LOCAL void
+static void
 emit_special_char(FILE * fp, int ch)
 {
     int ctr = sizeof(xml_xlate) / sizeof(xml_xlate[0]);
index ab8f3d1958be14c49ed7588929f4ebb466441346..bbb43ccdcd1e4a2b88cb39d1cd57d67027bc19f1 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -124,7 +124,8 @@ optionNumericVal(tOptions * opts, tOptDesc * od)
      */
     if (  (od == NULL)
        || (od->optArg.argString == NULL)
-       || ((od->fOptState & OPTST_RESET) != 0))
+       || ((od->fOptState & OPTST_RESET) != 0)
+       || (opts <= OPTPROC_EMIT_LIMIT))
         return;
 
     errno = 0;
@@ -135,14 +136,14 @@ optionNumericVal(tOptions * opts, tOptDesc * od)
     if ((od->fOptState & OPTST_SCALED_NUM) != 0)
         switch (*(pz++)) {
         case NUL:  pz--; break;
-        case 't':  val *= 1000;
-        case 'g':  val *= 1000;
-        case 'm':  val *= 1000;
+        case 't':  val *= 1000; /* FALLTHROUGH */
+        case 'g':  val *= 1000; /* FALLTHROUGH */
+        case 'm':  val *= 1000; /* FALLTHROUGH */
         case 'k':  val *= 1000; break;
 
-        case 'T':  val *= 1024;
-        case 'G':  val *= 1024;
-        case 'M':  val *= 1024;
+        case 'T':  val *= 1024; /* FALLTHROUGH */
+        case 'G':  val *= 1024; /* FALLTHROUGH */
+        case 'M':  val *= 1024; /* FALLTHROUGH */
         case 'K':  val *= 1024; break;
 
         default:   goto bad_number;
index 5f676408ae0094a18887716e01370cd96b50200e..2bc8642809c9be833e950ed2f190567fdfb15e60 100644 (file)
@@ -31,7 +31,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "option-value-type.h"
-/* ANSI-C code produced by gperf version 3.0.4 */
+/* ANSI-C code produced by gperf version 3.1 */
 /* Command-line: gperf option-value-type.gp  */
 /* Computed positions: -k'1' */
 
@@ -64,7 +64,7 @@ typedef struct {
 /* maximum key range = 15, duplicates = 0 */
 
 static unsigned int
-option_value_type_hash (register const char *str, register unsigned int len)
+option_value_type_hash (register const char *str, register size_t len)
 {
   static const unsigned char asso_values[] =
     {
@@ -119,13 +119,13 @@ static const option_value_type_map_t option_value_type_table[] =
   };
 
 static inline const option_value_type_map_t *
-find_option_value_type_name (register const char *str, register unsigned int len)
+find_option_value_type_name (register const char *str, register size_t len)
 {
   if (len <= 14 && len >= 3)
     {
-      register int key = (int)option_value_type_hash (str, len);
+      register unsigned int key = (int)option_value_type_hash (str, len);
 
-      if (key <= 17 && key >= 0)
+      if (key <= 17)
         {
           register const char *s = option_value_type_table[key].vtp_name;
 
index be86041fd8163a33dc4cdc685e56e38a882fa905..a34ab1b5b2c0dafd206bc4f53dfdd75d937013a5 100644 (file)
@@ -31,7 +31,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "option-xat-attribute.h"
-/* ANSI-C code produced by gperf version 3.0.4 */
+/* ANSI-C code produced by gperf version 3.1 */
 /* Command-line: gperf option-xat-attribute.gp  */
 /* Computed positions: -k'1' */
 
@@ -64,7 +64,7 @@ typedef struct {
 /* maximum key range = 6, duplicates = 0 */
 
 static unsigned int
-option_xat_attribute_hash (register const char *str, register unsigned int len)
+option_xat_attribute_hash (register const char *str, register size_t len)
 {
   static const unsigned char asso_values[] =
     {
@@ -111,13 +111,13 @@ static const option_xat_attribute_map_t option_xat_attribute_table[] =
   };
 
 static inline const option_xat_attribute_map_t *
-find_option_xat_attribute_name (register const char *str, register unsigned int len)
+find_option_xat_attribute_name (register const char *str, register size_t len)
 {
   if (len <= 8 && len >= 4)
     {
-      register int key = (int)option_xat_attribute_hash (str, len);
+      register unsigned int key = (int)option_xat_attribute_hash (str, len);
 
-      if (key <= 9 && key >= 0)
+      if (key <= 9)
         {
           register const char *s = option_xat_attribute_table[key].xat_name;
 
index 11e3d828d8975ef9da1ee9e3d05fc5a70cf7aee2..0f4a05634b9b681b63f8eb919e922505aebf172c 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse a time duration and return a seconds count
-   Copyright (C) 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2008-2018 Free Software Foundation, Inc.
    Written by Bruce Korb <bkorb@gnu.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -60,20 +60,14 @@ typedef enum {
 static unsigned long
 str_const_to_ul (cch_t * str, cch_t ** ppz, int base)
 {
-  char * pz;
-  int rv = strtoul (str, &pz, base);
-  *ppz = pz;
-  return rv;
+  return strtoul (str, (char **)ppz, base);
 }
 
 /* Wrapper around strtol that does not require a cast.  */
 static long
 str_const_to_l (cch_t * str, cch_t ** ppz, int base)
 {
-  char * pz;
-  int rv = strtol (str, &pz, base);
-  *ppz = pz;
-  return rv;
+  return strtol (str, (char **)ppz, base);
 }
 
 /* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME
index 33ddc3366e9ffb975c85e128268ef8d53deffe90..9a7bcd5e100f017e6cdec8ed15bd048857dbc500 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse a time duration and return a seconds count
-   Copyright (C) 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2008-2018 Free Software Foundation, Inc.
    Written by Bruce Korb <bkorb@gnu.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /*
 
@@ -22,7 +22,7 @@
 
   At the time of writing, this worked:
 
-  http://en.wikipedia.org/wiki/ISO_8601#Durations
+  https://en.wikipedia.org/wiki/ISO_8601#Durations
 
   The string must start with a 'P', 'T' or a digit.
 
index 3d229c18d0584112b462b4f20502c1b1cd2c3c4b..f895b3bb56d0b76e7d7d005af72edb14d47c98bd 100644 (file)
@@ -13,7 +13,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
index a78b794fc6a5389fa1091382eda84540add754b1..437e81ed9b0a4a2ab23f4ecc32a371128b350478 100644 (file)
@@ -1,19 +1,20 @@
 /* -*- buffer-read-only: t -*- vi: set ro:
  *
  * Prototypes for autoopts
- * Generated Sat Apr 25 09:53:18 PDT 2015
+ * Generated Sun Aug 26 10:44:39 PDT 2018
  */
 #ifndef AUTOOPTS_PROTO_H_GUARD
 #define AUTOOPTS_PROTO_H_GUARD 1
 
+
 /*
- *  Extracted from alias.c
+ * Static declarations from alias.c
  */
 static tSuccess
 too_many_occurrences(tOptions * opts, tOptDesc * od);
 
 /*
- *  Extracted from autoopts.c
+ * Static declarations from autoopts.c
  */
 static void *
 ao_malloc(size_t sz);
@@ -34,14 +35,53 @@ static tSuccess
 regular_opts(tOptions * opts);
 
 /*
- *  Extracted from check.c
+ * Static declarations from check.c
  */
+static bool
+has_conflict(tOptions * pOpts, tOptDesc * od);
+
+static bool
+occurs_enough(tOptions * pOpts, tOptDesc * pOD);
+
 static bool
 is_consistent(tOptions * pOpts);
 
 /*
- *  Extracted from configfile.c
+ * Static declarations from configfile.c
  */
+static void
+file_preset(tOptions * opts, char const * fname, int dir);
+
+static char *
+handle_comment(char * txt);
+
+static char *
+handle_cfg(tOptions * opts, tOptState * ost, char * txt, int dir);
+
+static char *
+handle_directive(tOptions * opts, char * txt);
+
+static char *
+aoflags_directive(tOptions * opts, char * txt);
+
+static char *
+program_directive(tOptions * opts, char * txt);
+
+static char *
+handle_section(tOptions * opts, char * txt);
+
+static int
+parse_xml_encoding(char ** ppz);
+
+static char *
+trim_xml_text(char * intxt, char const * pznm, tOptionLoadMode mode);
+
+static void
+cook_xml_text(char * pzData);
+
+static char *
+handle_struct(tOptions * opts, tOptState * ost, char * txt, int dir);
+
 static void
 intern_file_load(tOptions * opts);
 
@@ -49,24 +89,112 @@ static char const *
 parse_attrs(tOptions * opts, char const * txt, tOptionLoadMode * pMode,
             tOptionValue * pType);
 
+static char const *
+parse_keyword(tOptions * opts, char const * txt, tOptionValue * typ);
+
+static char const *
+parse_set_mem(tOptions * opts, char const * txt, tOptionValue * typ);
+
+static char const *
+parse_value(char const * txt, tOptionValue * typ);
+
+/*
+ * Static declarations from cook.c
+ */
+static char *
+nl_count(char * start, char * end, int * lnct_p);
+
+static bool
+contiguous_quote(char ** pps, char * pq, int * lnct_p);
+
+/*
+ * Static declarations from enum.c
+ */
+static void
+enum_err(tOptions * pOpts, tOptDesc * pOD,
+         char const * const * paz_names, int name_ct);
+
+static uintptr_t
+find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
+          char const * const *  paz_names, unsigned int name_ct);
+
+static void
+set_memb_shell(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names,
+               unsigned int name_ct);
+
+static void
+set_memb_names(tOptions * opts, tOptDesc * od, char const * const * nm_list,
+               unsigned int nm_ct);
+
+static uintptr_t
+check_membership_start(tOptDesc * od, char const ** argp, bool * invert);
+
+static uintptr_t
+find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len,
+                char const * const * nm_list, unsigned int nm_ct);
+
 /*
- *  Extracted from env.c
+ * Static declarations from env.c
  */
 static void
 doPrognameEnv(tOptions * pOpts, teEnvPresetType type);
 
+static void
+do_env_opt(tOptState * os, char * env_name,
+            tOptions * pOpts, teEnvPresetType type);
+
 static void
 env_presets(tOptions * pOpts, teEnvPresetType type);
 
 /*
- *  Extracted from find.c
+ * Static declarations from file.c
  */
+static void
+check_existence(teOptFileType ftype, tOptions * pOpts, tOptDesc * pOD);
+
+static void
+open_file_fd(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode);
+
+static void
+fopen_file_fp(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode);
+
+/*
+ * Static declarations from find.c
+ */
+static int
+parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz);
+
+static void
+opt_ambiguities(tOptions * opts, char const * name, int nm_len);
+
+static int
+opt_match_ct(tOptions * opts, char const * name, int nm_len,
+             int * ixp, bool * disable);
+
+static tSuccess
+opt_set(tOptions * opts, char * arg, int idx, bool disable, tOptState * st);
+
+static tSuccess
+opt_unknown(tOptions * opts, char const * name, char * arg, tOptState * st);
+
+static tSuccess
+opt_ambiguous(tOptions * opts, char const * name, int match_ct);
+
 static tSuccess
 opt_find_long(tOptions * opts, char const * opt_name, tOptState * state);
 
 static tSuccess
 opt_find_short(tOptions * pOpts, uint_t optValue, tOptState * pOptState);
 
+static tSuccess
+get_opt_arg_must(tOptions * opts, tOptState * o_st);
+
+static tSuccess
+get_opt_arg_may(tOptions * pOpts, tOptState * o_st);
+
+static tSuccess
+get_opt_arg_none(tOptions * pOpts, tOptState * o_st);
+
 static tSuccess
 get_opt_arg(tOptions * opts, tOptState * o_st);
 
@@ -74,7 +202,7 @@ static tSuccess
 find_opt(tOptions * opts, tOptState * o_st);
 
 /*
- *  Extracted from init.c
+ * Static declarations from init.c
  */
 static tSuccess
 validate_struct(tOptions * opts, char const * pname);
@@ -82,40 +210,137 @@ validate_struct(tOptions * opts, char const * pname);
 static tSuccess
 immediate_opts(tOptions * opts);
 
+static tSuccess
+do_presets(tOptions * opts);
+
 static bool
 ao_initialize(tOptions * opts, int a_ct, char ** a_v);
 
 /*
- *  Extracted from load.c
+ * Static declarations from load.c
  */
+static bool
+get_realpath(char * buf, size_t b_sz);
+
+static bool
+add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path);
+
+static bool
+add_env_val(char * buf, int buf_sz, char const * name);
+
 static void
 munge_str(char * txt, tOptionLoadMode mode);
 
+static char *
+assemble_arg_val(char * txt, tOptionLoadMode mode);
+
+static char *
+trim_quotes(char * arg);
+
+static bool
+direction_ok(opt_state_mask_t f, int dir);
+
 static void
 load_opt_line(tOptions * opts, tOptState * opt_state, char * line,
               tDirection direction, tOptionLoadMode load_mode );
 
 /*
- *  Extracted from makeshell.c
+ * Static declarations from makeshell.c
  */
-static noreturn void
+noreturn static void
 option_exits(int exit_code);
 
-static noreturn void
+noreturn static void
 ao_bug(char const * msg);
 
 static void
 fserr_warn(char const * prog, char const * op, char const * fname);
 
-static noreturn void
+noreturn static void
 fserr_exit(char const * prog, char const * op, char const * fname);
 
+static void
+emit_var_text(char const * prog, char const * var, int fdin);
+
+static void
+text_to_var(tOptions * opts, teTextTo which, tOptDesc * od);
+
+static void
+emit_usage(tOptions * opts);
+
+static void
+emit_wrapup(tOptions * opts);
+
+static void
+emit_setup(tOptions * opts);
+
+static void
+emit_action(tOptions * opts, tOptDesc * od);
+
+static void
+emit_inaction(tOptions * opts, tOptDesc * od);
+
+static void
+emit_flag(tOptions * opts);
+
+static void
+emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts);
+
+static void
+emit_long(tOptions * opts);
+
+static char *
+load_old_output(char const * fname, char const * pname);
+
+static void
+open_out(char const * fname, char const * pname);
+
 /*
- *  Extracted from nested.c
+ * Static declarations from nested.c
  */
+static void
+remove_continuation(char * src);
+
+static char const *
+scan_q_str(char const * pzTxt);
+
+static tOptionValue *
+add_string(void ** pp, char const * name, size_t nm_len,
+           char const * val, size_t d_len);
+
+static tOptionValue *
+add_bool(void ** pp, char const * name, size_t nm_len,
+         char const * val, size_t d_len);
+
+static tOptionValue *
+add_number(void ** pp, char const * name, size_t nm_len,
+           char const * val, size_t d_len);
+
+static tOptionValue *
+add_nested(void ** pp, char const * name, size_t nm_len,
+           char * val, size_t d_len);
+
+static char const *
+scan_name(char const * name, tOptionValue * res);
+
+static char const *
+unnamed_xml(char const * txt);
+
+static char const *
+scan_xml_name(char const * name, size_t * nm_len, tOptionValue * val);
+
+static char const *
+find_end_xml(char const * src, size_t nm_len, char const * val, size_t * len);
+
+static char const *
+scan_xml(char const * xml_name, tOptionValue * res_val);
+
 static void
 unload_arg_list(tArgList * arg_list);
 
+static void
+sort_list(tArgList * arg_list);
+
 static tOptionValue *
 optionLoadNested(char const * text, char const * name, size_t nm_len);
 
@@ -126,21 +351,270 @@ static void
 emit_special_char(FILE * fp, int ch);
 
 /*
- *  Extracted from sort.c
+ * Static declarations from parse-duration.c
  */
+static unsigned long
+str_const_to_ul (cch_t * str, cch_t ** ppz, int base);
+
+static long
+str_const_to_l (cch_t * str, cch_t ** ppz, int base);
+
+static time_t
+scale_n_add (time_t base, time_t val, int scale);
+
+static time_t
+parse_hr_min_sec (time_t start, cch_t * pz);
+
+static time_t
+parse_scaled_value (time_t base, cch_t ** ppz, cch_t * endp, int scale);
+
+static time_t
+parse_year_month_day (cch_t * pz, cch_t * ps);
+
+static time_t
+parse_yearmonthday (cch_t * in_pz);
+
+static time_t
+parse_YMWD (cch_t * pz);
+
+static time_t
+parse_hour_minute_second (cch_t * pz, cch_t * ps);
+
+static time_t
+parse_hourminutesecond (cch_t * in_pz);
+
+static time_t
+parse_HMS (cch_t * pz);
+
+static time_t
+parse_time (cch_t * pz);
+
+static char *
+trim (char * pz);
+
+static time_t
+parse_period (cch_t * in_pz);
+
+static time_t
+parse_non_iso8601 (cch_t * pz);
+
+/*
+ * Static declarations from pgusage.c
+ */
+static inline FILE *
+open_tmp_usage(char ** buf);
+
+static inline char *
+mk_pager_cmd(char const * fname);
+
+/*
+ * Static declarations from putshell.c
+ */
+static size_t
+string_size(char const * scan, size_t nl_len);
+
+static char const *
+print_quoted_apostrophes(char const * str);
+
+static void
+print_quot_str(char const * str);
+
+static void
+print_enumeration(tOptions * pOpts, tOptDesc * pOD);
+
+static void
+print_membership(tOptions * pOpts, tOptDesc * pOD);
+
+static void
+print_stacked_arg(tOptions * pOpts, tOptDesc * pOD);
+
+static void
+print_reordering(tOptions * opts);
+
+/*
+ * Static declarations from reset.c
+ */
+static void
+optionReset(tOptions * pOpts, tOptDesc * pOD);
+
+static void
+optionResetEverything(tOptions * pOpts);
+
+/*
+ * Static declarations from restore.c
+ */
+static void
+fixupSavedOptionArgs(tOptions * pOpts);
+
+/*
+ * Static declarations from save.c
+ */
+static char const *
+find_dir_name(tOptions * opts, int * p_free);
+
+static char const *
+find_file_name(tOptions * opts, int * p_free_name);
+
+static void
+prt_entry(FILE * fp, tOptDesc * od, char const * l_arg, save_flags_mask_t save_fl);
+
+static void
+prt_value(FILE * fp, int depth, tOptDesc * od, tOptionValue const * ovp);
+
+static void
+prt_string(FILE * fp, char const * name, char const * pz);
+
+static void
+prt_val_list(FILE * fp, char const * name, tArgList * al);
+
+static void
+prt_nested(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl);
+
+static void
+remove_settings(tOptions * opts, char const * fname);
+
+static FILE *
+open_sv_file(tOptions * opts, save_flags_mask_t save_fl);
+
+static void
+prt_no_arg_opt(FILE * fp, tOptDesc * vod, tOptDesc * pod, save_flags_mask_t save_fl);
+
+static void
+prt_str_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl);
+
+static void
+prt_enum_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl);
+
+static void
+prt_set_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl);
+
+static void
+prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts, save_flags_mask_t save_fl);
+
+/*
+ * Static declarations from sort.c
+ */
+static tSuccess
+must_arg(tOptions * opts, char * arg_txt, tOptState * pOS,
+         char ** opt_txt, uint32_t * opt_idx);
+
+static tSuccess
+maybe_arg(tOptions * opts, char * arg_txt, tOptState * pOS,
+          char ** opt_txt, uint32_t * opt_idx);
+
+static tSuccess
+short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS,
+             char ** opt_txt, uint32_t * opt_idx);
+
 static void
 optionSort(tOptions * opts);
 
 /*
- *  Extracted from stack.c
+ * Static declarations from stack.c
  */
 static void
 addArgListEntry(void ** ppAL, void * entry);
 
 /*
- *  Extracted from usage.c
+ * Static declarations from text_mmap.c
  */
+static void
+load_text_file(tmap_info_t * mapinfo, char const * pzFile);
+
+static void
+validate_mmap(char const * fname, int prot, int flags, tmap_info_t * mapinfo);
+
+static void
+close_mmap_files(tmap_info_t * mi);
+
+/*
+ * Static declarations from tokenize.c
+ */
+static void
+copy_cooked(ch_t ** ppDest, char const ** ppSrc);
+
+static void
+copy_raw(ch_t ** ppDest, char const ** ppSrc);
+
+static token_list_t *
+alloc_token_list(char const * str);
+
+/*
+ * Static declarations from usage.c
+ */
+static unsigned int
+parse_usage_flags(ao_flag_names_t const * fnt, char const * txt);
+
 static void
 set_usage_flags(tOptions * opts, char const * flg_txt);
 
+static inline bool
+do_gnu_usage(tOptions * pOpts);
+
+static inline bool
+skip_misuse_usage(tOptions * pOpts);
+
+static void
+print_offer_usage(tOptions * opts);
+
+static void
+print_usage_details(tOptions * opts, int exit_code);
+
+static void
+print_one_paragraph(char const * text, bool plain, FILE * fp);
+
+static void
+prt_conflicts(tOptions * opts, tOptDesc * od);
+
+static void
+prt_one_vendor(tOptions *    opts,  tOptDesc *   od,
+               arg_types_t * argtp, char const * usefmt);
+
+static void
+prt_vendor_opts(tOptions * opts, char const * title);
+
+static void
+prt_extd_usage(tOptions * opts, tOptDesc * od, char const * title);
+
+static void
+prt_ini_list(char const * const * papz, char const * ini_file,
+             char const * path_nm);
+
+static void
+prt_preamble(tOptions * opts, tOptDesc * od, arg_types_t * at);
+
+static void
+prt_one_usage(tOptions * opts, tOptDesc * od, arg_types_t * at);
+
+static void
+prt_opt_usage(tOptions * opts, int ex_code, char const * title);
+
+static void
+prt_prog_detail(tOptions * opts);
+
+static int
+setGnuOptFmts(tOptions * opts, char const ** ptxt);
+
+static int
+setStdOptFmts(tOptions * opts, char const ** ptxt);
+
+/*
+ * Static declarations from version.c
+ */
+static void
+emit_first_line(
+    FILE * fp, char const * alt1, char const * alt2, char const * alt3);
+
+static void
+emit_simple_ver(tOptions * o, FILE * fp);
+
+static void
+emit_copy_full(tOptions * o, FILE * fp);
+
+static void
+emit_copy_note(tOptions * opts, FILE * fp);
+
+static void
+print_ver(tOptions * opts, tOptDesc * od, FILE * fp, bool call_exit);
+
 #endif /* AUTOOPTS_PROTO_H_GUARD */
index 9bfa984da67dd020e2b54b1803077d14b44297fd..84463dd40be42c38eb420f2abf916f109914a79f 100644 (file)
@@ -12,7 +12,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-/* = = = START-STATIC-FORWARD = = = */
-static size_t
-string_size(char const * scan, size_t nl_len);
-
-static char const *
-print_quoted_apostrophes(char const * str);
-
-static void
-print_quot_str(char const * str);
-
-static void
-print_enumeration(tOptions * pOpts, tOptDesc * pOD);
-
-static void
-print_membership(tOptions * pOpts, tOptDesc * pOD);
-
-static void
-print_stacked_arg(tOptions * pOpts, tOptDesc * pOD);
-
-static void
-print_reordering(tOptions * opts);
-/* = = = END-STATIC-FORWARD = = = */
-
 /**
  * Count the number of bytes required to represent a string as a
  * compilable string.
@@ -129,8 +106,10 @@ char const *
 optionQuoteString(char const * text, char const * nl)
 {
     size_t   nl_len = strlen(nl);
+    size_t   out_sz = string_size(text, nl_len);
     char *   out;
-    char *   res = out = AGALOC(string_size(text, nl_len), "quot str");
+    char *   res    = out = AGALOC(out_sz, "quot str");
+
     *(out++) = '"';
 
     for (;;) {
@@ -179,16 +158,21 @@ optionQuoteString(char const * text, char const * nl)
              *  deallocate the text string.  Return the scan resumption point.
              */
             *(out++) = '"';
-            *out = NUL;
+            *(out++) = NUL;
+#ifndef NDEBUG
+            if ((size_t)(out - res) > out_sz) {
+                fputs(misguess_len, stderr);
+                option_exits(EXIT_FAILURE);
+            }
+#endif
             return res;
 
         default:
             /*
              *  sprintf is safe here, because we already computed
-             *  the amount of space we will be using.
+             *  the amount of space we will be using.  Assertion is above.
              */
-            sprintf(out, MK_STR_OCT_FMT, ch);
-            out += 4;
+            out += sprintf(out, MK_STR_OCT_FMT, ch);
         }
 
         text++;
index 97ecb52e242532a6c0dda4b72f7097dfbd06d9ab..f7b58e8d1a140cbc5a1b522c639d6d95d0e8ad9d 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -113,7 +113,7 @@ optionResetOpt(tOptions * pOpts, tOptDesc * pOD)
             assert(0 == 1);
         }
     } else {
-        succ = opt_find_long(pOpts, pzArg, &opt_state);
+        succ = opt_find_long(pOpts, (char *)pzArg, &opt_state);
         if (! SUCCESSFUL(succ)) {
             fprintf(stderr, zIllOptStr, pOpts->pzProgPath, pzArg);
             pOpts->pUsageProc(pOpts, EXIT_FAILURE);
index 02ef14aeba3829c4b032ebcc3040d7e7518a2294..36ebbce1a72fb43d7b68ff92a669ac369df09e41 100644 (file)
@@ -12,7 +12,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
index cdab05f628ec064e5e0aa15d82850ecdf0f03226..8b1fba9d624f09415ab5fb53bc9a2f9bcb935321 100644 (file)
@@ -12,7 +12,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b  COPYING.lgplv3
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
-
-/* = = = START-STATIC-FORWARD = = = */
-static char const *
-find_dir_name(tOptions * opts, int * p_free);
-
-static char const *
-find_file_name(tOptions * opts, int * p_free_name);
-
-static void
-prt_entry(FILE * fp, tOptDesc * od, char const * l_arg);
-
-static void
-prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp);
-
-static void
-prt_string(FILE * fp, char const * name, char const * pz);
-
-static void
-prt_val_list(FILE * fp, char const * name, tArgList * al);
-
-static void
-prt_nested(FILE * fp, tOptDesc * p);
-
-static FILE *
-open_sv_file(tOptions * opts);
-
-static void
-prt_no_arg_opt(FILE * fp, tOptDesc * p, tOptDesc * pOD);
-
-static void
-prt_str_arg(FILE * fp, tOptDesc * pOD);
-
-static void
-prt_enum_arg(FILE * fp, tOptDesc * od);
-
-static void
-prt_set_arg(FILE * fp, tOptDesc * od);
-
-static void
-prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts);
-/* = = = END-STATIC-FORWARD = = = */
+#include "save-flags.h"
 
 /**
+ * find the config file directory name
+ *
+ * @param opts    the options descriptor
+ * @param p_free  tell caller if name was allocated or not
  */
 static char const *
 find_dir_name(tOptions * opts, int * p_free)
 {
-    char const * pzDir;
+    char const * dir;
 
     if (  (opts->specOptIdx.save_opts == NO_EQUIVALENT)
        || (opts->specOptIdx.save_opts == 0))
         return NULL;
 
-    pzDir = opts->pOptDesc[ opts->specOptIdx.save_opts ].optArg.argString;
-    if ((pzDir != NULL) && (*pzDir != NUL))
-        return pzDir;
+    dir = opts->pOptDesc[ opts->specOptIdx.save_opts ].optArg.argString;
+    if ((dir != NULL) && (*dir != NUL)) {
+        char const * pz = strchr(dir, '>');
+        if (pz == NULL)
+            return dir;
+        while (*(++pz) == '>')  ;
+        pz += strspn(pz, " \t");
+        dir = pz;
+        if (*dir != NUL)
+            return dir;
+    }
+
+    if (opts->papzHomeList == NULL)
+        return NULL;
 
     /*
      *  This function only works if there is a directory where
      *  we can stash the RC (INI) file.
      */
-    {
-        char const * const * papz = opts->papzHomeList;
-        if (papz == NULL)
-            return NULL;
+    for (int idx = 0;; idx++) {
+        char f_name[ AG_PATH_MAX+1 ];
 
-        while (papz[1] != NULL) papz++;
-        pzDir = *papz;
-    }
-
-    /*
-     *  IF it does not require deciphering an env value, then just copy it
-     */
-    if (*pzDir != '$')
-        return pzDir;
-
-    {
-        char const * pzEndDir = strchr(++pzDir, DIRCH);
-        char * pzFileName;
-        char * pzEnv;
-
-        if (pzEndDir != NULL) {
-            char z[ AO_NAME_SIZE ];
-            if ((pzEndDir - pzDir) > AO_NAME_LIMIT )
-                return NULL;
-            memcpy(z, pzDir, (size_t)(pzEndDir - pzDir));
-            z[pzEndDir - pzDir] = NUL;
-            pzEnv = getenv(z);
-        } else {
+        dir = opts->papzHomeList[idx];
 
-            /*
-             *  Make sure we can get the env value (after stripping off
-             *  any trailing directory or file names)
-             */
-            pzEnv = getenv(pzDir);
+        switch (*dir) {
+        case '$':
+            break;
+        case NUL:
+            continue;
+        default:
+            return dir;
         }
-
-        if (pzEnv == NULL) {
-            fprintf(stderr, zsave_warn, opts->pzProgName);
-            fprintf(stderr, zNotDef, pzDir);
-            return NULL;
+        if (optionMakePath(f_name, (int)sizeof(f_name), dir, opts->pzProgPath)) {
+            *p_free = true;
+            AGDUPSTR(dir, f_name, "homerc");
+            return dir;
         }
-
-        if (pzEndDir == NULL)
-            return pzEnv;
-
-        {
-            size_t sz = strlen(pzEnv) + strlen(pzEndDir) + 2;
-            pzFileName = (char *)AGALOC(sz, "dir name");
-        }
-
-        if (pzFileName == NULL)
-            return NULL;
-
-        *p_free = 1;
-        /*
-         *  Glue together the full name into the allocated memory.
-         *  FIXME: We lose track of this memory.
-         */
-        sprintf(pzFileName, "%s/%s", pzEnv, pzEndDir);
-        return pzFileName;
     }
+    return NULL;
 }
 
 /**
+ * Find the name of the save-the-options file
+ *
+ * @param opts         the options descriptor
+ * @param p_free_name  tell caller if name was allocated or not
  */
 static char const *
 find_file_name(tOptions * opts, int * p_free_name)
@@ -162,15 +100,15 @@ find_file_name(tOptions * opts, int * p_free_name)
     struct stat stBuf;
     int    free_dir_name = 0;
 
-    char const * pzDir = find_dir_name(opts, &free_dir_name);
-    if (pzDir == NULL)
-        return NULL;
+    char const * res = find_dir_name(opts, &free_dir_name);
+    if (res == NULL)
+        return res;
 
     /*
      *  See if we can find the specified directory.  We use a once-only loop
      *  structure so we can bail out early.
      */
-    if (stat(pzDir, &stBuf) != 0) do {
+    if (stat(res, &stBuf) != 0) do {
         char z[AG_PATH_MAX];
         char * dirchp;
 
@@ -180,10 +118,10 @@ find_file_name(tOptions * opts, int * p_free_name)
          */
         if (errno != ENOENT) {
         bogus_name:
-            fprintf(stderr, zsave_warn, opts->pzProgName);
-            fprintf(stderr, zNoStat, errno, strerror(errno), pzDir);
+            fprintf(stderr, zsave_warn, opts->pzProgName, res);
+            fprintf(stderr, zNoStat, errno, strerror(errno), res);
             if (free_dir_name)
-                AGFREE(pzDir);
+                AGFREE(res);
             return NULL;
         }
 
@@ -191,17 +129,17 @@ find_file_name(tOptions * opts, int * p_free_name)
          *  Strip off the last component, stat the remaining string and
          *  that string must name a directory
          */
-        dirchp = strrchr(pzDir, DIRCH);
+        dirchp = strrchr(res, DIRCH);
         if (dirchp == NULL) {
             stBuf.st_mode = S_IFREG;
             break; /* found directory -- viz.,  "." */
         }
 
-        if ((size_t)(dirchp - pzDir) >= sizeof(z))
+        if ((size_t)(dirchp - res) >= sizeof(z))
             goto bogus_name;
 
-        memcpy(z, pzDir, (size_t)(dirchp - pzDir));
-        z[dirchp - pzDir] = NUL;
+        memcpy(z, res, (size_t)(dirchp - res));
+        z[dirchp - res] = NUL;
 
         if ((stat(z, &stBuf) != 0) || ! S_ISDIR(stBuf.st_mode))
             goto bogus_name;
@@ -213,18 +151,17 @@ find_file_name(tOptions * opts, int * p_free_name)
      *  THEN tack on the config file name
      */
     if (S_ISDIR(stBuf.st_mode)) {
-        size_t sz = strlen(pzDir) + strlen(opts->pzRcName) + 2;
 
         {
+            size_t sz = strlen(res) + strlen(opts->pzRcName) + 2;
             char * pzPath = (char *)AGALOC(sz, "file name");
-#ifdef HAVE_SNPRINTF
-            snprintf(pzPath, sz, "%s/%s", pzDir, opts->pzRcName);
-#else
-            sprintf(pzPath, "%s/%s", pzDir, opts->pzRcName);
-#endif
+            if (   snprintf(pzPath, sz, "%s/%s", res, opts->pzRcName)
+                >= (int)sz)
+                option_exits(EXIT_FAILURE);
+
             if (free_dir_name)
-                AGFREE(pzDir);
-            pzDir = pzPath;
+                AGFREE(res);
+            res = pzPath;
             free_dir_name = 1;
         }
 
@@ -232,12 +169,12 @@ find_file_name(tOptions * opts, int * p_free_name)
          *  IF we cannot stat the object for any reason other than
          *     it does not exist, then we bail out
          */
-        if (stat(pzDir, &stBuf) != 0) {
+        if (stat(res, &stBuf) != 0) {
             if (errno != ENOENT) {
-                fprintf(stderr, zsave_warn, opts->pzProgName);
+                fprintf(stderr, zsave_warn, opts->pzProgName, res);
                 fprintf(stderr, zNoStat, errno, strerror(errno),
-                        pzDir);
-                AGFREE(pzDir);
+                        res);
+                AGFREE(res);
                 return NULL;
             }
 
@@ -253,32 +190,37 @@ find_file_name(tOptions * opts, int * p_free_name)
      *  or will soon be a file.
      */
     if (! S_ISREG(stBuf.st_mode)) {
-        fprintf(stderr, zsave_warn, opts->pzProgName, pzDir);
+        fprintf(stderr, zsave_warn, opts->pzProgName, res);
         if (free_dir_name)
-            AGFREE(pzDir);
+            AGFREE(res);
         return NULL;
     }
 
     /*
      *  Get rid of the old file
      */
-    unlink(pzDir);
     *p_free_name = free_dir_name;
-    return pzDir;
+    return res;
 }
 
 /**
  * print one option entry to the save file.
  *
- * @param[in] fp    the file pointer for the save file
- * @param[in] od    the option descriptor to print
- * @param[in] l_arg the last argument for the option
+ * @param[in] fp       the file pointer for the save file
+ * @param[in] od       the option descriptor to print
+ * @param[in] l_arg    the last argument for the option
+ * @param[in] save_fl  include usage in comments
  */
 static void
-prt_entry(FILE * fp, tOptDesc * od, char const * l_arg)
+prt_entry(FILE * fp, tOptDesc * od, char const * l_arg, save_flags_mask_t save_fl)
 {
     int space_ct;
 
+    if (save_fl & SVFL_USAGE)
+        fprintf(fp, ao_name_use_fmt, od->pz_Name, od->pzText);
+    if (UNUSED_OPT(od) && (save_fl & SVFL_DEFAULT))
+        fputs(ao_default_use, fp);
+
     /*
      *  There is an argument.  Pad the name so values line up.
      *  Not disabled *OR* this got equivalenced to another opt,
@@ -287,9 +229,14 @@ prt_entry(FILE * fp, tOptDesc * od, char const * l_arg)
      */
     {
         char const * pz =
-            (! DISABLED_OPT(od) || (od->optEquivIndex != NO_EQUIVALENT))
+            (od->pz_DisableName == NULL)
             ? od->pz_Name
-            : od->pz_DisableName;
+            : (DISABLED_OPT(od)
+               ? od->pz_DisableName
+               : ((od->optEquivIndex == NO_EQUIVALENT)
+                  ? od->pz_Name : od->pz_DisableName)
+              );
+        
         space_ct = 17 - strlen(pz);
         fputs(pz, fp);
     }
@@ -338,9 +285,13 @@ end_entry:
 }
 
 /**
+ * print an option's value
+ *
+ * @param[in] fp          the file pointer for the save file
+ * @param[in] od          the option descriptor to print
  */
 static void
-prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp)
+prt_value(FILE * fp, int depth, tOptDesc * od, tOptionValue const * ovp)
 {
     while (--depth >= 0)
         putc(' ', fp), putc(' ', fp);
@@ -357,9 +308,9 @@ prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp)
 
     case OPARG_TYPE_ENUMERATION:
     case OPARG_TYPE_MEMBERSHIP:
-        if (pOD != NULL) {
-            uint32_t  opt_state = pOD->fOptState;
-            uintptr_t val = pOD->optArg.argEnum;
+        if (od != NULL) {
+            uint32_t  opt_state = od->fOptState;
+            uintptr_t val = od->optArg.argEnum;
             char const * typ = (ovp->valType == OPARG_TYPE_ENUMERATION)
                 ? "keyword" : "set-membership";
 
@@ -369,20 +320,20 @@ prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp)
              *  This is a magic incantation that will convert the
              *  bit flag values back into a string suitable for printing.
              */
-            (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD );
-            if (pOD->optArg.argString != NULL) {
-                fputs(pOD->optArg.argString, fp);
+            (*(od->pOptProc))(OPTPROC_RETURN_VALNAME, od );
+            if (od->optArg.argString != NULL) {
+                fputs(od->optArg.argString, fp);
 
                 if (ovp->valType != OPARG_TYPE_ENUMERATION) {
                     /*
                      *  set membership strings get allocated
                      */
-                    AGFREE(pOD->optArg.argString);
+                    AGFREE(od->optArg.argString);
                 }
             }
 
-            pOD->optArg.argEnum = val;
-            pOD->fOptState = opt_state;
+            od->optArg.argEnum = val;
+            od->fOptState = opt_state;
             fprintf(fp, END_XML_FMT, ovp->pzName);
             break;
         }
@@ -404,6 +355,9 @@ prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp)
 }
 
 /**
+ * Print a string value in XML format
+ *
+ * @param[in] fp          the file pointer for the save file
  */
 static void
 prt_string(FILE * fp, char const * name, char const * pz)
@@ -440,6 +394,9 @@ prt_string(FILE * fp, char const * name, char const * pz)
 }
 
 /**
+ * Print an option that can have multiple values in XML format
+ *
+ * @param[in] fp          file pointer
  */
 static void
 prt_val_list(FILE * fp, char const * name, tArgList * al)
@@ -453,7 +410,7 @@ prt_val_list(FILE * fp, char const * name, tArgList * al)
     if (al == NULL)
         return;
     opt_ct   = al->useCt;
-    opt_list = VOIDP(al->apzArgs);
+    opt_list = (void **)al->apzArgs;
 
     if (opt_ct <= 0) {
         fprintf(fp, OPEN_CLOSE_FMT, name);
@@ -476,19 +433,30 @@ prt_val_list(FILE * fp, char const * name, tArgList * al)
 }
 
 /**
+ * printed a nested/hierarchical value
+ *
+ * @param[in] fp       file pointer
+ * @param[in] od       option descriptor
+ * @param[in] save_fl  include usage in comments
  */
 static void
-prt_nested(FILE * fp, tOptDesc * p)
+prt_nested(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl)
 {
     int opt_ct;
-    tArgList * al = p->optCookie;
+    tArgList * al = od->optCookie;
     void ** opt_list;
 
-    if (al == NULL)
+    if (save_fl & SVFL_USAGE)
+        fprintf(fp, ao_name_use_fmt, od->pz_Name, od->pzText);
+
+    /*
+     * Never show a default value if a hierarchical value is empty.
+     */
+    if (UNUSED_OPT(od) || (al == NULL))
         return;
 
     opt_ct   = al->useCt;
-    opt_list = VOIDP(al->apzArgs);
+    opt_list = (void **)al->apzArgs;
 
     if (opt_ct <= 0)
         return;
@@ -500,48 +468,128 @@ prt_nested(FILE * fp, tOptDesc * p)
         if (ovp == NULL)
             continue;
 
-        fprintf(fp, NESTED_OPT_FMT, p->pz_Name);
+        fprintf(fp, NESTED_OPT_FMT, od->pz_Name);
 
         do  {
-            prt_value(fp, 1, p, ovp);
+            prt_value(fp, 1, od, ovp);
 
         } while (ovp = optionNextValue(base, ovp),
                  ovp != NULL);
 
-        fprintf(fp, "</%s>\n", p->pz_Name);
+        fprintf(fp, "</%s>\n", od->pz_Name);
     } while (--opt_ct > 0);
 }
 
 /**
- * open the file for saving option state.
+ * remove the current program settings
  *
  * @param[in] opts  the program options structure
+ * @param[in] fname the save file name
+ */
+static void
+remove_settings(tOptions * opts, char const * fname)
+{
+    size_t const name_len = strlen(opts->pzProgName);
+    tmap_info_t  map_info;
+    char *       text = text_mmap(fname, PROT_READ|PROT_WRITE, MAP_PRIVATE, &map_info);
+    char *       scan = text;
+
+    for (;;) {
+        char * next = scan = strstr(scan, zCfgProg);
+        if (scan == NULL)
+            goto leave;
+
+        scan = SPN_WHITESPACE_CHARS(scan + zCfgProg_LEN);
+        if (  (strneqvcmp(scan, opts->pzProgName, (int)name_len) == 0)
+           && (IS_END_XML_TOKEN_CHAR(scan[name_len])) )  {
+
+            scan = next;
+            break;
+        }
+    }
+
+    /*
+     * If not NULL, "scan" points to the "<?program" string introducing
+     * the program segment we are to remove. See if another segment follows.
+     * If so, copy text. If not se trim off this segment.
+     */
+    {
+        char * next = strstr(scan + zCfgProg_LEN, zCfgProg);
+        size_t new_sz;
+
+        if (next == NULL)
+            new_sz = map_info.txt_size - strlen(scan);
+        else {
+            int fd = open(fname, O_RDWR);
+            if (fd < 0) return;
+            if (lseek(fd, (scan - text), SEEK_SET) < 0)
+                scan = next;
+            else if (write(fd, next, strlen(next)) < 0)
+                scan = next;
+            if (close(fd) < 0)
+                scan = next;
+            new_sz = map_info.txt_size - (next - scan);
+        }
+        if (new_sz != map_info.txt_size)
+            if (truncate(fname, new_sz) < 0)
+                scan = next; // we removed it, so shorten file
+    }
+
+ leave:
+    text_munmap(&map_info);
+}
+
+/**
+ * open the file for saving option state.
+ *
+ * @param[in] opts     the program options structure
+ * @param[in] save_fl  flags for saving data
  * @returns the open file pointer.  It may be NULL.
  */
 static FILE *
-open_sv_file(tOptions * opts)
+open_sv_file(tOptions * opts, save_flags_mask_t save_fl)
 {
     FILE * fp;
 
     {
         int   free_name = 0;
-        char const * pzFName = find_file_name(opts, &free_name);
-        if (pzFName == NULL)
+        char const * fname = find_file_name(opts, &free_name);
+        if (fname == NULL)
             return NULL;
 
-        fp = fopen(pzFName, "w" FOPEN_BINARY_FLAG);
+        if (save_fl == 0)
+            unlink(fname);
+        else
+            remove_settings(opts, fname);
+
+        fp = fopen(fname, "a" FOPEN_BINARY_FLAG);
         if (fp == NULL) {
-            fprintf(stderr, zsave_warn, opts->pzProgName);
-            fprintf(stderr, zNoCreat, errno, strerror(errno), pzFName);
+            fprintf(stderr, zsave_warn, opts->pzProgName, fname);
+            fprintf(stderr, zNoCreat, errno, strerror(errno), fname);
             if (free_name)
-                AGFREE(pzFName);
+                AGFREE(fname);
             return fp;
         }
 
         if (free_name)
-            AGFREE(pzFName);
+            AGFREE(fname);
     }
 
+    do {
+        struct stat sbuf;
+        if (fstat(fileno(fp), &sbuf) < 0)
+            break;
+
+        if (sbuf.st_size > zPresetFile_LEN) {
+            /* non-zero size implies save_fl is non-zero */
+            fprintf(fp, zFmtProg, opts->pzProgName);
+            return fp;
+        }
+    } while (false);
+
+    /*
+     * We have a new file. Insert a header
+     */
     fputs("#  ", fp);
     {
         char const * e = strchr(opts->pzUsageTitle, NL);
@@ -563,40 +611,63 @@ open_sv_file(tOptions * opts)
         AGFREE(time_str);
 #endif
     }
-
+    if (save_fl != 0)
+        fprintf(fp, zFmtProg, opts->pzProgName);
     return fp;
 }
 
 /**
+ * print option without an arg
+ *
+ * @param[in] fp       file pointer
+ * @param[in] vod      value option descriptor
+ * @param[in] pod      primary option descriptor
+ * @param[in] save_fl  include usage in comments
  */
 static void
-prt_no_arg_opt(FILE * fp, tOptDesc * p, tOptDesc * pOD)
+prt_no_arg_opt(FILE * fp, tOptDesc * vod, tOptDesc * pod, save_flags_mask_t save_fl)
 {
     /*
      * The aliased to argument indicates whether or not the option
      * is "disabled".  However, the original option has the name
-     * string, so we get that there, not with "p".
+     * string, so we get that there, not with "vod".
      */
     char const * pznm =
-        (DISABLED_OPT(p)) ? pOD->pz_DisableName : pOD->pz_Name;
+        (DISABLED_OPT(vod)) ? pod->pz_DisableName : pod->pz_Name;
     /*
      *  If the option was disabled and the disablement name is NULL,
      *  then the disablement was caused by aliasing.
      *  Use the name as the string to emit.
      */
     if (pznm == NULL)
-        pznm = pOD->pz_Name;
+        pznm = pod->pz_Name;
+
+    if (save_fl & SVFL_USAGE)
+        fprintf(fp, ao_name_use_fmt, pod->pz_Name, pod->pzText);
+    if (UNUSED_OPT(pod) && (save_fl & SVFL_DEFAULT))
+        fputs(ao_default_use, fp);
 
     fprintf(fp, "%s\n", pznm);
 }
 
 /**
+ * print the string valued argument(s).
+ *
+ * @param[in] fp       file pointer
+ * @param[in] od       value option descriptor
+ * @param[in] save_fl  include usage in comments
  */
 static void
-prt_str_arg(FILE * fp, tOptDesc * pOD)
+prt_str_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl)
 {
-    if (pOD->fOptState & OPTST_STACKED) {
-        tArgList * pAL = (tArgList *)pOD->optCookie;
+    if (UNUSED_OPT(od) || ((od->fOptState & OPTST_STACKED) == 0)) {
+        char const * arg = od->optArg.argString;
+        if (arg == NULL)
+            arg = "''";
+        prt_entry(fp, od, arg, save_fl);
+
+    } else {
+        tArgList * pAL = (tArgList *)od->optCookie;
         int        uct = pAL->useCt;
         char const ** ppz = pAL->apzArgs;
 
@@ -604,23 +675,24 @@ prt_str_arg(FILE * fp, tOptDesc * pOD)
          *  un-disable multiple copies of disabled options.
          */
         if (uct > 1)
-            pOD->fOptState &= ~OPTST_DISABLED;
+            od->fOptState &= ~OPTST_DISABLED;
 
-        while (uct-- > 0)
-            prt_entry(fp, pOD, *(ppz++));
-    } else {
-        prt_entry(fp, pOD, pOD->optArg.argString);
+        while (uct-- > 0) {
+            prt_entry(fp, od, *(ppz++), save_fl);
+            save_fl &= ~SVFL_USAGE;
+        }
     }
 }
 
 /**
  * print the string value of an enumeration.
  *
- * @param[in] fp  the file pointer to write to
- * @param[in] od  the option descriptor with the enumerated value
+ * @param[in] fp       the file pointer to write to
+ * @param[in] od       the option descriptor with the enumerated value
+ * @param[in] save_fl  include usage in comments
  */
 static void
-prt_enum_arg(FILE * fp, tOptDesc * od)
+prt_enum_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl)
 {
     uintptr_t val = od->optArg.argEnum;
 
@@ -629,29 +701,31 @@ prt_enum_arg(FILE * fp, tOptDesc * od)
      *  bit flag values back into a string suitable for printing.
      */
     (*(od->pOptProc))(OPTPROC_RETURN_VALNAME, od);
-    prt_entry(fp, od, VOIDP(od->optArg.argString));
+    prt_entry(fp, od, VOIDP(od->optArg.argString), save_fl);
 
     od->optArg.argEnum = val;
 }
 
 /**
  * Print the bits set in a bit mask option.
+ *
  * We call the option handling function with a magic value for
  * the options pointer and it allocates and fills in the string.
  * We print that with a call to prt_entry().
  *
- * @param[in] fp  the file pointer to write to
- * @param[in] od  the option descriptor with a bit mask value type
+ * @param[in] fp       the file pointer to write to
+ * @param[in] od       the option descriptor with a bit mask value type
+ * @param[in] save_fl  include usage in comments
  */
 static void
-prt_set_arg(FILE * fp, tOptDesc * od)
+prt_set_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl)
 {
     char * list = optionMemberList(od);
     size_t len  = strlen(list);
     char * buf  = (char *)AGALOC(len + 3, "dir name");
     *buf= '=';
     memcpy(buf+1, list, len + 1);
-    prt_entry(fp, od, buf);
+    prt_entry(fp, od, buf, save_fl);
     AGFREE(buf);
     AGFREE(list);
 }
@@ -660,29 +734,35 @@ prt_set_arg(FILE * fp, tOptDesc * od)
  * figure out what the option file name argument is.
  * If one can be found, call prt_entry() to emit it.
  *
- * @param[in] fp   the file pointer to write to.
- * @param[in] od   the option descriptor with a bit mask value type
- * @param[in] opts the program options descriptor
+ * @param[in] fp       the file pointer to write to.
+ * @param[in] od       the option descriptor with a bit mask value type
+ * @param[in] opts     the program options descriptor
+ * @param[in] save_fl  include usage in comments
  */
 static void
-prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts)
+prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts, save_flags_mask_t save_fl)
 {
     /*
      *  If the cookie is not NULL, then it has the file name, period.
      *  Otherwise, if we have a non-NULL string argument, then....
      */
     if (od->optCookie != NULL)
-        prt_entry(fp, od, od->optCookie);
+        prt_entry(fp, od, od->optCookie, save_fl);
 
     else if (HAS_originalOptArgArray(opts)) {
         char const * orig =
             opts->originalOptArgArray[od->optIndex].argString;
 
-        if (od->optArg.argString == orig)
+        if (od->optArg.argString == orig) {
+            if (save_fl)
+                fprintf(fp, ao_name_use_fmt, od->pz_Name, od->pzText);
             return;
+        }
 
-        prt_entry(fp, od, od->optArg.argString);
-    }
+        prt_entry(fp, od, od->optArg.argString, save_fl);
+
+    } else if (save_fl)
+        fprintf(fp, ao_name_use_fmt, od->pz_Name, od->pzText);
 }
 
 /*=export_func  optionSaveFile
@@ -719,8 +799,32 @@ optionSaveFile(tOptions * opts)
 {
     tOptDesc *  od;
     int         ct;
-    FILE *      fp = open_sv_file(opts);
+    FILE *      fp;
+    save_flags_mask_t save_flags = SVFL_NONE;
+
+    do {
+        char * temp_str;
+        char const * dir = opts->pOptDesc[ opts->specOptIdx.save_opts ].optArg.argString;
+        size_t flen;
 
+        if (dir == NULL)
+            break;
+        temp_str = strchr(dir, '>');
+        if (temp_str == NULL)
+            break;
+        if (temp_str[1] == '>')
+            save_flags = SVFL_UPDATE;
+        flen = (temp_str - dir);
+        if (flen == 0)
+            break;
+        temp_str = AGALOC(flen + 1, "flag search str");
+        memcpy(temp_str, dir, flen);
+        temp_str[flen] = NUL;
+        save_flags |= save_flags_str2mask(temp_str, SVFL_NONE);
+        AGFREE(temp_str);
+    } while (false);
+
+    fp = open_sv_file(opts, save_flags & SVFL_UPDATE);
     if (fp == NULL)
         return;
 
@@ -730,20 +834,20 @@ optionSaveFile(tOptions * opts)
     ct = opts->presetOptCt;
     od = opts->pOptDesc;
     do  {
-        tOptDesc * p;
+        tOptDesc * vod;
 
         /*
-         *  IF    the option has not been defined
-         *     OR it does not take an initialization value
-         *     OR it is equivalenced to another option
-         *  THEN continue (ignore it)
-         *
          *  Equivalenced options get picked up when the equivalenced-to
-         *  option is processed.
+         *  option is processed. And do not save options with any state
+         *  bits in the DO_NOT_SAVE collection
+         *
+         * ** option cannot be preset
+         * #define OPTST_NO_INIT          0x0000100U
+         * ** disable from cmd line
+         * #define OPTST_NO_COMMAND       0x2000000U
+         * ** alias for other option
+         * #define OPTST_ALIAS            0x8000000U
          */
-        if (UNUSED_OPT(od))
-            continue;
-
         if ((od->fOptState & OPTST_DO_NOT_SAVE_MASK) != 0)
             continue;
 
@@ -751,45 +855,48 @@ optionSaveFile(tOptions * opts)
            && (od->optEquivIndex != od->optIndex))
             continue;
 
+        if (UNUSED_OPT(od) && ((save_flags & SVFL_USAGE_DEFAULT_MASK) == SVFL_NONE))
+            continue;
+
         /*
          *  The option argument data are found at the equivalenced-to option,
          *  but the actual option argument type comes from the original
          *  option descriptor.  Be careful!
          */
-        p = ((od->fOptState & OPTST_EQUIVALENCE) != 0)
-            ? (opts->pOptDesc + od->optActualIndex) : od;
+        vod = ((od->fOptState & OPTST_EQUIVALENCE) != 0)
+              ? (opts->pOptDesc + od->optActualIndex) : od;
 
         switch (OPTST_GET_ARGTYPE(od->fOptState)) {
         case OPARG_TYPE_NONE:
-            prt_no_arg_opt(fp, p, od);
+            prt_no_arg_opt(fp, vod, od, save_flags);
             break;
 
         case OPARG_TYPE_NUMERIC:
-            prt_entry(fp, p, VOIDP(p->optArg.argInt));
+            prt_entry(fp, vod, VOIDP(vod->optArg.argInt), save_flags);
             break;
 
         case OPARG_TYPE_STRING:
-            prt_str_arg(fp, p);
+            prt_str_arg(fp, vod, save_flags);
             break;
 
         case OPARG_TYPE_ENUMERATION:
-            prt_enum_arg(fp, p);
+            prt_enum_arg(fp, vod, save_flags);
             break;
 
         case OPARG_TYPE_MEMBERSHIP:
-            prt_set_arg(fp, p);
+            prt_set_arg(fp, vod, save_flags);
             break;
 
         case OPARG_TYPE_BOOLEAN:
-            prt_entry(fp, p, p->optArg.argBool ? "true" : "false");
+            prt_entry(fp, vod, vod->optArg.argBool ? "true" : "false", save_flags);
             break;
 
         case OPARG_TYPE_HIERARCHY:
-            prt_nested(fp, p);
+            prt_nested(fp, vod, save_flags);
             break;
 
         case OPARG_TYPE_FILE:
-            prt_file_arg(fp, p, opts);
+            prt_file_arg(fp, vod, opts, save_flags);
             break;
 
         default:
index da0033431affb004e7e07526a51ed4bdaf9996fe..b4bd5cb7e224f69005d37139f0e1075ec0669900 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-/* = = = START-STATIC-FORWARD = = = */
-static tSuccess
-must_arg(tOptions * opts, char * arg_txt, tOptState * pOS,
-         char ** opt_txt, uint32_t * opt_idx);
-
-static tSuccess
-maybe_arg(tOptions * opts, char * arg_txt, tOptState * pOS,
-          char ** opt_txt, uint32_t * opt_idx);
-
-static tSuccess
-short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS,
-             char ** opt_txt, uint32_t * opt_idx);
-/* = = = END-STATIC-FORWARD = = = */
-
 /*
  *  "must_arg" and "maybe_arg" are really similar.  The biggest
  *  difference is that "may" will consume the next argument only if it
@@ -178,7 +164,7 @@ short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS,
  *  If the program wants sorted options (separated operands and options),
  *  then this routine will to the trick.
  */
-LOCAL void
+static void
 optionSort(tOptions * opts)
 {
     char **  opt_txt;
index affe6b661fd514a8df7b4fa8885fcca8bf98ed25..39a328a85becc0eb644c3a8c23b6f588e4cb9f24 100644 (file)
@@ -11,7 +11,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -176,7 +176,7 @@ optionUnstackArg(tOptions * opts, tOptDesc * od)
  *  a pointer to the argument list structure.  It gets passed around
  *  as an opaque address.
  */
-LOCAL void
+static void
 addArgListEntry(void ** ppAL, void * entry)
 {
     tArgList * pAL = *(void **)ppAL;
index 5b4d11bb3b0ac87b2204eeed29dc3352447c17ee..bf46c0883e87e63af657f6b94b2df8426737fedf 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C11 <stdnoreturn.h>.
 
-   Copyright 2012-2015 Free Software Foundation, Inc.
+   Copyright 2012-2018 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -13,7 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
 
 /* The definition of _Noreturn is copied here.  */
 
-#if 1200 <= _MSC_VER
-/* Standard include files on this platform contain declarations like
-   "__declspec (noreturn) void abort (void);".  "#define noreturn
-   _Noreturn" would cause this declaration to be rewritten to the
-   invalid "__declspec (__declspec (noreturn)) void abort (void);".
-   Instead, define noreturn to empty, so that such declarations are
-   rewritten to "__declspec () void abort (void);", which is
-   equivalent to "void abort (void);"; this gives up on noreturn's
-   advice to the compiler but at least it is valid code.  */
+#if 1200 <= _MSC_VER || defined __CYGWIN__
+/* On MSVC, standard include files contain declarations like
+     __declspec (noreturn) void abort (void);
+   "#define noreturn _Noreturn" would cause this declaration to be rewritten
+   to the invalid
+     __declspec (__declspec (noreturn)) void abort (void);
+
+   Similarly, on Cygwin, standard include files contain declarations like
+     void __cdecl abort (void) __attribute__ ((noreturn));
+   "#define noreturn _Noreturn" would cause this declaration to be rewritten
+   to the invalid
+     void __cdecl abort (void) __attribute__ ((__attribute__ ((__noreturn__))));
+
+   Instead, define noreturn to empty, so that such declarations are rewritten to
+     __declspec () void abort (void);
+   or
+     void __cdecl abort (void) __attribute__ (());
+   respectively.  This gives up on noreturn's advice to the compiler but at
+   least it is valid code.  */
 # define noreturn /*empty*/
 #else
 # define noreturn _Noreturn
index e87a232d199dbe13af5134dc32bfb95c5f635789..53477d65f9d6d4c2b27e91817bdef629b5025a6e 100644 (file)
@@ -15,7 +15,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -37,7 +37,7 @@
  * together for a case independent comparison.  The mappings are
  * based upon ascii character sequences.
  */
-static unsigned char charmap[] = {
+  static unsigned char charmap[] = {
     NUL,  0x01, 0x02, 0x03,  0x04, 0x05, 0x06, '\a',
     '\b', '\t', NL,   '\v',  '\f', '\r', 0x0E, 0x0F,
     0x10, 0x11, 0x12, 0x13,  0x14, 0x15, 0x16, 0x17,
index 07c0bf10ebc3e22c682a4be8a3aa80e158de53e9..11093082e357b7948e97e96399dfbd687eb8d046 100644 (file)
@@ -9,7 +9,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -185,7 +185,11 @@ validate_mmap(char const * fname, int prot, int flags, tmap_info_t * mapinfo)
          *  then our updates will show in the file, so we must open with
          *  write access.
          */
-        int o_flag = FILE_WRITABLE(prot, flags) ? O_RDWR : O_RDONLY;
+        int o_flag =
+#ifdef _WIN32
+            O_BINARY |
+#endif
+            FILE_WRITABLE(prot, flags) ? O_RDWR : O_RDONLY;
 
         /*
          *  If you're not sharing the file and you are writing to it,
@@ -349,16 +353,15 @@ text_munmap(tmap_info_t * mi)
 #ifdef HAVE_MMAP
     (void)munmap(mi->txt_data, mi->txt_full_size);
 
-#else  /* don't HAVE_MMAP */
+#else // don't HAVE_MMAP
     /*
      *  IF the memory is writable *AND* it is not private (copy-on-write)
      *     *AND* the memory is "sharable" (seen by other processes)
      *  THEN rewrite the data.  Emulate mmap visibility.
      */
-    if (   FILE_WRITABLE(mi->txt_prot, mi->txt_flags)
-        && (lseek(mi->txt_fd, 0, SEEK_SET) >= 0) ) {
+    if (  FILE_WRITABLE(mi->txt_prot, mi->txt_flags)
+       && (lseek(mi->txt_fd, 0, SEEK_SET) >= 0) )
         write(mi->txt_fd, mi->txt_data, mi->txt_size);
-    }
 
     free(mi->txt_data);
 #endif /* HAVE_MMAP */
index 62e07541e54a5bf151c102eb7c693d370ef43548..debaa7aed340cccc195afe712318d4387abe9a88 100644 (file)
@@ -8,7 +8,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -90,8 +90,10 @@ optionTimeDate(tOptions * opts, tOptDesc * od)
 
         if (envptr == NULL) {
             static char const fmt[] = "DATEMSK=%s/datemsk";
-            envptr = AGALOC(sizeof(fmt) + strlen(opts->pzPkgDataDir), fmt);
-            sprintf(envptr, fmt, opts->pzPkgDataDir);
+            size_t sz = sizeof(fmt) + strlen(opts->pzPkgDataDir);
+            envptr = AGALOC(sz, fmt);
+            if (snprintf(envptr, sz, fmt, opts->pzPkgDataDir) >= (int)sz)
+                option_exits(EXIT_FAILURE);
 
             putenv(envptr);
         }
index 25550eaafeeae7eb80704032c75cb0ad285d7ad3..7489e3d526bb852074f27132180f99edaa53c924 100644 (file)
@@ -9,7 +9,7 @@
  *  This file defines the string_tokenize interface
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-#include <errno.h>
-#include <stdlib.h>
-
-#define cc_t   const unsigned char
-#define ch_t   unsigned char
-
-/* = = = START-STATIC-FORWARD = = = */
-static void
-copy_cooked(ch_t ** ppDest, char const ** ppSrc);
-
-static void
-copy_raw(ch_t ** ppDest, char const ** ppSrc);
-
-static token_list_t *
-alloc_token_list(char const * str);
-/* = = = END-STATIC-FORWARD = = = */
-
 static void
 copy_cooked(ch_t ** ppDest, char const ** ppSrc)
 {
@@ -57,7 +40,7 @@ copy_cooked(ch_t ** ppDest, char const ** ppSrc)
         case NUL:   *ppSrc = NULL; return;
         case '"':   goto done;
         case '\\':
-            pSrc += ao_string_cook_escape_char((const char *)pSrc, (char *)&ch, 0x7F);
+            pSrc += ao_string_cook_escape_char((char *)pSrc, (char *)&ch, 0x7F);
             if (ch == 0x7F)
                 break;
             /* FALLTHROUGH */
index c652da7f0bceac1c846cedace5f8c10147aa2169..8df3591e665977754180686005042afc3221b8f3 100644 (file)
@@ -18,7 +18,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
-/* = = = START-STATIC-FORWARD = = = */
-static unsigned int
-parse_usage_flags(ao_flag_names_t const * fnt, char const * txt);
-
-static inline bool
-do_gnu_usage(tOptions * pOpts);
-
-static inline bool
-skip_misuse_usage(tOptions * pOpts);
-
-static void
-print_offer_usage(tOptions * opts);
-
-static void
-print_usage_details(tOptions * opts, int exit_code);
-
-static void
-print_one_paragraph(char const * text, bool plain, FILE * fp);
-
-static void
-prt_conflicts(tOptions * opts, tOptDesc * od);
-
-static void
-prt_one_vendor(tOptions *    opts,  tOptDesc *   od,
-               arg_types_t * argtp, char const * usefmt);
-
-static void
-prt_vendor_opts(tOptions * opts, char const * title);
-
-static void
-prt_extd_usage(tOptions * opts, tOptDesc * od, char const * title);
-
-static void
-prt_ini_list(char const * const * papz, char const * ini_file,
-             char const * path_nm);
-
-static void
-prt_preamble(tOptions * opts, tOptDesc * od, arg_types_t * at);
-
-static void
-prt_one_usage(tOptions * opts, tOptDesc * od, arg_types_t * at);
-
-static void
-prt_opt_usage(tOptions * opts, int ex_code, char const * title);
-
-static void
-prt_prog_detail(tOptions * opts);
-
-static int
-setGnuOptFmts(tOptions * opts, char const ** ptxt);
-
-static int
-setStdOptFmts(tOptions * opts, char const ** ptxt);
-/* = = = END-STATIC-FORWARD = = = */
+#define GRAPH_CH(_ch) \
+    ((((unsigned)_ch) <= 0x7E) && (((unsigned)_ch) > ' '))
 
 /**
  * Parse the option usage flags string.  Any parsing problems yield
@@ -151,6 +99,7 @@ parse_usage_flags(ao_flag_names_t const * fnt, char const * txt)
         case ',':
             txt = SPN_WHITESPACE_CHARS(txt + 1);
             /* Something must follow the comma */
+            /* FALLTHROUGH */
 
         default:
             continue;
@@ -167,7 +116,7 @@ parse_usage_flags(ao_flag_names_t const * fnt, char const * txt)
  *                      environment variable is parsed.
  * @param[in,out] opts  the program option descriptor
  */
-LOCAL void
+static void
 set_usage_flags(tOptions * opts, char const * flg_txt)
 {
 #   define _aof_(_n, _f)   { sizeof(#_n)-1, _f, #_n },
@@ -304,7 +253,7 @@ print_offer_usage(tOptions * opts)
             help[0] = help[1] = '-';
             strncpy(help + 2, od->pz_Name, 20);
             break;
-        
+
         case 0:
             strncpy(help, od->pz_Name, 20);
             break;
@@ -320,7 +269,7 @@ print_offer_usage(tOptions * opts)
         case (OPTPROC_LONGOPT | OPTPROC_SHORTOPT):
             strcpy(help, "--help");
             break;
-        
+
         case 0:
             strcpy(help, "help");
             break;
@@ -351,8 +300,8 @@ print_usage_details(tOptions * opts, int exit_code)
             flen = setGnuOptFmts(opts, &pOptTitle);
             sprintf(line_fmt_buf, zFmtFmt, flen);
             fputc(NL, option_usage_fp);
-        }
-        else {
+
+        else {
             flen = setStdOptFmts(opts, &pOptTitle);
             sprintf(line_fmt_buf, zFmtFmt, flen);
 
@@ -438,7 +387,7 @@ print_one_paragraph(char const * text, bool plain, FILE * fp)
         AGFREE(t);
     }
 }
+
 /*=export_func  optionPrintParagraphs
  * private:
  *
@@ -565,7 +514,7 @@ optionPrintParagraphs(char const * text, bool plain, FILE * fp)
  *  If "exitCode" is "AO_EXIT_REQ_USAGE" (normally 64), then output will to
  *  to stdout and the actual exit code will be "EXIT_SUCCESS".
 =*/
-void
+noreturn void
 optionUsage(tOptions * opts, int usage_exit_code)
 {
     int exit_code = (usage_exit_code == AO_EXIT_REQ_USAGE)
@@ -617,7 +566,7 @@ optionUsage(tOptions * opts, int usage_exit_code)
         print_usage_details(opts, usage_exit_code);
     else
         print_offer_usage(opts);
-    
+
  flush_and_exit:
     fflush(option_usage_fp);
     if (ferror(option_usage_fp) != 0)
@@ -777,7 +726,7 @@ prt_vendor_opts(tOptions * opts, char const * title)
         do  {
             size_t l;
             if (  ((od->fOptState & not_vended_mask) != 0)
-               || IS_GRAPHIC_CHAR(od->optValue))
+               || GRAPH_CH(od->optValue))
                 continue;
 
             l = strlen(od->pz_Name);
@@ -795,7 +744,7 @@ prt_vendor_opts(tOptions * opts, char const * title)
 
     do  {
         if (  ((od->fOptState & not_vended_mask) != 0)
-           || IS_GRAPHIC_CHAR(od->optValue))
+           || GRAPH_CH(od->optValue))
             continue;
 
         prt_one_vendor(opts, od, &argTypes, vfmt);
@@ -1005,7 +954,7 @@ prt_preamble(tOptions * opts, tOptDesc * od, arg_types_t * at)
     if ((opts->fOptSet & OPTPROC_SHORTOPT) == 0)
         fputs(at->pzSpc, option_usage_fp);
 
-    else if (! IS_GRAPHIC_CHAR(od->optValue)) {
+    else if (! GRAPH_CH(od->optValue)) {
         if (  (opts->fOptSet & (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
            == (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
             fputc(' ', option_usage_fp);
@@ -1132,7 +1081,7 @@ prt_opt_usage(tOptions * opts, int ex_code, char const * title)
 
         /* Skip name only options when we have a vendor option */
         if (  ((opts->fOptSet & OPTPROC_VENDOR_OPT) != 0)
-           && (! IS_GRAPHIC_CHAR(od->optValue)))
+           && (! GRAPH_CH(od->optValue)))
             continue;
 
         /*
index 8a8de75dbe312682b1626cecc80a206c26b8e406..cd46be3a4d850eaf6f14f12ea6e90b52ad1601ac 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2018 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -90,7 +90,7 @@ emit_copy_full(tOptions * o, FILE * fp)
 
     else
         emit_first_line(fp, o->pzUsageTitle, NULL, NULL);
-    
+
     if (HAS_pzPkgDataDir(o) && (o->pzPackager != NULL)) {
         fputc(NL, fp);
         fputs(o->pzPackager, fp);
@@ -119,7 +119,7 @@ emit_copy_note(tOptions * opts, FILE * fp)
 
     fputc(NL, fp);
     fprintf(fp, zao_ver_fmt, optionVersion());
-    
+
     if (HAS_pzPkgDataDir(opts) && (opts->pzPackager != NULL)) {
         fputc(NL, fp);
         fputs(opts->pzPackager, fp);
@@ -153,7 +153,10 @@ print_ver(tOptions * opts, tOptDesc * od, FILE * fp, bool call_exit)
 
         ch = od->optArg.argString[0];
 
-    else {
+    else if (OPTST_GET_ARGTYPE(od->fOptState) == OPARG_TYPE_STATIC) {
+        ch = od->optArg.argString[0];
+
+    } else {
         set_usage_flags(opts, NULL);
         ch = (opts->fOptSet & OPTPROC_GNUUSAGE) ? 'c' : 'v';
     }
index 2dbd4cc1627527362c104557228485f4cfecdc24..7e8f21f7193791dbece668e50ea7c6592bafb590 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.c)
  *
- *  It has been AutoGen-ed  June 23, 2020 at 02:21:03 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:33 PM by AutoGen 5.18.16
  *  From the definitions    ntp-keygen-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This source file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntp-keygen program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
 #define OPTION_CODE_COMPILE 1
 #include "ntp-keygen-opts.h"
 #include <sys/types.h>
+#include <sys/stat.h>
 
+#include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <errno.h>
+#include <string.h>
+#include <unistd.h>
 
 #ifdef  __cplusplus
 extern "C" {
@@ -73,7 +77,7 @@ extern FILE * option_usage_fp;
  */
 static char const ntp_keygen_opt_strs[2442] =
 /*     0 */ "ntp-keygen (ntp) 4.2.8p15\n"
-            "Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+            "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
@@ -979,7 +983,7 @@ static char const * const apzHomeList[3] = {
 #define zDetail         (NULL)
 /** The full version string for ntp-keygen. */
 #define zFullVersion    (ntp_keygen_opt_strs+2416)
-/* extracted from optcode.tlib near line 364 */
+/* extracted from optcode.tlib near line 342 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -1011,7 +1015,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od)
     ex_code = NTP_KEYGEN_EXIT_SUCCESS;
     optionUsage(&ntp_keygenOptions, ex_code);
     /* NOTREACHED */
-    exit(1);
+    exit(NTP_KEYGEN_EXIT_FAILURE);
     (void)opts;
     (void)od;
 }
@@ -1299,19 +1303,19 @@ static void bogus_function(void) {
      extract the correct strings.  These strings are actually referenced
      by a field name in the ntp_keygenOptions structure noted in the
      comments below.  The literal text is defined in ntp_keygen_opt_strs.
-   
+
      NOTE: the strings below are segmented with respect to the source string
      ntp_keygen_opt_strs.  The strings above are handed off for translation
      at run time a paragraph at a time.  Consequently, they are presented here
      for translation a paragraph at a time.
-   
+
      ALSO: often the description for an option will reference another option
      by name.  These are set off with apostrophe quotes (I hope).  Do not
      translate option names.
    */
   /* referenced via ntp_keygenOptions.pzCopyright */
   puts(_("ntp-keygen (ntp) 4.2.8p15\n\
-Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -1426,234 +1430,230 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
   /* LIBOPTS-MESSAGES: */
 #line 67 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 93 "../autoopts.c"
+#line 89 "../autoopts.c"
   puts(_("allocation of %d bytes failed\n"));
-#line 53 "../init.c"
+#line 48 "../init.c"
   puts(_("AutoOpts function called without option descriptor\n"));
-#line 86 "../init.c"
+#line 81 "../init.c"
   puts(_("\tThis exceeds the compiled library version:  "));
-#line 84 "../init.c"
+#line 79 "../init.c"
   puts(_("Automated Options Processing Error!\n"
        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
-#line 80 "../autoopts.c"
+#line 78 "../autoopts.c"
   puts(_("realloc of %d bytes at 0x%p failed\n"));
-#line 88 "../init.c"
+#line 83 "../init.c"
   puts(_("\tThis is less than the minimum library version:  "));
 #line 121 "../version.c"
   puts(_("Automated Options version %s\n"
-       "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
-#line 87 "../makeshell.c"
+       "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
+#line 49 "../makeshell.c"
   puts(_("(AutoOpts bug):  %s.\n"));
 #line 90 "../reset.c"
   puts(_("optionResetOpt() called, but reset-option not configured"));
-#line 292 "../usage.c"
+#line 241 "../usage.c"
   puts(_("could not locate the 'help' option"));
-#line 336 "../autoopts.c"
+#line 330 "../autoopts.c"
   puts(_("optionProcess() was called with invalid data"));
-#line 748 "../usage.c"
+#line 697 "../usage.c"
   puts(_("invalid argument type specified"));
-#line 598 "../find.c"
+#line 568 "../find.c"
   puts(_("defaulted to option with optional arg"));
 #line 76 "../alias.c"
   puts(_("aliasing option is out of range."));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
-#line 108 "../find.c"
+#line 78 "../find.c"
   puts(_("  The following options match:\n"));
-#line 293 "../find.c"
+#line 263 "../find.c"
   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
 #line 161 "../check.c"
   puts(_("%s: Command line arguments required\n"));
 #line 43 "../alias.c"
   puts(_("%d %s%s options allowed\n"));
-#line 94 "../makeshell.c"
+#line 56 "../makeshell.c"
   puts(_("%s error %d (%s) calling %s for '%s'\n"));
-#line 306 "../makeshell.c"
+#line 268 "../makeshell.c"
   puts(_("interprocess pipe"));
-#line 168 "../version.c"
+#line 171 "../version.c"
   puts(_("error: version option argument '%c' invalid.  Use:\n"
        "\t'v' - version only\n"
        "\t'c' - version and copyright\n"
        "\t'n' - version and full copyright notice\n"));
 #line 58 "../check.c"
   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
-#line 217 "../find.c"
+#line 187 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
-#line 430 "../find.c"
+#line 400 "../find.c"
   puts(_("%s: The '%s' option has been disabled."));
 #line 38 "../alias.c"
   puts(_("-equivalence"));
-#line 469 "../find.c"
+#line 439 "../find.c"
   puts(_("%s: illegal option -- %c\n"));
 #line 110 "../reset.c"
   puts(_("%s: illegal option -- %c\n"));
-#line 271 "../find.c"
+#line 241 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 755 "../find.c"
+#line 740 "../find.c"
   puts(_("%s: illegal option -- %s\n"));
 #line 118 "../reset.c"
   puts(_("%s: illegal option -- %s\n"));
-#line 335 "../find.c"
+#line 305 "../find.c"
   puts(_("%s: unknown vendor extension option -- %s\n"));
-#line 159 "../enum.c"
+#line 135 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 169 "../enum.c"
+#line 145 "../enum.c"
   puts(_("  or an integer from %d through %d\n"));
-#line 747 "../usage.c"
+#line 696 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 1081 "../usage.c"
+#line 1030 "../usage.c"
   puts(_("%s error:  invalid option descriptor for %s\n"));
-#line 385 "../find.c"
+#line 355 "../find.c"
   puts(_("%s: invalid option name: %s\n"));
-#line 527 "../find.c"
+#line 497 "../find.c"
   puts(_("%s: The '%s' option requires an argument.\n"));
-#line 156 "../autoopts.c"
+#line 150 "../autoopts.c"
   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
        "\t'%s' and '%s'."));
 #line 94 "../check.c"
   puts(_("%s error:  The %s option is required\n"));
-#line 632 "../find.c"
+#line 602 "../find.c"
   puts(_("%s: The '%s' option cannot have an argument.\n"));
 #line 151 "../check.c"
   puts(_("%s: Command line arguments are not allowed.\n"));
-#line 535 "../save.c"
+#line 568 "../save.c"
   puts(_("error %d (%s) creating %s\n"));
-#line 234 "../enum.c"
+#line 210 "../enum.c"
   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
 #line 93 "../reset.c"
   puts(_("%s error: The '%s' option requires an argument.\n"));
-#line 184 "../save.c"
+#line 122 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
-#line 238 "../save.c"
+#line 175 "../save.c"
   puts(_("error %d (%s) stat-ing %s\n"));
 #line 143 "../restore.c"
   puts(_("%s error: no saved option state\n"));
-#line 231 "../autoopts.c"
+#line 225 "../autoopts.c"
   puts(_("'%s' is not a command line option.\n"));
-#line 111 "../time.c"
+#line 113 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
-#line 132 "../save.c"
-  puts(_("'%s' not defined\n"));
 #line 50 "../time.c"
   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
 #line 92 "../check.c"
   puts(_("%s error:  The %s option must appear %d times.\n"));
-#line 164 "../numeric.c"
+#line 165 "../numeric.c"
   puts(_("%s error:  '%s' is not a recognizable number.\n"));
-#line 200 "../enum.c"
+#line 176 "../enum.c"
   puts(_("%s error:  %s exceeds %s keyword count\n"));
-#line 330 "../usage.c"
+#line 279 "../usage.c"
   puts(_("Try '%s %s' for more information.\n"));
 #line 45 "../alias.c"
   puts(_("one %s%s option allowed\n"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("standard output"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard output"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard output"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard output"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard output"));
-#line 274 "../usage.c"
+#line 223 "../usage.c"
   puts(_("standard error"));
-#line 415 "../usage.c"
+#line 364 "../usage.c"
   puts(_("standard error"));
-#line 625 "../usage.c"
+#line 574 "../usage.c"
   puts(_("standard error"));
-#line 175 "../version.c"
+#line 178 "../version.c"
   puts(_("standard error"));
-#line 208 "../makeshell.c"
+#line 170 "../makeshell.c"
   puts(_("write"));
-#line 943 "../makeshell.c"
+#line 905 "../makeshell.c"
   puts(_("write"));
-#line 273 "../usage.c"
+#line 222 "../usage.c"
   puts(_("write"));
-#line 414 "../usage.c"
+#line 363 "../usage.c"
   puts(_("write"));
-#line 624 "../usage.c"
+#line 573 "../usage.c"
   puts(_("write"));
-#line 174 "../version.c"
+#line 177 "../version.c"
   puts(_("write"));
 #line 60 "../numeric.c"
   puts(_("%s error:  %s option value %ld is out of range.\n"));
 #line 44 "../check.c"
   puts(_("%s error:  %s option requires the %s option\n"));
-#line 131 "../save.c"
+#line 121 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 183 "../save.c"
+#line 174 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 237 "../save.c"
+#line 193 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 256 "../save.c"
-  puts(_("%s warning:  cannot save options - %s not regular file\n"));
-#line 534 "../save.c"
+#line 567 "../save.c"
   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   /* END-LIBOPTS-MESSAGES */
 
   /* USAGE-TEXT: */
-#line 873 "../usage.c"
+#line 822 "../usage.c"
   puts(_("\t\t\t\t- an alternate for '%s'\n"));
-#line 1148 "../usage.c"
+#line 1097 "../usage.c"
   puts(_("Version, usage and configuration options:"));
-#line 924 "../usage.c"
+#line 873 "../usage.c"
   puts(_("\t\t\t\t- default option for unnamed options\n"));
-#line 837 "../usage.c"
+#line 786 "../usage.c"
   puts(_("\t\t\t\t- disabled as '--%s'\n"));
-#line 1117 "../usage.c"
+#line 1066 "../usage.c"
   puts(_(" --- %-14s %s\n"));
-#line 1115 "../usage.c"
+#line 1064 "../usage.c"
   puts(_("This option has been disabled"));
-#line 864 "../usage.c"
+#line 813 "../usage.c"
   puts(_("\t\t\t\t- enabled by default\n"));
 #line 40 "../alias.c"
   puts(_("%s error:  only "));
-#line 1194 "../usage.c"
+#line 1143 "../usage.c"
   puts(_(" - examining environment variables named %s_*\n"));
 #line 168 "../file.c"
   puts(_("\t\t\t\t- file must not pre-exist\n"));
 #line 172 "../file.c"
   puts(_("\t\t\t\t- file must pre-exist\n"));
-#line 380 "../usage.c"
+#line 329 "../usage.c"
   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
        "hyphen and the flag character.\n"));
-#line 921 "../makeshell.c"
+#line 882 "../makeshell.c"
   puts(_("\n"
        "= = = = = = = =\n\n"
        "This incarnation of genshell will produce\n"
        "a shell script to parse the options for %s:\n\n"));
-#line 166 "../enum.c"
+#line 142 "../enum.c"
   puts(_("  or an integer mask with any of the lower %d bits set\n"));
-#line 897 "../usage.c"
+#line 846 "../usage.c"
   puts(_("\t\t\t\t- is a set membership option\n"));
-#line 918 "../usage.c"
+#line 867 "../usage.c"
   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
-#line 382 "../usage.c"
+#line 331 "../usage.c"
   puts(_("Options are specified by single or double hyphens and their name.\n"));
-#line 904 "../usage.c"
+#line 853 "../usage.c"
   puts(_("\t\t\t\t- may appear multiple times\n"));
-#line 891 "../usage.c"
+#line 840 "../usage.c"
   puts(_("\t\t\t\t- may not be preset\n"));
-#line 1309 "../usage.c"
+#line 1258 "../usage.c"
   puts(_("   Arg Option-Name    Description\n"));
-#line 1245 "../usage.c"
+#line 1194 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1303 "../usage.c"
+#line 1252 "../usage.c"
   puts(_("  Flg Arg Option-Name    Description\n"));
-#line 1304 "../usage.c"
+#line 1253 "../usage.c"
   puts(_(" %3s %s"));
-#line 1310 "../usage.c"
+#line 1259 "../usage.c"
   puts(_(" %3s %s"));
-#line 387 "../usage.c"
+#line 336 "../usage.c"
   puts(_("The '-#<number>' option may omit the hash char\n"));
-#line 383 "../usage.c"
+#line 332 "../usage.c"
   puts(_("All arguments are named options.\n"));
-#line 971 "../usage.c"
+#line 920 "../usage.c"
   puts(_(" - reading file %s"));
-#line 409 "../usage.c"
+#line 358 "../usage.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
 #line 100 "../version.c"
@@ -1662,17 +1662,17 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
 #line 129 "../version.c"
   puts(_("\n"
        "Please send bug reports to:  <%s>\n"));
-#line 903 "../usage.c"
+#line 852 "../usage.c"
   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
-#line 944 "../usage.c"
+#line 893 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 1192 "../usage.c"
+#line 1141 "../usage.c"
   puts(_("\n"
        "The following option preset mechanisms are supported:\n"));
-#line 682 "../usage.c"
+#line 631 "../usage.c"
   puts(_("prohibits these options:\n"));
-#line 677 "../usage.c"
+#line 626 "../usage.c"
   puts(_("prohibits the option '%s'\n"));
 #line 81 "../numeric.c"
   puts(_("%s%ld to %ld"));
@@ -1690,28 +1690,28 @@ Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
 #line 77 "../numeric.c"
   puts(_("%sless than or equal to %ld"));
-#line 390 "../usage.c"
+#line 339 "../usage.c"
   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
-#line 652 "../usage.c"
+#line 601 "../usage.c"
   puts(_("requires the option '%s'\n"));
-#line 655 "../usage.c"
+#line 604 "../usage.c"
   puts(_("requires these options:\n"));
-#line 1321 "../usage.c"
+#line 1270 "../usage.c"
   puts(_("   Arg Option-Name   Req?  Description\n"));
-#line 1315 "../usage.c"
+#line 1264 "../usage.c"
   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
-#line 167 "../enum.c"
+#line 143 "../enum.c"
   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
        "will set them all.  Multiple entries may be passed as an option\n"
        "argument list.\n"));
-#line 910 "../usage.c"
+#line 859 "../usage.c"
   puts(_("\t\t\t\t- may appear up to %d times\n"));
-#line 77 "../enum.c"
+#line 52 "../enum.c"
   puts(_("The valid \"%s\" option keywords are:\n"));
-#line 1152 "../usage.c"
+#line 1101 "../usage.c"
   puts(_("The next option supports vendor supported extra options:"));
-#line 773 "../usage.c"
+#line 722 "../usage.c"
   puts(_("These additional options are:"));
   /* END-USAGE-TEXT */
 }
index e17412417f9240a74579913f62df8063b287cdb1..63861cb345f69305ce375f69cf2378cb641d6e7d 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.h)
  *
- *  It has been AutoGen-ed  June 23, 2020 at 02:21:03 AM by AutoGen 5.18.5
+ *  It has been AutoGen-ed  March  4, 2023 at 09:25:32 PM by AutoGen 5.18.16
  *  From the definitions    ntp-keygen-opts.def
  *  and the template file   options
  *
- * Generated from AutoOpts 41:1:16 templates.
+ * Generated from AutoOpts 42:1:17 templates.
  *
  *  AutoOpts is a copyrighted work.  This header file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -18,7 +18,7 @@
  * The ntp-keygen program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
+ *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -45,6 +45,8 @@
 #define AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD 1
 #include "config.h"
 #include <autoopts/options.h>
+#include <stdarg.h>
+#include <stdnoreturn.h>
 
 /**
  *  Ensure that the library used for compiling this generated header is at
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 167937
+#define AO_TEMPLATE_VERSION 172033
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
   Choke Me.
 #endif
 
+#if GCC_VERSION > 40400
+#define NOT_REACHED __builtin_unreachable();
+#else
+#define NOT_REACHED
+#endif
+
 /**
  *  Enumeration of each option type for ntp-keygen
  */
@@ -378,6 +386,7 @@ static inline char* aoGetsText(char const* pz) {
 # endif
 #endif  /* ENABLE_NLS */
 
+
 #ifdef  __cplusplus
 }
 #endif