]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Upgrade to autogen-5.16 and libopts-36.4.11
authorHarlan Stenn <stenn@ntp.org>
Tue, 17 Apr 2012 08:54:04 +0000 (01:54 -0700)
committerHarlan Stenn <stenn@ntp.org>
Tue, 17 Apr 2012 08:54:04 +0000 (01:54 -0700)
bk: 4f8d2facjXQFZt7OQbBJvDlas-hE1A

68 files changed:
ChangeLog
ntpd/Makefile.am
ntpd/invoke-ntpd.menu [moved from ntpd/ntpd-opts.menu with 100% similarity]
ntpd/invoke-ntpd.texi [new file with mode: 0644]
ntpd/ntpd-opts.texi [deleted file]
ntpdc/Makefile.am
ntpdc/invoke-ntpdc.menu [moved from ntpdc/ntpdc-opts.menu with 100% similarity]
ntpdc/invoke-ntpdc.texi [new file with mode: 0644]
ntpdc/ntpdc-opts.texi [deleted file]
ntpdc/ntpdc.texi
ntpq/Makefile.am
ntpq/invoke-ntpq.menu [moved from ntpq/ntpq-opts.menu with 100% similarity]
ntpq/invoke-ntpq.texi [new file with mode: 0644]
ntpq/ntpq-opts.texi [deleted file]
ntpsnmpd/Makefile.am
ntpsnmpd/invoke-ntpsnmpd.menu [moved from ntpsnmpd/ntpsnmpd-opts.menu with 100% similarity]
ntpsnmpd/invoke-ntpsnmpd.texi [new file with mode: 0644]
ntpsnmpd/ntpsnmpd-opts.texi [deleted file]
scripts/Makefile.am
scripts/invoke-ntp-wait.menu [moved from scripts/ntp-wait-opts.menu with 100% similarity]
scripts/invoke-ntp-wait.texi [new file with mode: 0644]
scripts/ntp-wait-opts.texi [deleted file]
scripts/ntp-wait.texi
sntp/Makefile.am
sntp/invoke-sntp.menu [moved from sntp/sntp-opts.menu with 100% similarity]
sntp/invoke-sntp.texi [moved from sntp/sntp-opts.texi with 58% similarity]
sntp/libopts/Makefile.am
sntp/libopts/ag-char-map.h
sntp/libopts/ao-strs.c
sntp/libopts/ao-strs.h [new file with mode: 0644]
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/configfile.c
sntp/libopts/cook.c
sntp/libopts/enum.c
sntp/libopts/env.c
sntp/libopts/find.c
sntp/libopts/genshell.c
sntp/libopts/genshell.h
sntp/libopts/libopts.c
sntp/libopts/load.c
sntp/libopts/m4/libopts.m4
sntp/libopts/makeshell.c
sntp/libopts/nested.c
sntp/libopts/parse-duration.c
sntp/libopts/pgusage.c
sntp/libopts/proto.h
sntp/libopts/putshell.c
sntp/libopts/reset.c
sntp/libopts/save.c
sntp/libopts/stack.c
sntp/libopts/streqvcmp.c
sntp/libopts/tokenize.c
sntp/libopts/usage.c
sntp/libopts/value-type.h
sntp/libopts/xat-attribute.h
sntp/sntp.texi
util/Makefile.am
util/invoke-ntp-keygen.menu [moved from util/ntp-keygen-opts.menu with 100% similarity]
util/invoke-ntp-keygen.texi [new file with mode: 0644]
util/ntp-keygen-opts.texi [deleted file]

index 0fb08fa61bcc501b7d4cd6beb6c93406dadcfd0f..41be3f2ed46ba4ff26f1377b0949d34972de450a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* Upgrade to autogen-5.16 and libopts-36.4.11.
 * Upgrade to autogen-5.15.
 (4.2.7p271) 2012/04/11 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 1122] openssl detection via pkg-config fails when no additional
index 67ff48de53c1bfc977bf609bbfcf26cd52b857a7..fd9109b5b0ce33f7fadac2acbdfb94df7fdbe457 100644 (file)
@@ -114,6 +114,8 @@ CLEANFILES =                        \
 
 EXTRA_DIST =                   \
        complete.conf           \
+       invoke-ntpd.menu        \
+       invoke-ntpd.texi        \
        keyword-gen-utd         \
        ntp.conf.5man           \
        ntp.conf.5mdoc          \
@@ -124,8 +126,6 @@ EXTRA_DIST =                        \
        ntp.keys.man.in         \
        ntp.keys.mdoc.in        \
        ntpd-opts.def           \
-       ntpd-opts.menu          \
-       ntpd-opts.texi          \
        ntpd.1ntpdman           \
        ntpd.1ntpdmdoc          \
        ntpd.man.in             \
@@ -140,12 +140,12 @@ EXTRA_DIST =                      \
 check_PROGRAMS = @MAKE_CHECK_Y2K@
 EXTRA_PROGRAMS = check_y2k keyword-gen ntpd ntpdsim
 noinst_DATA =                          \
+       $(srcdir)/invoke-ntpd.menu      \
+       $(srcdir)/invoke-ntpd.texi      \
        $(srcdir)/ntp.conf.man.in       \
        $(srcdir)/ntp.conf.mdoc.in      \
        $(srcdir)/ntp.keys.man.in       \
        $(srcdir)/ntp.keys.mdoc.in      \
-       $(srcdir)/ntpd-opts.menu        \
-       $(srcdir)/ntpd-opts.texi        \
        $(srcdir)/ntpd.man.in           \
        $(srcdir)/ntpd.mdoc.in          \
        $(NULL)
@@ -346,11 +346,11 @@ ntp.keys.5: $(srcdir)/ntp.keys.$(MANTAGFMT).in $(top_builddir)/config.status
 
 ###
 
-$(srcdir)/ntpd-opts.menu: $(srcdir)/ntpd-opts.texi
+$(srcdir)/invoke-ntpd.menu: $(srcdir)/invoke-ntpd.texi
        @: do-nothing action to avoid default SCCS get, .menu built with .texi
        
-$(srcdir)/ntpd-opts.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
-       $(run_ag) -Taginfo.tpl -DLEVEL=section ntpd-opts.def
+$(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
+       $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpd-opts.def
        $(top_srcdir)/scripts/check--help $@
 
 $(PROGRAMS): $(LDADD)
similarity index 100%
rename from ntpd/ntpd-opts.menu
rename to ntpd/invoke-ntpd.menu
diff --git a/ntpd/invoke-ntpd.texi b/ntpd/invoke-ntpd.texi
new file mode 100644 (file)
index 0000000..25c8f4a
--- /dev/null
@@ -0,0 +1,1055 @@
+@node ntpd Invocation
+@section Invoking ntpd
+@pindex ntpd
+@cindex NTP daemon program
+@ignore
+# 
+# EDIT THIS FILE WITH CAUTION  (invoke-ntpd.texi)
+# 
+# It has been AutoGen-ed  April 14, 2012 at 12:21:50 AM by AutoGen 5.16pre18
+# From the definitions    ntpd-opts.def
+# and the template file   agtexi-cmd.tpl
+@end ignore
+
+
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpd} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntpd usage::                  ntpd help/usage (-?)
+* ntpd ipv4::                   ipv4 option (-4)
+* ntpd ipv6::                   ipv6 option (-6)
+* ntpd authreq::                authreq option (-a)
+* ntpd authnoreq::              authnoreq option (-A)
+* ntpd configfile::             configfile option (-c)
+* ntpd debug-level::            debug-level option (-d)
+* ntpd set-debug-level::        set-debug-level option (-D)
+* ntpd driftfile::              driftfile option (-f)
+* ntpd panicgate::              panicgate option (-g)
+* ntpd jaildir::                jaildir option (-i)
+* ntpd interface::              interface option (-I)
+* ntpd keyfile::                keyfile option (-k)
+* ntpd logfile::                logfile option (-l)
+* ntpd novirtualips::           novirtualips option (-L)
+* ntpd modifymmtimer::          modifymmtimer option (-M)
+* ntpd nice::                   nice option (-N)
+* ntpd pidfile::                pidfile option (-p)
+* ntpd priority::               priority option (-P)
+* ntpd quit::                   quit option (-q)
+* ntpd propagationdelay::       propagationdelay option (-r)
+* ntpd saveconfigquit::         saveconfigquit option
+* ntpd statsdir::               statsdir option (-s)
+* ntpd trustedkey::             trustedkey option (-t)
+* ntpd user::                   user option (-u)
+* ntpd updateinterval::         updateinterval option (-U)
+* ntpd wait-sync::              wait-sync option (-w)
+* ntpd slew::                   slew option (-x)
+* ntpd usepcc::                 usepcc option
+* ntpd pccfreq::                pccfreq option
+* ntpd config::                 presetting/configuring ntpd
+* ntpd exit status::            exit status
+* ntpd Description::            Description
+* ntpd Usage::                  Usage
+* ntpd Files::                  Files
+* ntpd See Also::               See Also
+* ntpd Bugs::                   Bugs
+* ntpd Notes::                  Notes
+@end menu
+
+@node ntpd usage
+@subsection ntpd help/usage (-?)
+@cindex ntpd help
+
+This is the automatically generated usage text for ntpd.
+The text printed is the same whether for the @code{help} option (-?) or the @code{more-help} option (-!).  @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function.  The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}.  Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntpd - NTP daemon program - Ver. 4.2.7p271
+USAGE:  ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
+                [ <server1> ... <serverN> ]
+  Flg Arg Option-Name    Description
+   -4 no  ipv4           Force IPv4 DNS name resolution
+                                - prohibits these options:
+                                ipv6
+   -6 no  ipv6           Force IPv6 DNS name resolution
+                                - prohibits these options:
+                                ipv4
+   -a no  authreq        Require crypto authentication
+                                - prohibits these options:
+                                authnoreq
+   -A no  authnoreq      Do not require crypto authentication
+                                - prohibits these options:
+                                authreq
+   -b no  bcastsync      Allow us to sync to broadcast servers
+   -c Str configfile     configuration file name
+   -d no  debug-level    Increase output debug message level
+                                - may appear multiple times
+   -D Str set-debug-level Set the output debug message level
+                                - may appear multiple times
+   -f Str driftfile      frequency drift file name
+   -g no  panicgate      Allow the first adjustment to be Big
+                                - may appear multiple times
+   -i --- jaildir        built without --enable-clockctl or --enable-linuxcaps
+   -I Str interface      Listen on an interface name or address
+                                - may appear multiple times
+   -k Str keyfile        path to symmetric keys
+   -l Str logfile        path to the log file
+   -L no  novirtualips   Do not listen to virtual interfaces
+   -n no  nofork         Do not fork
+                                - prohibits these options:
+                                wait-sync
+   -N no  nice           Run at high priority
+   -p Str pidfile        path to the PID file
+   -P Num priority       Process priority
+   -q no  quit           Set the time and quit
+                                - prohibits these options:
+                                saveconfigquit
+                                wait-sync
+   -r Str propagationdelay Broadcast/propagation delay
+      Str saveconfigquit Save parsed configuration and quit
+                                - prohibits these options:
+                                quit
+                                wait-sync
+   -s Str statsdir       Statistics file location
+   -t Str trustedkey     Trusted key number
+                                - may appear multiple times
+   -u --- user           built without --enable-clockctl or --enable-linuxcaps
+   -U Num updateinterval interval in seconds between scans for new or dropped interfaces
+      Str var            make ARG an ntp variable (RW)
+                                - may appear multiple times
+      Str dvar           make ARG an ntp variable (RW|DEF)
+                                - may appear multiple times
+   -w Num wait-sync      Seconds to wait for first clock sync
+                                - prohibits these options:
+                                nofork
+                                quit
+                                saveconfigquit
+   -x no  slew           Slew up to 600 seconds
+   -! opt version        Output version information and exit
+   -? no  help           Display extended usage information and exit
+   -! no  more-help      Extended usage information passed thru pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+
+The following option preset mechanisms are supported:
+ - examining environment variables named NTPD_*
+
+please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
+@end example
+@exampleindent 4
+
+@node ntpd ipv4
+@subsection ipv4 option (-4)
+@cindex ntpd-ipv4
+
+This is the ``force ipv4 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv6.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+@node ntpd ipv6
+@subsection ipv6 option (-6)
+@cindex ntpd-ipv6
+
+This is the ``force ipv6 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv4.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+@node ntpd authreq
+@subsection authreq option (-a)
+@cindex ntpd-authreq
+
+This is the ``require crypto authentication'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+authnoreq.
+@end itemize
+
+Require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is the default.
+@node ntpd authnoreq
+@subsection authnoreq option (-A)
+@cindex ntpd-authnoreq
+
+This is the ``do not require crypto authentication'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+authreq.
+@end itemize
+
+Do not require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is almost never a good idea.
+@node ntpd configfile
+@subsection configfile option (-c)
+@cindex ntpd-configfile
+
+This is the ``configuration file name'' option.
+This option takes an argument string.
+The name and path of the configuration file,
+/etc/ntp.conf
+by default.
+@node ntpd debug-level
+@subsection debug-level option (-d)
+@cindex ntpd-debug-level
+
+This is the ``increase output debug message level'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@item
+must be compiled in by defining @code{DEBUG} during the compilation.
+@end itemize
+
+Increase the debugging message output level.
+@node ntpd set-debug-level
+@subsection set-debug-level option (-D)
+@cindex ntpd-set-debug-level
+
+This is the ``set the output debug message level'' option.
+This option takes an argument string.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@item
+must be compiled in by defining @code{DEBUG} during the compilation.
+@end itemize
+
+Set the output debugging level.  Can be supplied multiple times,
+but each overrides the previous value(s).
+@node ntpd driftfile
+@subsection driftfile option (-f)
+@cindex ntpd-driftfile
+
+This is the ``frequency drift file name'' option.
+This option takes an argument string.
+The name and path of the frequency file,
+/etc/ntp.drift
+by default.
+This is the same operation as the
+driftfile driftfile
+configuration specification in the 
+/etc/ntp.conf
+file.
+@node ntpd panicgate
+@subsection panicgate option (-g)
+@cindex ntpd-panicgate
+
+This is the ``allow the first adjustment to be big'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+Normally,
+ntpd
+exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
+ntpd
+will exit with a message to the system log. This option can be used with the
+-q
+and
+-x
+options.
+See the
+tinker
+configuration file directive for other options.
+@node ntpd jaildir
+@subsection jaildir option (-i)
+@cindex ntpd-jaildir
+
+This is the ``jail directory'' option.
+This option takes an argument string.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{HAVE_DROPROOT} during the compilation.
+@end itemize
+
+Chroot the server to the directory
+jaildir
+.
+This option also implies that the server attempts to drop root privileges at startup.
+You may need to also specify a
+-u
+option.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+--enable-clockctl
+) and Linux (configure with
+--enable-linuxcaps
+).
+@node ntpd interface
+@subsection interface option (-I)
+@cindex ntpd-interface
+
+This is the ``listen on an interface name or address'' option.
+This option takes an argument string @file{iface}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+Open the network address given, or all the addresses associated with the
+given interface name.  This option may appear multiple times.  This option
+also implies not opening other addresses, except wildcard and localhost.
+This option is deprecated. Please consider using the configuration file
+interface command, which is more versatile. 
+@node ntpd keyfile
+@subsection keyfile option (-k)
+@cindex ntpd-keyfile
+
+This is the ``path to symmetric keys'' option.
+This option takes an argument string.
+Specify the name and path of the symmetric key file.
+/etc/ntp.keys
+is the default.
+This is the same operation as the
+keys keyfile
+configuration file directive.
+@node ntpd logfile
+@subsection logfile option (-l)
+@cindex ntpd-logfile
+
+This is the ``path to the log file'' option.
+This option takes an argument string.
+Specify the name and path of the log file.
+The default is the system log file.
+This is the same operation as the
+logfile logfile
+configuration file directive.
+@node ntpd novirtualips
+@subsection novirtualips option (-L)
+@cindex ntpd-novirtualips
+
+This is the ``do not listen to virtual interfaces'' option.
+Do not listen to virtual interfaces, defined as those with
+names containing a colon.  This option is deprecated.  Please
+consider using the configuration file interface command, which
+is more versatile.
+@node ntpd modifymmtimer
+@subsection modifymmtimer option (-M)
+@cindex ntpd-modifymmtimer
+
+This is the ``modify multimedia timer (windows only)'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{SYS_WINNT} during the compilation.
+@end itemize
+
+Set the Windows Multimedia Timer to highest resolution.  This
+ensures the resolution does not change while ntpd is running,
+avoiding timekeeping glitches associated with changes.
+@node ntpd nice
+@subsection nice option (-N)
+@cindex ntpd-nice
+
+This is the ``run at high priority'' option.
+To the extent permitted by the operating system, run
+ntpd
+at the highest priority.
+@node ntpd pidfile
+@subsection pidfile option (-p)
+@cindex ntpd-pidfile
+
+This is the ``path to the pid file'' option.
+This option takes an argument string.
+Specify the name and path of the file used to record
+ntpd's
+process ID.
+This is the same operation as the
+pidfile pidfile
+configuration file directive.
+@node ntpd priority
+@subsection priority option (-P)
+@cindex ntpd-priority
+
+This is the ``process priority'' option.
+This option takes an argument number.
+To the extent permitted by the operating system, run
+ntpd
+at the specified
+sched_setscheduler(SCHED_FIFO)
+priority.
+@node ntpd quit
+@subsection quit option (-q)
+@cindex ntpd-quit
+
+This is the ``set the time and quit'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+saveconfigquit, wait-sync.
+@end itemize
+
+ntpd
+will not daemonize and will exit after the clock is first
+synchronized.  This behavior mimics that of the
+ntpdate
+program, which will soon be replaced with a shell script.
+The
+-g
+and
+-x
+options can be used with this option.
+Note: The kernel time discipline is disabled with this option.
+@node ntpd propagationdelay
+@subsection propagationdelay option (-r)
+@cindex ntpd-propagationdelay
+
+This is the ``broadcast/propagation delay'' option.
+This option takes an argument string.
+Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
+@node ntpd saveconfigquit
+@subsection saveconfigquit option
+@cindex ntpd-saveconfigquit
+
+This is the ``save parsed configuration and quit'' option.
+This option takes an argument string.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{SAVECONFIG} during the compilation.
+@item
+must not appear in combination with any of the following options:
+quit, wait-sync.
+@end itemize
+
+Cause ntpd to parse its startup configuration file and save an
+equivalent to the given filename and exit.  This option was
+designed for automated testing.
+@node ntpd statsdir
+@subsection statsdir option (-s)
+@cindex ntpd-statsdir
+
+This is the ``statistics file location'' option.
+This option takes an argument string.
+Specify the directory path for files created by the statistics facility.
+This is the same operation as the
+statsdir statsdir
+configuration file directive.
+@node ntpd trustedkey
+@subsection trustedkey option (-t)
+@cindex ntpd-trustedkey
+
+This is the ``trusted key number'' option.
+This option takes an argument string @file{tkey}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+Add a key number to the trusted key list.
+@node ntpd user
+@subsection user option (-u)
+@cindex ntpd-user
+
+This is the ``run as userid (or userid:groupid)'' option.
+This option takes an argument string.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{HAVE_DROPROOT} during the compilation.
+@end itemize
+
+Specify a user, and optionally a group, to switch to.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+--enable-clockctl
+) and Linux (configure with
+--enable-linuxcaps
+).
+@node ntpd updateinterval
+@subsection updateinterval option (-U)
+@cindex ntpd-updateinterval
+
+This is the ``interval in seconds between scans for new or dropped interfaces'' option.
+This option takes an argument number.
+Give the time in seconds between two scans for new or dropped interfaces.
+For systems with routing socket support the scans will be performed shortly after the interface change
+has been detected by the system.
+Use 0 to disable scanning. 60 seconds is the minimum time between scans.
+@node ntpd wait-sync
+@subsection wait-sync option (-w)
+@cindex ntpd-wait-sync
+
+This is the ``seconds to wait for first clock sync'' option.
+This option takes an argument number.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{HAVE_WORKING_FORK} during the compilation.
+@item
+must not appear in combination with any of the following options:
+nofork, quit, saveconfigquit.
+@end itemize
+
+If greater than zero, alters ntpd behavior when forking to
+daemonize.  Instead of exiting with status 0 immediately after
+the fork, the parent waits up to the specified number of
+seconds for the child to first synchronize the clock.  The exit
+status is zero (success) if the clock was synchronized,
+otherwise it is ETIMEDOUT.
+This provides the option for a script starting ntpd to easily
+wait for the first set of the clock before proceeding.
+@node ntpd slew
+@subsection slew option (-x)
+@cindex ntpd-slew
+
+This is the ``slew up to 600 seconds'' option.
+Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
+This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
+Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
+Thus, an adjustment as much as 600 s will take almost 14 days to complete.
+This option can be used with the
+-g
+and
+-q
+options.
+See the
+tinker
+configuration file directive for other options.
+Note: The kernel time discipline is disabled with this option.
+@node ntpd usepcc
+@subsection usepcc option
+@cindex ntpd-usepcc
+
+This is the ``use cpu cycle counter (windows only)'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{SYS_WINNT} during the compilation.
+@end itemize
+
+Attempt to substitute the CPU counter for QueryPerformanceCounter.
+The CPU counter and QueryPerformanceCounter are compared, and if
+they have the same frequency, the CPU counter (RDTSC on x86) is
+used directly, saving the overhead of a system call.
+@node ntpd pccfreq
+@subsection pccfreq option
+@cindex ntpd-pccfreq
+
+This is the ``force cpu cycle counter use (windows only)'' option.
+This option takes an argument string.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{SYS_WINNT} during the compilation.
+@end itemize
+
+Force substitution the CPU counter for QueryPerformanceCounter.
+The CPU counter (RDTSC on x86) is used unconditionally with the
+given frequency (in Hz).
+
+
+@node ntpd config
+@subsection presetting/configuring ntpd
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from environment variables named @code{NTPD} and @code{NTPD_<OPTION_NAME>}.  @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTPD} variable will be tokenized and parsed like
+the command line.  The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0.  The optional argument specifies how much licensing
+detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.  Only the
+first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version.  This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntpd exit status
+@subsection ntpd exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
+@node ntpd Description
+@subsection ntpd Description
+The
+utility is an operating system daemon which sets
+and maintains the system time of day in synchronism with Internet
+standard time servers.
+It is a complete implementation of the
+Network Time Protocol (NTP) version 4, as defined by RFC-5905,
+but also retains compatibility with
+version 3, as defined by RFC-1305, and versions 1
+and 2, as defined by RFC-1059 and RFC-1119, respectively.
+The
+utility does most computations in 64-bit floating point
+arithmetic and does relatively clumsy 64-bit fixed point operations
+only when necessary to preserve the ultimate precision, about 232
+picoseconds.
+While the ultimate precision is not achievable with
+ordinary workstations and networks of today, it may be required
+with future gigahertz CPU clocks and gigabit LANs.
+Ordinarily,
+reads the
+configuration file at startup time in order to determine the
+synchronization sources and operating modes.
+It is also possible to
+specify a working, although limited, configuration entirely on the
+command line, obviating the need for a configuration file.
+This may
+be particularly useful when the local host is to be configured as a
+broadcast/multicast client, with all peers being determined by
+listening to broadcasts at run time.
+If NetInfo support is built into
+then
+will attempt to read its configuration from the
+NetInfo if the default
+file cannot be read and no file is
+specified by the
+option.
+Various internal
+variables can be displayed and
+configuration options altered while the
+is running
+using the
+and
+utility programs.
+When
+starts it looks at the value of
+and if zero
+will set the
+to 022.
+@node ntpd Usage
+@subsection ntpd Usage
+The
+utility operates by exchanging messages with
+one or more configured servers over a range of designated poll intervals.
+When
+started, whether for the first or subsequent times, the program
+requires several exchanges from the majority of these servers so
+the signal processing and mitigation algorithms can accumulate and
+groom the data and set the clock.
+In order to protect the network
+from bursts, the initial poll interval for each server is delayed
+an interval randomized over a few seconds.
+At the default initial poll
+interval of 64s, several minutes can elapse before the clock is
+set.
+This initial delay to set the clock
+can be safely and dramatically reduced using the
+keyword with the
+configuration
+command, as described in
+Most operating systems and hardware of today incorporate a
+time-of-year (TOY) chip to maintain the time during periods when
+the power is off.
+When the machine is booted, the chip is used to
+initialize the operating system time.
+After the machine has
+synchronized to a NTP server, the operating system corrects the
+chip from time to time.
+In the default case, if
+detects that the time on the host
+is more than 1000s from the server time,
+assumes something must be terribly wrong and the only
+reliable action is for the operator to intervene and set the clock
+by hand.
+(Reasons for this include there is no TOY chip,
+or its battery is dead, or that the TOY chip is just of poor quality.)
+This causes
+to exit with a panic message to
+the system log.
+The
+option overrides this check and the
+clock will be set to the server time regardless of the chip time
+(up to 68 years in the past or future \(em
+this is a limitation of the NTPv4 protocol).
+However, and to protect against broken hardware, such as when the
+CMOS battery fails or the clock counter becomes defective, once the
+clock has been set an error greater than 1000s will cause
+to exit anyway.
+Under ordinary conditions,
+adjusts the clock in
+small steps so that the timescale is effectively continuous and
+without discontinuities.
+Under conditions of extreme network
+congestion, the roundtrip delay jitter can exceed three seconds and
+the synchronization distance, which is equal to one-half the
+roundtrip delay plus error budget terms, can become very large.
+The
+algorithms discard sample offsets exceeding 128 ms,
+unless the interval during which no sample offset is less than 128
+ms exceeds 900s.
+The first sample after that, no matter what the
+offset, steps the clock to the indicated time.
+In practice this
+reduces the false alarm rate where the clock is stepped in error to
+a vanishingly low incidence.
+As the result of this behavior, once the clock has been set it
+very rarely strays more than 128 ms even under extreme cases of
+network path congestion and jitter.
+Sometimes, in particular when
+is first started without a valid drift file
+on a system with a large intrinsic drift
+the error might grow to exceed 128 ms,
+which would cause the clock to be set backwards
+if the local clock time is more than 128 s
+in the future relative to the server.
+In some applications, this behavior may be unacceptable.
+There are several solutions, however.
+If the
+option is included on the command line, the clock will
+never be stepped and only slew corrections will be used.
+But this choice comes with a cost that
+should be carefully explored before deciding to use
+the
+option.
+The maximum slew rate possible is limited
+to 500 parts-per-million (PPM) as a consequence of the correctness
+principles on which the NTP protocol and algorithm design are
+based.
+As a result, the local clock can take a long time to
+converge to an acceptable offset, about 2,000 s for each second the
+clock is outside the acceptable range.
+During this interval the
+local clock will not be consistent with any other network clock and
+the system cannot be used for distributed applications that require
+correctly synchronized network time.
+In spite of the above precautions, sometimes when large
+frequency errors are present the resulting time offsets stray
+outside the 128-ms range and an eventual step or slew time
+correction is required.
+If following such a correction the
+frequency error is so large that the first sample is outside the
+acceptable range,
+enters the same state as when the
+file is not present.
+The intent of this behavior
+is to quickly correct the frequency and restore operation to the
+normal tracking mode.
+In the most extreme cases
+(the host
+comes to mind), there may be occasional
+step/slew corrections and subsequent frequency corrections.
+It
+helps in these cases to use the
+keyword when
+configuring the server, but
+ONLY
+when you have permission to do so from the owner of the target host.
+Finally,
+in the past many startup scripts would run
+to get the system clock close to correct before starting
+but this was never more than a mediocre hack and is no longer needed.
+There is a way to start
+that often addresses all of the problems mentioned above.
+First, use the
+option on your
+entries.
+If you can also keep a good
+file then
+will effectively "warm-start" and your system's clock will
+be stable in under 11 seconds' time.
+As soon as possible in the startup sequence, start
+with at least the
+and perhaps the
+options.
+Then,
+start the rest of your "normal" processes.
+This will give
+as much time as possible to get the system's clock synchronized and stable.
+Finally,
+if you have processes like
+or database servers
+that require
+monotonically-increasing time,
+run
+as late as possible in the boot sequence
+(perhaps with the
+flag)
+and after
+exits successfully
+it is as safe as it will ever be to start any process that require
+stable time.
+The
+behavior at startup depends on whether the
+frequency file, usually
+exists.
+This file
+contains the latest estimate of clock frequency error.
+When the
+is started and the file does not exist, the
+enters a special mode designed to quickly adapt to
+the particular system clock oscillator time and frequency error.
+This takes approximately 15 minutes, after which the time and
+frequency are set to nominal values and the
+enters
+normal mode, where the time and frequency are continuously tracked
+relative to the server.
+After one hour the frequency file is
+created and the current frequency offset written to it.
+When the
+is started and the file does exist, the
+frequency is initialized from the file and enters normal mode
+immediately.
+After that the current frequency offset is written to
+the file at hourly intervals.
+The
+utility can operate in any of several modes, including
+symmetric active/passive, client/server broadcast/multicast and
+manycast, as described in the
+page
+(available as part of the HTML documentation
+provided in
+It normally operates continuously while
+monitoring for small changes in frequency and trimming the clock
+for the ultimate precision.
+However, it can operate in a one-time
+mode where the time is set from an external server and frequency is
+set from a previously recorded frequency file.
+A
+broadcast/multicast or manycast client can discover remote servers,
+compute server-client propagation delay correction factors and
+configure itself automatically.
+This makes it possible to deploy a
+fleet of workstations without specifying configuration details
+specific to the local environment.
+By default,
+runs in continuous mode where each of
+possibly several external servers is polled at intervals determined
+by an intricate state machine.
+The state machine measures the
+incidental roundtrip delay jitter and oscillator frequency wander
+and determines the best poll interval using a heuristic algorithm.
+Ordinarily, and in most operating environments, the state machine
+will start with 64s intervals and eventually increase in steps to
+1024s.
+A small amount of random variation is introduced in order to
+avoid bunching at the servers.
+In addition, should a server become
+unreachable for some time, the poll interval is increased in steps
+to 1024s in order to reduce network overhead.
+In some cases it may not be practical for
+to run
+continuously.
+A common workaround has been to run the
+program from a
+job at designated
+times.
+However, this program does not have the crafted signal
+processing, error checking and mitigation algorithms of
+The
+option is intended for this purpose.
+Setting this option will cause
+to exit just after
+setting the clock for the first time.
+The procedure for initially
+setting the clock is the same as in continuous mode; most
+applications will probably want to specify the
+keyword with the
+configuration command.
+With this
+keyword a volley of messages are exchanged to groom the data and
+the clock is set in about 10 s.
+If nothing is heard after a
+couple of minutes, the daemon times out and exits.
+After a suitable
+period of mourning, the
+program may be
+retired.
+When kernel support is available to discipline the clock
+frequency, which is the case for stock Solaris, Tru64, Linux and
+a useful feature is available to discipline the clock
+frequency.
+First,
+is run in continuous mode with
+selected servers in order to measure and record the intrinsic clock
+frequency offset in the frequency file.
+It may take some hours for
+the frequency and offset to settle down.
+Then the
+is
+stopped and run in one-time mode as required.
+At each startup, the
+frequency is read from the file and initializes the kernel
+frequency.
+This version of NTP includes an intricate state machine to
+reduce the network load while maintaining a quality of
+synchronization consistent with the observed jitter and wander.
+There are a number of ways to tailor the operation in order enhance
+accuracy by reducing the interval or to reduce network overhead by
+increasing it.
+However, the user is advised to carefully consider
+the consequences of changing the poll adjustment range from the
+default minimum of 64 s to the default maximum of 1,024 s.
+The
+default minimum can be changed with the
+command to a value not less than 16 s.
+This value is used for all
+configured associations, unless overridden by the
+option on the configuration command.
+Note that most device drivers
+will not operate properly if the poll interval is less than 64 s
+and that the broadcast server and manycast client associations will
+also use the default, unless overridden.
+In some cases involving dial up or toll services, it may be
+useful to increase the minimum interval to a few tens of minutes
+and maximum interval to a day or so.
+Under normal operation
+conditions, once the clock discipline loop has stabilized the
+interval will be increased in steps from the minimum to the
+maximum.
+However, this assumes the intrinsic clock frequency error
+is small enough for the discipline loop correct it.
+The capture
+range of the loop is 500 PPM at an interval of 64s decreasing by a
+factor of two for each doubling of interval.
+At a minimum of 1,024
+s, for example, the capture range is only 31 PPM.
+If the intrinsic
+error is greater than this, the drift file
+will
+have to be specially tailored to reduce the residual error below
+this limit.
+Once this is done, the drift file is automatically
+updated once per hour and is available to initialize the frequency
+on subsequent daemon restarts.
+In scenarios where a considerable amount of data are to be
+downloaded or uploaded over telephone modems, timekeeping quality
+can be seriously degraded.
+This occurs because the differential
+delays on the two directions of transmission can be quite large.
+In
+many cases the apparent time errors are so large as to exceed the
+step threshold and a step correction can occur during and after the
+data transfer is in progress.
+The huff-n'-puff filter is designed to correct the apparent time
+offset in these cases.
+It depends on knowledge of the propagation
+delay when no other traffic is present.
+In common scenarios this
+occurs during other than work hours.
+The filter maintains a shift
+register that remembers the minimum delay over the most recent
+interval measured usually in hours.
+Under conditions of severe
+delay, the filter corrects the apparent offset using the sign of
+the offset and the difference between the apparent delay and
+minimum delay.
+The name of the filter reflects the negative (huff)
+and positive (puff) correction, which depends on the sign of the
+offset.
+The filter is activated by the
+command and
+keyword, as described in
+@node ntpd Files
+@subsection ntpd Files
+@table @samp
+@item Pa
+the default name of the configuration file
+@item Pa
+the default name of the drift file
+@item Pa
+the default name of the key file
+
+@end multitable
+@node ntpd See Also
+@subsection ntpd See Also
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+A snapshot of this documentation is available in HTML format in
+@node ntpd Bugs
+@subsection ntpd Bugs
+The
+utility has gotten rather fat.
+While not huge, it has gotten
+larger than might be desirable for an elevated-priority
+running on a workstation, particularly since many of
+the fancy features which consume the space were designed more with
+a busy primary server, rather than a high stratum workstation in
+mind.
+@node ntpd Notes
+@subsection ntpd Notes
+Portions of this document came from FreeBSD.
diff --git a/ntpd/ntpd-opts.texi b/ntpd/ntpd-opts.texi
deleted file mode 100644 (file)
index 54cdaa1..0000000
+++ /dev/null
@@ -1,646 +0,0 @@
-@node ntpd Invocation
-@section Invoking ntpd
-@pindex ntpd
-@cindex NTP daemon program
-@ignore
-# 
-# EDIT THIS FILE WITH CAUTION  (ntpd-opts.texi)
-# 
-# It has been AutoGen-ed  April 11, 2012 at 08:42:57 AM by AutoGen 5.14
-# From the definitions    ntpd-opts.def
-# and the template file   aginfo.tpl
-@end ignore
-
-
-
-This section was generated by @strong{AutoGen},
-the aginfo template and the option descriptions for the @command{ntpd} program.  It documents the @command{ntpd} usage text and option meanings.
-
-This software is released under a specialized copyright license.
-
-@menu
-* ntpd usage::                  ntpd usage help (-?)
-* ntpd authnoreq::             authnoreq option (-A)
-* ntpd authreq::               authreq option (-a)
-* ntpd bcastsync::             bcastsync option (-b)
-* ntpd configfile::            configfile option (-c)
-* ntpd debug-level::           debug-level option (-d)
-* ntpd driftfile::             driftfile option (-f)
-* ntpd dvar::                  dvar option
-* ntpd interface::             interface option (-I)
-* ntpd ipv4::                  ipv4 option (-4)
-* ntpd ipv6::                  ipv6 option (-6)
-* ntpd jaildir::               jaildir option (-i)
-* ntpd keyfile::               keyfile option (-k)
-* ntpd logfile::               logfile option (-l)
-* ntpd modifymmtimer::         modifymmtimer option (-M)
-* ntpd nice::                  nice option (-N)
-* ntpd nofork::                nofork option (-n)
-* ntpd novirtualips::          novirtualips option (-L)
-* ntpd panicgate::             panicgate option (-g)
-* ntpd pccfreq::               pccfreq option
-* ntpd pidfile::               pidfile option (-p)
-* ntpd priority::              priority option (-P)
-* ntpd propagationdelay::      propagationdelay option (-r)
-* ntpd quit::                  quit option (-q)
-* ntpd saveconfigquit::        saveconfigquit option
-* ntpd set-debug-level::       set-debug-level option (-D)
-* ntpd slew::                  slew option (-x)
-* ntpd statsdir::              statsdir option (-s)
-* ntpd trustedkey::            trustedkey option (-t)
-* ntpd updateinterval::        updateinterval option (-U)
-* ntpd usepcc::                usepcc option
-* ntpd user::                  user option (-u)
-* ntpd var::                   var option
-* ntpd wait-sync::             wait-sync option (-w)
-@end menu
-
-@node ntpd usage
-@subsection ntpd usage help (-?)
-@cindex ntpd-usage
-
-This is the automatically generated usage text for ntpd:
-
-@exampleindent 0
-@example
-ntpd - NTP daemon program - Ver. 4.2.7p271
-USAGE:  ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
-                [ <server1> ... <serverN> ]
-  Flg Arg Option-Name    Description
-   -4 no  ipv4           Force IPv4 DNS name resolution
-                                - prohibits these options:
-                                ipv6
-   -6 no  ipv6           Force IPv6 DNS name resolution
-                                - prohibits these options:
-                                ipv4
-   -a no  authreq        Require crypto authentication
-                                - prohibits these options:
-                                authnoreq
-   -A no  authnoreq      Do not require crypto authentication
-                                - prohibits these options:
-                                authreq
-   -b no  bcastsync      Allow us to sync to broadcast servers
-   -c Str configfile     configuration file name
-   -d no  debug-level    Increase output debug message level
-                                - may appear multiple times
-   -D Str set-debug-level Set the output debug message level
-                                - may appear multiple times
-   -f Str driftfile      frequency drift file name
-   -g no  panicgate      Allow the first adjustment to be Big
-                                - may appear multiple times
-   -i --- jaildir        built without --enable-clockctl or --enable-linuxcaps
-   -I Str interface      Listen on an interface name or address
-                                - may appear multiple times
-   -k Str keyfile        path to symmetric keys
-   -l Str logfile        path to the log file
-   -L no  novirtualips   Do not listen to virtual interfaces
-   -n no  nofork         Do not fork
-                                - prohibits these options:
-                                wait-sync
-   -N no  nice           Run at high priority
-   -p Str pidfile        path to the PID file
-   -P Num priority       Process priority
-   -q no  quit           Set the time and quit
-                                - prohibits these options:
-                                saveconfigquit
-                                wait-sync
-   -r Str propagationdelay Broadcast/propagation delay
-      Str saveconfigquit Save parsed configuration and quit
-                                - prohibits these options:
-                                quit
-                                wait-sync
-   -s Str statsdir       Statistics file location
-   -t Str trustedkey     Trusted key number
-                                - may appear multiple times
-   -u --- user           built without --enable-clockctl or --enable-linuxcaps
-   -U Num updateinterval interval in seconds between scans for new or dropped interfaces
-      Str var            make ARG an ntp variable (RW)
-                                - may appear multiple times
-      Str dvar           make ARG an ntp variable (RW|DEF)
-                                - may appear multiple times
-   -w Num wait-sync      Seconds to wait for first clock sync
-                                - prohibits these options:
-                                nofork
-                                quit
-                                saveconfigquit
-   -x no  slew           Slew up to 600 seconds
-   -! opt version        Output version information and exit
-   -? no  help           Display extended usage information and exit
-   -! no  more-help      Extended usage information passed thru pager
-
-Options are specified by doubled hyphens and their name or by a single
-hyphen and the flag character.
-
-
-
-The following option preset mechanisms are supported:
- - examining environment variables named NTPD_*
-
-please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
-@end example
-@exampleindent 4
-
-@node ntpd authnoreq
-@subsection authnoreq option (-A)
-@cindex ntpd-authnoreq
-
-This is the ``do not require crypto authentication'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-authreq.
-@end itemize
-
-Do not require cryptographic authentication for broadcast client,
-multicast client and symmetric passive associations.
-This is almost never a good idea.
-
-@node ntpd authreq
-@subsection authreq option (-a)
-@cindex ntpd-authreq
-
-This is the ``require crypto authentication'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-authnoreq.
-@end itemize
-
-Require cryptographic authentication for broadcast client,
-multicast client and symmetric passive associations.
-This is the default.
-
-@node ntpd bcastsync
-@subsection bcastsync option (-b)
-@cindex ntpd-bcastsync
-
-This is the ``allow us to sync to broadcast servers'' option.
-
-
-@node ntpd configfile
-@subsection configfile option (-c)
-@cindex ntpd-configfile
-
-This is the ``configuration file name'' option.
-The name and path of the configuration file,
-/etc/ntp.conf
-by default.
-
-@node ntpd debug-level
-@subsection debug-level option (-d)
-@cindex ntpd-debug-level
-
-This is the ``increase output debug message level'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@item
-must be compiled in by defining @code{DEBUG} during the compilation.
-@end itemize
-
-Increase the debugging message output level.
-
-@node ntpd driftfile
-@subsection driftfile option (-f)
-@cindex ntpd-driftfile
-
-This is the ``frequency drift file name'' option.
-The name and path of the frequency file,
-/etc/ntp.drift
-by default.
-This is the same operation as the
-driftfile driftfile
-configuration specification in the 
-/etc/ntp.conf
-file.
-
-@node ntpd dvar
-@subsection dvar option
-@cindex ntpd-dvar
-
-This is the ``make arg an ntp variable (rw|def)'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-
-
-@node ntpd interface
-@subsection interface option (-I)
-@cindex ntpd-interface
-
-This is the ``listen on an interface name or address'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-Open the network address given, or all the addresses associated with the
-given interface name.  This option may appear multiple times.  This option
-also implies not opening other addresses, except wildcard and localhost.
-This option is deprecated. Please consider using the configuration file
-interface command, which is more versatile. 
-
-@node ntpd ipv4
-@subsection ipv4 option (-4)
-@cindex ntpd-ipv4
-
-This is the ``force ipv4 dns name resolution'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-ipv6.
-@end itemize
-
-Force DNS resolution of following host names on the command line
-to the IPv4 namespace.
-
-@node ntpd ipv6
-@subsection ipv6 option (-6)
-@cindex ntpd-ipv6
-
-This is the ``force ipv6 dns name resolution'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-ipv4.
-@end itemize
-
-Force DNS resolution of following host names on the command line
-to the IPv6 namespace.
-
-@node ntpd jaildir
-@subsection jaildir option (-i)
-@cindex ntpd-jaildir
-
-This is the ``jail directory'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{HAVE_DROPROOT} during the compilation.
-@end itemize
-
-Chroot the server to the directory
-jaildir
-.
-This option also implies that the server attempts to drop root privileges at startup.
-You may need to also specify a
--u
-option.
-This option is only available if the OS supports adjusting the clock
-without full root privileges.
-This option is supported under NetBSD (configure with
---enable-clockctl
-) and Linux (configure with
---enable-linuxcaps
-).
-
-@node ntpd keyfile
-@subsection keyfile option (-k)
-@cindex ntpd-keyfile
-
-This is the ``path to symmetric keys'' option.
-Specify the name and path of the symmetric key file.
-/etc/ntp.keys
-is the default.
-This is the same operation as the
-keys keyfile
-configuration file directive.
-
-@node ntpd logfile
-@subsection logfile option (-l)
-@cindex ntpd-logfile
-
-This is the ``path to the log file'' option.
-Specify the name and path of the log file.
-The default is the system log file.
-This is the same operation as the
-logfile logfile
-configuration file directive.
-
-@node ntpd modifymmtimer
-@subsection modifymmtimer option (-M)
-@cindex ntpd-modifymmtimer
-
-This is the ``modify multimedia timer (windows only)'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{SYS_WINNT} during the compilation.
-@end itemize
-
-Set the Windows Multimedia Timer to highest resolution.  This
-ensures the resolution does not change while ntpd is running,
-avoiding timekeeping glitches associated with changes.
-
-@node ntpd nice
-@subsection nice option (-N)
-@cindex ntpd-nice
-
-This is the ``run at high priority'' option.
-To the extent permitted by the operating system, run
-ntpd
-at the highest priority.
-
-@node ntpd nofork
-@subsection nofork option (-n)
-@cindex ntpd-nofork
-
-This is the ``do not fork'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-wait-sync.
-@end itemize
-
-
-
-@node ntpd novirtualips
-@subsection novirtualips option (-L)
-@cindex ntpd-novirtualips
-
-This is the ``do not listen to virtual interfaces'' option.
-Do not listen to virtual interfaces, defined as those with
-names containing a colon.  This option is deprecated.  Please
-consider using the configuration file interface command, which
-is more versatile.
-
-@node ntpd panicgate
-@subsection panicgate option (-g)
-@cindex ntpd-panicgate
-
-This is the ``allow the first adjustment to be big'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-Normally,
-ntpd
-exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
-ntpd
-will exit with a message to the system log. This option can be used with the
--q
-and
--x
-options.
-See the
-tinker
-configuration file directive for other options.
-
-@node ntpd pccfreq
-@subsection pccfreq option
-@cindex ntpd-pccfreq
-
-This is the ``force cpu cycle counter use (windows only)'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{SYS_WINNT} during the compilation.
-@end itemize
-
-Force substitution the CPU counter for QueryPerformanceCounter.
-The CPU counter (RDTSC on x86) is used unconditionally with the
-given frequency (in Hz).
-
-@node ntpd pidfile
-@subsection pidfile option (-p)
-@cindex ntpd-pidfile
-
-This is the ``path to the pid file'' option.
-Specify the name and path of the file used to record
-ntpd's
-process ID.
-This is the same operation as the
-pidfile pidfile
-configuration file directive.
-
-@node ntpd priority
-@subsection priority option (-P)
-@cindex ntpd-priority
-
-This is the ``process priority'' option.
-To the extent permitted by the operating system, run
-ntpd
-at the specified
-sched_setscheduler(SCHED_FIFO)
-priority.
-
-@node ntpd propagationdelay
-@subsection propagationdelay option (-r)
-@cindex ntpd-propagationdelay
-
-This is the ``broadcast/propagation delay'' option.
-Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
-
-@node ntpd quit
-@subsection quit option (-q)
-@cindex ntpd-quit
-
-This is the ``set the time and quit'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-saveconfigquit, wait-sync.
-@end itemize
-
-ntpd
-will not daemonize and will exit after the clock is first
-synchronized.  This behavior mimics that of the
-ntpdate
-program, which will soon be replaced with a shell script.
-The
--g
-and
--x
-options can be used with this option.
-Note: The kernel time discipline is disabled with this option.
-
-@node ntpd saveconfigquit
-@subsection saveconfigquit option
-@cindex ntpd-saveconfigquit
-
-This is the ``save parsed configuration and quit'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{SAVECONFIG} during the compilation.
-@item
-must not appear in combination with any of the following options:
-quit, wait-sync.
-@end itemize
-
-Cause ntpd to parse its startup configuration file and save an
-equivalent to the given filename and exit.  This option was
-designed for automated testing.
-
-@node ntpd set-debug-level
-@subsection set-debug-level option (-D)
-@cindex ntpd-set-debug-level
-
-This is the ``set the output debug message level'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@item
-must be compiled in by defining @code{DEBUG} during the compilation.
-@end itemize
-
-Set the output debugging level.  Can be supplied multiple times,
-but each overrides the previous value(s).
-
-@node ntpd slew
-@subsection slew option (-x)
-@cindex ntpd-slew
-
-This is the ``slew up to 600 seconds'' option.
-Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
-This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
-Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
-Thus, an adjustment as much as 600 s will take almost 14 days to complete.
-This option can be used with the
--g
-and
--q
-options.
-See the
-tinker
-configuration file directive for other options.
-Note: The kernel time discipline is disabled with this option.
-
-@node ntpd statsdir
-@subsection statsdir option (-s)
-@cindex ntpd-statsdir
-
-This is the ``statistics file location'' option.
-Specify the directory path for files created by the statistics facility.
-This is the same operation as the
-statsdir statsdir
-configuration file directive.
-
-@node ntpd trustedkey
-@subsection trustedkey option (-t)
-@cindex ntpd-trustedkey
-
-This is the ``trusted key number'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-Add a key number to the trusted key list.
-
-@node ntpd updateinterval
-@subsection updateinterval option (-U)
-@cindex ntpd-updateinterval
-
-This is the ``interval in seconds between scans for new or dropped interfaces'' option.
-Give the time in seconds between two scans for new or dropped interfaces.
-For systems with routing socket support the scans will be performed shortly after the interface change
-has been detected by the system.
-Use 0 to disable scanning. 60 seconds is the minimum time between scans.
-
-@node ntpd usepcc
-@subsection usepcc option
-@cindex ntpd-usepcc
-
-This is the ``use cpu cycle counter (windows only)'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{SYS_WINNT} during the compilation.
-@end itemize
-
-Attempt to substitute the CPU counter for QueryPerformanceCounter.
-The CPU counter and QueryPerformanceCounter are compared, and if
-they have the same frequency, the CPU counter (RDTSC on x86) is
-used directly, saving the overhead of a system call.
-
-@node ntpd user
-@subsection user option (-u)
-@cindex ntpd-user
-
-This is the ``run as userid (or userid:groupid)'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{HAVE_DROPROOT} during the compilation.
-@end itemize
-
-Specify a user, and optionally a group, to switch to.
-This option is only available if the OS supports adjusting the clock
-without full root privileges.
-This option is supported under NetBSD (configure with
---enable-clockctl
-) and Linux (configure with
---enable-linuxcaps
-).
-
-@node ntpd var
-@subsection var option
-@cindex ntpd-var
-
-This is the ``make arg an ntp variable (rw)'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-
-
-@node ntpd wait-sync
-@subsection wait-sync option (-w)
-@cindex ntpd-wait-sync
-
-This is the ``seconds to wait for first clock sync'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{HAVE_WORKING_FORK} during the compilation.
-@item
-must not appear in combination with any of the following options:
-nofork, quit, saveconfigquit.
-@end itemize
-
-If greater than zero, alters ntpd behavior when forking to
-daemonize.  Instead of exiting with status 0 immediately after
-the fork, the parent waits up to the specified number of
-seconds for the child to first synchronize the clock.  The exit
-status is zero (success) if the clock was synchronized,
-otherwise it is ETIMEDOUT.
-This provides the option for a script starting ntpd to easily
-wait for the first set of the clock before proceeding.
index 99715202123846bdc060efd252bb431fc6b97d24..0cd3a0f87077cfad73722d377733f1827847a89e 100644 (file)
@@ -29,9 +29,11 @@ CLEANFILES=  check-layout layout.here nl.c ntpdc-layout
 noinst_HEADERS=        ntpdc.h
 ETAGS_ARGS=    Makefile.am
 EXTRA_DIST=                    \
+       invoke-ntpdc.menu       \
+       invoke-ntpdc.texi       \
+       layout.std              \
        nl_in.c                 \
        nl.pl                   \
-       layout.std              \
        ntpdc-opts.def          \
        ntpdc.1ntpdcman         \
        ntpdc.1ntpdcmdoc        \
@@ -39,8 +41,6 @@ EXTRA_DIST=                   \
        ntpdc.mdoc.in           \
        ntpdc.html              \
        ntpdc.texi              \
-       ntpdc-opts.texi         \
-       ntpdc-opts.menu         \
        $(NULL)
 
 man1_MANS=
@@ -52,11 +52,11 @@ man_MANS=   ntpdc.$(NTPDC_MS)
 ##ntpdc_TEXINFOS=      ntpdc-opts.texi
 
 noinst_DATA=                           \
+       $(srcdir)/invoke-ntpdc.menu     \
+       $(srcdir)/invoke-ntpdc.texi     \
        $(srcdir)/ntpdc.html            \
        $(srcdir)/ntpdc.man.in          \
        $(srcdir)/ntpdc.mdoc.in         \
-       $(srcdir)/ntpdc-opts.texi       \
-       $(srcdir)/ntpdc-opts.menu       \
        $(NULL)
 
 run_ag=                cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)"      \
@@ -103,14 +103,14 @@ ntpdc.$(NTPDC_MS): $(srcdir)/ntpdc.$(MANTAGFMT).in $(top_builddir)/config.status
 
 ###
 
-$(srcdir)/ntpdc-opts.menu: $(srcdir)/ntpdc-opts.texi
+$(srcdir)/invoke-ntpdc.menu: $(srcdir)/invoke-ntpdc.texi
        @: do-nothing action to avoid default SCCS get, .menu built with .texi
        
-$(srcdir)/ntpdc-opts.texi: $(srcdir)/ntpdc-opts.def $(std_def_list)
-       $(run_ag) -Taginfo.tpl -DLEVEL=section ntpdc-opts.def
+$(srcdir)/invoke-ntpdc.texi: $(srcdir)/ntpdc-opts.def $(std_def_list)
+       $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpdc-opts.def
        $(top_srcdir)/scripts/check--help $@
 
-$(srcdir)/ntpdc.html: $(srcdir)/ntpdc-opts.menu $(srcdir)/ntpdc-opts.texi $(srcdir)/ntpdc.texi $(top_srcdir)/sntp/include/version.texi
+$(srcdir)/ntpdc.html: $(srcdir)/invoke-ntpdc.menu $(srcdir)/invoke-ntpdc.texi $(srcdir)/ntpdc.texi $(top_srcdir)/sntp/include/version.texi
        cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpdc.html ntpdc.texi || true )
 
 ntpdc_SOURCES = ntpdc.c ntpdc_ops.c ntpdc-opts.c ntpdc-opts.h
diff --git a/ntpdc/invoke-ntpdc.texi b/ntpdc/invoke-ntpdc.texi
new file mode 100644 (file)
index 0000000..350d8a5
--- /dev/null
@@ -0,0 +1,825 @@
+@node ntpdc Invocation
+@section Invoking ntpdc
+@pindex ntpdc
+@cindex vendor-specific NTPD control program
+@ignore
+# 
+# EDIT THIS FILE WITH CAUTION  (invoke-ntpdc.texi)
+# 
+# It has been AutoGen-ed  April 14, 2012 at 12:22:39 AM by AutoGen 5.16pre18
+# From the definitions    ntpdc-opts.def
+# and the template file   agtexi-cmd.tpl
+@end ignore
+
+
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpdc} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntpdc usage::                  ntpdc help/usage (-?)
+* ntpdc ipv4::                   ipv4 option (-4)
+* ntpdc ipv6::                   ipv6 option (-6)
+* ntpdc command::                command option (-c)
+* ntpdc interactive::            interactive option (-i)
+* ntpdc listpeers::              listpeers option (-l)
+* ntpdc numeric::                numeric option (-n)
+* ntpdc peers::                  peers option (-p)
+* ntpdc showpeers::              showpeers option (-s)
+* ntpdc config::                 presetting/configuring ntpdc
+* ntpdc exit status::            exit status
+* ntpdc Description::            Description
+* ntpdc Usage::                  Usage
+* ntpdc See Also::               See Also
+* ntpdc Authors::                Authors
+* ntpdc Bugs::                   Bugs
+@end menu
+
+@node ntpdc usage
+@subsection ntpdc help/usage (-?)
+@cindex ntpdc help
+
+This is the automatically generated usage text for ntpdc.
+The text printed is the same whether for the @code{help} option (-?) or the @code{more-help} option (-!).  @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function.  The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}.  Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntpdc - vendor-specific NTPD control program - Ver. 4.2.7p271
+USAGE:  ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
+  Flg Arg Option-Name    Description
+   -4 no  ipv4           Force IPv4 DNS name resolution
+                                - prohibits these options:
+                                ipv6
+   -6 no  ipv6           Force IPv6 DNS name resolution
+                                - prohibits these options:
+                                ipv4
+   -c Str command        run a command and exit
+                                - may appear multiple times
+   -d no  debug-level    Increase debug verbosity level
+                                - may appear multiple times
+   -D Str set-debug-level Set the debug verbosity level
+                                - may appear multiple times
+   -i no  interactive    Force ntpq to operate in interactive mode
+                                - prohibits these options:
+                                command
+                                listpeers
+                                peers
+                                showpeers
+   -l no  listpeers      Print a list of the peers
+                                - prohibits these options:
+                                command
+   -n no  numeric        numeric host addresses
+   -p no  peers          Print a list of the peers
+                                - prohibits these options:
+                                command
+   -s no  showpeers      Show a list of the peers
+                                - prohibits these options:
+                                command
+      opt version        Output version information and exit
+   -? no  help           Display extended usage information and exit
+   -! no  more-help      Extended usage information passed thru pager
+   -> opt save-opts      Save the option state to a config file
+   -< Str load-opts      Load options from a config file
+                                - disabled as --no-load-opts
+                                - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named NTPDC_*
+
+please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
+@end example
+@exampleindent 4
+
+@node ntpdc ipv4
+@subsection ipv4 option (-4)
+@cindex ntpdc-ipv4
+
+This is the ``force ipv4 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv6.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+@node ntpdc ipv6
+@subsection ipv6 option (-6)
+@cindex ntpdc-ipv6
+
+This is the ``force ipv6 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv4.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+@node ntpdc command
+@subsection command option (-c)
+@cindex ntpdc-command
+
+This is the ``run a command and exit'' option.
+This option takes an argument string @file{cmd}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+@node ntpdc interactive
+@subsection interactive option (-i)
+@cindex ntpdc-interactive
+
+This is the ``force ntpq to operate in interactive mode'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+command, listpeers, peers, showpeers.
+@end itemize
+
+Force ntpq to operate in interactive mode.  Prompts will be written
+to the standard output and commands read from the standard input.
+@node ntpdc listpeers
+@subsection listpeers option (-l)
+@cindex ntpdc-listpeers
+
+This is the ``print a list of the peers'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+command.
+@end itemize
+
+Print a list of the peers known to the server as well as a summary of
+their state. This is equivalent to the 'listpeers' interactive command.
+@node ntpdc numeric
+@subsection numeric option (-n)
+@cindex ntpdc-numeric
+
+This is the ``numeric host addresses'' option.
+Output all host addresses in dotted-quad numeric format rather than
+converting to the canonical host names. 
+@node ntpdc peers
+@subsection peers option (-p)
+@cindex ntpdc-peers
+
+This is the ``print a list of the peers'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+command.
+@end itemize
+
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+@node ntpdc showpeers
+@subsection showpeers option (-s)
+@cindex ntpdc-showpeers
+
+This is the ``show a list of the peers'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+command.
+@end itemize
+
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'dmpeers' interactive command.
+
+
+@node ntpdc config
+@subsection presetting/configuring ntpdc
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTPDC} and @code{NTPDC_<OPTION_NAME>}.  @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTPDC} variable will be tokenized and parsed like
+the command line.  The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+@noindent
+@code{libopts} will search in 2 places for configuration files:
+@itemize @bullet
+@item
+$HOME
+@item
+$PWD
+@end itemize
+The environment variables @code{HOME}, and @code{PWD}
+are expanded and replaced when @file{ntpdc} runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named @file{.ntprc} is searched for
+within that directory and processed.
+
+
+Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line.  Values may be separated from the option name with a colon,
+equal sign or simply white space.  Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments.  The segments are separated by lines like:
+@example
+[NTPDC]
+@end example
+@noindent
+or by
+@example
+<?program ntpdc>
+@end example
+@noindent
+Do not mix these styles within one configuration file.
+
+Compound values and carefully constructed string values may also be
+specified using XML syntax:
+@example
+<option-name>
+   <sub-opt>...&lt;...&gt;...</sub-opt>
+</option-name>
+@end example
+@noindent
+yielding an @code{option-name.sub-opt} string value of
+@example
+"...<...>..."
+@end example
+@code{AutoOpts} does not track suboptions.  You simply note that it is a
+hierarchicly valued option.  @code{AutoOpts} does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0.  The optional argument specifies how much licensing
+detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.  Only the
+first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version.  This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntpdc exit status
+@subsection ntpdc exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@item 66 (EX_NOINPUT)
+A specified configuration file could not be loaded.
+@item 70 (EX_SOFTWARE)
+libopts had an internal operational error.  Please report
+it to autogen-users@@lists.sourceforge.net.  Thank you.
+@end table
+@node ntpdc Description
+@subsection ntpdc Description
+is a utility program used to query
+about its
+current state and to request changes in that state.
+It uses NTP mode 7 control message formats described in the source code.
+The program may
+be run either in interactive mode or controlled using command line
+arguments.
+Extensive state and statistics information is available
+through the
+interface.
+In addition, nearly all the
+configuration options which can be specified at startup using
+ntpd's configuration file may also be specified at run time using
+@node ntpdc Usage
+@subsection ntpdc Usage
+If one or more request options are included on the command line
+when
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+utility will prompt for
+commands if the standard input is a terminal device.
+The
+utility uses NTP mode 7 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+utility makes
+no attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+The operation of
+are specific to the particular
+implementation of the
+daemon and can be expected to
+work only with this and maybe some previous versions of the daemon.
+Requests from a remote
+utility which affect the
+state of the local server must be authenticated, which requires
+both the remote program and local server share a common key and key
+identifier.
+Note that in contexts where a host name is expected, a
+qualifier preceding the host name forces DNS resolution to the IPv4 namespace,
+while a
+qualifier forces DNS resolution to the IPv6 namespace.
+Specifying a command line option other than
+or
+will cause the specified query (queries) to be sent to
+the indicated host(s) immediately.
+Otherwise,
+will
+attempt to read interactive format commands from the standard
+input.
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+The output of a
+command is normally sent to the standard output, but optionally the
+output of individual commands may be sent to a file by appending a
+followed by a file name, to the command line.
+A number of interactive format commands are executed entirely
+within the
+utility itself and do not result in NTP
+mode 7 requests being sent to a server.
+These are described
+following.
+@table @samp
+@item Ic
+@item Ic
+A
+will print a list of all the command
+keywords known to this incarnation of
+A
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+than this manual
+page.
+@item Ic
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+@item Ic
+Set the host to which future queries will be sent.
+Hostname may
+be either a host name or a numeric address.
+@item Ic
+If
+is specified, host names are printed in
+information displays.
+If
+is specified, numeric
+addresses are printed instead.
+The default is
+unless
+modified using the command line
+switch.
+@item Ic
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+@item Ic
+Exit
+@item Ic
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+@item Ic
+Specify a timeout period for responses to server queries.
+The
+default is about 8000 milliseconds.
+Note that since
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+
+@end multitable
+Query commands result in NTP mode 7 packets containing requests for
+information being sent to the server.
+These are read-only commands
+in that they make no modification of the server configuration
+state.
+@table @samp
+@item Ic
+Obtains and prints a brief list of the peers for which the
+server is maintaining state.
+These should include all configured
+peer associations as well as those peers whose stratum is such that
+they are considered by the server to be possible future
+synchronization candidates.
+@item Ic
+Obtains a list of peers for which the server is maintaining
+state, along with a summary of that state.
+Summary information
+includes the address of the remote peer, the local interface
+address (0.0.0.0 if a local address has yet to be determined), the
+stratum of the remote peer (a stratum of 16 indicates the remote
+peer is unsynchronized), the polling interval, in seconds, the
+reachability register, in octal, and the current estimated delay,
+offset and dispersion of the peer, all in seconds.
+The character in the left margin indicates the mode this peer
+entry is operating in.
+A
+denotes symmetric active, a
+indicates symmetric passive, a
+means the
+remote server is being polled in client mode, a
+indicates that the server is broadcasting to this address, a
+denotes that the remote peer is sending broadcasts and a
+denotes that the remote peer is sending broadcasts and a
+marks the peer the server is currently synchronizing
+to.
+The contents of the host field may be one of four forms.
+It may
+be a host name, an IP address, a reference clock implementation
+name with its parameter or
+On
+only IP-addresses
+will be displayed.
+@item Ic
+A slightly different peer summary list.
+Identical to the output
+of the
+command, except for the character in the
+leftmost column.
+Characters only appear beside peers which were
+included in the final stage of the clock selection algorithm.
+A
+indicates that this peer was cast off in the falseticker
+detection, while a
+indicates that the peer made it
+through.
+A
+denotes the peer the server is currently
+synchronizing with.
+@item Ic
+Shows a detailed display of the current peer variables for one
+or more peers.
+Most of these values are described in the NTP
+Version 2 specification.
+@item Ic
+Show per-peer statistic counters associated with the specified
+peer(s).
+@item Ic
+Obtain and print information concerning a peer clock.
+The
+values obtained provide information on the setting of fudge factors
+and other clock performance information.
+@item Ic
+Obtain and print kernel phase-lock loop operating parameters.
+This information is available only if the kernel has been specially
+modified for a precision timekeeping function.
+@item Ic
+Print the values of selected loop filter variables.
+The loop
+filter is the part of NTP which deals with adjusting the local
+system clock.
+The
+is the last offset given to the
+loop filter by the packet processing code.
+The
+is the frequency error of the local clock in parts-per-million
+(ppm).
+The
+controls the stiffness of the
+phase-lock loop and thus the speed at which it can adapt to
+oscillator drift.
+The
+value is the number
+of seconds which have elapsed since the last sample offset was
+given to the loop filter.
+The
+and
+options specify the format in which this
+information is to be printed, with
+as the
+default.
+@item Ic
+Print a variety of system state variables, i.e., state related
+to the local server.
+All except the last four lines are described
+in the NTP Version 3 specification, RFC-1305.
+The
+show various system flags, some of
+which can be set and cleared by the
+and
+configuration commands, respectively.
+These are
+the
+and
+flags.
+See the
+documentation for the meaning of these flags.
+There
+are two additional flags which are read only, the
+and
+These flags indicate
+the synchronization status when the precision time kernel
+modifications are in use.
+The
+indicates that
+the local clock is being disciplined by the kernel, while the
+indicates the kernel discipline is provided by the PPS
+signal.
+The
+is the residual frequency error remaining
+after the system frequency correction is applied and is intended for
+maintenance and debugging.
+In most architectures, this value will
+initially decrease from as high as 500 ppm to a nominal value in
+the range .01 to 0.1 ppm.
+If it remains high for some time after
+starting the daemon, something may be wrong with the local clock,
+or the value of the kernel variable
+may be
+incorrect.
+The
+shows the default broadcast delay,
+as set by the
+configuration command.
+The
+shows the default authentication delay,
+as set by the
+configuration command.
+@item Ic
+Print statistics counters maintained in the protocol
+module.
+@item Ic
+Print statistics counters related to memory allocation
+code.
+@item Ic
+Print statistics counters maintained in the input-output
+module.
+@item Ic
+Print statistics counters maintained in the timer/event queue
+support code.
+@item Ic
+Obtain and print the server's restriction list.
+This list is
+(usually) printed in sorted order and may help to understand how
+the restrictions are applied.
+@item Ic
+Obtain and print traffic counts collected and maintained by the
+monitor facility.
+The version number should not normally need to be
+specified.
+@item Ic
+Obtain debugging information for a reference clock driver.
+This
+information is provided only by some clock drivers and is mostly
+undecodable without a copy of the driver source in hand.
+
+@end multitable
+All requests which cause state changes in the server are
+authenticated by the server using a configured NTP key (the
+facility can also be disabled by the server by not configuring a
+key).
+The key number and the corresponding key must also be made
+known to
+This can be done using the
+and
+commands, the latter of which will prompt at the terminal for a
+password to use as the encryption key.
+You will also be prompted
+automatically for both the key number and password the first time a
+command which would result in an authenticated request to the
+server is given.
+Authentication not only provides verification that
+the requester has permission to make such changes, but also gives
+an extra degree of protection again transmission errors.
+Authenticated requests always include a timestamp in the packet
+data, which is included in the computation of the authentication
+code.
+This timestamp is compared by the server to its receive time
+stamp.
+If they differ by more than a small amount the request is
+rejected.
+This is done for two reasons.
+First, it makes simple
+replay attacks on the server, by someone who might be able to
+overhear traffic on your LAN, much more difficult.
+Second, it makes
+it more difficult to request configuration changes to your server
+from topologically remote hosts.
+While the reconfiguration facility
+will work well with a server on the local host, and may work
+adequately between time-synchronized hosts on the same LAN, it will
+work very poorly for more distant hosts.
+As such, if reasonable
+passwords are chosen, care is taken in the distribution and
+protection of keys and appropriate source address restrictions are
+applied, the run time reconfiguration facility should provide an
+adequate level of security.
+The following commands all make authenticated requests.
+@table @samp
+@item Xo
+Add a configured peer association at the given address and
+operating in symmetric active mode.
+Note that an existing
+association with the same peer may be deleted when this command is
+executed, or may simply be converted to conform to the new
+configuration, as appropriate.
+If the optional
+is a
+nonzero integer, all outgoing packets to the remote server will
+have an authentication field attached encrypted with this key.
+If
+the value is 0 (or not given) no authentication will be done.
+The
+can be 1, 2 or 3 and defaults to 3.
+The
+keyword indicates a preferred peer (and thus will
+be used primarily for clock synchronisation if possible).
+The
+preferred peer also determines the validity of the PPS signal - if
+the preferred peer is suitable for synchronisation so is the PPS
+signal.
+@item Xo
+Identical to the addpeer command, except that the operating
+mode is client.
+@item Xo
+Identical to the addpeer command, except that the operating
+mode is broadcast.
+In this case a valid key identifier and key are
+required.
+The
+parameter can be the broadcast
+address of the local network or a multicast group address assigned
+to NTP.
+If a multicast address, a multicast-capable kernel is
+required.
+@item Ic
+This command causes the configured bit to be removed from the
+specified peer(s).
+In many cases this will cause the peer
+association to be deleted.
+When appropriate, however, the
+association may persist in an unconfigured mode if the remote peer
+is willing to continue on in this fashion.
+@item Xo
+This command provides a way to set certain data for a reference
+clock.
+See the source listing for further information.
+@item Xo
+@item Xo
+These commands operate in the same way as the
+and
+configuration file commands of
+@table @samp
+@item Cm
+Enables the server to synchronize with unconfigured peers only
+if the peer has been correctly authenticated using either public key
+or private key cryptography.
+The default for this flag is enable.
+@item Cm
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the multicastclient command with
+default address.
+The default for this flag is disable.
+@item Cm
+Enables the calibrate feature for reference clocks.
+The default for this flag is disable.
+@item Cm
+Enables the kernel time discipline, if available.
+The default for this flag is enable if support is available, otherwise disable.
+@item Cm
+Enables the monitoring facility.
+See the
+program and the monlist command or further information.
+The default for this flag is enable.
+@item Cm
+Enables time and frequency discipline.
+In effect, this switch opens and closes the feedback loop,
+which is useful for testing.
+The default for this flag is enable.
+@item Cm
+Enables the pulse-per-second (PPS) signal when frequency
+and time is disciplined by the precision time kernel modifications.
+See the
+(available as part of the HTML documentation
+provided in
+page for further information.
+The default for this flag is disable.
+@item Cm
+Enables the statistics facility.
+See the
+section of
+for further information.
+The default for this flag is disable.
+
+@end multitable
+This command operates in the same way as the
+configuration file commands of
+Unrestrict the matching entry from the restrict list.
+Delete the matching entry from the restrict list.
+Causes the current set of authentication keys to be purged and
+a new set to be obtained by rereading the keys file (which must
+have been specified in the
+configuration file).
+This
+allows encryption keys to be changed without restarting the
+server.
+These commands operate in the same way as the
+and
+configuration file
+commands of
+Returns information concerning the authentication module,
+including known keys and counts of encryptions and decryptions
+which have been done.
+Display the traps set in the server.
+See the source listing for
+further information.
+Set a trap for asynchronous messages.
+See the source listing
+for further information.
+Clear a trap for asynchronous messages.
+See the source listing
+for further information.
+Clear the statistics counters in various modules of the server.
+See the source listing for further information.
+
+@end multitable
+@node ntpdc See Also
+@subsection ntpdc See Also
+@node ntpdc Authors
+@subsection ntpdc Authors
+The formatting directives in this document came from FreeBSD.
+@node ntpdc Bugs
+@subsection ntpdc Bugs
+The
+utility is a crude hack.
+Much of the information it shows is
+deadly boring and could only be loved by its implementer.
+The
+program was designed so that new (and temporary) features were easy
+to hack in, at great expense to the program's ease of use.
+Despite
+this, the program is occasionally useful.
+Please report bugs to http://bugs.ntp.org .
diff --git a/ntpdc/ntpdc-opts.texi b/ntpdc/ntpdc-opts.texi
deleted file mode 100644 (file)
index 9877107..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-@node ntpdc Invocation
-@section Invoking ntpdc
-@pindex ntpdc
-@cindex vendor-specific NTPD control program
-@ignore
-# 
-# EDIT THIS FILE WITH CAUTION  (ntpdc-opts.texi)
-# 
-# It has been AutoGen-ed  April 11, 2012 at 08:43:11 AM by AutoGen 5.14
-# From the definitions    ntpdc-opts.def
-# and the template file   aginfo.tpl
-@end ignore
-
-
-
-This section was generated by @strong{AutoGen},
-the aginfo template and the option descriptions for the @command{ntpdc} program.  It documents the @command{ntpdc} usage text and option meanings.
-
-This software is released under a specialized copyright license.
-
-@menu
-* ntpdc usage::                  ntpdc usage help (-?)
-* ntpdc command::               command option (-c)
-* ntpdc debug-level::           debug-level option (-d)
-* ntpdc interactive::           interactive option (-i)
-* ntpdc ipv4::                  ipv4 option (-4)
-* ntpdc ipv6::                  ipv6 option (-6)
-* ntpdc listpeers::             listpeers option (-l)
-* ntpdc numeric::               numeric option (-n)
-* ntpdc peers::                 peers option (-p)
-* ntpdc set-debug-level::       set-debug-level option (-D)
-* ntpdc showpeers::             showpeers option (-s)
-@end menu
-
-@node ntpdc usage
-@subsection ntpdc usage help (-?)
-@cindex ntpdc-usage
-
-This is the automatically generated usage text for ntpdc:
-
-@exampleindent 0
-@example
-ntpdc - vendor-specific NTPD control program - Ver. 4.2.7p271
-USAGE:  ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
-  Flg Arg Option-Name    Description
-   -4 no  ipv4           Force IPv4 DNS name resolution
-                                - prohibits these options:
-                                ipv6
-   -6 no  ipv6           Force IPv6 DNS name resolution
-                                - prohibits these options:
-                                ipv4
-   -c Str command        run a command and exit
-                                - may appear multiple times
-   -d no  debug-level    Increase debug verbosity level
-                                - may appear multiple times
-   -D Str set-debug-level Set the debug verbosity level
-                                - may appear multiple times
-   -i no  interactive    Force ntpq to operate in interactive mode
-                                - prohibits these options:
-                                command
-                                listpeers
-                                peers
-                                showpeers
-   -l no  listpeers      Print a list of the peers
-                                - prohibits these options:
-                                command
-   -n no  numeric        numeric host addresses
-   -p no  peers          Print a list of the peers
-                                - prohibits these options:
-                                command
-   -s no  showpeers      Show a list of the peers
-                                - prohibits these options:
-                                command
-      opt version        Output version information and exit
-   -? no  help           Display extended usage information and exit
-   -! no  more-help      Extended usage information passed thru pager
-   -> opt save-opts      Save the option state to a config file
-   -< Str load-opts      Load options from a config file
-                                - disabled as --no-load-opts
-                                - may appear multiple times
-
-Options are specified by doubled hyphens and their name or by a single
-hyphen and the flag character.
-
-
-
-The following option preset mechanisms are supported:
- - reading file $HOME/.ntprc
- - reading file ./.ntprc
- - examining environment variables named NTPDC_*
-
-please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
-@end example
-@exampleindent 4
-
-@node ntpdc command
-@subsection command option (-c)
-@cindex ntpdc-command
-
-This is the ``run a command and exit'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-The following argument is interpreted as an interactive format command
-and is added to the list of commands to be executed on the specified
-host(s).
-
-@node ntpdc debug-level
-@subsection debug-level option (-d)
-@cindex ntpdc-debug-level
-
-This is the ``increase debug verbosity level'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-
-
-@node ntpdc interactive
-@subsection interactive option (-i)
-@cindex ntpdc-interactive
-
-This is the ``force ntpq to operate in interactive mode'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-command, listpeers, peers, showpeers.
-@end itemize
-
-Force ntpq to operate in interactive mode.  Prompts will be written
-to the standard output and commands read from the standard input.
-
-@node ntpdc ipv4
-@subsection ipv4 option (-4)
-@cindex ntpdc-ipv4
-
-This is the ``force ipv4 dns name resolution'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-ipv6.
-@end itemize
-
-Force DNS resolution of following host names on the command line
-to the IPv4 namespace.
-
-@node ntpdc ipv6
-@subsection ipv6 option (-6)
-@cindex ntpdc-ipv6
-
-This is the ``force ipv6 dns name resolution'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-ipv4.
-@end itemize
-
-Force DNS resolution of following host names on the command line
-to the IPv6 namespace.
-
-@node ntpdc listpeers
-@subsection listpeers option (-l)
-@cindex ntpdc-listpeers
-
-This is the ``print a list of the peers'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-command.
-@end itemize
-
-Print a list of the peers known to the server as well as a summary of
-their state. This is equivalent to the 'listpeers' interactive command.
-
-@node ntpdc numeric
-@subsection numeric option (-n)
-@cindex ntpdc-numeric
-
-This is the ``numeric host addresses'' option.
-Output all host addresses in dotted-quad numeric format rather than
-converting to the canonical host names. 
-
-@node ntpdc peers
-@subsection peers option (-p)
-@cindex ntpdc-peers
-
-This is the ``print a list of the peers'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-command.
-@end itemize
-
-Print a list of the peers known to the server as well as a summary
-of their state. This is equivalent to the 'peers' interactive command.
-
-@node ntpdc set-debug-level
-@subsection set-debug-level option (-D)
-@cindex ntpdc-set-debug-level
-
-This is the ``set the debug verbosity level'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-
-
-@node ntpdc showpeers
-@subsection showpeers option (-s)
-@cindex ntpdc-showpeers
-
-This is the ``show a list of the peers'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-command.
-@end itemize
-
-Print a list of the peers known to the server as well as a summary
-of their state. This is equivalent to the 'dmpeers' interactive command.
index 20e9f217eae46e464eecc1102ce1f833d2ad28b6..a4c7f269c4e60aa316dda6df58f80c466bdc6304 100644 (file)
@@ -64,7 +64,7 @@ and
 the +4.567 +/- 0.089 secs indicates the time offset and
 error bound of the system clock relative to the server clock.
 
-@include ntpdc-opts.texi
+@include invoke-ntpdc.texi
 
 @node Usage
 @comment  node-name,  next,  previous,  up
index 45c451889d497aa41f456a19054effbb44923688..03ebe9c6f19aaeab63bbd00ef75bb8a5d0325cfa 100644 (file)
@@ -25,9 +25,9 @@ CLEANFILES=
 DISTCLEANFILES=        .version version.c config.log $(man_MANS)
 ETAGS_ARGS=    Makefile.am
 EXTRA_DIST=                    \
+       invoke-ntpq.menu        \
+       invoke-ntpq.texi        \
        ntpq-opts.def           \
-       ntpq-opts.menu          \
-       ntpq-opts.texi          \
        ntpq.1ntpqman           \
        ntpq.1ntpqmdoc          \
        ntpq.man.in             \
@@ -36,8 +36,8 @@ EXTRA_DIST=                   \
 
 BUILT_SOURCES= ntpq-opts.c ntpq-opts.h
 noinst_DATA=                           \
-       $(srcdir)/ntpq-opts.menu        \
-       $(srcdir)/ntpq-opts.texi        \
+       $(srcdir)/invoke-ntpq.menu      \
+       $(srcdir)/invoke-ntpq.texi      \
        $(srcdir)/ntpq.man.in           \
        $(srcdir)/ntpq.mdoc.in          \
        $(NULL)
@@ -92,11 +92,11 @@ ntpq.$(NTPQ_MS): $(srcdir)/ntpq.$(MANTAGFMT).in $(top_builddir)/config.status
 
 ###
 
-$(srcdir)/ntpq-opts.menu: $(srcdir)/ntpq-opts.texi
+$(srcdir)/invoke-ntpq.menu: $(srcdir)/invoke-ntpq.texi
        @: do-nothing action to avoid default SCCS get, .menu built with .texi
        
-$(srcdir)/ntpq-opts.texi: $(srcdir)/ntpq-opts.def $(std_def_list)
-       $(run_ag) -Taginfo.tpl -DLEVEL=section ntpq-opts.def
+$(srcdir)/invoke-ntpq.texi: $(srcdir)/ntpq-opts.def $(std_def_list)
+       $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpq-opts.def
        $(top_srcdir)/scripts/check--help $@
 
 $(PROGRAMS): version.o
similarity index 100%
rename from ntpq/ntpq-opts.menu
rename to ntpq/invoke-ntpq.menu
diff --git a/ntpq/invoke-ntpq.texi b/ntpq/invoke-ntpq.texi
new file mode 100644 (file)
index 0000000..e6930a9
--- /dev/null
@@ -0,0 +1,481 @@
+@node ntpq Invocation
+@section Invoking ntpq
+@pindex ntpq
+@cindex standard NTP query program
+@ignore
+# 
+# EDIT THIS FILE WITH CAUTION  (invoke-ntpq.texi)
+# 
+# It has been AutoGen-ed  April 14, 2012 at 12:22:51 AM by AutoGen 5.16pre18
+# From the definitions    ntpq-opts.def
+# and the template file   agtexi-cmd.tpl
+@end ignore
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpq} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntpq usage::                  ntpq help/usage (-?)
+* ntpq ipv4::                   ipv4 option (-4)
+* ntpq ipv6::                   ipv6 option (-6)
+* ntpq command::                command option (-c)
+* ntpq peers::                  peers option (-p)
+* ntpq interactive::            interactive option (-i)
+* ntpq numeric::                numeric option (-n)
+* ntpq old-rv::                 old-rv option
+* ntpq config::                 presetting/configuring ntpq
+* ntpq exit status::            exit status
+* ntpq Description::            Description
+@end menu
+
+@node ntpq usage
+@subsection ntpq help/usage (-?)
+@cindex ntpq help
+
+This is the automatically generated usage text for ntpq.
+The text printed is the same whether for the @code{help} option (-?) or the @code{more-help} option (-!).  @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function.  The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}.  Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntpq - standard NTP query program - Ver. 4.2.7p271
+USAGE:  ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
+  Flg Arg Option-Name    Description
+   -4 no  ipv4           Force IPv4 DNS name resolution
+                                - prohibits these options:
+                                ipv6
+   -6 no  ipv6           Force IPv6 DNS name resolution
+                                - prohibits these options:
+                                ipv4
+   -c Str command        run a command and exit
+                                - may appear multiple times
+   -d no  debug-level    Increase debug verbosity level
+                                - may appear multiple times
+   -D Str set-debug-level Set the debug verbosity level
+                                - may appear multiple times
+   -p no  peers          Print a list of the peers
+                                - prohibits these options:
+                                interactive
+   -i no  interactive    Force ntpq to operate in interactive mode
+                                - prohibits these options:
+                                command
+                                peers
+   -n no  numeric        numeric host addresses
+      no  old-rv         Always output status line with readvar
+      opt version        Output version information and exit
+   -? no  help           Display extended usage information and exit
+   -! no  more-help      Extended usage information passed thru pager
+   -> opt save-opts      Save the option state to a config file
+   -< Str load-opts      Load options from a config file
+                                - disabled as --no-load-opts
+                                - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named NTPQ_*
+
+please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
+@end example
+@exampleindent 4
+
+@node ntpq ipv4
+@subsection ipv4 option (-4)
+@cindex ntpq-ipv4
+
+This is the ``force ipv4 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv6.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+@node ntpq ipv6
+@subsection ipv6 option (-6)
+@cindex ntpq-ipv6
+
+This is the ``force ipv6 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv4.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+@node ntpq command
+@subsection command option (-c)
+@cindex ntpq-command
+
+This is the ``run a command and exit'' option.
+This option takes an argument string @file{cmd}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+@node ntpq peers
+@subsection peers option (-p)
+@cindex ntpq-peers
+
+This is the ``print a list of the peers'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+interactive.
+@end itemize
+
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+@node ntpq interactive
+@subsection interactive option (-i)
+@cindex ntpq-interactive
+
+This is the ``force ntpq to operate in interactive mode'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+command, peers.
+@end itemize
+
+Force ntpq to operate in interactive mode.  Prompts will be written
+to the standard output and commands read from the standard input.
+@node ntpq numeric
+@subsection numeric option (-n)
+@cindex ntpq-numeric
+
+This is the ``numeric host addresses'' option.
+Output all host addresses in dotted-quad numeric format rather than
+converting to the canonical host names. 
+@node ntpq old-rv
+@subsection old-rv option
+@cindex ntpq-old-rv
+
+This is the ``always output status line with readvar'' option.
+By default, ntpq now suppresses the associd=... line that
+precedes the output of "readvar" (alias "rv") when a single
+variable is requested, such as ntpq -c "rv 0 offset".  This
+option causes ntpq to include both lines of output for a
+single-variable readvar.  Using an environment variable to
+preset this option in a script will enable both older and
+newer ntpq to behave identically in this regard.
+
+
+@node ntpq config
+@subsection presetting/configuring ntpq
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTPQ} and @code{NTPQ_<OPTION_NAME>}.  @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTPQ} variable will be tokenized and parsed like
+the command line.  The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+@noindent
+@code{libopts} will search in 2 places for configuration files:
+@itemize @bullet
+@item
+$HOME
+@item
+$PWD
+@end itemize
+The environment variables @code{HOME}, and @code{PWD}
+are expanded and replaced when @file{ntpq} runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named @file{.ntprc} is searched for
+within that directory and processed.
+
+
+Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line.  Values may be separated from the option name with a colon,
+equal sign or simply white space.  Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments.  The segments are separated by lines like:
+@example
+[NTPQ]
+@end example
+@noindent
+or by
+@example
+<?program ntpq>
+@end example
+@noindent
+Do not mix these styles within one configuration file.
+
+Compound values and carefully constructed string values may also be
+specified using XML syntax:
+@example
+<option-name>
+   <sub-opt>...&lt;...&gt;...</sub-opt>
+</option-name>
+@end example
+@noindent
+yielding an @code{option-name.sub-opt} string value of
+@example
+"...<...>..."
+@end example
+@code{AutoOpts} does not track suboptions.  You simply note that it is a
+hierarchicly valued option.  @code{AutoOpts} does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0.  The optional argument specifies how much licensing
+detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.  Only the
+first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version.  This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntpq exit status
+@subsection ntpq exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@item 66 (EX_NOINPUT)
+A specified configuration file could not be loaded.
+@item 70 (EX_SOFTWARE)
+libopts had an internal operational error.  Please report
+it to autogen-users@@lists.sourceforge.net.  Thank you.
+@end table
+@node ntpq Description
+@subsection ntpq Description
+
+The
+utility program is used to query NTP servers which
+implement the standard NTP mode 6 control message formats defined
+in Appendix B of the NTPv3 specification RFC1305, requesting
+information about current state and/or changes in that state.
+The same formats are used in NTPv4, although some of the
+variables have changed and new ones added. The description on this
+page is for the NTPv4 variables.
+The program may be run either in interactive mode or controlled using
+command line arguments.
+Requests to read and write arbitrary
+variables can be assembled, with raw and pretty-printed output
+options being available.
+The
+utility can also obtain and print a
+list of peers in a common format by sending multiple queries to the
+server.
+
+If one or more request options is included on the command line
+when
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+utility will prompt for
+commands if the standard input is a terminal device.
+
+uses NTP mode 6 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+utility makes
+one attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+
+Specifying a
+command line option other than
+or
+will
+cause the specified query (queries) to be sent to the indicated
+host(s) immediately.
+Otherwise,
+will attempt to read
+interactive format commands from the standard input.
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+
+A
+number of interactive format commands are executed entirely within
+the
+utility itself and do not result in NTP mode 6
+requests being sent to a server.
+These are described following.
+@table @samp
+@item Ic
+@item Ic
+A
+by itself will print a list of all the command
+keywords known to this incarnation of
+A
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+than this manual
+page.
+@item Ic
+@item Ic
+@item Ic
+The data carried by NTP mode 6 messages consists of a list of
+items of the form
+where the
+is ignored, and can be omitted,
+in requests to the server to read variables.
+The
+utility maintains an internal list in which data to be included in control
+messages can be assembled, and sent using the
+and
+commands described below.
+The
+command allows variables and their optional values to be added to
+the list.
+If more than one variable is to be added, the list should
+be comma-separated and not contain white space.
+The
+command can be used to remove individual variables from the list,
+while the
+command removes all variables from the
+list.
+@item Ic
+Normally
+does not authenticate requests unless
+they are write requests.
+The command
+causes
+to send authentication with all requests it
+makes.
+Authenticated requests causes some servers to handle
+requests slightly differently, and can occasionally melt the CPU in
+fuzzballs if you turn authentication on before doing a
+display.
+The command
+causes
+to display whether or not
+is currently autheinticating requests.
+@item Ic
+Causes output from query commands to be "cooked", so that
+variables which are recognized by
+will have their
+values reformatted for human consumption.
+Variables which
+thinks should have a decodable value but didn't are
+marked with a trailing
+@item Xo
+With no argument, displays the current debug level.
+Otherwise, the debug level is changed to the indicated level.
+@item Ic
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+@item Ic
+Set the host to which future queries will be sent.
+may be either a host name or a numeric address.
+@item Ic
+If
+is specified, host names are printed in
+information displays.
+If
+is specified, numeric
+addresses are printed instead.
+The default is
+unless
+modified using the command line
+switch.
+@item Ic
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+@item Ic
+Sets the NTP version number which
+claims in
+packets.
+Defaults to 3, and note that mode 6 control messages (and
+modes, for that matter) didn't exist in NTP version 1.
+There appear
+to be no servers left which demand version 1.
+With no argument, displays the current NTP version that will be used
+when communicating with servers.
+@item Ic
+Exit
+@item Ic
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+@item Ic
+Causes all output from query commands is printed as received
+from the remote server.
+The only formating/interpretation done on
+the data is to transform nonascii data into a printable (but barely
+understandable) form.
+@item Ic
+Specify a timeout period for responses to server queries.
+The
+default is about 5000 milliseconds.
+Note that since
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+
+@end multitable
diff --git a/ntpq/ntpq-opts.texi b/ntpq/ntpq-opts.texi
deleted file mode 100644 (file)
index 8cd6e7a..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-@node ntpq Invocation
-@section Invoking ntpq
-@pindex ntpq
-@cindex standard NTP query program
-@ignore
-# 
-# EDIT THIS FILE WITH CAUTION  (ntpq-opts.texi)
-# 
-# It has been AutoGen-ed  April 11, 2012 at 08:43:23 AM by AutoGen 5.14
-# From the definitions    ntpq-opts.def
-# and the template file   aginfo.tpl
-@end ignore
-This program has no explanation.
-
-
-
-This section was generated by @strong{AutoGen},
-the aginfo template and the option descriptions for the @command{ntpq} program.  It documents the @command{ntpq} usage text and option meanings.
-
-This software is released under a specialized copyright license.
-
-@menu
-* ntpq usage::                  ntpq usage help (-?)
-* ntpq command::               command option (-c)
-* ntpq debug-level::           debug-level option (-d)
-* ntpq interactive::           interactive option (-i)
-* ntpq ipv4::                  ipv4 option (-4)
-* ntpq ipv6::                  ipv6 option (-6)
-* ntpq numeric::               numeric option (-n)
-* ntpq old-rv::                old-rv option
-* ntpq peers::                 peers option (-p)
-* ntpq set-debug-level::       set-debug-level option (-D)
-@end menu
-
-@node ntpq usage
-@subsection ntpq usage help (-?)
-@cindex ntpq-usage
-
-This is the automatically generated usage text for ntpq:
-
-@exampleindent 0
-@example
-ntpq - standard NTP query program - Ver. 4.2.7p271
-USAGE:  ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
-  Flg Arg Option-Name    Description
-   -4 no  ipv4           Force IPv4 DNS name resolution
-                                - prohibits these options:
-                                ipv6
-   -6 no  ipv6           Force IPv6 DNS name resolution
-                                - prohibits these options:
-                                ipv4
-   -c Str command        run a command and exit
-                                - may appear multiple times
-   -d no  debug-level    Increase debug verbosity level
-                                - may appear multiple times
-   -D Str set-debug-level Set the debug verbosity level
-                                - may appear multiple times
-   -p no  peers          Print a list of the peers
-                                - prohibits these options:
-                                interactive
-   -i no  interactive    Force ntpq to operate in interactive mode
-                                - prohibits these options:
-                                command
-                                peers
-   -n no  numeric        numeric host addresses
-      no  old-rv         Always output status line with readvar
-      opt version        Output version information and exit
-   -? no  help           Display extended usage information and exit
-   -! no  more-help      Extended usage information passed thru pager
-   -> opt save-opts      Save the option state to a config file
-   -< Str load-opts      Load options from a config file
-                                - disabled as --no-load-opts
-                                - may appear multiple times
-
-Options are specified by doubled hyphens and their name or by a single
-hyphen and the flag character.
-
-The following option preset mechanisms are supported:
- - reading file $HOME/.ntprc
- - reading file ./.ntprc
- - examining environment variables named NTPQ_*
-
-please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
-@end example
-@exampleindent 4
-
-@node ntpq command
-@subsection command option (-c)
-@cindex ntpq-command
-
-This is the ``run a command and exit'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-The following argument is interpreted as an interactive format command
-and is added to the list of commands to be executed on the specified
-host(s).
-
-@node ntpq debug-level
-@subsection debug-level option (-d)
-@cindex ntpq-debug-level
-
-This is the ``increase debug verbosity level'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-
-
-@node ntpq interactive
-@subsection interactive option (-i)
-@cindex ntpq-interactive
-
-This is the ``force ntpq to operate in interactive mode'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-command, peers.
-@end itemize
-
-Force ntpq to operate in interactive mode.  Prompts will be written
-to the standard output and commands read from the standard input.
-
-@node ntpq ipv4
-@subsection ipv4 option (-4)
-@cindex ntpq-ipv4
-
-This is the ``force ipv4 dns name resolution'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-ipv6.
-@end itemize
-
-Force DNS resolution of following host names on the command line
-to the IPv4 namespace.
-
-@node ntpq ipv6
-@subsection ipv6 option (-6)
-@cindex ntpq-ipv6
-
-This is the ``force ipv6 dns name resolution'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-ipv4.
-@end itemize
-
-Force DNS resolution of following host names on the command line
-to the IPv6 namespace.
-
-@node ntpq numeric
-@subsection numeric option (-n)
-@cindex ntpq-numeric
-
-This is the ``numeric host addresses'' option.
-Output all host addresses in dotted-quad numeric format rather than
-converting to the canonical host names. 
-
-@node ntpq old-rv
-@subsection old-rv option
-@cindex ntpq-old-rv
-
-This is the ``always output status line with readvar'' option.
-By default, ntpq now suppresses the associd=... line that
-precedes the output of "readvar" (alias "rv") when a single
-variable is requested, such as ntpq -c "rv 0 offset".  This
-option causes ntpq to include both lines of output for a
-single-variable readvar.  Using an environment variable to
-preset this option in a script will enable both older and
-newer ntpq to behave identically in this regard.
-
-@node ntpq peers
-@subsection peers option (-p)
-@cindex ntpq-peers
-
-This is the ``print a list of the peers'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-interactive.
-@end itemize
-
-Print a list of the peers known to the server as well as a summary
-of their state. This is equivalent to the 'peers' interactive command.
-
-@node ntpq set-debug-level
-@subsection set-debug-level option (-D)
-@cindex ntpq-set-debug-level
-
-This is the ``set the debug verbosity level'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
index 0d9e5271cb98906c63c036f8d1fa3678928bb78f..13b00d4aec6a08ec60ddbcc5c6fcd88e61d4e107 100644 (file)
@@ -23,9 +23,9 @@ AM_CPPFLAGS += $(CPPFLAGS_NTP)
 AM_LDFLAGS = $(LDFLAGS_NTP)
 
 EXTRA_DIST=                    \
+       invoke-ntpsnmpd.menu    \
+       invoke-ntpsnmpd.texi    \
        ntpsnmpd-opts.def       \
-       ntpsnmpd-opts.menu      \
-       ntpsnmpd-opts.texi      \
        ntpsnmpd.1ntpsnmpdman   \
        ntpsnmpd.1ntpsnmpdmdoc  \
        ntpsnmpd.man.in         \
@@ -37,8 +37,8 @@ BUILT_SOURCES=        ntpsnmpd-opts.c ntpsnmpd-opts.h
 CLEANFILES=
 DISTCLEANFILES=        config.log $(man_MANS)
 noinst_DATA=                           \
-       $(srcdir)/ntpsnmpd-opts.menu    \
-       $(srcdir)/ntpsnmpd-opts.texi    \
+       $(srcdir)/invoke-ntpsnmpd.menu  \
+       $(srcdir)/invoke-ntpsnmpd.texi  \
        $(srcdir)/ntpsnmpd.man.in       \
        $(srcdir)/ntpsnmpd.mdoc.in      \
        $(NULL)
@@ -90,11 +90,11 @@ ntpsnmpd.$(NTPSNMPD_MS): $(srcdir)/ntpsnmpd.$(MANTAGFMT).in $(top_builddir)/conf
 
 ###
 
-$(srcdir)/ntpsnmpd-opts.menu: $(srcdir)/ntpsnmpd-opts.texi
+$(srcdir)/invoke-ntpsnmpd.menu: $(srcdir)/invoke-ntpsnmpd.texi
        @: do-nothing action to avoid default SCCS get, .menu built with .texi
        
-$(srcdir)/ntpsnmpd-opts.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
-       $(run_ag) -Taginfo.tpl -DLEVEL=section ntpsnmpd-opts.def
+$(srcdir)/invoke-ntpsnmpd.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
+       $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsnmpd-opts.def
        $(top_srcdir)/scripts/check--help $@
 
 include $(top_srcdir)/bincheck.mf
diff --git a/ntpsnmpd/invoke-ntpsnmpd.texi b/ntpsnmpd/invoke-ntpsnmpd.texi
new file mode 100644 (file)
index 0000000..fc0cd88
--- /dev/null
@@ -0,0 +1,156 @@
+@node ntpsnmpd Invocation
+@section Invoking ntpsnmpd
+@pindex ntpsnmpd
+@cindex NTP SNMP MIB agent
+@ignore
+# 
+# EDIT THIS FILE WITH CAUTION  (invoke-ntpsnmpd.texi)
+# 
+# It has been AutoGen-ed  April 14, 2012 at 12:22:53 AM by AutoGen 5.16pre18
+# From the definitions    ntpsnmpd-opts.def
+# and the template file   agtexi-cmd.tpl
+@end ignore
+
+
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpsnmpd} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntpsnmpd usage::                  ntpsnmpd help/usage (-?)
+* ntpsnmpd agentxsocket::           agentxsocket option
+* ntpsnmpd config::                 presetting/configuring ntpsnmpd
+* ntpsnmpd exit status::            exit status
+* ntpsnmpd Description::            Description
+* ntpsnmpd Authors::                Authors
+@end menu
+
+@node ntpsnmpd usage
+@subsection ntpsnmpd help/usage (-?)
+@cindex ntpsnmpd help
+
+This is the automatically generated usage text for ntpsnmpd.
+The text printed is the same whether for the @code{help} option (-?) or the @code{more-help} option (-!).  @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function.  The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}.  Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntpsnmpd is unavailable - no -?
+@end example
+@exampleindent 4
+
+@node ntpsnmpd agentxsocket
+@subsection agentxsocket option
+@cindex ntpsnmpd-agentxsocket
+
+This is the ``the socket address ntpsnmpd uses to connect to net-snmpd'' option.
+This option takes an argument string.
+[<transport-specifier>:]<transport-address>
+The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705.
+
+
+@node ntpsnmpd config
+@subsection presetting/configuring ntpsnmpd
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTPSNMPD} and @code{NTPSNMPD_<OPTION_NAME>}.  @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTPSNMPD} variable will be tokenized and parsed like
+the command line.  The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+@noindent
+@code{libopts} will search in 2 places for configuration files:
+@itemize @bullet
+@item
+$HOME
+@item
+$PWD
+@end itemize
+The environment variables @code{HOME}, and @code{PWD}
+are expanded and replaced when @file{ntpsnmpd} runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named @file{.ntprc} is searched for
+within that directory and processed.
+
+
+Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line.  Values may be separated from the option name with a colon,
+equal sign or simply white space.  Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments.  The segments are separated by lines like:
+@example
+[NTPSNMPD]
+@end example
+@noindent
+or by
+@example
+<?program ntpsnmpd>
+@end example
+@noindent
+Do not mix these styles within one configuration file.
+
+Compound values and carefully constructed string values may also be
+specified using XML syntax:
+@example
+<option-name>
+   <sub-opt>...&lt;...&gt;...</sub-opt>
+</option-name>
+@end example
+@noindent
+yielding an @code{option-name.sub-opt} string value of
+@example
+"...<...>..."
+@end example
+@code{AutoOpts} does not track suboptions.  You simply note that it is a
+hierarchicly valued option.  @code{AutoOpts} does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0.  The optional argument specifies how much licensing
+detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.  Only the
+first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version.  This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntpsnmpd exit status
+@subsection ntpsnmpd exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@item 66 (EX_NOINPUT)
+A specified configuration file could not be loaded.
+@item 70 (EX_SOFTWARE)
+libopts had an internal operational error.  Please report
+it to autogen-users@@lists.sourceforge.net.  Thank you.
+@end table
+@node ntpsnmpd Description
+@subsection ntpsnmpd Description
+@node ntpsnmpd Authors
+@subsection ntpsnmpd Authors
diff --git a/ntpsnmpd/ntpsnmpd-opts.texi b/ntpsnmpd/ntpsnmpd-opts.texi
deleted file mode 100644 (file)
index f7cafcb..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-@node ntpsnmpd Invocation
-@section Invoking ntpsnmpd
-@pindex ntpsnmpd
-@cindex NTP SNMP MIB agent
-@ignore
-# 
-# EDIT THIS FILE WITH CAUTION  (ntpsnmpd-opts.texi)
-# 
-# It has been AutoGen-ed  April 11, 2012 at 08:43:30 AM by AutoGen 5.14
-# From the definitions    ntpsnmpd-opts.def
-# and the template file   aginfo.tpl
-@end ignore
-
-
-
-This section was generated by @strong{AutoGen},
-the aginfo template and the option descriptions for the @command{ntpsnmpd} program.  It documents the @command{ntpsnmpd} usage text and option meanings.
-
-This software is released under a specialized copyright license.
-
-@menu
-* ntpsnmpd usage::                  ntpsnmpd usage help (-?)
-* ntpsnmpd agentxsocket::          agentxsocket option
-* ntpsnmpd nofork::                nofork option (-n)
-* ntpsnmpd syslog::                syslog option (-p)
-@end menu
-
-@node ntpsnmpd usage
-@subsection ntpsnmpd usage help (-?)
-@cindex ntpsnmpd-usage
-
-This is the automatically generated usage text for ntpsnmpd:
-
-@exampleindent 0
-@example
-ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p271
-USAGE:  ntpsnmpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
-  Flg Arg Option-Name    Description
-   -n no  nofork         Do not fork
-   -p no  syslog         Log to syslog()
-      Str agentxsocket   The socket address ntpsnmpd uses to connect to net-snmpd
-      opt version        Output version information and exit
-   -? no  help           Display extended usage information and exit
-   -! no  more-help      Extended usage information passed thru pager
-   -> opt save-opts      Save the option state to a config file
-   -< Str load-opts      Load options from a config file
-                                - disabled as --no-load-opts
-                                - may appear multiple times
-
-Options are specified by doubled hyphens and their name or by a single
-hyphen and the flag character.
-
-
-
-The following option preset mechanisms are supported:
- - reading file $HOME/.ntprc
- - reading file ./.ntprc
- - examining environment variables named NTPSNMPD_*
-
-please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
-@end example
-@exampleindent 4
-
-@node ntpsnmpd agentxsocket
-@subsection agentxsocket option
-@cindex ntpsnmpd-agentxsocket
-
-This is the ``the socket address ntpsnmpd uses to connect to net-snmpd'' option.
-[<transport-specifier>:]<transport-address>
-The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705.
-
-@node ntpsnmpd nofork
-@subsection nofork option (-n)
-@cindex ntpsnmpd-nofork
-
-This is the ``do not fork'' option.
-
-
-@node ntpsnmpd syslog
-@subsection syslog option (-p)
-@cindex ntpsnmpd-syslog
-
-This is the ``log to syslog()'' option.
index 710f60d6e3fc3f74232c01cd33d3457a5b74ccaa..b0e76e2e93b720481fca971c88c7f54300fbb8ca 100644 (file)
@@ -35,8 +35,8 @@ noinst_SCRIPTS =              \
        $(NULL)
 
 noinst_DATA=                           \
-       $(srcdir)/ntp-wait-opts.menu    \
-       $(srcdir)/ntp-wait-opts.texi    \
+       $(srcdir)/invoke-ntp-wait.menu  \
+       $(srcdir)/invoke-ntp-wait.texi  \
        $(srcdir)/ntp-wait.html         \
        $(srcdir)/ntp-wait.man.in       \
        $(srcdir)/ntp-wait.mdoc.in      \
@@ -49,6 +49,8 @@ EXTRA_DIST =                  \
        genCommitLog            \
        genver                  \
        hpadjtime.sh            \
+       invoke-ntp-wait.menu    \
+       invoke-ntp-wait.texi    \
        monitoring              \
        ntp-close               \
        ntp-groper              \
@@ -61,8 +63,6 @@ EXTRA_DIST =                  \
        ntp-wait.html           \
        ntp-wait.texi           \
        ntp-wait-opts.def       \
-       ntp-wait-opts.menu      \
-       ntp-wait-opts.texi      \
        rc1                     \
        rc2                     \
        stats                   \
@@ -96,13 +96,13 @@ ntp-wait.$(NTP_WAIT_MS): $(srcdir)/ntp-wait.$(MANTAGFMT).in $(top_builddir)/conf
 
 ###
 
-$(srcdir)/ntp-wait-opts.menu: $(srcdir)/ntp-wait-opts.texi
+$(srcdir)/invoke-ntp-wait.menu: $(srcdir)/invoke-ntp-wait.texi
        @: do-nothing action to avoid default SCCS get, .menu built with .texi
 
-$(srcdir)/ntp-wait-opts.texi: $(srcdir)/ntp-wait-opts.def $(std_def_list)
-       $(run_ag) -Taginfo.tpl -DLEVEL=section ntp-wait-opts.def
+$(srcdir)/invoke-ntp-wait.texi: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+       $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-wait-opts.def
        -$(top_srcdir)/../scripts/check--help $@
 
-$(srcdir)/ntp-wait.html: $(srcdir)/ntp-wait-opts.menu $(srcdir)/ntp-wait-opts.texi $(srcdir)/ntp-wait.texi $(top_srcdir)/sntp/include/version.texi
+$(srcdir)/ntp-wait.html: $(srcdir)/invoke-ntp-wait.menu $(srcdir)/invoke-ntp-wait.texi $(srcdir)/ntp-wait.texi $(top_srcdir)/sntp/include/version.texi
        cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntp-wait.html ntp-wait.texi || true )
 
diff --git a/scripts/invoke-ntp-wait.texi b/scripts/invoke-ntp-wait.texi
new file mode 100644 (file)
index 0000000..27ed556
--- /dev/null
@@ -0,0 +1,124 @@
+@node ntp-wait Invocation
+@section Invoking ntp-wait
+@pindex ntp-wait
+@cindex Wait for ntpd to stabilize the system clock
+@ignore
+# 
+# EDIT THIS FILE WITH CAUTION  (invoke-ntp-wait.texi)
+# 
+# It has been AutoGen-ed  April 14, 2012 at 12:21:38 AM by AutoGen 5.16pre18
+# From the definitions    ntp-wait-opts.def
+# and the template file   agtexi-cmd.tpl
+@end ignore
+
+
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntp-wait} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntp-wait usage::                  ntp-wait help/usage (-?)
+* ntp-wait ::                        option (-n)
+* ntp-wait ::                        option (-s)
+* ntp-wait ::                        option (-v)
+* ntp-wait config::                 presetting/configuring ntp-wait
+* ntp-wait exit status::            exit status
+* ntp-wait Description::            Description
+* ntp-wait Authors::                Authors
+@end menu
+
+@node ntp-wait usage
+@subsection ntp-wait help/usage (-?)
+@cindex ntp-wait help
+
+This is the automatically generated usage text for ntp-wait.
+The text printed is the same whether for the @code{help} option (-?) or the @code{more-help} option (-!).  @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function.  The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}.  Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+Unknown option: ?
+@end example
+@exampleindent 4
+
+@node ntp-wait 
+@subsection  option (-n)
+@cindex ntp-wait-
+
+This is the ``number of times to check ntpd'' option.
+This option takes an argument number @file{num-tries}.
+The maximum number of times we will check ntpd to see if it
+has been able to synchronize and stabilize the system clock.
+@node ntp-wait 
+@subsection  option (-s)
+@cindex ntp-wait-
+
+This is the ``how long to sleep between tries'' option.
+This option takes an argument number @file{secs-between-tries}.
+We will sleep for @file{secs-between-tries} after each query of ntpd
+that returns "the time is not yet stable".
+@node ntp-wait 
+@subsection  option (-v)
+@cindex ntp-wait-
+
+This is the ``be verbose'' option.
+By default, ntp-wait is silent.  With this option, ntp-wait
+will provide status information.
+
+
+@node ntp-wait config
+@subsection presetting/configuring ntp-wait
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from environment variables named @code{NTP-WAIT} and @code{NTP-WAIT_<OPTION_NAME>}.  @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTP-WAIT} variable will be tokenized and parsed like
+the command line.  The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0.  The optional argument specifies how much licensing
+detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.  Only the
+first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version.  This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntp-wait exit status
+@subsection ntp-wait exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
+@node ntp-wait Description
+@subsection ntp-wait Description
+will send at most
+queries to
+sleeping for
+after each status return that says
+has not yet produced a synchronized and stable system clock.
+will do this quietly, unless the
+flag is provided.
+@node ntp-wait Authors
+@subsection ntp-wait Authors
diff --git a/scripts/ntp-wait-opts.texi b/scripts/ntp-wait-opts.texi
deleted file mode 100644 (file)
index 40631e9..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-@node ntp-wait Invocation
-@section Invoking ntp-wait
-@pindex ntp-wait
-@cindex Wait for ntpd to stabilize the system clock
-@ignore
-# 
-# EDIT THIS FILE WITH CAUTION  (ntp-wait-opts.texi)
-# 
-# It has been AutoGen-ed  April 11, 2012 at 08:42:44 AM by AutoGen 5.14
-# From the definitions    ntp-wait-opts.def
-# and the template file   aginfo.tpl
-@end ignore
-
-
-
-This section was generated by @strong{AutoGen},
-the aginfo template and the option descriptions for the @command{ntp-wait} program.  It documents the @command{ntp-wait} usage text and option meanings.
-
-This software is released under a specialized copyright license.
-
-@menu
-* ntp-wait usage::                  ntp-wait usage help (-?)
-* ntp-wait ::                       option (-n)
-* ntp-wait ::                       option (-s)
-* ntp-wait ::                       option (-v)
-@end menu
-
-@node ntp-wait usage
-@subsection ntp-wait usage help (-?)
-@cindex ntp-wait-usage
-
-This is the automatically generated usage text for ntp-wait:
-
-@exampleindent 0
-@example
-/deacon/backroom/snaps/ntp-dev/A.snap/scripts/ntp-wait version [unknown] calling Getopt::Std::getopts (version 1.05 [paranoid]),
-running under Perl version 5.8.8.
-
-Usage: ntp-wait [-OPTIONS [-MORE_OPTIONS]] [--] [PROGRAM_ARG1 ...]
-
-The following single-character options are accepted:
-        With arguments: -n -s
-        Boolean (without arguments): -v
-
-Options may be merged together.  -- stops processing of options.
-Space is not required between options and their arguments.
-  [Now continuing due to backward compatibility and excessive paranoia.
-   See ``perldoc Getopt::Std'' about $Getopt::Std::STANDARD_HELP_VERSION.]
-@end example
-@exampleindent 4
-
-@node ntp-wait 
-@subsection  option (-v)
-@cindex ntp-wait-
-
-This is the ``be verbose'' option.
-By default, ntp-wait is silent.  With this option, ntp-wait
-will provide status information.
index a8526bf19f49d77a7aea104c428d4a626556d606..57244460130d286f3e7f4575a4da6f547febb2d7 100644 (file)
@@ -67,7 +67,7 @@ and
 the +4.567 +/- 0.089 secs indicates the time offset and
 error bound of the system clock relative to the server clock.
 
-@include ntp-wait-opts.texi
+@include invoke-ntp-wait.texi
 
 @node Usage
 @comment  node-name,  next,  previous,  up
index 91f8c1b727bebdb77d597e44df079e8bc70cc71f..a3254ad211b1b1c87175f394bc52f3c20d367adf 100644 (file)
@@ -111,11 +111,11 @@ EXTRA_DIST =                              \
        $(srcdir)/COPYRIGHT             \
        ag-tpl                          \
        deps-ver                        \
+       invoke-sntp.menu                \
+       invoke-sntp.texi                \
        @NTP_FORCE_LIBEVENT_DIST@       \
        loc                             \
        sntp-opts.def                   \
-       sntp-opts.menu                  \
-       sntp-opts.texi                  \
        sntp.1sntpman                   \
        sntp.1sntpmdoc                  \
        sntp.man.in                     \
@@ -148,14 +148,14 @@ man_MANS= sntp.$(SNTP_MS)
 
 ## HMS: Real Soon Now...
 ##info_TEXINFOS=       sntp.texi
-##sntp_TEXINFOS=       sntp-opts.texi
+##sntp_TEXINFOS=       invoke-sntp.texi
 
 noinst_DATA=                           \
+       $(srcdir)/invoke-sntp.menu      \
+       $(srcdir)/invoke-sntp.texi      \
        $(srcdir)/sntp.html             \
        $(srcdir)/sntp.man.in           \
        $(srcdir)/sntp.mdoc.in          \
-       $(srcdir)/sntp-opts.texi        \
-       $(srcdir)/sntp-opts.menu        \
        $(NULL)
 
 FRC:
@@ -267,14 +267,14 @@ sntp.$(SNTP_MS): $(srcdir)/sntp.$(MANTAGFMT).in $(top_builddir)/config.status
 
 ###
 
-$(srcdir)/sntp-opts.menu: $(srcdir)/sntp-opts.texi
+$(srcdir)/invoke-sntp.menu: $(srcdir)/invoke-sntp.texi
        @: do-nothing action to avoid default SCCS get, .menu built with .texi
 
-$(srcdir)/sntp-opts.texi: $(srcdir)/sntp-opts.def $(std_def_list)
-       $(run_ag) -Taginfo.tpl -DLEVEL=section sntp-opts.def
+$(srcdir)/invoke-sntp.texi: $(srcdir)/sntp-opts.def $(std_def_list)
+       $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section sntp-opts.def
        $(top_srcdir)/../scripts/check--help $@
 
-$(srcdir)/sntp.html: $(srcdir)/sntp-opts.menu $(srcdir)/sntp-opts.texi $(srcdir)/sntp.texi $(srcdir)/include/version.texi
+$(srcdir)/sntp.html: $(srcdir)/invoke-sntp.menu $(srcdir)/invoke-sntp.texi $(srcdir)/sntp.texi $(srcdir)/include/version.texi
        cd $(srcdir) && ( makeinfo --force --html --no-split -o sntp.html sntp.texi || true )
 
 libtool: $(LIBTOOL_DEPS)
similarity index 100%
rename from sntp/sntp-opts.menu
rename to sntp/invoke-sntp.menu
similarity index 58%
rename from sntp/sntp-opts.texi
rename to sntp/invoke-sntp.texi
index eea61529edfa50e61dc504a23b7d7b8dade57091..587be72452baa2b857ef943f73d3049ca40f87d8 100644 (file)
@@ -4,13 +4,14 @@
 @cindex standard Simple Network Time Protocol client program
 @ignore
 # 
-# EDIT THIS FILE WITH CAUTION  (sntp-opts.texi)
+# EDIT THIS FILE WITH CAUTION  (invoke-sntp.texi)
 # 
-# It has been AutoGen-ed  April 11, 2012 at 08:43:58 AM by AutoGen 5.14
+# It has been AutoGen-ed  April 14, 2012 at 12:23:04 AM by AutoGen 5.16pre18
 # From the definitions    sntp-opts.def
-# and the template file   aginfo.tpl
+# and the template file   agtexi-cmd.tpl
 @end ignore
 
+
 @code{sntp}
 can be used as an SNTP client to query a NTP or SNTP server and either display
 the time or set the local system's time (given suitable privilege).  It can be
@@ -56,38 +57,45 @@ Otherwise, only the @file{IP} is displayed.
 Finally, the @file{stratum} is reported.
 
 This section was generated by @strong{AutoGen},
-the aginfo template and the option descriptions for the @command{sntp} program.  It documents the @command{sntp} usage text and option meanings.
-
-This software is released under a specialized copyright license.
+using the @code{agtexi-cmd} template and the option descriptions for the @code{sntp} program.
+This software is released under the NTP license, <http://ntp.org/license>.
 
 @menu
-* sntp usage::                  sntp usage help (-?)
-* sntp authentication::        authentication option (-a)
-* sntp bctimeout::             bctimeout option (-B)
-* sntp broadcast::             broadcast option (-b)
-* sntp concurrent::            concurrent option (-c)
-* sntp debug-level::           debug-level option (-d)
-* sntp gap::                   gap option (-g)
-* sntp ipv4::                  ipv4 option (-4)
-* sntp ipv6::                  ipv6 option (-6)
-* sntp keyfile::               keyfile option (-k)
-* sntp kod::                   kod option (-K)
-* sntp logfile::               logfile option (-l)
-* sntp ntpversion::            ntpversion option (-o)
-* sntp set-debug-level::       set-debug-level option (-D)
-* sntp slew::                  slew option (-s)
-* sntp step::                  step option (-S)
-* sntp steplimit::             steplimit option (-M)
-* sntp uctimeout::             uctimeout option (-u)
-* sntp usereservedport::       usereservedport option (-r)
-* sntp wait::                  wait option
+* sntp usage::                  sntp help/usage (-?)
+* sntp ipv4::                   ipv4 option (-4)
+* sntp ipv6::                   ipv6 option (-6)
+* sntp authentication::         authentication option (-a)
+* sntp bctimeout::              bctimeout option (-B)
+* sntp broadcast::              broadcast option (-b)
+* sntp concurrent::             concurrent option (-c)
+* sntp gap::                    gap option (-g)
+* sntp kod::                    kod option (-K)
+* sntp keyfile::                keyfile option (-k)
+* sntp logfile::                logfile option (-l)
+* sntp steplimit::              steplimit option (-M)
+* sntp ntpversion::             ntpversion option (-o)
+* sntp usereservedport::        usereservedport option (-r)
+* sntp uctimeout::              uctimeout option (-u)
+* sntp wait::                   wait option
+* sntp config::                 presetting/configuring sntp
+* sntp exit status::            exit status
+* sntp Description::            Description
+* sntp Usage::                  Usage
+* sntp Authors::                Authors
+* sntp Bugs::                   Bugs
 @end menu
 
 @node sntp usage
-@subsection sntp usage help (-?)
-@cindex sntp-usage
+@subsection sntp help/usage (-?)
+@cindex sntp help
 
-This is the automatically generated usage text for sntp:
+This is the automatically generated usage text for sntp.
+The text printed is the same whether for the @code{help} option (-?) or the @code{more-help} option (-!).  @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function.  The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}.  Both will exit
+with a status code of 0.
 
 @exampleindent 0
 @example
@@ -150,30 +158,64 @@ please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
 @end example
 @exampleindent 4
 
+@node sntp ipv4
+@subsection ipv4 option (-4)
+@cindex sntp-ipv4
+
+This is the ``force ipv4 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv6.
+@end itemize
+
+Force DNS resolution of the following host names on the command line
+to the IPv4 namespace.
+@node sntp ipv6
+@subsection ipv6 option (-6)
+@cindex sntp-ipv6
+
+This is the ``force ipv6 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv4.
+@end itemize
+
+Force DNS resolution of the following host names on the command line
+to the IPv6 namespace.
 @node sntp authentication
 @subsection authentication option (-a)
 @cindex sntp-authentication
 
 This is the ``enable authentication with the key @var{auth-keynumber}'' option.
+This option takes an argument number @file{auth-keynumber}.
 This option enables authentication using the key specified in this
 option's argument.  The argument of this option is the keyid, a
 number specified in the keyfile as this key's identifier. See the
 keyfile option (@option{-k}) for more details.
-
 @node sntp bctimeout
 @subsection bctimeout option (-B)
 @cindex sntp-bctimeout
 
 This is the ``the number of seconds to wait for broadcasts'' option.
+This option takes an argument number @file{seconds}.
 When waiting for a broadcast packet @code{sntp} will wait the number
 of seconds specified before giving up.
-
 @node sntp broadcast
 @subsection broadcast option (-b)
 @cindex sntp-broadcast
 
 This is the ``listen to the address specified for broadcast time sync'' option.
+This option takes an argument string @file{broadcast-address}.
 
+@noindent
 This option has some usage constraints.  It:
 @itemize @bullet
 @item
@@ -183,13 +225,14 @@ may appear an unlimited number of times.
 If specified @code{sntp} will listen to the specified address
 for NTP broadcasts.  The default maximum wait time
 can be modified with @option{-B}.
-
 @node sntp concurrent
 @subsection concurrent option (-c)
 @cindex sntp-concurrent
 
 This is the ``concurrently query all ips returned for host-name'' option.
+This option takes an argument string @file{host-name}.
 
+@noindent
 This option has some usage constraints.  It:
 @itemize @bullet
 @item
@@ -205,68 +248,30 @@ after another, with a 2-second gap in between each query.
 The @option{-c} or @option{--concurrent} flag says that any IPs
 returned for the DNS lookup of the supplied host-name are on
 different machines, so we can send concurrent queries.
-
-@node sntp debug-level
-@subsection debug-level option (-d)
-@cindex sntp-debug-level
-
-This is the ``increase debug verbosity level'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-
-
 @node sntp gap
 @subsection gap option (-g)
 @cindex sntp-gap
 
 This is the ``the gap (in milliseconds) between time requests'' option.
+This option takes an argument number @file{milliseconds}.
 Since we're only going to use the first valid response we get and
 there is benefit to specifying a good number of servers to query,
 separate the queries we send out by the specified number of
 milliseconds.
+@node sntp kod
+@subsection kod option (-K)
+@cindex sntp-kod
 
-@node sntp ipv4
-@subsection ipv4 option (-4)
-@cindex sntp-ipv4
-
-This is the ``force ipv4 dns name resolution'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-ipv6.
-@end itemize
-
-Force DNS resolution of the following host names on the command line
-to the IPv4 namespace.
-
-@node sntp ipv6
-@subsection ipv6 option (-6)
-@cindex sntp-ipv6
-
-This is the ``force ipv6 dns name resolution'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must not appear in combination with any of the following options:
-ipv4.
-@end itemize
-
-Force DNS resolution of the following host names on the command line
-to the IPv6 namespace.
-
+This is the ``kod history filename'' option.
+This option takes an argument file @file{file-name}.
+Specifies the filename to be used for the persistent history of KoD
+responses received from servers.
 @node sntp keyfile
 @subsection keyfile option (-k)
 @cindex sntp-keyfile
 
 This is the ``look in this file for the key specified with @option{-a}'' option.
+This option takes an argument file @file{file-name}.
 This option specifies the keyfile.
 @code{sntp} will search for the key specified with @option{-a}
 @file{keyno} in this file.  Key files follow the following format:
@@ -281,76 +286,31 @@ Where     @file{keyid} is a number identifying this key
 @code{M}  Key is a 1-to-8 character ASCII string using the MD5 authentication scheme.
 
 For more information see @command{ntp.keys(5)}.
-
-@node sntp kod
-@subsection kod option (-K)
-@cindex sntp-kod
-
-This is the ``kod history filename'' option.
-Specifies the filename to be used for the persistent history of KoD
-responses received from servers.
-
 @node sntp logfile
 @subsection logfile option (-l)
 @cindex sntp-logfile
 
 This is the ``log to specified logfile'' option.
+This option takes an argument file @file{file-name}.
 This option causes the client to write log messages to the specified
 @file{logfile}.
-
-@node sntp ntpversion
-@subsection ntpversion option (-o)
-@cindex sntp-ntpversion
-
-This is the ``send @var{int} as our ntp version'' option.
-When sending requests to a remote server, tell them we are running
-NTP protocol version @file{ntpversion} .
-
-@node sntp set-debug-level
-@subsection set-debug-level option (-D)
-@cindex sntp-set-debug-level
-
-This is the ``set the debug verbosity level'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-
-
-@node sntp slew
-@subsection slew option (-s)
-@cindex sntp-slew
-
-This is the ``ok to 'slew' the time with @command{adjtime(2)}'' option.
-
-
-@node sntp step
-@subsection step option (-S)
-@cindex sntp-step
-
-This is the ``ok to 'step' the time with @command{settimeofday(2)}'' option.
-
-
 @node sntp steplimit
 @subsection steplimit option (-M)
 @cindex sntp-steplimit
 
 This is the ``adjustments less than @var{steplimit} msec will be slewed'' option.
+This option takes an argument number.
 If the time adjustment is less than @file{steplimit} milliseconds,
 slew the amount using @command{adjtime(2)}.  Otherwise, step the
 correction using @command{settimeofday(2)}. 
+@node sntp ntpversion
+@subsection ntpversion option (-o)
+@cindex sntp-ntpversion
 
-@node sntp uctimeout
-@subsection uctimeout option (-u)
-@cindex sntp-uctimeout
-
-This is the ``the number of seconds to wait for unicast responses'' option.
-When waiting for a unicast reply, @code{sntp} will wait the number
-of seconds specified before giving up.
-
+This is the ``send @var{int} as our ntp version'' option.
+This option takes an argument number.
+When sending requests to a remote server, tell them we are running
+NTP protocol version @file{ntpversion} .
 @node sntp usereservedport
 @subsection usereservedport option (-r)
 @cindex sntp-usereservedport
@@ -358,13 +318,21 @@ of seconds specified before giving up.
 This is the ``use the ntp reserved port (port 123)'' option.
 Use port 123, which is reserved for NTP, for our network
 communications.
+@node sntp uctimeout
+@subsection uctimeout option (-u)
+@cindex sntp-uctimeout
 
+This is the ``the number of seconds to wait for unicast responses'' option.
+This option takes an argument number @file{seconds}.
+When waiting for a unicast reply, @code{sntp} will wait the number
+of seconds specified before giving up.
 @node sntp wait
 @subsection wait option
 @cindex sntp-wait
 
 This is the ``wait for pending replies (if not setting the time)'' option.
 
+@noindent
 This option has some usage constraints.  It:
 @itemize @bullet
 @item
@@ -372,3 +340,156 @@ is enabled by default.
 @end itemize
 
 If we are not setting the time, wait for all pending responses.
+
+
+@node sntp config
+@subsection presetting/configuring sntp
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{SNTP} and @code{SNTP_<OPTION_NAME>}.  @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{SNTP} variable will be tokenized and parsed like
+the command line.  The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+@noindent
+@code{libopts} will search in 2 places for configuration files:
+@itemize @bullet
+@item
+$HOME
+@item
+$PWD
+@end itemize
+The environment variables @code{HOME}, and @code{PWD}
+are expanded and replaced when @file{sntp} runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named @file{.ntprc} is searched for
+within that directory and processed.
+
+
+Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line.  Values may be separated from the option name with a colon,
+equal sign or simply white space.  Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments.  The segments are separated by lines like:
+@example
+[SNTP]
+@end example
+@noindent
+or by
+@example
+<?program sntp>
+@end example
+@noindent
+Do not mix these styles within one configuration file.
+
+Compound values and carefully constructed string values may also be
+specified using XML syntax:
+@example
+<option-name>
+   <sub-opt>...&lt;...&gt;...</sub-opt>
+</option-name>
+@end example
+@noindent
+yielding an @code{option-name.sub-opt} string value of
+@example
+"...<...>..."
+@end example
+@code{AutoOpts} does not track suboptions.  You simply note that it is a
+hierarchicly valued option.  @code{AutoOpts} does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0.  The optional argument specifies how much licensing
+detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.  Only the
+first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version.  This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node sntp exit status
+@subsection sntp exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@item 66 (EX_NOINPUT)
+A specified configuration file could not be loaded.
+@item 70 (EX_SOFTWARE)
+libopts had an internal operational error.  Please report
+it to autogen-users@@lists.sourceforge.net.  Thank you.
+@end table
+@node sntp Description
+@subsection sntp Description
+can be used as an SNTP client to query a NTP or SNTP server and either display
+the time or set the local system's time (given suitable privilege).  It can be
+run as an interactive command or from a
+job.
+
+NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
+are defined and described by RFC 5905.
+
+The default is to write the estimated correct local date and time (i.e. not
+UTC) to the standard output in a format like:
+
+
+where the
+means that to get to UTC from the reported local time one must
+add 8 hours and 0 minutes,
+the
+indicates the local clock is 4.567 seconds behind the correct time
+(so 4.567 seconds must be added to the local clock to get it to be correct).
+Note that the number of decimals printed for this value will change
+based on the reported precision of the server.
+is the reported
+(in seconds), which represents the maximum error due to all causes.
+If the server does not report valid data needed to calculate the
+synchronization distance, this will be reported as
+If the
+is different from the
+both will be displayed.
+Otherwise, only the 
+is displayed.
+Finally, the
+of the host is reported.
+@node sntp Usage
+@subsection sntp Usage
+@table @samp
+@item Li
+is the simplest use of this program
+and can be run as an unprivileged command
+to check the current time and error in the local clock.
+@item Li
+With suitable privilege,
+run as a command
+or from a
+job,
+will reset the local clock from a synchronized specified server,
+like the (deprecated)
+or
+commands.
+
+@end multitable
+@node sntp Authors
+@subsection sntp Authors
+@node sntp Bugs
+@subsection sntp Bugs
+Please report bugs to http://bugs.ntp.org .
index 1aeed6d3d8d7bdbd9178ec945f25a5fa8d5117a4..e58557c91e09b4bcfa2f11f999d45fc8bb2e4703 100644 (file)
@@ -7,19 +7,19 @@ noinst_LTLIBRARIES      = libopts.la
 endif
 libopts_la_SOURCES      = libopts.c
 libopts_la_CPPFLAGS     = -I$(top_srcdir)
-libopts_la_LDFLAGS      = -version-info  36:3:11
+libopts_la_LDFLAGS      = -version-info  36:4:11
 EXTRA_DIST              = \
     COPYING.gplv3           COPYING.lgplv3          COPYING.mbsd  \
     MakeDefs.inc            README                  ag-char-map.h  \
     alias.c                 ao-strs.c               ao-strs.h  \
-    autoopts/options.h      autoopts/usage-txt.h    autoopts/project.h  \
+    autoopts/project.h      autoopts/usage-txt.h    autoopts/options.h  \
     autoopts.c              autoopts.h              boolean.c  \
-    check.c                 compat/compat.h         compat/strdup.c  \
-    compat/strchr.c         compat/pathfind.c       compat/snprintf.c  \
-    compat/windows-config.h configfile.c            cook.c  \
+    check.c                 compat/strchr.c         compat/windows-config.h  \
+    compat/compat.h         compat/strdup.c         compat/pathfind.c  \
+    compat/snprintf.c       configfile.c            cook.c  \
     enum.c                  env.c                   file.c  \
     find.c                  genshell.c              genshell.h  \
-    load.c                  m4/liboptschk.m4        m4/libopts.m4  \
+    load.c                  m4/libopts.m4           m4/liboptschk.m4  \
     makeshell.c             nested.c                numeric.c  \
     parse-duration.c        parse-duration.h        pgusage.c  \
     proto.h                 putshell.c              reset.c  \
index c06b46ac7981ad4e335f31ee5df1f7e7ec4abc81..c91c0c768bca26ca039610a6dd14a4ca5cca9b1b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *   Character mapping generated 02/26/12 11:08:40
+ *  28 bit character mapping generated 04/07/12 12:39:37
  *
  *  This file contains the character classifications
  *  used by AutoGen and AutoOpts for identifying tokens.
 // 
 // %guard
 // %file           ag-char-map.h
+// %backup
 // 
 // %comment -- see above
 // %
 // 
-// lower-case      "a-z"
-// upper-case      "A-Z"
-// alphabetic      +lower-case   +upper-case
+// newline         "\n"
+// nul-byte        "\x00"
+// dir-sep         "/\\"
+// percent         "%"
+// comma           ","
+// colon           ":"
+// underscore      "_"
+// plus            "+"
+// dollar          "$"
+// 
+// horiz-white     "\t "
+// alt-white       "\v\f\r\b"
+// whitespace      +horiz-white  +newline +alt-white
+// non-nl-white    +horiz-white  +alt-white
+// quote           "'\""
+// parentheses     "()"
+// 
+// graphic         "!-~"
+// inversion       "~-"
 // oct-digit       "0-7"
 // dec-digit       "89"          +oct-digit
 // hex-digit       "a-fA-F"      +dec-digit
+// lower-case      "a-z"
+// upper-case      "A-Z"
+// alphabetic      +lower-case   +upper-case
 // alphanumeric    +alphabetic   +dec-digit
-// var-first       "_"           +alphabetic
+// var-first       +underscore   +alphabetic
 // variable-name   +var-first    +dec-digit
 // option-name     "^-"          +variable-name
-// value-name      ":"           +option-name
-// horiz-white     "\t "
+// value-name      +colon        +option-name
 // name-sep        "[.]"
 // compound-name   +value-name   +name-sep +horiz-white
-// whitespace      "\v\f\r\n\b"  +horiz-white
-// unquotable      "!-~"         -"\"#(),;<=>[\\]`{}?*'"
+// scheme-note     +parentheses  +quote
+// 
+// unquotable      "!-~"         -"#,;<=>[\\]`{}?*" -quote -parentheses
 // end-xml-token   "/>"          +whitespace
-// graphic         "!-~"
-// plus-n-space    "+"           +whitespace
+// plus-n-space    +plus         +whitespace
 // punctuation     "!-~"         -alphanumeric -"_"
 // suffix          "-._"         +alphanumeric
-// suffix-fmt      "%/"          +suffix     
-// false-type      "nNfF0\x00"
-// file-name       "/"           +suffix
-// end-token       "\x00"        +whitespace
-// end-list-entry  ","           +end-token
+// suffix-fmt      +percent      +suffix +dir-sep
+// false-type      "nNfF0"       +nul-byte
+// file-name       +dir-sep      +suffix
+// end-token       +nul-byte     +whitespace
+// end-list-entry  +comma        +end-token
 // set-separator   "|+"          +end-list-entry
+// signed-number   +inversion    +dec-digit
+// make-script     +dollar       +newline
 //
 #endif /* 0 -- mapping spec. source */
 
 
 typedef uint32_t ag_char_map_mask_t;
 
-#define  IS_LOWER_CASE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x000001)
-#define SPN_LOWER_CASE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x000001)
-#define BRK_LOWER_CASE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x000001)
-#define  IS_UPPER_CASE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x000002)
-#define SPN_UPPER_CASE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x000002)
-#define BRK_UPPER_CASE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x000002)
-#define  IS_ALPHABETIC_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x000003)
-#define SPN_ALPHABETIC_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x000003)
-#define BRK_ALPHABETIC_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x000003)
-#define  IS_OCT_DIGIT_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x000004)
-#define SPN_OCT_DIGIT_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x000004)
-#define BRK_OCT_DIGIT_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x000004)
-#define  IS_DEC_DIGIT_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x00000C)
-#define SPN_DEC_DIGIT_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x00000C)
-#define BRK_DEC_DIGIT_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x00000C)
-#define  IS_HEX_DIGIT_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x00001C)
-#define SPN_HEX_DIGIT_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x00001C)
-#define BRK_HEX_DIGIT_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x00001C)
-#define  IS_ALPHANUMERIC_CHAR( _c)     is_ag_char_map_char((char)( _c), 0x00000F)
-#define SPN_ALPHANUMERIC_CHARS(_s)    spn_ag_char_map_chars((char *)_s, 0x00000F)
-#define BRK_ALPHANUMERIC_CHARS(_s)    brk_ag_char_map_chars((char *)_s, 0x00000F)
-#define  IS_VAR_FIRST_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x000023)
-#define SPN_VAR_FIRST_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x000023)
-#define BRK_VAR_FIRST_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x000023)
-#define  IS_VARIABLE_NAME_CHAR( _c)    is_ag_char_map_char((char)( _c), 0x00002F)
-#define SPN_VARIABLE_NAME_CHARS(_s)   spn_ag_char_map_chars((char *)_s, 0x00002F)
-#define BRK_VARIABLE_NAME_CHARS(_s)   brk_ag_char_map_chars((char *)_s, 0x00002F)
-#define  IS_OPTION_NAME_CHAR( _c)      is_ag_char_map_char((char)( _c), 0x00006F)
-#define SPN_OPTION_NAME_CHARS(_s)     spn_ag_char_map_chars((char *)_s, 0x00006F)
-#define BRK_OPTION_NAME_CHARS(_s)     brk_ag_char_map_chars((char *)_s, 0x00006F)
-#define  IS_VALUE_NAME_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x0000EF)
-#define SPN_VALUE_NAME_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x0000EF)
-#define BRK_VALUE_NAME_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x0000EF)
-#define  IS_HORIZ_WHITE_CHAR( _c)      is_ag_char_map_char((char)( _c), 0x000100)
-#define SPN_HORIZ_WHITE_CHARS(_s)     spn_ag_char_map_chars((char *)_s, 0x000100)
-#define BRK_HORIZ_WHITE_CHARS(_s)     brk_ag_char_map_chars((char *)_s, 0x000100)
-#define  IS_NAME_SEP_CHAR( _c)         is_ag_char_map_char((char)( _c), 0x000200)
-#define SPN_NAME_SEP_CHARS(_s)        spn_ag_char_map_chars((char *)_s, 0x000200)
-#define BRK_NAME_SEP_CHARS(_s)        brk_ag_char_map_chars((char *)_s, 0x000200)
-#define  IS_COMPOUND_NAME_CHAR( _c)    is_ag_char_map_char((char)( _c), 0x0003EF)
-#define SPN_COMPOUND_NAME_CHARS(_s)   spn_ag_char_map_chars((char *)_s, 0x0003EF)
-#define BRK_COMPOUND_NAME_CHARS(_s)   brk_ag_char_map_chars((char *)_s, 0x0003EF)
-#define  IS_WHITESPACE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x000500)
-#define SPN_WHITESPACE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x000500)
-#define BRK_WHITESPACE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x000500)
-#define  IS_UNQUOTABLE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x000800)
-#define SPN_UNQUOTABLE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x000800)
-#define BRK_UNQUOTABLE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x000800)
-#define  IS_END_XML_TOKEN_CHAR( _c)    is_ag_char_map_char((char)( _c), 0x001500)
-#define SPN_END_XML_TOKEN_CHARS(_s)   spn_ag_char_map_chars((char *)_s, 0x001500)
-#define BRK_END_XML_TOKEN_CHARS(_s)   brk_ag_char_map_chars((char *)_s, 0x001500)
-#define  IS_GRAPHIC_CHAR( _c)          is_ag_char_map_char((char)( _c), 0x002000)
-#define SPN_GRAPHIC_CHARS(_s)         spn_ag_char_map_chars((char *)_s, 0x002000)
-#define BRK_GRAPHIC_CHARS(_s)         brk_ag_char_map_chars((char *)_s, 0x002000)
-#define  IS_PLUS_N_SPACE_CHAR( _c)     is_ag_char_map_char((char)( _c), 0x004500)
-#define SPN_PLUS_N_SPACE_CHARS(_s)    spn_ag_char_map_chars((char *)_s, 0x004500)
-#define BRK_PLUS_N_SPACE_CHARS(_s)    brk_ag_char_map_chars((char *)_s, 0x004500)
-#define  IS_PUNCTUATION_CHAR( _c)      is_ag_char_map_char((char)( _c), 0x008000)
-#define SPN_PUNCTUATION_CHARS(_s)     spn_ag_char_map_chars((char *)_s, 0x008000)
-#define BRK_PUNCTUATION_CHARS(_s)     brk_ag_char_map_chars((char *)_s, 0x008000)
-#define  IS_SUFFIX_CHAR( _c)           is_ag_char_map_char((char)( _c), 0x01000F)
-#define SPN_SUFFIX_CHARS(_s)          spn_ag_char_map_chars((char *)_s, 0x01000F)
-#define BRK_SUFFIX_CHARS(_s)          brk_ag_char_map_chars((char *)_s, 0x01000F)
-#define  IS_SUFFIX_FMT_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x03000F)
-#define SPN_SUFFIX_FMT_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x03000F)
-#define BRK_SUFFIX_FMT_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x03000F)
-#define  IS_FALSE_TYPE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x040000)
-#define SPN_FALSE_TYPE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x040000)
-#define BRK_FALSE_TYPE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x040000)
-#define  IS_FILE_NAME_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x09000F)
-#define SPN_FILE_NAME_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x09000F)
-#define BRK_FILE_NAME_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x09000F)
-#define  IS_END_TOKEN_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x100500)
-#define SPN_END_TOKEN_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x100500)
-#define BRK_END_TOKEN_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x100500)
-#define  IS_END_LIST_ENTRY_CHAR( _c)   is_ag_char_map_char((char)( _c), 0x300500)
-#define SPN_END_LIST_ENTRY_CHARS(_s)  spn_ag_char_map_chars((char *)_s, 0x300500)
-#define BRK_END_LIST_ENTRY_CHARS(_s)  brk_ag_char_map_chars((char *)_s, 0x300500)
-#define  IS_SET_SEPARATOR_CHAR( _c)    is_ag_char_map_char((char)( _c), 0x700500)
-#define SPN_SET_SEPARATOR_CHARS(_s)   spn_ag_char_map_chars((char *)_s, 0x700500)
-#define BRK_SET_SEPARATOR_CHARS(_s)   brk_ag_char_map_chars((char *)_s, 0x700500)
+#define  IS_NEWLINE_CHAR( _c)          is_ag_char_map_char((char)( _c), 0x0000001)
+#define SPN_NEWLINE_CHARS(_s)         spn_ag_char_map_chars((char *)_s, 0x0000001)
+#define BRK_NEWLINE_CHARS(_s)         brk_ag_char_map_chars((char *)_s, 0x0000001)
+#define SPN_NEWLINE_BACK(s,e)         spn_ag_char_map_back((char *)s, (char *)e, 0x0000001)
+#define BRK_NEWLINE_BACK(s,e)         brk_ag_char_map_back((char *)s, (char *)e, 0x0000001)
+#define  IS_NUL_BYTE_CHAR( _c)         is_ag_char_map_char((char)( _c), 0x0000002)
+#define SPN_NUL_BYTE_CHARS(_s)        spn_ag_char_map_chars((char *)_s, 0x0000002)
+#define BRK_NUL_BYTE_CHARS(_s)        brk_ag_char_map_chars((char *)_s, 0x0000002)
+#define SPN_NUL_BYTE_BACK(s,e)        spn_ag_char_map_back((char *)s, (char *)e, 0x0000002)
+#define BRK_NUL_BYTE_BACK(s,e)        brk_ag_char_map_back((char *)s, (char *)e, 0x0000002)
+#define  IS_DIR_SEP_CHAR( _c)          is_ag_char_map_char((char)( _c), 0x0000004)
+#define SPN_DIR_SEP_CHARS(_s)         spn_ag_char_map_chars((char *)_s, 0x0000004)
+#define BRK_DIR_SEP_CHARS(_s)         brk_ag_char_map_chars((char *)_s, 0x0000004)
+#define SPN_DIR_SEP_BACK(s,e)         spn_ag_char_map_back((char *)s, (char *)e, 0x0000004)
+#define BRK_DIR_SEP_BACK(s,e)         brk_ag_char_map_back((char *)s, (char *)e, 0x0000004)
+#define  IS_PERCENT_CHAR( _c)          is_ag_char_map_char((char)( _c), 0x0000008)
+#define SPN_PERCENT_CHARS(_s)         spn_ag_char_map_chars((char *)_s, 0x0000008)
+#define BRK_PERCENT_CHARS(_s)         brk_ag_char_map_chars((char *)_s, 0x0000008)
+#define SPN_PERCENT_BACK(s,e)         spn_ag_char_map_back((char *)s, (char *)e, 0x0000008)
+#define BRK_PERCENT_BACK(s,e)         brk_ag_char_map_back((char *)s, (char *)e, 0x0000008)
+#define  IS_COMMA_CHAR( _c)            is_ag_char_map_char((char)( _c), 0x0000010)
+#define SPN_COMMA_CHARS(_s)           spn_ag_char_map_chars((char *)_s, 0x0000010)
+#define BRK_COMMA_CHARS(_s)           brk_ag_char_map_chars((char *)_s, 0x0000010)
+#define SPN_COMMA_BACK(s,e)           spn_ag_char_map_back((char *)s, (char *)e, 0x0000010)
+#define BRK_COMMA_BACK(s,e)           brk_ag_char_map_back((char *)s, (char *)e, 0x0000010)
+#define  IS_COLON_CHAR( _c)            is_ag_char_map_char((char)( _c), 0x0000020)
+#define SPN_COLON_CHARS(_s)           spn_ag_char_map_chars((char *)_s, 0x0000020)
+#define BRK_COLON_CHARS(_s)           brk_ag_char_map_chars((char *)_s, 0x0000020)
+#define SPN_COLON_BACK(s,e)           spn_ag_char_map_back((char *)s, (char *)e, 0x0000020)
+#define BRK_COLON_BACK(s,e)           brk_ag_char_map_back((char *)s, (char *)e, 0x0000020)
+#define  IS_UNDERSCORE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x0000040)
+#define SPN_UNDERSCORE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x0000040)
+#define BRK_UNDERSCORE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x0000040)
+#define SPN_UNDERSCORE_BACK(s,e)      spn_ag_char_map_back((char *)s, (char *)e, 0x0000040)
+#define BRK_UNDERSCORE_BACK(s,e)      brk_ag_char_map_back((char *)s, (char *)e, 0x0000040)
+#define  IS_PLUS_CHAR( _c)             is_ag_char_map_char((char)( _c), 0x0000080)
+#define SPN_PLUS_CHARS(_s)            spn_ag_char_map_chars((char *)_s, 0x0000080)
+#define BRK_PLUS_CHARS(_s)            brk_ag_char_map_chars((char *)_s, 0x0000080)
+#define SPN_PLUS_BACK(s,e)            spn_ag_char_map_back((char *)s, (char *)e, 0x0000080)
+#define BRK_PLUS_BACK(s,e)            brk_ag_char_map_back((char *)s, (char *)e, 0x0000080)
+#define  IS_DOLLAR_CHAR( _c)           is_ag_char_map_char((char)( _c), 0x0000100)
+#define SPN_DOLLAR_CHARS(_s)          spn_ag_char_map_chars((char *)_s, 0x0000100)
+#define BRK_DOLLAR_CHARS(_s)          brk_ag_char_map_chars((char *)_s, 0x0000100)
+#define SPN_DOLLAR_BACK(s,e)          spn_ag_char_map_back((char *)s, (char *)e, 0x0000100)
+#define BRK_DOLLAR_BACK(s,e)          brk_ag_char_map_back((char *)s, (char *)e, 0x0000100)
+#define  IS_HORIZ_WHITE_CHAR( _c)      is_ag_char_map_char((char)( _c), 0x0000200)
+#define SPN_HORIZ_WHITE_CHARS(_s)     spn_ag_char_map_chars((char *)_s, 0x0000200)
+#define BRK_HORIZ_WHITE_CHARS(_s)     brk_ag_char_map_chars((char *)_s, 0x0000200)
+#define SPN_HORIZ_WHITE_BACK(s,e)     spn_ag_char_map_back((char *)s, (char *)e, 0x0000200)
+#define BRK_HORIZ_WHITE_BACK(s,e)     brk_ag_char_map_back((char *)s, (char *)e, 0x0000200)
+#define  IS_ALT_WHITE_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x0000400)
+#define SPN_ALT_WHITE_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x0000400)
+#define BRK_ALT_WHITE_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x0000400)
+#define SPN_ALT_WHITE_BACK(s,e)       spn_ag_char_map_back((char *)s, (char *)e, 0x0000400)
+#define BRK_ALT_WHITE_BACK(s,e)       brk_ag_char_map_back((char *)s, (char *)e, 0x0000400)
+#define  IS_WHITESPACE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x0000601)
+#define SPN_WHITESPACE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x0000601)
+#define BRK_WHITESPACE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x0000601)
+#define SPN_WHITESPACE_BACK(s,e)      spn_ag_char_map_back((char *)s, (char *)e, 0x0000601)
+#define BRK_WHITESPACE_BACK(s,e)      brk_ag_char_map_back((char *)s, (char *)e, 0x0000601)
+#define  IS_NON_NL_WHITE_CHAR( _c)     is_ag_char_map_char((char)( _c), 0x0000600)
+#define SPN_NON_NL_WHITE_CHARS(_s)    spn_ag_char_map_chars((char *)_s, 0x0000600)
+#define BRK_NON_NL_WHITE_CHARS(_s)    brk_ag_char_map_chars((char *)_s, 0x0000600)
+#define SPN_NON_NL_WHITE_BACK(s,e)    spn_ag_char_map_back((char *)s, (char *)e, 0x0000600)
+#define BRK_NON_NL_WHITE_BACK(s,e)    brk_ag_char_map_back((char *)s, (char *)e, 0x0000600)
+#define  IS_QUOTE_CHAR( _c)            is_ag_char_map_char((char)( _c), 0x0000800)
+#define SPN_QUOTE_CHARS(_s)           spn_ag_char_map_chars((char *)_s, 0x0000800)
+#define BRK_QUOTE_CHARS(_s)           brk_ag_char_map_chars((char *)_s, 0x0000800)
+#define SPN_QUOTE_BACK(s,e)           spn_ag_char_map_back((char *)s, (char *)e, 0x0000800)
+#define BRK_QUOTE_BACK(s,e)           brk_ag_char_map_back((char *)s, (char *)e, 0x0000800)
+#define  IS_PARENTHESES_CHAR( _c)      is_ag_char_map_char((char)( _c), 0x0001000)
+#define SPN_PARENTHESES_CHARS(_s)     spn_ag_char_map_chars((char *)_s, 0x0001000)
+#define BRK_PARENTHESES_CHARS(_s)     brk_ag_char_map_chars((char *)_s, 0x0001000)
+#define SPN_PARENTHESES_BACK(s,e)     spn_ag_char_map_back((char *)s, (char *)e, 0x0001000)
+#define BRK_PARENTHESES_BACK(s,e)     brk_ag_char_map_back((char *)s, (char *)e, 0x0001000)
+#define  IS_GRAPHIC_CHAR( _c)          is_ag_char_map_char((char)( _c), 0x0002000)
+#define SPN_GRAPHIC_CHARS(_s)         spn_ag_char_map_chars((char *)_s, 0x0002000)
+#define BRK_GRAPHIC_CHARS(_s)         brk_ag_char_map_chars((char *)_s, 0x0002000)
+#define SPN_GRAPHIC_BACK(s,e)         spn_ag_char_map_back((char *)s, (char *)e, 0x0002000)
+#define BRK_GRAPHIC_BACK(s,e)         brk_ag_char_map_back((char *)s, (char *)e, 0x0002000)
+#define  IS_INVERSION_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x0004000)
+#define SPN_INVERSION_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x0004000)
+#define BRK_INVERSION_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x0004000)
+#define SPN_INVERSION_BACK(s,e)       spn_ag_char_map_back((char *)s, (char *)e, 0x0004000)
+#define BRK_INVERSION_BACK(s,e)       brk_ag_char_map_back((char *)s, (char *)e, 0x0004000)
+#define  IS_OCT_DIGIT_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x0008000)
+#define SPN_OCT_DIGIT_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x0008000)
+#define BRK_OCT_DIGIT_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x0008000)
+#define SPN_OCT_DIGIT_BACK(s,e)       spn_ag_char_map_back((char *)s, (char *)e, 0x0008000)
+#define BRK_OCT_DIGIT_BACK(s,e)       brk_ag_char_map_back((char *)s, (char *)e, 0x0008000)
+#define  IS_DEC_DIGIT_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x0018000)
+#define SPN_DEC_DIGIT_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x0018000)
+#define BRK_DEC_DIGIT_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x0018000)
+#define SPN_DEC_DIGIT_BACK(s,e)       spn_ag_char_map_back((char *)s, (char *)e, 0x0018000)
+#define BRK_DEC_DIGIT_BACK(s,e)       brk_ag_char_map_back((char *)s, (char *)e, 0x0018000)
+#define  IS_HEX_DIGIT_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x0038000)
+#define SPN_HEX_DIGIT_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x0038000)
+#define BRK_HEX_DIGIT_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x0038000)
+#define SPN_HEX_DIGIT_BACK(s,e)       spn_ag_char_map_back((char *)s, (char *)e, 0x0038000)
+#define BRK_HEX_DIGIT_BACK(s,e)       brk_ag_char_map_back((char *)s, (char *)e, 0x0038000)
+#define  IS_LOWER_CASE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x0040000)
+#define SPN_LOWER_CASE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x0040000)
+#define BRK_LOWER_CASE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x0040000)
+#define SPN_LOWER_CASE_BACK(s,e)      spn_ag_char_map_back((char *)s, (char *)e, 0x0040000)
+#define BRK_LOWER_CASE_BACK(s,e)      brk_ag_char_map_back((char *)s, (char *)e, 0x0040000)
+#define  IS_UPPER_CASE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x0080000)
+#define SPN_UPPER_CASE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x0080000)
+#define BRK_UPPER_CASE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x0080000)
+#define SPN_UPPER_CASE_BACK(s,e)      spn_ag_char_map_back((char *)s, (char *)e, 0x0080000)
+#define BRK_UPPER_CASE_BACK(s,e)      brk_ag_char_map_back((char *)s, (char *)e, 0x0080000)
+#define  IS_ALPHABETIC_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x00C0000)
+#define SPN_ALPHABETIC_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x00C0000)
+#define BRK_ALPHABETIC_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x00C0000)
+#define SPN_ALPHABETIC_BACK(s,e)      spn_ag_char_map_back((char *)s, (char *)e, 0x00C0000)
+#define BRK_ALPHABETIC_BACK(s,e)      brk_ag_char_map_back((char *)s, (char *)e, 0x00C0000)
+#define  IS_ALPHANUMERIC_CHAR( _c)     is_ag_char_map_char((char)( _c), 0x00D8000)
+#define SPN_ALPHANUMERIC_CHARS(_s)    spn_ag_char_map_chars((char *)_s, 0x00D8000)
+#define BRK_ALPHANUMERIC_CHARS(_s)    brk_ag_char_map_chars((char *)_s, 0x00D8000)
+#define SPN_ALPHANUMERIC_BACK(s,e)    spn_ag_char_map_back((char *)s, (char *)e, 0x00D8000)
+#define BRK_ALPHANUMERIC_BACK(s,e)    brk_ag_char_map_back((char *)s, (char *)e, 0x00D8000)
+#define  IS_VAR_FIRST_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x00C0040)
+#define SPN_VAR_FIRST_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x00C0040)
+#define BRK_VAR_FIRST_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x00C0040)
+#define SPN_VAR_FIRST_BACK(s,e)       spn_ag_char_map_back((char *)s, (char *)e, 0x00C0040)
+#define BRK_VAR_FIRST_BACK(s,e)       brk_ag_char_map_back((char *)s, (char *)e, 0x00C0040)
+#define  IS_VARIABLE_NAME_CHAR( _c)    is_ag_char_map_char((char)( _c), 0x00D8040)
+#define SPN_VARIABLE_NAME_CHARS(_s)   spn_ag_char_map_chars((char *)_s, 0x00D8040)
+#define BRK_VARIABLE_NAME_CHARS(_s)   brk_ag_char_map_chars((char *)_s, 0x00D8040)
+#define SPN_VARIABLE_NAME_BACK(s,e)   spn_ag_char_map_back((char *)s, (char *)e, 0x00D8040)
+#define BRK_VARIABLE_NAME_BACK(s,e)   brk_ag_char_map_back((char *)s, (char *)e, 0x00D8040)
+#define  IS_OPTION_NAME_CHAR( _c)      is_ag_char_map_char((char)( _c), 0x01D8040)
+#define SPN_OPTION_NAME_CHARS(_s)     spn_ag_char_map_chars((char *)_s, 0x01D8040)
+#define BRK_OPTION_NAME_CHARS(_s)     brk_ag_char_map_chars((char *)_s, 0x01D8040)
+#define SPN_OPTION_NAME_BACK(s,e)     spn_ag_char_map_back((char *)s, (char *)e, 0x01D8040)
+#define BRK_OPTION_NAME_BACK(s,e)     brk_ag_char_map_back((char *)s, (char *)e, 0x01D8040)
+#define  IS_VALUE_NAME_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x01D8060)
+#define SPN_VALUE_NAME_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x01D8060)
+#define BRK_VALUE_NAME_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x01D8060)
+#define SPN_VALUE_NAME_BACK(s,e)      spn_ag_char_map_back((char *)s, (char *)e, 0x01D8060)
+#define BRK_VALUE_NAME_BACK(s,e)      brk_ag_char_map_back((char *)s, (char *)e, 0x01D8060)
+#define  IS_NAME_SEP_CHAR( _c)         is_ag_char_map_char((char)( _c), 0x0200000)
+#define SPN_NAME_SEP_CHARS(_s)        spn_ag_char_map_chars((char *)_s, 0x0200000)
+#define BRK_NAME_SEP_CHARS(_s)        brk_ag_char_map_chars((char *)_s, 0x0200000)
+#define SPN_NAME_SEP_BACK(s,e)        spn_ag_char_map_back((char *)s, (char *)e, 0x0200000)
+#define BRK_NAME_SEP_BACK(s,e)        brk_ag_char_map_back((char *)s, (char *)e, 0x0200000)
+#define  IS_COMPOUND_NAME_CHAR( _c)    is_ag_char_map_char((char)( _c), 0x03D8260)
+#define SPN_COMPOUND_NAME_CHARS(_s)   spn_ag_char_map_chars((char *)_s, 0x03D8260)
+#define BRK_COMPOUND_NAME_CHARS(_s)   brk_ag_char_map_chars((char *)_s, 0x03D8260)
+#define SPN_COMPOUND_NAME_BACK(s,e)   spn_ag_char_map_back((char *)s, (char *)e, 0x03D8260)
+#define BRK_COMPOUND_NAME_BACK(s,e)   brk_ag_char_map_back((char *)s, (char *)e, 0x03D8260)
+#define  IS_SCHEME_NOTE_CHAR( _c)      is_ag_char_map_char((char)( _c), 0x0001800)
+#define SPN_SCHEME_NOTE_CHARS(_s)     spn_ag_char_map_chars((char *)_s, 0x0001800)
+#define BRK_SCHEME_NOTE_CHARS(_s)     brk_ag_char_map_chars((char *)_s, 0x0001800)
+#define SPN_SCHEME_NOTE_BACK(s,e)     spn_ag_char_map_back((char *)s, (char *)e, 0x0001800)
+#define BRK_SCHEME_NOTE_BACK(s,e)     brk_ag_char_map_back((char *)s, (char *)e, 0x0001800)
+#define  IS_UNQUOTABLE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x0400000)
+#define SPN_UNQUOTABLE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x0400000)
+#define BRK_UNQUOTABLE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x0400000)
+#define SPN_UNQUOTABLE_BACK(s,e)      spn_ag_char_map_back((char *)s, (char *)e, 0x0400000)
+#define BRK_UNQUOTABLE_BACK(s,e)      brk_ag_char_map_back((char *)s, (char *)e, 0x0400000)
+#define  IS_END_XML_TOKEN_CHAR( _c)    is_ag_char_map_char((char)( _c), 0x0800601)
+#define SPN_END_XML_TOKEN_CHARS(_s)   spn_ag_char_map_chars((char *)_s, 0x0800601)
+#define BRK_END_XML_TOKEN_CHARS(_s)   brk_ag_char_map_chars((char *)_s, 0x0800601)
+#define SPN_END_XML_TOKEN_BACK(s,e)   spn_ag_char_map_back((char *)s, (char *)e, 0x0800601)
+#define BRK_END_XML_TOKEN_BACK(s,e)   brk_ag_char_map_back((char *)s, (char *)e, 0x0800601)
+#define  IS_PLUS_N_SPACE_CHAR( _c)     is_ag_char_map_char((char)( _c), 0x0000681)
+#define SPN_PLUS_N_SPACE_CHARS(_s)    spn_ag_char_map_chars((char *)_s, 0x0000681)
+#define BRK_PLUS_N_SPACE_CHARS(_s)    brk_ag_char_map_chars((char *)_s, 0x0000681)
+#define SPN_PLUS_N_SPACE_BACK(s,e)    spn_ag_char_map_back((char *)s, (char *)e, 0x0000681)
+#define BRK_PLUS_N_SPACE_BACK(s,e)    brk_ag_char_map_back((char *)s, (char *)e, 0x0000681)
+#define  IS_PUNCTUATION_CHAR( _c)      is_ag_char_map_char((char)( _c), 0x1000000)
+#define SPN_PUNCTUATION_CHARS(_s)     spn_ag_char_map_chars((char *)_s, 0x1000000)
+#define BRK_PUNCTUATION_CHARS(_s)     brk_ag_char_map_chars((char *)_s, 0x1000000)
+#define SPN_PUNCTUATION_BACK(s,e)     spn_ag_char_map_back((char *)s, (char *)e, 0x1000000)
+#define BRK_PUNCTUATION_BACK(s,e)     brk_ag_char_map_back((char *)s, (char *)e, 0x1000000)
+#define  IS_SUFFIX_CHAR( _c)           is_ag_char_map_char((char)( _c), 0x20D8000)
+#define SPN_SUFFIX_CHARS(_s)          spn_ag_char_map_chars((char *)_s, 0x20D8000)
+#define BRK_SUFFIX_CHARS(_s)          brk_ag_char_map_chars((char *)_s, 0x20D8000)
+#define SPN_SUFFIX_BACK(s,e)          spn_ag_char_map_back((char *)s, (char *)e, 0x20D8000)
+#define BRK_SUFFIX_BACK(s,e)          brk_ag_char_map_back((char *)s, (char *)e, 0x20D8000)
+#define  IS_SUFFIX_FMT_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x20D800C)
+#define SPN_SUFFIX_FMT_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x20D800C)
+#define BRK_SUFFIX_FMT_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x20D800C)
+#define SPN_SUFFIX_FMT_BACK(s,e)      spn_ag_char_map_back((char *)s, (char *)e, 0x20D800C)
+#define BRK_SUFFIX_FMT_BACK(s,e)      brk_ag_char_map_back((char *)s, (char *)e, 0x20D800C)
+#define  IS_FALSE_TYPE_CHAR( _c)       is_ag_char_map_char((char)( _c), 0x4000002)
+#define SPN_FALSE_TYPE_CHARS(_s)      spn_ag_char_map_chars((char *)_s, 0x4000002)
+#define BRK_FALSE_TYPE_CHARS(_s)      brk_ag_char_map_chars((char *)_s, 0x4000002)
+#define SPN_FALSE_TYPE_BACK(s,e)      spn_ag_char_map_back((char *)s, (char *)e, 0x4000002)
+#define BRK_FALSE_TYPE_BACK(s,e)      brk_ag_char_map_back((char *)s, (char *)e, 0x4000002)
+#define  IS_FILE_NAME_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x20D8004)
+#define SPN_FILE_NAME_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x20D8004)
+#define BRK_FILE_NAME_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x20D8004)
+#define SPN_FILE_NAME_BACK(s,e)       spn_ag_char_map_back((char *)s, (char *)e, 0x20D8004)
+#define BRK_FILE_NAME_BACK(s,e)       brk_ag_char_map_back((char *)s, (char *)e, 0x20D8004)
+#define  IS_END_TOKEN_CHAR( _c)        is_ag_char_map_char((char)( _c), 0x0000603)
+#define SPN_END_TOKEN_CHARS(_s)       spn_ag_char_map_chars((char *)_s, 0x0000603)
+#define BRK_END_TOKEN_CHARS(_s)       brk_ag_char_map_chars((char *)_s, 0x0000603)
+#define SPN_END_TOKEN_BACK(s,e)       spn_ag_char_map_back((char *)s, (char *)e, 0x0000603)
+#define BRK_END_TOKEN_BACK(s,e)       brk_ag_char_map_back((char *)s, (char *)e, 0x0000603)
+#define  IS_END_LIST_ENTRY_CHAR( _c)   is_ag_char_map_char((char)( _c), 0x0000613)
+#define SPN_END_LIST_ENTRY_CHARS(_s)  spn_ag_char_map_chars((char *)_s, 0x0000613)
+#define BRK_END_LIST_ENTRY_CHARS(_s)  brk_ag_char_map_chars((char *)_s, 0x0000613)
+#define SPN_END_LIST_ENTRY_BACK(s,e)  spn_ag_char_map_back((char *)s, (char *)e, 0x0000613)
+#define BRK_END_LIST_ENTRY_BACK(s,e)  brk_ag_char_map_back((char *)s, (char *)e, 0x0000613)
+#define  IS_SET_SEPARATOR_CHAR( _c)    is_ag_char_map_char((char)( _c), 0x8000613)
+#define SPN_SET_SEPARATOR_CHARS(_s)   spn_ag_char_map_chars((char *)_s, 0x8000613)
+#define BRK_SET_SEPARATOR_CHARS(_s)   brk_ag_char_map_chars((char *)_s, 0x8000613)
+#define SPN_SET_SEPARATOR_BACK(s,e)   spn_ag_char_map_back((char *)s, (char *)e, 0x8000613)
+#define BRK_SET_SEPARATOR_BACK(s,e)   brk_ag_char_map_back((char *)s, (char *)e, 0x8000613)
+#define  IS_SIGNED_NUMBER_CHAR( _c)    is_ag_char_map_char((char)( _c), 0x001C000)
+#define SPN_SIGNED_NUMBER_CHARS(_s)   spn_ag_char_map_chars((char *)_s, 0x001C000)
+#define BRK_SIGNED_NUMBER_CHARS(_s)   brk_ag_char_map_chars((char *)_s, 0x001C000)
+#define SPN_SIGNED_NUMBER_BACK(s,e)   spn_ag_char_map_back((char *)s, (char *)e, 0x001C000)
+#define BRK_SIGNED_NUMBER_BACK(s,e)   brk_ag_char_map_back((char *)s, (char *)e, 0x001C000)
+#define  IS_MAKE_SCRIPT_CHAR( _c)      is_ag_char_map_char((char)( _c), 0x0000101)
+#define SPN_MAKE_SCRIPT_CHARS(_s)     spn_ag_char_map_chars((char *)_s, 0x0000101)
+#define BRK_MAKE_SCRIPT_CHARS(_s)     brk_ag_char_map_chars((char *)_s, 0x0000101)
+#define SPN_MAKE_SCRIPT_BACK(s,e)     spn_ag_char_map_back((char *)s, (char *)e, 0x0000101)
+#define BRK_MAKE_SCRIPT_BACK(s,e)     brk_ag_char_map_back((char *)s, (char *)e, 0x0000101)
 
 static ag_char_map_mask_t const ag_char_map_table[128] = {
-  /*NUL*/ 0x140000, /*x01*/ 0x000000, /*x02*/ 0x000000, /*x03*/ 0x000000,
-  /*x04*/ 0x000000, /*x05*/ 0x000000, /*x06*/ 0x000000, /*BEL*/ 0x000000,
-  /* BS*/ 0x000400, /* HT*/ 0x000100, /* NL*/ 0x000400, /* VT*/ 0x000400,
-  /* FF*/ 0x000400, /* CR*/ 0x000400, /*x0E*/ 0x000000, /*x0F*/ 0x000000,
-  /*x10*/ 0x000000, /*x11*/ 0x000000, /*x12*/ 0x000000, /*x13*/ 0x000000,
-  /*x14*/ 0x000000, /*x15*/ 0x000000, /*x16*/ 0x000000, /*x17*/ 0x000000,
-  /*x18*/ 0x000000, /*x19*/ 0x000000, /*x1A*/ 0x000000, /*ESC*/ 0x000000,
-  /*x1C*/ 0x000000, /*x1D*/ 0x000000, /*x1E*/ 0x000000, /*x1F*/ 0x000000,
-  /*   */ 0x000100, /* ! */ 0x00A800, /* " */ 0x00A000, /* # */ 0x00A000,
-  /* $ */ 0x00A800, /* % */ 0x02A800, /* & */ 0x00A800, /* ' */ 0x00A000,
-  /* ( */ 0x00A000, /* ) */ 0x00A000, /* * */ 0x00A000, /* + */ 0x40E800,
-  /* , */ 0x20A000, /* - */ 0x01A840, /* . */ 0x01AA00, /* / */ 0x0AB800,
-  /* 0 */ 0x042804, /* 1 */ 0x002804, /* 2 */ 0x002804, /* 3 */ 0x002804,
-  /* 4 */ 0x002804, /* 5 */ 0x002804, /* 6 */ 0x002804, /* 7 */ 0x002804,
-  /* 8 */ 0x002808, /* 9 */ 0x002808, /* : */ 0x00A880, /* ; */ 0x00A000,
-  /* < */ 0x00A000, /* = */ 0x00A000, /* > */ 0x00B000, /* ? */ 0x00A000,
-  /* @ */ 0x00A800, /* A */ 0x002812, /* B */ 0x002812, /* C */ 0x002812,
-  /* D */ 0x002812, /* E */ 0x002812, /* F */ 0x042812, /* G */ 0x002802,
-  /* H */ 0x002802, /* I */ 0x002802, /* J */ 0x002802, /* K */ 0x002802,
-  /* L */ 0x002802, /* M */ 0x002802, /* N */ 0x042802, /* O */ 0x002802,
-  /* P */ 0x002802, /* Q */ 0x002802, /* R */ 0x002802, /* S */ 0x002802,
-  /* T */ 0x002802, /* U */ 0x002802, /* V */ 0x002802, /* W */ 0x002802,
-  /* X */ 0x002802, /* Y */ 0x002802, /* Z */ 0x002802, /* [ */ 0x00A200,
-  /* \ */ 0x00A000, /* ] */ 0x00A200, /* ^ */ 0x00A840, /* _ */ 0x012820,
-  /* ` */ 0x00A000, /* a */ 0x002811, /* b */ 0x002811, /* c */ 0x002811,
-  /* d */ 0x002811, /* e */ 0x002811, /* f */ 0x042811, /* g */ 0x002801,
-  /* h */ 0x002801, /* i */ 0x002801, /* j */ 0x002801, /* k */ 0x002801,
-  /* l */ 0x002801, /* m */ 0x002801, /* n */ 0x042801, /* o */ 0x002801,
-  /* p */ 0x002801, /* q */ 0x002801, /* r */ 0x002801, /* s */ 0x002801,
-  /* t */ 0x002801, /* u */ 0x002801, /* v */ 0x002801, /* w */ 0x002801,
-  /* x */ 0x002801, /* y */ 0x002801, /* z */ 0x002801, /* { */ 0x00A000,
-  /* | */ 0x40A800, /* } */ 0x00A000, /* ~ */ 0x00A800, /*x7F*/ 0x000000
+  /*NUL*/ 0x0000002, /*x01*/ 0x0000000, /*x02*/ 0x0000000, /*x03*/ 0x0000000,
+  /*x04*/ 0x0000000, /*x05*/ 0x0000000, /*x06*/ 0x0000000, /*BEL*/ 0x0000000,
+  /* BS*/ 0x0000400, /* HT*/ 0x0000200, /* NL*/ 0x0000001, /* VT*/ 0x0000400,
+  /* FF*/ 0x0000400, /* CR*/ 0x0000400, /*x0E*/ 0x0000000, /*x0F*/ 0x0000000,
+  /*x10*/ 0x0000000, /*x11*/ 0x0000000, /*x12*/ 0x0000000, /*x13*/ 0x0000000,
+  /*x14*/ 0x0000000, /*x15*/ 0x0000000, /*x16*/ 0x0000000, /*x17*/ 0x0000000,
+  /*x18*/ 0x0000000, /*x19*/ 0x0000000, /*x1A*/ 0x0000000, /*ESC*/ 0x0000000,
+  /*x1C*/ 0x0000000, /*x1D*/ 0x0000000, /*x1E*/ 0x0000000, /*x1F*/ 0x0000000,
+  /*   */ 0x0000200, /* ! */ 0x1402000, /* " */ 0x1002800, /* # */ 0x1002000,
+  /* $ */ 0x1402100, /* % */ 0x1402008, /* & */ 0x1402000, /* ' */ 0x1002800,
+  /* ( */ 0x1003000, /* ) */ 0x1003000, /* * */ 0x1002000, /* + */ 0x9402080,
+  /* , */ 0x1002010, /* - */ 0x3506000, /* . */ 0x3602000, /* / */ 0x1C02004,
+  /* 0 */ 0x440A000, /* 1 */ 0x040A000, /* 2 */ 0x040A000, /* 3 */ 0x040A000,
+  /* 4 */ 0x040A000, /* 5 */ 0x040A000, /* 6 */ 0x040A000, /* 7 */ 0x040A000,
+  /* 8 */ 0x0412000, /* 9 */ 0x0412000, /* : */ 0x1402020, /* ; */ 0x1002000,
+  /* < */ 0x1002000, /* = */ 0x1002000, /* > */ 0x1802000, /* ? */ 0x1002000,
+  /* @ */ 0x1402000, /* A */ 0x04A2000, /* B */ 0x04A2000, /* C */ 0x04A2000,
+  /* D */ 0x04A2000, /* E */ 0x04A2000, /* F */ 0x44A2000, /* G */ 0x0482000,
+  /* H */ 0x0482000, /* I */ 0x0482000, /* J */ 0x0482000, /* K */ 0x0482000,
+  /* L */ 0x0482000, /* M */ 0x0482000, /* N */ 0x4482000, /* O */ 0x0482000,
+  /* P */ 0x0482000, /* Q */ 0x0482000, /* R */ 0x0482000, /* S */ 0x0482000,
+  /* T */ 0x0482000, /* U */ 0x0482000, /* V */ 0x0482000, /* W */ 0x0482000,
+  /* X */ 0x0482000, /* Y */ 0x0482000, /* Z */ 0x0482000, /* [ */ 0x1202000,
+  /* \ */ 0x1002004, /* ] */ 0x1202000, /* ^ */ 0x1502000, /* _ */ 0x2402040,
+  /* ` */ 0x1002000, /* a */ 0x0462000, /* b */ 0x0462000, /* c */ 0x0462000,
+  /* d */ 0x0462000, /* e */ 0x0462000, /* f */ 0x4462000, /* g */ 0x0442000,
+  /* h */ 0x0442000, /* i */ 0x0442000, /* j */ 0x0442000, /* k */ 0x0442000,
+  /* l */ 0x0442000, /* m */ 0x0442000, /* n */ 0x4442000, /* o */ 0x0442000,
+  /* p */ 0x0442000, /* q */ 0x0442000, /* r */ 0x0442000, /* s */ 0x0442000,
+  /* t */ 0x0442000, /* u */ 0x0442000, /* v */ 0x0442000, /* w */ 0x0442000,
+  /* x */ 0x0442000, /* y */ 0x0442000, /* z */ 0x0442000, /* { */ 0x1002000,
+  /* | */ 0x9402000, /* } */ 0x1002000, /* ~ */ 0x1406000, /*x7F*/ 0x0000000
 };
 static inline int
 is_ag_char_map_char(char ch, ag_char_map_mask_t mask)
@@ -219,4 +379,20 @@ brk_ag_char_map_chars(char * p, ag_char_map_mask_t mask)
     while ((*p != '\0') && (! is_ag_char_map_char(*p, mask)))  p++;
     return p;
 }
+
+static inline char *
+spn_ag_char_map_back(char * s, char * e, ag_char_map_mask_t mask)
+{
+    if (s == e) e += strlen(e);
+    while ((e > s) && is_ag_char_map_char(e[-1], mask))  e--;
+    return e;
+}
+
+static inline char *
+brk_ag_char_map_back(char * s, char * e, ag_char_map_mask_t mask)
+{
+    if (s == e) e += strlen(e);
+    while ((e > s) && (! is_ag_char_map_char(e[-1], mask)))  e--;
+    return e;
+}
 #endif /* AG_CHAR_MAP_H_GUARD */
index d0f4d1cb2c4a9f18751d8f5290c437eedd58dda5..bc693e877d5732f7c82ade32689e2671d845a003 100644 (file)
@@ -2,7 +2,7 @@
  * 
  * DO NOT EDIT THIS FILE   (ao-strs.c)
  * 
- * It has been AutoGen-ed  February 26, 2012 at 11:08:40 AM by AutoGen 5.15pre14
+ * It has been AutoGen-ed  April  7, 2012 at 12:39:37 PM by AutoGen 5.16pre15
  * From the definitions    ao-strs.def
  * and the template file   strings
  *
diff --git a/sntp/libopts/ao-strs.h b/sntp/libopts/ao-strs.h
new file mode 100644 (file)
index 0000000..11d6034
--- /dev/null
@@ -0,0 +1,251 @@
+/*  -*- buffer-read-only: t -*- vi: set ro:
+ * 
+ * DO NOT EDIT THIS FILE   (ao-strs.h)
+ * 
+ * It has been AutoGen-ed  April  7, 2012 at 12:39:37 PM by AutoGen 5.16pre15
+ * From the definitions    ao-strs.def
+ * and the template file   strings
+ *
+ *  Copyright (C) 2011-2012 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
+ *    <http://www.xfree86.org/3.3.6/COPYRIGHT2.html>
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *  1. Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *  2. Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *  3. Neither the name ``Bruce Korb'' nor the name of any other
+ *     contributor may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *  
+ *  strings IS PROVIDED BY Bruce Korb ``AS IS'' AND ANY EXPRESS
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *  ARE DISCLAIMED.  IN NO EVENT SHALL Bruce Korb OR ANY OTHER CONTRIBUTORS
+ *  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ *  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ *  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef STRINGS_AO_STRS_H_GUARD
+#define STRINGS_AO_STRS_H_GUARD 1
+/*
+ * 102 strings in ao_strs_strtable string table
+ */
+#define ARG_BREAK_STR                   (ao_strs_strtable+0)
+#define ARG_BREAK_STR_LEN               5
+#define INVALID_FMT                     (ao_strs_strtable+6)
+#define INVALID_FMT_LEN                 10
+#define INVALID_STR                     (ao_strs_strtable+17)
+#define INVALID_STR_LEN                 9
+#define NONE_STR                        (ao_strs_strtable+27)
+#define NONE_STR_LEN                    4
+#define PLUS_STR                        (ao_strs_strtable+32)
+#define PLUS_STR_LEN                    3
+#define OR_STR                          (ao_strs_strtable+36)
+#define OR_STR_LEN                      3
+#define NLSTR_FMT                       (ao_strs_strtable+40)
+#define NLSTR_FMT_LEN                   3
+#define PAGER_NAME                      (ao_strs_strtable+44)
+#define PAGER_NAME_LEN                  5
+#define TMP_USAGE_FMT                   (ao_strs_strtable+50)
+#define TMP_USAGE_FMT_LEN               12
+#define MORE_STR                        (ao_strs_strtable+63)
+#define MORE_STR_LEN                    4
+#define LONG_OPT_MARK                   (ao_strs_strtable+68)
+#define LONG_OPT_MARK_LEN               10
+#define NLSTR_SPACE_FMT                 (ao_strs_strtable+79)
+#define NLSTR_SPACE_FMT_LEN             5
+#define TWO_SPACES_STR                  (ao_strs_strtable+85)
+#define TWO_SPACES_STR_LEN              2
+#define FLAG_OPT_MARK                   (ao_strs_strtable+88)
+#define FLAG_OPT_MARK_LEN               9
+#define END_OPT_SEL_STR                 (ao_strs_strtable+98)
+#define END_OPT_SEL_STR_LEN             12
+#define STDOUT                          (ao_strs_strtable+111)
+#define STDOUT_LEN                      6
+#define TIME_FMT                        (ao_strs_strtable+118)
+#define TIME_FMT_LEN                    21
+#define SHELL_MAGIC                     (ao_strs_strtable+140)
+#define SHELL_MAGIC_LEN                 6
+#define OPT_VAL_FMT                     (ao_strs_strtable+147)
+#define OPT_VAL_FMT_LEN                 6
+#define OPT_END_FMT                     (ao_strs_strtable+154)
+#define OPT_END_FMT_LEN                 14
+#define EMPTY_ARG                       (ao_strs_strtable+169)
+#define EMPTY_ARG_LEN                   2
+#define QUOT_APOS                       (ao_strs_strtable+172)
+#define QUOT_APOS_LEN                   2
+#define QUOT_ARG_FMT                    (ao_strs_strtable+175)
+#define QUOT_ARG_FMT_LEN                4
+#define ARG_BY_NUM_FMT                  (ao_strs_strtable+180)
+#define ARG_BY_NUM_FMT_LEN              9
+#define EXPORT_ARG_FMT                  (ao_strs_strtable+190)
+#define EXPORT_ARG_FMT_LEN              17
+#define set_dash                        (ao_strs_strtable+208)
+#define set_dash_LEN                    6
+#define arg_fmt                         (ao_strs_strtable+215)
+#define arg_fmt_LEN                     5
+#define apostrophy                      (ao_strs_strtable+221)
+#define apostrophy_LEN                  4
+#define init_optct                      (ao_strs_strtable+226)
+#define init_optct_LEN                  13
+#define SHOW_VAL_FMT                    (ao_strs_strtable+240)
+#define SHOW_VAL_FMT_LEN                17
+#define TRUE_STR                        (ao_strs_strtable+258)
+#define TRUE_STR_LEN                    4
+#define FALSE_STR                       (ao_strs_strtable+263)
+#define FALSE_STR_LEN                   5
+#define VER_STR                         (ao_strs_strtable+269)
+#define VER_STR_LEN                     7
+#define OK_NEED_OPT_ARG                 (ao_strs_strtable+277)
+#define OK_NEED_OPT_ARG_LEN             17
+#define NO_ARG_NEEDED                   (ao_strs_strtable+295)
+#define NO_ARG_NEEDED_LEN               17
+#define YES_NEED_OPT_ARG                (ao_strs_strtable+313)
+#define YES_NEED_OPT_ARG_LEN            18
+#define LONG_USE_STR                    (ao_strs_strtable+332)
+#define LONG_USE_STR_LEN                9
+#define FLAG_STR                        (ao_strs_strtable+342)
+#define FLAG_STR_LEN                    4
+#define SET_TEXT_FMT                    (ao_strs_strtable+347)
+#define SET_TEXT_FMT_LEN                12
+#define END_SET_TEXT                    (ao_strs_strtable+360)
+#define END_SET_TEXT_LEN                3
+#define OPTION_STR                      (ao_strs_strtable+364)
+#define OPTION_STR_LEN                  6
+#define SHOW_PROG_ENV                   (ao_strs_strtable+371)
+#define SHOW_PROG_ENV_LEN               19
+#define SET_OFF_FMT                     (ao_strs_strtable+391)
+#define SET_OFF_FMT_LEN                 6
+#define LONG_OPT_MARKER                 (ao_strs_strtable+398)
+#define LONG_OPT_MARKER_LEN             2
+#define BULLET_STR                      (ao_strs_strtable+401)
+#define BULLET_STR_LEN                  6
+#define DEEP_INDENT_STR                 (ao_strs_strtable+408)
+#define DEEP_INDENT_STR_LEN             6
+#define ONE_TAB_STR                     (ao_strs_strtable+415)
+#define ONE_TAB_STR_LEN                 1
+#define NOT_FOUND_STR                   (ao_strs_strtable+417)
+#define NOT_FOUND_STR_LEN               56
+#define ENUM_ERR_SEP_LINE_FMT           (ao_strs_strtable+474)
+#define ENUM_ERR_SEP_LINE_FMT_LEN       5
+#define ENUM_ERR_STR_WIDTH_FMT          (ao_strs_strtable+480)
+#define ENUM_ERR_STR_WIDTH_FMT_LEN      6
+#define PAGE_USAGE_FMT                  (ao_strs_strtable+487)
+#define PAGE_USAGE_FMT_LEN              42
+#define START_MARK                      (ao_strs_strtable+530)
+#define START_MARK_LEN                  82
+#define PREAMBLE_FMT                    (ao_strs_strtable+613)
+#define PREAMBLE_FMT_LEN                105
+#define END_PRE_FMT                     (ao_strs_strtable+719)
+#define END_PRE_FMT_LEN                 36
+#define MULTI_DEF_FMT                   (ao_strs_strtable+756)
+#define MULTI_DEF_FMT_LEN               120
+#define SGL_DEF_FMT                     (ao_strs_strtable+877)
+#define SGL_DEF_FMT_LEN                 67
+#define SGL_NO_DEF_FMT                  (ao_strs_strtable+945)
+#define SGL_NO_DEF_FMT_LEN              61
+#define LOOP_STR                        (ao_strs_strtable+1007)
+#define LOOP_STR_LEN                    193
+#define ONLY_OPTS_LOOP                  (ao_strs_strtable+1201)
+#define ONLY_OPTS_LOOP_LEN              89
+#define zLoopEnd                        (ao_strs_strtable+1291)
+#define zLoopEnd_LEN                    329
+#define END_MARK                        (ao_strs_strtable+1621)
+#define END_MARK_LEN                    115
+#define zOptionCase                     (ao_strs_strtable+1737)
+#define zOptionCase_LEN                 30
+#define zOptionPartName                 (ao_strs_strtable+1768)
+#define zOptionPartName_LEN             17
+#define zOptionFullName                 (ao_strs_strtable+1786)
+#define zOptionFullName_LEN             15
+#define zOptionFlag                     (ao_strs_strtable+1802)
+#define zOptionFlag_LEN                 15
+#define zOptionEndSelect                (ao_strs_strtable+1818)
+#define zOptionEndSelect_LEN            16
+#define UNK_OPT_FMT                     (ao_strs_strtable+1835)
+#define UNK_OPT_FMT_LEN                 141
+#define zTextExit                       (ao_strs_strtable+1977)
+#define zTextExit_LEN                   50
+#define zPagedUsageExit                 (ao_strs_strtable+2028)
+#define zPagedUsageExit_LEN             73
+#define zCmdFmt                         (ao_strs_strtable+2102)
+#define zCmdFmt_LEN                     15
+#define zCountTest                      (ao_strs_strtable+2118)
+#define zCountTest_LEN                  178
+#define MULTI_ARG_FMT                   (ao_strs_strtable+2297)
+#define MULTI_ARG_FMT_LEN               123
+#define SGL_ARG_FMT                     (ao_strs_strtable+2421)
+#define SGL_ARG_FMT_LEN                 246
+#define NO_MULTI_ARG_FMT                (ao_strs_strtable+2668)
+#define NO_MULTI_ARG_FMT_LEN            140
+#define NO_SGL_ARG_FMT                  (ao_strs_strtable+2809)
+#define NO_SGL_ARG_FMT_LEN              306
+#define zMayArg                         (ao_strs_strtable+3116)
+#define zMayArg_LEN                     119
+#define zMustArg                        (ao_strs_strtable+3236)
+#define zMustArg_LEN                    31
+#define zCantArg                        (ao_strs_strtable+3268)
+#define zCantArg_LEN                    119
+#define INIT_LOPT_STR                   (ao_strs_strtable+3388)
+#define INIT_LOPT_STR_LEN               250
+#define LOPT_ARG_FMT                    (ao_strs_strtable+3639)
+#define LOPT_ARG_FMT_LEN                778
+#define INIT_OPT_STR                    (ao_strs_strtable+4418)
+#define INIT_OPT_STR_LEN                116
+#define OPT_ARG_FMT                     (ao_strs_strtable+4535)
+#define OPT_ARG_FMT_LEN                 1153
+#define zOptNumFmt                      (ao_strs_strtable+5689)
+#define zOptNumFmt_LEN                  41
+#define zOptCookieCt                    (ao_strs_strtable+5731)
+#define zOptCookieCt_LEN                38
+#define zOptCtFmt                       (ao_strs_strtable+5770)
+#define zOptCtFmt_LEN                   30
+#define zOptDisabl                      (ao_strs_strtable+5801)
+#define zOptDisabl_LEN                  32
+#define zFullOptFmt                     (ao_strs_strtable+5834)
+#define zFullOptFmt_LEN                 34
+#define zEquivMode                      (ao_strs_strtable+5869)
+#define zEquivMode_LEN                  44
+#define NO_LOAD_WARN                    (ao_strs_strtable+5914)
+#define NO_LOAD_WARN_LEN                46
+#define NO_SAVE_OPTS                    (ao_strs_strtable+5961)
+#define NO_SAVE_OPTS_LEN                46
+#define NO_SUPPRESS_LOAD                (ao_strs_strtable+6008)
+#define NO_SUPPRESS_LOAD_LEN            65
+#define SET_NO_TEXT_FMT                 (ao_strs_strtable+6074)
+#define SET_NO_TEXT_FMT_LEN             30
+#define SAVE_WARN                       (ao_strs_strtable+6105)
+#define SAVE_WARN_LEN                   35
+#define OPEN_CLOSE_FMT                  (ao_strs_strtable+6141)
+#define OPEN_CLOSE_FMT_LEN              6
+#define OPEN_XML_FMT                    (ao_strs_strtable+6148)
+#define OPEN_XML_FMT_LEN                4
+#define END_XML_FMT                     (ao_strs_strtable+6153)
+#define END_XML_FMT_LEN                 6
+#define TYPE_ATR_FMT                    (ao_strs_strtable+6160)
+#define TYPE_ATR_FMT_LEN                12
+#define NULL_ATR_FMT                    (ao_strs_strtable+6141)
+#define NULL_ATR_FMT_LEN                6
+#define NESTED_OPT_FMT                  (ao_strs_strtable+6173)
+#define NESTED_OPT_FMT_LEN              17
+#define XML_HEX_BYTE_FMT                (ao_strs_strtable+6191)
+#define XML_HEX_BYTE_FMT_LEN            7
+#define BOOL_ATR_FMT                    (ao_strs_strtable+6199)
+#define BOOL_ATR_FMT_LEN                31
+#define NUMB_ATR_FMT                    (ao_strs_strtable+6231)
+#define NUMB_ATR_FMT_LEN                34
+
+extern char const ao_strs_strtable[6266];
+
+#endif /* STRINGS_AO_STRS_H_GUARD */
index df9e3cb9274e1aa42e516e7bb5fd39885caa0d79..1eff7002fa2c59eedad7745923cfedc34ad9bebb 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * \file autoopts.c
  *
- *  Time-stamp:      "2012-01-29 09:58:30 bkorb"
+ *  Time-stamp:      "2012-03-04 19:44:56 bkorb"
  *
  *  This file contains all of the routines that must be linked into
  *  an executable to use the generated option processing.  The optional
@@ -37,7 +37,7 @@
 static char const   zNil[] = "";
 static arg_types_t  argTypes             = { NULL };
 static char         line_fmt_buf[32];
-static ag_bool      displayEnum          = AG_FALSE;
+static bool         displayEnum          = false;
 static char const   pkgdatadir_default[] = PKGDATADIR;
 static char const * program_pkgdatadir   = pkgdatadir_default;
 static tOptionLoadMode option_load_mode  = OPTION_LOAD_UNCOOKED;
@@ -50,7 +50,7 @@ static tSuccess
 next_opt_arg_must(tOptions * pOpts, tOptState* pOptState);
 
 static tSuccess
-next_opt_arg_may(tOptions * pOpts, tOptState* pOptState);
+next_opt_arg_may(tOptions * pOpts, tOptState * pOptState);
 
 static tSuccess
 next_opt_arg_none(tOptions * pOpts, tOptState* pOptState);
@@ -295,9 +295,18 @@ next_opt_arg_must(tOptions * pOpts, tOptState* pOptState)
     return SUCCESS;
 }
 
-
+/**
+ * Process an optional option argument.  For short options, it looks at the
+ * character after the option character, or it consumes the next full argument.
+ * For long options, it looks for an '=' character attachment to the long
+ * option name before deciding to take the next command line argument.
+ *
+ * @param pOpts      the option descriptor
+ * @param pOptState  a structure for managing the current processing state
+ * @returns SUCCESS or does not return
+ */
 static tSuccess
-next_opt_arg_may(tOptions * pOpts, tOptState* pOptState)
+next_opt_arg_may(tOptions * pOpts, tOptState * pOptState)
 {
     /*
      *  An option argument is optional.
index 6c3fee767be0106e6fed33cce242eb9efac31dba..194ea5a839ef7703c7630fb5414acc2ee92ef770 100644 (file)
@@ -2,7 +2,7 @@
 /*
  *  \file autoopts.h
  *
- *  Time-stamp:      "2012-02-12 09:04:40 bkorb"
+ *  Time-stamp:      "2012-03-04 19:05:01 bkorb"
  *
  *  This file defines all the global structures and special values
  *  used in the automated option processing library.
@@ -31,9 +31,6 @@
 #ifndef AUTOGEN_AUTOOPTS_H
 #define AUTOGEN_AUTOOPTS_H
 
-#include "compat/compat.h"
-#include "ag-char-map.h"
-
 #define AO_NAME_LIMIT           127
 #define AO_NAME_SIZE            ((size_t)(AO_NAME_LIMIT + 1))
 
 # define DIRCH                  '/'
 #endif
 
+#define AO_EXIT_REQ_USAGE       64
 #ifndef EX_NOINPUT
+   /**
+    *  option state was requested from a file that cannot be loaded.
+    */
 #  define EX_NOINPUT            66
 #endif
 #ifndef EX_SOFTWARE
+   /**
+    *  AutoOpts Software failure.
+    */
 #  define EX_SOFTWARE           70
 #endif
-#ifndef EX_CONFIG
-#  define EX_CONFIG             78
-#endif
 
 #define NL '\n'
 
@@ -199,8 +200,6 @@ ao_realloc(void *p, size_t sz);
 static char *
 ao_strdup(char const *str);
 
-#define TAGMEM(m, t)
-
 /*
  *  DO option handling?
  *
index a89c3495226b172788db0d4cabe34cea9683385d..f09f42a11fa6019e46c184a8c6fb1333bc955f90 100644 (file)
@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (options.h)
  *  
- *  It has been AutoGen-ed  February 26, 2012 at 11:08:44 AM by AutoGen 5.15pre14
+ *  It has been AutoGen-ed  April  7, 2012 at 12:39:41 PM by AutoGen 5.16pre15
  *  From the definitions    funcs.def
  *  and the template file   options_h
  *
 #include <sys/types.h>
 #include <stdio.h>
 
-#if defined(HAVE_STDINT_H)
-# include <stdint.h>
-#elif defined(HAVE_INTTYPES_H)
-# include <inttypes.h>
-#endif /* HAVE_STDINT/INTTYPES_H */
-
-#if defined(HAVE_LIMITS_H)
-# include <limits.h>
-#elif defined(HAVE_SYS_LIMITS_H)
-# include <sys/limits.h>
-#endif /* HAVE_LIMITS/SYS_LIMITS_H */
-
-#if defined(HAVE_SYSEXITS_H)
-#  include <sysexits.h>
-#endif /* HAVE_SYSEXITS_H */
+#ifndef COMPAT_H_GUARD
+/*
+ * This is needed for test compilations where the "compat.h"
+ * header is not usually available.
+ */
+#  if defined(HAVE_STDINT_H)
+#    include <stdint.h>
+#  elif defined(HAVE_INTTYPES_H)
+#    include <inttypes.h>
+#  endif /* HAVE_STDINT/INTTYPES_H */
+
+#  if defined(HAVE_LIMITS_H)
+#    include <limits.h>
+#  elif defined(HAVE_SYS_LIMITS_H)
+#    include <sys/limits.h>
+#  endif /* HAVE_LIMITS/SYS_LIMITS_H */
+
+#  if defined(HAVE_SYSEXITS_H)
+#    include <sysexits.h>
+#  endif /* HAVE_SYSEXITS_H */
+
+#  if defined(HAVE_STDBOOL_H)
+#    include <stdbool.h>
+#  else
+     typedef enum { false = 0, true = 1 } _Bool;
+#    define bool _Bool
+
+     /* The other macros must be usable in preprocessor directives.  */
+#    define false 0
+#    define true 1
+#  endif /* HAVE_SYSEXITS_H */
+#endif /* COMPAT_H_GUARD */
 // END-CONFIGURED-HEADERS
-#ifndef  EX_USAGE
-# define EX_USAGE               64
-#endif
+
+/**
+ * Defined to normal value of EX_USAGE.  Used to indicate that paged usage
+ * was requested.  It is used to distinguish a --usage from a --help request.
+ * --usage is abbreviated and --help gives as much help as possible.
+ */
+#define AO_EXIT_REQ_USAGE 64
 
 /*
  *  PUBLIC DEFINES
@@ -65,8 +86,8 @@
  *  See the relevant generated header file to determine which and what
  *  values for "opt_name" are available.
  */
-#define OPTIONS_STRUCT_VERSION      147459
-#define OPTIONS_VERSION_STRING      "36:3:11"
+#define OPTIONS_STRUCT_VERSION      147460
+#define OPTIONS_VERSION_STRING      "36:4:11"
 #define OPTIONS_MINIMUM_VERSION     102400
 #define OPTIONS_MIN_VER_STRING      "25:0:0"
 #define OPTIONS_VER_TO_NUM(_v, _r)  (((_v) * 4096) + (_r))
@@ -302,7 +323,7 @@ typedef enum {
         OPTPROC_NXLAT_OPT |     OPTPROC_NXLAT_OPT_CFG \
         /* 0x00030000U */ )
 
-#define STMTS(s)  do { s; } while (0)
+#define STMTS(s)  do { s; } while (false)
 
 /*
  *  The following must be #defined instead of typedef-ed
@@ -534,7 +555,7 @@ CPLUSPLUS_OPENER
  *  The following routines may be coded into AutoOpts client code:
  */
 
-/* From: tokenize.c line 166
+/* From: tokenize.c line 164
  *
  * ao_string_tokenize - tokenize an input string
  *
@@ -598,7 +619,7 @@ extern token_list_t* ao_string_tokenize(char const*);
 extern const tOptionValue* configFileLoad(char const*);
 
 
-/* From: configfile.c line 1059
+/* From: configfile.c line 1066
  *
  * optionFileLoad - Load the locatable config files, in order
  *
@@ -697,7 +718,7 @@ extern void optionFree(tOptions*);
 extern const tOptionValue* optionGetValue(const tOptionValue*, char const*);
 
 
-/* From: load.c line 476
+/* From: load.c line 475
  *
  * optionLoadLine - process a string for an option name and value
  *
@@ -740,7 +761,7 @@ extern void optionLoadLine(tOptions*, char const*);
 extern const tOptionValue* optionNextValue(const tOptionValue*, const tOptionValue*);
 
 
-/* From: usage.c line 202
+/* From: usage.c line 201
  *
  * optionOnlyUsage - Print usage text for just the options
  *
@@ -755,7 +776,7 @@ extern const tOptionValue* optionNextValue(const tOptionValue*, const tOptionVal
 extern void optionOnlyUsage(tOptions*, int);
 
 
-/* From: autoopts.c line 598
+/* From: autoopts.c line 607
  *
  * optionProcess - this is the main option processing routine
  *
@@ -849,7 +870,7 @@ extern void optionSaveFile(tOptions*);
 extern void optionSaveState(tOptions*);
 
 
-/* From: nested.c line 562
+/* From: nested.c line 563
  *
  * optionUnloadNested - Deallocate the memory for a nested value
  *
@@ -1040,7 +1061,7 @@ extern char const * optionKeywordName(tOptDesc*, unsigned int);
 
 extern void optionLoadOpt(tOptions*, tOptDesc*);
 
-extern ag_bool optionMakePath(char*, int, char const*, char const*);
+extern bool optionMakePath(char*, int, char const*, char const*);
 
 extern void optionNestedVal(tOptions*, tOptDesc*);
 
index b01affbc19e2be2b933e01bd7a4d10f4f6a894ff..3003e1fd2c68b7801128dc217465963dc56c5ff6 100644 (file)
@@ -3,6 +3,8 @@
 #define AUTOGEN_PROJECT_H
 
 #include "config.h"
+#include "compat/compat.h"
+#include "ag-char-map.h"
 
 /*
  *  Procedure success codes
index 7f9999aae1389e0c025b5d814c53f510661fb6c6..99b985639d0181fc5df938b1b7dcaa0cb135d091 100644 (file)
@@ -2,12 +2,12 @@
  *  
  *  DO NOT EDIT THIS FILE   (usage-txt.h)
  *  
- *  It has been AutoGen-ed  February 26, 2012 at 11:08:42 AM by AutoGen 5.15pre14
+ *  It has been AutoGen-ed  April  7, 2012 at 12:39:39 PM by AutoGen 5.16pre15
  *  From the definitions    usage-txt.def
  *  and the template file   usage-txt.tpl
  *
  *  This file handles all the bookkeeping required for tracking all the little
- *  tiny strings used by the AutoOpts library.  There are 144
+ *  tiny strings used by the AutoOpts library.  There are 145
  *  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
@@ -50,7 +50,7 @@ typedef struct {
   char*     utpz_GnuTimeArg;
   char*     utpz_GnuNumArg;
   char*     utpz_GnuStrArg;
-  cch_t*    apz_str[ 137 ];
+  cch_t*    apz_str[ 138 ];
 } usage_text_t;
 
 /*
@@ -202,11 +202,12 @@ extern usage_text_t option_usage_text;
 #define zTabHypAnd            (option_usage_text.apz_str[129])
 #define zTabout               (option_usage_text.apz_str[130])
 #define zThreeSpaces          (option_usage_text.apz_str[131])
-#define zTwoSpaces            (option_usage_text.apz_str[132])
-#define zUpTo                 (option_usage_text.apz_str[133])
-#define zValidKeys            (option_usage_text.apz_str[134])
-#define zVendOptsAre          (option_usage_text.apz_str[135])
-#define zVendIntro            (option_usage_text.apz_str[136])
+#define zTooLarge             (option_usage_text.apz_str[132])
+#define zTwoSpaces            (option_usage_text.apz_str[133])
+#define zUpTo                 (option_usage_text.apz_str[134])
+#define zValidKeys            (option_usage_text.apz_str[135])
+#define zVendOptsAre          (option_usage_text.apz_str[136])
+#define zVendIntro            (option_usage_text.apz_str[137])
 
   /*
    *  First, set up the strings.  Some of these are writable.  These are all in
@@ -221,7 +222,7 @@ extern usage_text_t option_usage_text;
   static char    eng_zGnuTimeArg[] = "=Tim";
   static char    eng_zGnuNumArg[] = "=num";
   static char    eng_zGnuStrArg[] = "=str";
-static char const usage_txt[4575] =
+static char const usage_txt[4631] =
 /*     0 */ "malloc of %d bytes failed\n\0"
 /*    27 */ "AutoOpts function called without option descriptor\n\0"
 /*    79 */ "\tThis exceeds the compiled library version:  \0"
@@ -242,141 +243,142 @@ static char const usage_txt[4575] =
 /*   707 */ "  %s%s\n\0"
 /*   715 */ "%s: Command line arguments required\n\0"
 /*   752 */ "%d %s%s options allowed\n\0"
-/*   777 */ "version and help options:\0"
-/*   803 */ "Error %d (%s) from the pipe(2) syscall\n\0"
-/*   843 */ "ERROR: version option argument '%c' invalid.  Use:\n"
+/*   777 */ "version, usage and configuration options:\0"
+/*   819 */ "Error %d (%s) from the pipe(2) syscall\n\0"
+/*   859 */ "ERROR: version option argument '%c' invalid.  Use:\n"
             "\t'v' - version only\n"
             "\t'c' - version and copyright\n"
             "\t'n' - version and copyright notice\n\0"
-/*   980 */ "ERROR:  %s option conflicts with the %s option\n\0"
-/*  1028 */ "%s(optionSaveState): error: cannot allocate %d bytes\n\0"
-/*  1082 */ "auto-options\0"
-/*  1095 */ "program\0"
-/*  1103 */ "\t\t\t\t- default option for unnamed options\n\0"
-/*  1145 */ "\t\t\t\t- disabled as --%s\n\0"
-/*  1169 */ "%s: The ``%s'' option has been disabled\0"
-/*  1209 */ " --- %-14s %s\n\0"
-/*  1224 */ "This option has been disabled\0"
-/*  1254 */ "\t\t\t\t- enabled by default\n\0"
-/*  1280 */ "-equivalence\0"
-/*  1293 */ "ERROR:  only \0"
-/*  1307 */ " - examining environment variables named %s_*\n\0"
-/*  1354 */ "     \0"
-/*  1360 */ "Options are specified by doubled hyphens and their name or by a single\n"
+/*   996 */ "ERROR:  %s option conflicts with the %s option\n\0"
+/*  1044 */ "%s(optionSaveState): error: cannot allocate %d bytes\n\0"
+/*  1098 */ "auto-options\0"
+/*  1111 */ "program\0"
+/*  1119 */ "\t\t\t\t- default option for unnamed options\n\0"
+/*  1161 */ "\t\t\t\t- disabled as --%s\n\0"
+/*  1185 */ "%s: The ``%s'' option has been disabled\0"
+/*  1225 */ " --- %-14s %s\n\0"
+/*  1240 */ "This option has been disabled\0"
+/*  1270 */ "\t\t\t\t- enabled by default\n\0"
+/*  1296 */ "-equivalence\0"
+/*  1309 */ "ERROR:  only \0"
+/*  1323 */ " - examining environment variables named %s_*\n\0"
+/*  1370 */ "     \0"
+/*  1376 */ "Options are specified by doubled hyphens and their name or by a single\n"
             "hyphen and the flag character.\n\0"
-/*  1463 */ "%%-%ds %%s\n\0"
-/*  1475 */ "fs error %d (%s) on fork - cannot obtain %s usage\n\0"
-/*  1526 */ "fs error %d (%s) on freopen\n\0"
-/*  1555 */ "File error %d (%s) opening %s for loading options\n\0"
-/*  1606 */ "fs error %d (%s) reading file %s\n\0"
-/*  1640 */ "fs error %d (%s) on %s %s for option %s\n\0"
-/*  1681 */ "stat-ing for directory\0"
-/*  1704 */ "stat-ing for regular file\0"
-/*  1730 */ "stat-ing for non-existant file\0"
-/*  1761 */ "open-ing file\0"
-/*  1775 */ "fopen-ing file\0"
-/*  1790 */ "\t\t\t\t- file must not pre-exist\n\0"
-/*  1821 */ "\t\t\t\t- file must pre-exist\n\0"
-/*  1848 */ "\n"
+/*  1479 */ "%%-%ds %%s\n\0"
+/*  1491 */ "fs error %d (%s) on fork - cannot obtain %s usage\n\0"
+/*  1542 */ "fs error %d (%s) on freopen\n\0"
+/*  1571 */ "File error %d (%s) opening %s for loading options\n\0"
+/*  1622 */ "fs error %d (%s) reading file %s\n\0"
+/*  1656 */ "fs error %d (%s) on %s %s for option %s\n\0"
+/*  1697 */ "stat-ing for directory\0"
+/*  1720 */ "stat-ing for regular file\0"
+/*  1746 */ "stat-ing for non-existant file\0"
+/*  1777 */ "open-ing file\0"
+/*  1791 */ "fopen-ing file\0"
+/*  1806 */ "\t\t\t\t- file must not pre-exist\n\0"
+/*  1837 */ "\t\t\t\t- file must pre-exist\n\0"
+/*  1864 */ "\n"
             "= = = = = = = =\n\n"
             "This incarnation of genshell will produce\n"
             "a shell script to parse the options for %s:\n\n\0"
-/*  1954 */ "\n"
+/*  1970 */ "\n"
             "%s\n\n\0"
-/*  1960 */ "=Cplx\0"
-/*  1966 */ "[=arg]\0"
-/*  1973 */ "--%2$s%1$s\0"
-/*  1984 */ "%s: illegal option -- %c\n\0"
-/*  2010 */ "%s: illegal option -- %s\n\0"
-/*  2036 */ "%s: unknown vendor extension option -- %s\n\0"
-/*  2079 */ "  or an integer from %d through %d\n\0"
-/*  2115 */ "AutoOpts ERROR:  invalid option descriptor for %s\n\0"
-/*  2166 */ "  or an integer mask with any of the lower %d bits set\n\0"
-/*  2222 */ "\t\t\t\t- is a set membership option\n\0"
-/*  2256 */ "%s: option `%s' requires an argument\n\0"
-/*  2294 */ "Equivalenced option '%s' was equivalenced to both\n"
+/*  1976 */ "=Cplx\0"
+/*  1982 */ "[=arg]\0"
+/*  1989 */ "--%2$s%1$s\0"
+/*  2000 */ "%s: illegal option -- %c\n\0"
+/*  2026 */ "%s: illegal option -- %s\n\0"
+/*  2052 */ "%s: unknown vendor extension option -- %s\n\0"
+/*  2095 */ "  or an integer from %d through %d\n\0"
+/*  2131 */ "AutoOpts ERROR:  invalid option descriptor for %s\n\0"
+/*  2182 */ "  or an integer mask with any of the lower %d bits set\n\0"
+/*  2238 */ "\t\t\t\t- is a set membership option\n\0"
+/*  2272 */ "%s: option `%s' requires an argument\n\0"
+/*  2310 */ "Equivalenced option '%s' was equivalenced to both\n"
             "\t'%s' and '%s'\0"
-/*  2359 */ "\t\t\t\t- must appear between %d and %d times\n\0"
-/*  2402 */ "ERROR:  The %s option is required\n\0"
-/*  2437 */ "%s: option `%s' cannot have an argument\n\0"
-/*  2478 */ "%s: Command line arguments not allowed\n\0"
-/*  2518 */ "error %d (%s) creating %s\n\0"
-/*  2545 */ "Options are specified by single or double hyphens and their name.\n\0"
-/*  2612 */ "%s error:  `%s' does not match any %s keywords\n\0"
-/*  2660 */ "\t\t\t\t- may appear multiple times\n\0"
-/*  2693 */ "\t\t\t\t- may not be preset\n\0"
-/*  2718 */ "The 'reset-option' option requires an argument\n\0"
-/*  2766 */ "   Arg Option-Name    Description\n\0"
-/*  2801 */ "  Flg Arg Option-Name    Description\n\0"
-/*  2839 */ "error %d (%s) stat-ing %s\n\0"
-/*  2866 */ "%s(optionRestore): error: no saved option state\n\0"
-/*  2915 */ "none\0"
-/*  2920 */ "'%s' not defined\n\0"
-/*  2938 */ "'%s' is not a command line option\n\0"
-/*  2973 */ "ERROR:  The %s option must appear %d times\n\0"
-/*  3017 */ "error:  cannot load options from non-regular file %s\n\0"
-/*  3071 */ "%s error:  `%s' is not a recognizable number\n\0"
-/*  3117 */ "%s error:  `%s' is not a recognizable date/time\n\0"
-/*  3166 */ "%s error:  `%s' is not a recognizable time duration\n\0"
-/*  3219 */ " %3s %s\0"
-/*  3227 */ "The '-#<number>' option may omit the hash char\n\0"
-/*  3275 */ "one %s%s option allowed\n\0"
-/*  3300 */ "All arguments are named options.\n\0"
-/*  3334 */ "Write failure to output file\0"
-/*  3363 */ " - reading file %s\0"
-/*  3382 */ "\n"
+/*  2375 */ "\t\t\t\t- must appear between %d and %d times\n\0"
+/*  2418 */ "ERROR:  The %s option is required\n\0"
+/*  2453 */ "%s: option `%s' cannot have an argument\n\0"
+/*  2494 */ "%s: Command line arguments not allowed\n\0"
+/*  2534 */ "error %d (%s) creating %s\n\0"
+/*  2561 */ "Options are specified by single or double hyphens and their name.\n\0"
+/*  2628 */ "%s error:  `%s' does not match any %s keywords\n\0"
+/*  2676 */ "\t\t\t\t- may appear multiple times\n\0"
+/*  2709 */ "\t\t\t\t- may not be preset\n\0"
+/*  2734 */ "The 'reset-option' option requires an argument\n\0"
+/*  2782 */ "   Arg Option-Name    Description\n\0"
+/*  2817 */ "  Flg Arg Option-Name    Description\n\0"
+/*  2855 */ "error %d (%s) stat-ing %s\n\0"
+/*  2882 */ "%s(optionRestore): error: no saved option state\n\0"
+/*  2931 */ "none\0"
+/*  2936 */ "'%s' not defined\n\0"
+/*  2954 */ "'%s' is not a command line option\n\0"
+/*  2989 */ "ERROR:  The %s option must appear %d times\n\0"
+/*  3033 */ "error:  cannot load options from non-regular file %s\n\0"
+/*  3087 */ "%s error:  `%s' is not a recognizable number\n\0"
+/*  3133 */ "%s error:  `%s' is not a recognizable date/time\n\0"
+/*  3182 */ "%s error:  `%s' is not a recognizable time duration\n\0"
+/*  3235 */ " %3s %s\0"
+/*  3243 */ "The '-#<number>' option may omit the hash char\n\0"
+/*  3291 */ "one %s%s option allowed\n\0"
+/*  3316 */ "All arguments are named options.\n\0"
+/*  3350 */ "Write failure to output file\0"
+/*  3379 */ " - reading file %s\0"
+/*  3398 */ "\n"
             "please send bug reports to:  %s\n\0"
-/*  3416 */ "\t\t\t\t- may NOT appear - preset only\n\0"
-/*  3452 */ "#  preset/initialization file\n"
+/*  3432 */ "\t\t\t\t- may NOT appear - preset only\n\0"
+/*  3468 */ "#  preset/initialization file\n"
             "#  %s#\n\0"
-/*  3490 */ "\n"
+/*  3506 */ "\n"
             "The following option preset mechanisms are supported:\n\0"
-/*  3546 */ "prohibits these options:\n\0"
-/*  3572 */ "Operands and options may be intermixed.  They will be reordered.\n\0"
-/*  3638 */ "%s%ld to %ld\0"
-/*  3651 */ "%sgreater than or equal to %ld\0"
-/*  3682 */ "%sIt must lie in one of the ranges:\n\0"
-/*  3719 */ "%sIt must be in the range:\n\0"
-/*  3747 */ ", or\n\0"
-/*  3753 */ "%s error:  %s option value %ld is out of range.\n\0"
-/*  3802 */ "%s%ld exactly\0"
-/*  3816 */ "%sis scalable with a suffix: k/K/m/M/g/G/t/T\n\0"
-/*  3862 */ "%sless than or equal to %ld\0"
-/*  3890 */ "The --reset-option has not been configured.\n\0"
-/*  3935 */ "ERROR:  %s option requires the %s option\n\0"
-/*  3977 */ " %3s %-14s %s\0"
-/*  3991 */ "requires these options:\n\0"
-/*  4016 */ "   Arg Option-Name   Req?  Description\n\0"
-/*  4056 */ "  Flg Arg Option-Name   Req?  Description\n\0"
-/*  4099 */ "-_^\0"
-/*  4103 */ "or you may use a numeric representation.  Preceding these with a '!' will\n"
+/*  3562 */ "prohibits these options:\n\0"
+/*  3588 */ "Operands and options may be intermixed.  They will be reordered.\n\0"
+/*  3654 */ "%s%ld to %ld\0"
+/*  3667 */ "%sgreater than or equal to %ld\0"
+/*  3698 */ "%sIt must lie in one of the ranges:\n\0"
+/*  3735 */ "%sIt must be in the range:\n\0"
+/*  3763 */ ", or\n\0"
+/*  3769 */ "%s error:  %s option value %ld is out of range.\n\0"
+/*  3818 */ "%s%ld exactly\0"
+/*  3832 */ "%sis scalable with a suffix: k/K/m/M/g/G/t/T\n\0"
+/*  3878 */ "%sless than or equal to %ld\0"
+/*  3906 */ "The --reset-option has not been configured.\n\0"
+/*  3951 */ "ERROR:  %s option requires the %s option\n\0"
+/*  3993 */ " %3s %-14s %s\0"
+/*  4007 */ "requires these options:\n\0"
+/*  4032 */ "   Arg Option-Name   Req?  Description\n\0"
+/*  4072 */ "  Flg Arg Option-Name   Req?  Description\n\0"
+/*  4115 */ "-_^\0"
+/*  4119 */ "or you may use a numeric representation.  Preceding these with a '!' will\n"
             "clear the bits, specifying 'none' will clear all bits, and 'all' will set them\n"
             "all.  Multiple entries may be passed as an option argument list.\n\0"
-/*  4322 */ "%s\0"
-/*  4325 */ "      \0"
-/*  4332 */ "T/F\0"
-/*  4336 */ "\n"
+/*  4338 */ "%s\0"
+/*  4341 */ "      \0"
+/*  4348 */ "T/F\0"
+/*  4352 */ "\n"
             "%s\n\n"
             "%s\0"
-/*  4344 */ "Fil\0"
-/*  4348 */ "KWd\0"
-/*  4352 */ "Mbr\0"
-/*  4356 */ "Tim\0"
-/*  4360 */ "Cpx\0"
-/*  4364 */ "no \0"
-/*  4368 */ "Num\0"
-/*  4372 */ "opt\0"
-/*  4376 */ "YES\0"
-/*  4380 */ "Str\0"
-/*  4384 */ "\t\t\t\t- \0"
-/*  4391 */ "\t\t\t\t-- and \0"
-/*  4403 */ "\t\t\t\t%s\n\0"
-/*  4411 */ "   \0"
-/*  4415 */ "  \0"
-/*  4418 */ "\t\t\t\t- may appear up to %d times\n\0"
-/*  4451 */ "The valid \"%s\" option keywords are:\n\0"
-/*  4488 */ "These additional options are:\0"
-/*  4518 */ "The next option supports vendor supported extra options:";
+/*  4360 */ "Fil\0"
+/*  4364 */ "KWd\0"
+/*  4368 */ "Mbr\0"
+/*  4372 */ "Tim\0"
+/*  4376 */ "Cpx\0"
+/*  4380 */ "no \0"
+/*  4384 */ "Num\0"
+/*  4388 */ "opt\0"
+/*  4392 */ "YES\0"
+/*  4396 */ "Str\0"
+/*  4400 */ "\t\t\t\t- \0"
+/*  4407 */ "\t\t\t\t-- and \0"
+/*  4419 */ "\t\t\t\t%s\n\0"
+/*  4427 */ "   \0"
+/*  4431 */ "%s error:  %s exceeds %s keyword count\n\0"
+/*  4471 */ "  \0"
+/*  4474 */ "\t\t\t\t- may appear up to %d times\n\0"
+/*  4507 */ "The valid \"%s\" option keywords are:\n\0"
+/*  4544 */ "These additional options are:\0"
+/*  4574 */ "The next option supports vendor supported extra options:";
 
 
   /*
@@ -385,7 +387,7 @@ static char const usage_txt[4575] =
    *  Aren't you glad you don't maintain this by hand?
    */
   usage_text_t option_usage_text = {
-    144,
+    145,
     eng_zGnuBoolArg, eng_zGnuKeyArg,  eng_zGnuFileArg, eng_zGnuKeyLArg,
     eng_zGnuTimeArg, eng_zGnuNumArg,  eng_zGnuStrArg,
     {
@@ -393,37 +395,37 @@ static char const usage_txt[4575] =
       usage_txt + 224, usage_txt + 260, usage_txt + 310, usage_txt + 343,
       usage_txt + 434, usage_txt + 493, usage_txt + 543, usage_txt + 547,
       usage_txt + 574, usage_txt + 623, usage_txt + 655, usage_txt + 707,
-      usage_txt + 715, usage_txt + 752, usage_txt + 777, usage_txt + 803,
-      usage_txt + 843, usage_txt + 980, usage_txt +1028, usage_txt +1082,
-      usage_txt +1095, usage_txt +1103, usage_txt +1145, usage_txt +1169,
-      usage_txt +1209, usage_txt +1224, usage_txt +1254, usage_txt +1280,
-      usage_txt +1293, usage_txt +1307, usage_txt +1354, usage_txt +1360,
-      usage_txt +1463, usage_txt +1475, usage_txt +1526, usage_txt +1555,
-      usage_txt +1606, usage_txt +1640, usage_txt +1681, usage_txt +1704,
-      usage_txt +1730, usage_txt +1761, usage_txt +1775, usage_txt +1790,
-      usage_txt +1821, usage_txt +1848, usage_txt +1954, usage_txt +1960,
-      usage_txt +1966, usage_txt +1973, usage_txt +1984, usage_txt +2010,
-      usage_txt +2036, usage_txt +2079, usage_txt +2115, usage_txt +2166,
-      usage_txt +2222, usage_txt +2256, usage_txt +2294, usage_txt +2359,
-      usage_txt +2402, usage_txt +2437, usage_txt +2478, usage_txt +2518,
-      usage_txt +2545, usage_txt +2612, usage_txt +2660, usage_txt +2693,
-      usage_txt +2718, usage_txt +2766, usage_txt +2801, usage_txt +2839,
-      usage_txt +2866, usage_txt +2915, usage_txt +2920, usage_txt +2938,
-      usage_txt +2973, usage_txt +3017, usage_txt +3071, usage_txt +3117,
-      usage_txt +3166, usage_txt +3219, usage_txt +3227, usage_txt +3275,
-      usage_txt +3300, usage_txt +3334, usage_txt +3363, usage_txt +3382,
-      usage_txt +3416, usage_txt +3452, usage_txt +3490, usage_txt +3546,
-      usage_txt +3572, usage_txt +3638, usage_txt +3651, usage_txt +3682,
-      usage_txt +3719, usage_txt +3747, usage_txt +3753, usage_txt +3802,
-      usage_txt +3816, usage_txt +3862, usage_txt +3890, usage_txt +3935,
-      usage_txt +3977, usage_txt +3991, usage_txt +4016, usage_txt +4056,
-      usage_txt +4099, usage_txt +4103, usage_txt +4322, usage_txt +4325,
-      usage_txt +4332, usage_txt +4336, usage_txt +4344, usage_txt +4348,
-      usage_txt +4352, usage_txt +4356, usage_txt +4360, usage_txt +4364,
+      usage_txt + 715, usage_txt + 752, usage_txt + 777, usage_txt + 819,
+      usage_txt + 859, usage_txt + 996, usage_txt +1044, usage_txt +1098,
+      usage_txt +1111, usage_txt +1119, usage_txt +1161, usage_txt +1185,
+      usage_txt +1225, usage_txt +1240, usage_txt +1270, usage_txt +1296,
+      usage_txt +1309, usage_txt +1323, usage_txt +1370, usage_txt +1376,
+      usage_txt +1479, usage_txt +1491, usage_txt +1542, usage_txt +1571,
+      usage_txt +1622, usage_txt +1656, usage_txt +1697, usage_txt +1720,
+      usage_txt +1746, usage_txt +1777, usage_txt +1791, usage_txt +1806,
+      usage_txt +1837, usage_txt +1864, usage_txt +1970, usage_txt +1976,
+      usage_txt +1982, usage_txt +1989, usage_txt +2000, usage_txt +2026,
+      usage_txt +2052, usage_txt +2095, usage_txt +2131, usage_txt +2182,
+      usage_txt +2238, usage_txt +2272, usage_txt +2310, usage_txt +2375,
+      usage_txt +2418, usage_txt +2453, usage_txt +2494, usage_txt +2534,
+      usage_txt +2561, usage_txt +2628, usage_txt +2676, usage_txt +2709,
+      usage_txt +2734, usage_txt +2782, usage_txt +2817, usage_txt +2855,
+      usage_txt +2882, usage_txt +2931, usage_txt +2936, usage_txt +2954,
+      usage_txt +2989, usage_txt +3033, usage_txt +3087, usage_txt +3133,
+      usage_txt +3182, usage_txt +3235, usage_txt +3243, usage_txt +3291,
+      usage_txt +3316, usage_txt +3350, usage_txt +3379, usage_txt +3398,
+      usage_txt +3432, usage_txt +3468, usage_txt +3506, usage_txt +3562,
+      usage_txt +3588, usage_txt +3654, usage_txt +3667, usage_txt +3698,
+      usage_txt +3735, usage_txt +3763, usage_txt +3769, usage_txt +3818,
+      usage_txt +3832, usage_txt +3878, usage_txt +3906, usage_txt +3951,
+      usage_txt +3993, usage_txt +4007, usage_txt +4032, usage_txt +4072,
+      usage_txt +4115, usage_txt +4119, usage_txt +4338, usage_txt +4341,
+      usage_txt +4348, usage_txt +4352, usage_txt +4360, usage_txt +4364,
       usage_txt +4368, usage_txt +4372, usage_txt +4376, usage_txt +4380,
-      usage_txt +4384, usage_txt +4391, usage_txt +4403, usage_txt +4411,
-      usage_txt +4415, usage_txt +4418, usage_txt +4451, usage_txt +4488,
-      usage_txt +4518
+      usage_txt +4384, usage_txt +4388, usage_txt +4392, usage_txt +4396,
+      usage_txt +4400, usage_txt +4407, usage_txt +4419, usage_txt +4427,
+      usage_txt +4431, usage_txt +4471, usage_txt +4474, usage_txt +4507,
+      usage_txt +4544, usage_txt +4574
     }
   };
 
index 37d18e12b3bf3aefb4a21a38d28b7c5e1c6a2ad1..f0e5498a88b7641089236527e5916191b0fecd24 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * \file boolean.c
  *
- * Time-stamp:      "2010-07-10 11:02:10 bkorb"
+ * Time-stamp:      "2012-03-31 13:46:19 bkorb"
  *
  *   Automated Options Paged Usage module.
  *
  *  it is an empty string or it is a number that evaluates to zero.
 =*/
 void
-optionBooleanVal( tOptions* pOpts, tOptDesc* pOD )
+optionBooleanVal(tOptions * pOpts, tOptDesc * pOD )
 {
     char* pz;
-    ag_bool  res = AG_TRUE;
+    bool  res = true;
+
+    (void)pOpts;
 
     if ((pOD->fOptState & OPTST_RESET) != 0)
         return;
 
     if (pOD->optArg.argString == NULL) {
-        pOD->optArg.argBool = AG_FALSE;
+        pOD->optArg.argBool = false;
         return;
     }
 
@@ -69,12 +71,12 @@ optionBooleanVal( tOptions* pOpts, tOptDesc* pOD )
     case 'F':
     case 'f':
     case NUL:
-        res = AG_FALSE;
+        res = false;
         break;
     case '#':
         if (pOD->optArg.argString[1] != 'f')
             break;
-        res = AG_FALSE;
+        res = false;
     }
 
     if (pOD->fOptState & OPTST_ALLOC_ARG) {
index 003fe1363e8c6ef124745f9a866c2ed1ab2d2737..019a23505aef5efc040ebd6217f24a5ab534abfa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * @brief consistency checks.
  *
- *  Time-stamp:      "2011-05-24 17:50:10 bkorb"
+ *  Time-stamp:      "2012-03-31 13:46:35 bkorb"
  *
  *  This file contains the routines that deal with processing quoted strings
  *  into an internal format.
@@ -32,7 +32,7 @@
 /**
  *  Check for conflicts based on "must" and "cannot" attributes.
  */
-static ag_bool
+static bool
 has_conflict(tOptions * pOpts, tOptDesc * pOD)
 {
     if (pOD->pOptMust != NULL) {
@@ -43,7 +43,7 @@ has_conflict(tOptions * pOpts, tOptDesc * pOD)
             if (UNUSED_OPT(p)) {
                 const tOptDesc * pN = pOpts->pOptDesc + pMust[-1];
                 fprintf(stderr, zReqFmt, pOD->pz_Name, pN->pz_Name);
-                return AG_TRUE;
+                return true;
             }
         }
     }
@@ -56,26 +56,28 @@ has_conflict(tOptions * pOpts, tOptDesc * pOD)
             if (SELECTED_OPT(p)) {
                 const tOptDesc* pN = pOpts->pOptDesc + pCant[-1];
                 fprintf(stderr, zCantFmt, pOD->pz_Name, pN->pz_Name);
-                return AG_TRUE;
+                return true;
             }
         }
     }
 
-    return AG_FALSE;
+    return false;
 }
 
 /**
  *  Check that the option occurs often enough.  Too often is already checked.
  */
-static ag_bool
+static bool
 occurs_enough(tOptions * pOpts, tOptDesc * pOD)
 {
+    (void)pOpts;
+
     /*
      *  IF the occurrence counts have been satisfied,
      *  THEN there is no problem.
      */
     if (pOD->optOccCt >= pOD->optMinCt)
-        return AG_TRUE;
+        return true;
 
     /*
      *  IF MUST_SET means SET and PRESET are okay,
@@ -83,12 +85,12 @@ occurs_enough(tOptions * pOpts, tOptDesc * pOD)
      */
     if (  (pOD->fOptState & OPTST_MUST_SET)
        && (pOD->fOptState & (OPTST_PRESET | OPTST_SET)) )
-        return AG_TRUE;
+        return true;
 
     if (pOD->optMinCt > 1)
          fprintf(stderr, zNotEnough, pOD->pz_Name, pOD->optMinCt);
     else fprintf(stderr, zNeedOne, pOD->pz_Name);
-    return AG_FALSE;
+    return false;
 }
 
 /**
@@ -96,7 +98,7 @@ occurs_enough(tOptions * pOpts, tOptDesc * pOD)
  *
  *  Make sure that the argument list passes our consistency tests.
  */
-LOCAL ag_bool
+LOCAL bool
 is_consistent(tOptions * pOpts)
 {
     tOptDesc * pOD   = pOpts->pOptDesc;
@@ -114,7 +116,7 @@ is_consistent(tOptions * pOpts)
          */
         if (SELECTED_OPT(pOD)) {
             if (has_conflict(pOpts, pOD))
-                return AG_FALSE;
+                return false;
         }
 
         /*
@@ -126,7 +128,7 @@ is_consistent(tOptions * pOpts)
            || (pOD->optEquivIndex == pOD->optIndex) )
 
             if (! occurs_enough(pOpts, pOD))
-                return AG_FALSE;
+                return false;
 
         if (--oCt <= 0)
             break;
@@ -145,7 +147,7 @@ is_consistent(tOptions * pOpts)
         if ((pOpts->fOptSet & OPTPROC_NO_ARGS) != 0) {
             if (pOpts->origArgCt > pOpts->curOptIdx) {
                 fprintf(stderr, zNoArgs, pOpts->pzProgName);
-                return AG_FALSE;
+                return false;
             }
         }
 
@@ -155,10 +157,10 @@ is_consistent(tOptions * pOpts)
         else if ((pOpts->fOptSet & OPTPROC_ARGS_REQ) != 0) {
             if (pOpts->origArgCt <= pOpts->curOptIdx) {
                 fprintf(stderr, zArgsMust, pOpts->pzProgName);
-                return AG_FALSE;
+                return false;
             }
         }
     }
 
-    return AG_TRUE;
+    return true;
 }
index 9fe9b299382a2c3cb86e53c0e284dbd53381ee64..9d1c02ac4a4fb8880a03b3c1b616ffae4050e97a 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * \file compat.h --- fake the preprocessor into handlng portability
  *
- *  Time-stamp:      "2012-02-12 09:00:09 bkorb"
+ *  Time-stamp:      "2012-02-28 19:40:44 bkorb"
  *
  *  compat.h is free software.
  *  This file is part of AutoGen.
 #include <setjmp.h>
 #include <signal.h>
 
-#if defined( HAVE_STDINT_H )
+#if defined(HAVE_STDINT_H)
 #  include <stdint.h>
-#elif defined( HAVE_INTTYPES_H )
+
+#elif defined(HAVE_INTTYPES_H)
 #  include <inttypes.h>
 #endif
 
 #include <stdlib.h>
 #include <string.h>
-
 #include <time.h>
 
 #ifdef HAVE_UTIME_H
 #  include <unistd.h>
 #endif
 
+#ifdef HAVE_STDBOOL_H
+#  include <stdbool.h>
+#else
+   typedef enum { false = 0, true = 1 } _Bool;
+#  define bool _Bool
+
+   /* The other macros must be usable in preprocessor directives.  */
+#  define false 0
+#  define true 1
+#endif
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *  FIXUPS and CONVIENCE STUFF:
index 2d5b27d913ccaa4fccd0b3c95d6cbafa1b334a92..2e6f881ec931036b9d8517c4ab8e2dc79dd3eca2 100644 (file)
@@ -4,7 +4,7 @@
 
 /*
  * Author:           Gary V Vaughan <gvaughan@oranda.demon.co.uk>
- * Time-stamp:       "2010-07-17 09:50:32 bkorb"
+ * Time-stamp:       "2012-03-31 13:44:42 bkorb"
  */
 
 /* Code: */
@@ -309,7 +309,7 @@ extract_colon_unit( char* pzDir, char const *string, int *p_index )
                 goto copy_done;
             }
 
-            if ((pzDest - pzDir) >= AG_PATH_MAX)
+            if ((unsigned long)(pzDest - pzDir) >= AG_PATH_MAX)
                 break;
         } copy_done:;
 
index e3da1bb0c4648e8b1fbe2c2db017c72b17f9cd88..56e22b5db77bc431bdd82a5bd13e9aa46b980236 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * \file configfile.c
  *
- *  Time-stamp:      "2012-02-25 12:54:32 bkorb"
+ *  Time-stamp:      "2012-03-31 13:56:11 bkorb"
  *
  *  configuration/rc/ini file handling.
  *
@@ -52,7 +52,7 @@ static int
 parse_xml_encoding(char ** ppz);
 
 static char *
-trim_xml_text(char * pztxt, char const * pznm, tOptionLoadMode mode);
+trim_xml_text(char * intxt, char const * pznm, tOptionLoadMode mode);
 
 static void
 cook_xml_text(char * pzData);
@@ -202,13 +202,15 @@ optionFindValue(const tOptDesc* pOptDesc, char const* pzName,
         }
         if (pRes == NULL)
             errno = ENOENT;
-    } while (0);
+    } while (false);
 
     return pRes;
 }
 
 
 /*=export_func  optionFindNextValue
+ *
+ * FIXME: the handling of 'pzName' and 'pzVal' is just wrong.
  *
  * what:  find a hierarcicaly valued option instance
  * arg:   + const tOptDesc* + pOptDesc + an option with a nested arg type +
@@ -238,9 +240,12 @@ tOptionValue const *
 optionFindNextValue(const tOptDesc * pOptDesc, const tOptionValue * pPrevVal,
                     char const * pzName, char const * pzVal)
 {
-    int foundOldVal = 0;
+    bool old_found = false;
     tOptionValue* pRes = NULL;
 
+    (void)pzName;
+    (void)pzVal;
+
     if (  (pOptDesc == NULL)
        || (OPTST_GET_ARGTYPE(pOptDesc->fOptState) != OPARG_TYPE_HIERARCHY))  {
         errno = EINVAL;
@@ -255,23 +260,18 @@ optionFindNextValue(const tOptDesc * pOptDesc, const tOptionValue * pPrevVal,
         int    ct   = pAL->useCt;
         void** ppOV = (void**)pAL->apzArgs;
 
-        if (ct == 0) {
-            errno = ENOENT;
-            break;
-        }
-
         while (--ct >= 0) {
             tOptionValue* pOV = *(ppOV++);
-            if (foundOldVal) {
+            if (old_found) {
                 pRes = pOV;
                 break;
             }
             if (pOV == pPrevVal)
-                foundOldVal = 1;
+                old_found = true;
         }
         if (pRes == NULL)
             errno = ENOENT;
-    } while (0);
+    } while (false);
 
     return pRes;
 }
@@ -431,7 +431,7 @@ file_preset(tOptions * opts, char const * fname, int dir)
 
     do  {
         optst.flags = st_flags;
-        while (IS_WHITESPACE_CHAR(*ftext))  ftext++;
+        ftext = SPN_WHITESPACE_CHARS(ftext);
 
         if (IS_VAR_FIRST_CHAR(*ftext)) {
             ftext = handle_cfg(opts, &optst, ftext, dir);
@@ -508,8 +508,8 @@ handle_cfg(tOptions * pOpts, tOptState * pOS, char * pzText, int dir)
     if (pzEnd == NULL)
         return pzText + strlen(pzText);
 
-    while (IS_VALUE_NAME_CHAR(*pzText)) pzText++;
-    while (IS_WHITESPACE_CHAR(*pzText)) pzText++;
+    pzText = SPN_VALUE_NAME_CHARS(pzText);
+    pzText = SPN_WHITESPACE_CHARS(pzText);
     if (pzText > pzEnd) {
     name_only:
         *pzEnd++ = NUL;
@@ -523,7 +523,7 @@ handle_cfg(tOptions * pOpts, tOptState * pOS, char * pzText, int dir)
      *  is an invalid format and we give up parsing the text.
      */
     if ((*pzText == '=') || (*pzText == ':')) {
-        while (IS_WHITESPACE_CHAR(*++pzText))   ;
+        pzText = SPN_WHITESPACE_CHARS(pzText+1);
         if (pzText > pzEnd)
             goto name_only;
     } else if (! IS_WHITESPACE_CHAR(pzText[-1]))
@@ -630,9 +630,9 @@ handle_directive(tOptions * pOpts, char * pzText)
 static char *
 aoflags_directive(tOptions * pOpts, char * pzText)
 {
-    char * pz = pzText;
+    char * pz;
 
-    while (IS_WHITESPACE_CHAR(*++pz))  ;
+    pz = SPN_WHITESPACE_CHARS(pzText+1);
     pzText = strchr(pz, '>');
     if (pzText != NULL) {
 
@@ -665,7 +665,7 @@ program_directive(tOptions * pOpts, char * pzText)
     memcpy(ttl + sizeof(ttlfmt) - 1, zCfgProg, ttl_len - (sizeof(ttlfmt) - 1));
 
     do  {
-        while (IS_WHITESPACE_CHAR(*++pzText))  ;
+        pzText = SPN_WHITESPACE_CHARS(pzText+1);
 
         if (  (strneqvcmp(pzText, pOpts->pzProgName, (int)name_len) == 0)
            && (IS_END_XML_TOKEN_CHAR(pzText[name_len])) ) {
@@ -809,28 +809,35 @@ parse_xml_encoding(char ** ppz)
  * except for OPTION_LOAD_UNCOOKED.
  */
 static char *
-trim_xml_text(char * pztxt, char const * pznm, tOptionLoadMode mode)
+trim_xml_text(char * intxt, char const * pznm, tOptionLoadMode mode)
 {
     static char const fmt[] = "</%s>";
-    char   z[64], *pz = z;
     size_t len = strlen(pznm) + sizeof(fmt) - 2 /* for %s */;
+    char * etext;
 
-    if (len > sizeof(z))
-        pz = AGALOC(len, "scan name");
+    {
+        char z[64], *pz = z;
+        if (len >= sizeof(z))
+            pz = AGALOC(len, "scan name");
+
+        len = sprintf(pz, fmt, pznm);
+        *intxt = ' ';
+        etext = strstr(intxt, pz);
+        if (pz != z) AGFREE(pz);
+    }
 
-    sprintf(pz, fmt, pznm);
-    *pztxt = ' ';
-    pztxt = strstr(pztxt, pz);
-    if (pz != z) AGFREE(pz);
+    if (etext == NULL)
+        return etext;
 
-    if (pztxt == NULL)
-        return pztxt;
+    {
+        char * result = etext + len;
 
-    if (mode != OPTION_LOAD_UNCOOKED)
-        while (IS_WHITESPACE_CHAR(pztxt[-1]))   len++, pztxt--;
+        if (mode != OPTION_LOAD_UNCOOKED)
+            etext = SPN_WHITESPACE_BACK(intxt, etext);
 
-    *pztxt = NUL;
-    return pztxt + len - 1 /* for NUL byte */;
+        *etext = NUL;
+        return result;
+    }
 }
 
 /**
@@ -889,14 +896,14 @@ handle_struct(tOptions * pOpts, tOptState * pOS, char * pzText, int dir)
     char* pzData;
     char* pcNulPoint;
 
-    while (IS_VALUE_NAME_CHAR(*pzText))  pzText++;
+    pzText = SPN_VALUE_NAME_CHARS(pzText);
     pcNulPoint = pzText;
     valu.valType = OPARG_TYPE_STRING;
 
     switch (*pzText) {
     case ' ':
     case '\t':
-        pzText = parseAttributes(pOpts, pzText, &mode, &valu);
+        pzText = parse_attrs(pOpts, pzText, &mode, &valu);
         if (*pzText == '>')
             break;
         if (*pzText != '/')
@@ -933,7 +940,7 @@ handle_struct(tOptions * pOpts, tOptState * pOS, char * pzText, int dir)
 
     /*
      *  Rejoin the name and value for parsing by "loadOptionLine()".
-     *  Erase any attributes parsed by "parseAttributes()".
+     *  Erase any attributes parsed by "parse_attrs()".
      */
     memset(pcNulPoint, ' ', pzData - pcNulPoint);
 
@@ -1159,11 +1166,8 @@ optionLoadOpt(tOptions * pOpts, tOptDesc * pOptDesc)
  *  Parse the various attributes of an XML-styled config file entry
  */
 LOCAL char*
-parseAttributes(
-    tOptions*           pOpts,
-    char*               pzText,
-    tOptionLoadMode*    pMode,
-    tOptionValue*       pType )
+parse_attrs(tOptions * pOpts, char * pzText, tOptionLoadMode * pMode,
+            tOptionValue * pType)
 {
     size_t len;
 
@@ -1177,9 +1181,8 @@ parseAttributes(
             case NUL: return NULL;
             }
 
-        while (IS_WHITESPACE_CHAR(*++pzText))     ;
-        len = 0;
-        while (IS_LOWER_CASE_CHAR(pzText[len]))   len++;
+        pzText = SPN_WHITESPACE_CHARS(pzText+1);
+        len = SPN_LOWER_CASE_CHARS(pzText) - pzText;
 
         switch (find_xat_attribute_id(pzText, len)) {
         case XAT_KWD_TYPE:
@@ -1237,6 +1240,9 @@ parseAttributes(
 static char*
 parse_keyword(tOptions * pOpts, char * pzText, tOptionValue * pType)
 {
+    (void)pOpts;
+    (void)pType;
+
     return skip_unkn(pzText);
 }
 
@@ -1249,6 +1255,9 @@ parse_keyword(tOptions * pOpts, char * pzText, tOptionValue * pType)
 static char*
 parse_set_mem(tOptions * pOpts, char * pzText, tOptionValue * pType)
 {
+    (void)pOpts;
+    (void)pType;
+
     return skip_unkn(pzText);
 }
 
@@ -1264,16 +1273,15 @@ parse_value(char * pzText, tOptionValue * pType)
     if (*(pzText++) != '=')
         goto woops;
 
-    while (IS_OPTION_NAME_CHAR(pzText[len]))  len++;
-    pzText += len;
+    len = SPN_OPTION_NAME_CHARS(pzText) - pzText;
 
-    if ((len == 0) || (! IS_END_XML_TOKEN_CHAR(*pzText))) {
+    if ((len == 0) || (! IS_END_XML_TOKEN_CHAR(pzText[len]))) {
     woops:
         pType->valType = OPARG_TYPE_NONE;
-        return skip_unkn(pzText);
+        return skip_unkn(pzText + len);
     }
 
-    switch (find_value_type_id(pzText - len, len)) {
+    switch (find_value_type_id(pzText, len)) {
     default:
     case VTP_KWD_INVALID: goto woops;
 
@@ -1304,7 +1312,7 @@ parse_value(char * pzText, tOptionValue * pType)
         pType->valType = OPARG_TYPE_HIERARCHY;
     }
 
-    return pzText;
+    return pzText + len;
 }
 
 
index c681ea317c56dd011f3289e76fea5602bfc51de1..f34a6edd788168d420164b42b7dbaac551e7708d 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * \file cook.c
  *
- *  Time-stamp:      "2012-02-12 09:00:47 bkorb"
+ *  Time-stamp:      "2012-02-28 19:40:47 bkorb"
  *
  *  This file contains the routines that deal with processing quoted strings
  *  into an internal format.
@@ -28,7 +28,7 @@
  */
 
 /* = = = START-STATIC-FORWARD = = = */
-static ag_bool
+static bool
 contiguous_quote(char ** pps, char * pq, int * lnct_p);
 /* = = = END-STATIC-FORWARD = = = */
 
@@ -130,7 +130,7 @@ ao_string_cook_escape_char(char const* pzIn, char* pRes, uint_t nl)
  *  A quoted string has been found.
  *  Find the end of it and compress any escape sequences.
  */
-static ag_bool
+static bool
 contiguous_quote(char ** pps, char * pq, int * lnct_p)
 {
     char * ps = *pps + 1;
@@ -149,7 +149,7 @@ contiguous_quote(char ** pps, char * pq, int * lnct_p)
         case '\'':
             *pq  = *(ps++);  /* assign new quote character and return */
             *pps = ps;
-            return AG_TRUE;
+            return true;
 
         case '/':
             /*
@@ -158,7 +158,7 @@ contiguous_quote(char ** pps, char * pq, int * lnct_p)
             switch (ps[1]) {
             default:
                 *pps = NULL;
-                return AG_FALSE;
+                return false;
 
             case '/':
                 /*
@@ -167,7 +167,7 @@ contiguous_quote(char ** pps, char * pq, int * lnct_p)
                 ps = strchr(ps, NL);
                 if (ps == NULL) {
                     *pps = NULL;
-                    return AG_FALSE;
+                    return false;
                 }
                 break;
 
@@ -179,7 +179,7 @@ contiguous_quote(char ** pps, char * pq, int * lnct_p)
                  */
                 if (p == NULL) {
                     *pps = NULL;
-                    return AG_FALSE;
+                    return false;
                 }
 
                 while (ps < p) {
@@ -198,7 +198,7 @@ contiguous_quote(char ** pps, char * pq, int * lnct_p)
              *  The series of quoted strings has come to an end.
              */
             *pps = ps;
-            return AG_FALSE;
+            return false;
         }
     }
 }
index 6ce6b4bfb9b6996691d1ef3596f706961b299357..2a9f9bc2b5e3a8b5f3f97076c2a8e3694b125c19 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * \file enumeration.c
  *
- * Time-stamp:      "2012-01-29 19:07:59 bkorb"
+ * Time-stamp:      "2012-03-31 13:22:33 bkorb"
  *
  *   Automated Options Paged Usage module.
  *
@@ -166,7 +166,16 @@ enum_err(tOptions * pOpts, tOptDesc * pOD,
     }
 }
 
-
+/**
+ * Convert a name or number into a binary number.
+ * "~0" and "-1" will be converted to the largest value in the enumeration.
+ *
+ * @param pzName     the keyword name (number) to convert
+ * @param pOpts      the program's option descriptor
+ * @param pOD        the option descriptor for this option
+ * @param paz_names  the list of keywords for this option
+ * @param name_ct    the count of keywords
+ */
 static uintptr_t
 find_name(char const * pzName, tOptions * pOpts, tOptDesc * pOD,
           char const * const *  paz_names, unsigned int name_ct)
@@ -184,10 +193,19 @@ find_name(char const * pzName, tOptions * pOpts, tOptDesc * pOD,
         unsigned long val = strtoul(pz, &pz, 0);
         if ((*pz == NUL) && (val < name_ct))
             return (uintptr_t)val;
+        pz_enum_err_fmt = zTooLarge;
+        option_usage_fp = stderr;
         enum_err(pOpts, pOD, paz_names, (int)name_ct);
         return name_ct;
     }
 
+    if (IS_INVERSION_CHAR(*pzName) && (pzName[2] == NUL)) {
+        if (  ((pzName[0] == '~') && (pzName[1] == '0'))
+           || ((pzName[0] == '-') && (pzName[1] == '1')))
+        return (uintptr_t)(name_ct - 1);
+        goto oops;
+    }
+
     /*
      *  Look for an exact match, but remember any partial matches.
      *  Multiple partial matches means we have an ambiguous match.
@@ -197,13 +215,18 @@ find_name(char const * pzName, tOptions * pOpts, tOptDesc * pOD,
             if (paz_names[idx][len] == NUL)
                 return idx;  /* full match */
 
-            res = (res != name_ct) ? ~0 : idx; /* save partial match */
+            if (res == name_ct)
+                res = idx; /* save partial match */
+            else
+                res = ~0;  /* may yet find full match */
         }
     }
 
     if (res < name_ct)
         return res; /* partial match */
 
+oops:
+
     pz_enum_err_fmt = (res == name_ct) ? zNoKey : zAmbigKey;
     option_usage_fp = stderr;
     enum_err(pOpts, pOD, paz_names, (int)name_ct);
@@ -226,9 +249,9 @@ find_name(char const * pzName, tOptions * pOpts, tOptDesc * pOD,
 char const *
 optionKeywordName(tOptDesc * pOD, unsigned int enum_val)
 {
-    tOptDesc od;
+    tOptDesc od = {
+        .optArg.argEnum = enum_val };
 
-    od.optArg.argEnum = enum_val;
     (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, &od );
     return od.optArg.argString;
 }
@@ -317,6 +340,7 @@ set_memb_usage(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names,
     /*
      *  print the list of enumeration names.
      */
+    (void)pOpts;
     enum_err(OPTPROC_EMIT_USAGE, pOD, paz_names, (int)name_ct );
 }
 
@@ -331,6 +355,7 @@ set_memb_shell(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names,
     uintptr_t  bits = (uintptr_t)pOD->optCookie;
     size_t     len  = 0;
 
+    (void)pOpts;
     bits &= ((uintptr_t)1 << (uintptr_t)name_ct) - (uintptr_t)1;
 
     while (bits != 0) {
@@ -352,6 +377,7 @@ set_memb_names(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names,
     unsigned int ix = 0;
     size_t     len  = NONE_STR_LEN + 1;
 
+    (void)pOpts;
     bits &= ((uintptr_t)1 << (uintptr_t)name_ct) - (uintptr_t)1;
 
     /*
@@ -494,7 +520,7 @@ optionSetMembers(tOptions * pOpts, tOptDesc * pOD,
                 if (iv)
                      res &= ~bit;
                 else res |= bit;
-            } while (0);
+            } while (false);
 
             if (pzArg[len] == NUL)
                 break;
index 60e8a037f7ae7b7069d3e05cbd4b3d08c08526f8..4dd18faabaf8e10d541d93311a6811d7f1095cc8 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * \file environment.c
  *
- * Time-stamp:      "2011-07-19 17:43:34 bkorb"
+ * Time-stamp:      "2012-04-01 05:59:15 bkorb"
  *
  *  This file contains all of the routines that must be linked into
  *  an executable to use the generated option processing.  The optional
@@ -45,11 +45,11 @@ do_env_opt(tOptState * os, char * env_name,
 LOCAL void
 doPrognameEnv(tOptions * pOpts, teEnvPresetType type)
 {
-    char const  pczOptStr = getenv(pOpts->pzPROGNAME);
+    char const *  pczOptStr = getenv(pOpts->pzPROGNAME);
     token_list_t* pTL;
     int           sv_argc;
     tAoUI         sv_flag;
-    char**        sv_argv;
+    char **       sv_argv;
 
     /*
      *  No such beast?  Then bail now.
@@ -78,7 +78,10 @@ doPrognameEnv(tOptions * pOpts, teEnvPresetType type)
      *  The option scanning code will skip the "program name" at the start
      *  of this list of tokens, so we accommodate this way ....
      */
-    pOpts->origArgVect = (char**)(pTL->tkn_list - 1);
+    {
+        uintptr_t v = (uintptr_t)(pTL->tkn_list);
+        pOpts->origArgVect = (void *)(v - sizeof(char *));
+    }
     pOpts->origArgCt   = pTL->tkn_ct   + 1;
     pOpts->fOptSet    &= ~OPTPROC_ERRSTOP;
 
index aa730c6fd951dfd810349ed0ea812c0d3c19c173..f6510ee7454e8cd432443627afba2210f4956a59 100644 (file)
@@ -99,7 +99,7 @@ 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, ag_bool * disable)
+             int * ixp, bool * disable)
 {
     int   matchCt  = 0;
     int   idx      = 0;
@@ -136,7 +136,7 @@ opt_match_ct(tOptions * opts, char const * name, int nm_len,
         else if (  (pOD->pz_DisableName != NULL)
                 && (strneqvcmp(name, pOD->pz_DisableName, nm_len) == 0)
                 )  {
-            *disable = AG_TRUE;
+            *disable = true;
 
             /*
              *  IF we have a complete match
@@ -173,7 +173,7 @@ opt_match_ct(tOptions * opts, char const * name, int nm_len,
  * @param st        state about current option
  */
 static tSuccess
-opt_set(tOptions * opts, char * arg, int idx, ag_bool disable, tOptState * st)
+opt_set(tOptions * opts, char * arg, int idx, bool disable, tOptState * st)
 {
     tOptDesc * pOD = opts->pOptDesc + idx;
 
@@ -335,7 +335,7 @@ opt_find_long(tOptions * pOpts, char const * opt_name, tOptState * pOptState)
     int     nm_len = parse_opt(&opt_name, &opt_arg, name_buf, sizeof(name_buf));
 
     int     matchIdx = 0;
-    ag_bool disable  = AG_FALSE;
+    bool disable  = false;
     int     match_ct =
         opt_match_ct(pOpts, opt_name, nm_len, &matchIdx, &disable);
 
index c8d30470730bbd39879802d5936a478fce57eae6..1604c39f85827637033125d00031d838bc8874c0 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (genshell.c)
  *  
- *  It has been AutoGen-ed  February 26, 2012 at 11:08:41 AM by AutoGen 5.15pre14
+ *  It has been AutoGen-ed  April  7, 2012 at 12:39:38 PM by AutoGen 5.16pre15
  *  From the definitions    genshell.def
  *  and the template file   options
  *
- * Generated from AutoOpts 36:3:11 templates.
+ * Generated from AutoOpts 36:4:11 templates.
  *
  *  AutoOpts is a copyrighted work.  This source file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -66,7 +66,7 @@ extern tUsageProc genshelloptUsage;
 /*
  *  genshellopt option static const strings
  */
-static char const genshellopt_opt_strs[1691] =
+static char const genshellopt_opt_strs[1690] =
 /*     0 */ "genshellopt 1\n"
             "Copyright (C) 1999-2012 Bruce Korb, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
@@ -74,13 +74,13 @@ static char const genshellopt_opt_strs[1691] =
             "GNU General Public License, version 3 or later\n"
             "    <http://gnu.org/licenses/gpl.html>\n\0"
 /*   260 */ "genshellopt is free software: you can redistribute it and/or modify it\n"
-            "under the terms of the GNU General Public License as published by the\n"
-            "Free Software Foundation, either version 3 of the License, or (at your\n"
-            "option) any later version.\n\n"
+            "under the terms of the GNU General Public License as published by the Free\n"
+            "Software Foundation, either version 3 of the License, or (at your option)\n"
+            "any later version.\n\n"
             "genshellopt is distributed in the hope that it will be useful, but WITHOUT\n"
             "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n"
-            "FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\n"
-            "for more details.\n\n"
+            "FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\n"
+            "more details.\n\n"
             "You should have received a copy of the GNU General Public License along\n"
             "with this program.  If not, see <http://www.gnu.org/licenses/>.\n\0"
 /*   871 */ "Output Script File\0"
@@ -102,13 +102,13 @@ static char const genshellopt_opt_strs[1691] =
 /*  1235 */ "autogen-users@lists.sourceforge.net\0"
 /*  1271 */ "\n"
             "Note that ``shell'' is only useful if the output file does not already\n"
-            "exist.  If it does, then the shell name and optional first argument will\n"
-            "be extracted from the script file.\n\0"
+            "exist.  If it does, then the shell name and optional first argument will be\n"
+            "extracted from the script file.\n\0"
 /*  1452 */ "\n"
             "If the script file already exists and contains Automated Option Processing\n"
             "text, the second line of the file through the ending tag will be replaced\n"
-            "by the newly generated text.  The first ``#!''  line will be regenerated.\n\0"
-/*  1677 */ "genshellopt 1";
+            "by the newly generated text.  The first ``#!'' line will be regenerated.\n\0"
+/*  1676 */ "genshellopt 1";
 
 /*
  *  script option description:
@@ -244,8 +244,8 @@ static tOptDesc optDesc[GENSHELL_OPTION_CT] = {
 #define zBugsAddr       (genshellopt_opt_strs+1235)
 #define zExplain        (genshellopt_opt_strs+1271)
 #define zDetail         (genshellopt_opt_strs+1452)
-#define zFullVersion    (genshellopt_opt_strs+1677)
-/* extracted from optcode.tlib near line 349 */
+#define zFullVersion    (genshellopt_opt_strs+1676)
+/* extracted from optcode.tlib near line 350 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -272,10 +272,11 @@ static tOptDesc optDesc[GENSHELL_OPTION_CT] = {
 static void
 doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
 {
-    (void)pOptions;
     GENSHELL_USAGE(GENSHELLOPT_EXIT_SUCCESS);
+    (void)pOptDesc;
+    (void)pOptions;
 }
-/* extracted from optmain.tlib near line 1093 */
+/* extracted from optmain.tlib near line 1109 */
 
 #ifndef  PKGDATADIR
 # define PKGDATADIR ""
index 4c90c9dad0f2920e630b75c7ace61d934dc6c898..3197f4b4bcaeaa93aaac9dc5bf7b0b1d36bfe096 100644 (file)
@@ -2,11 +2,11 @@
  *  
  *  DO NOT EDIT THIS FILE   (genshell.h)
  *  
- *  It has been AutoGen-ed  February 26, 2012 at 11:08:41 AM by AutoGen 5.15pre14
+ *  It has been AutoGen-ed  April  7, 2012 at 12:39:38 PM by AutoGen 5.16pre15
  *  From the definitions    genshell.def
  *  and the template file   options
  *
- * Generated from AutoOpts 36:3:11 templates.
+ * Generated from AutoOpts 36:4:11 templates.
  *
  *  AutoOpts is a copyrighted work.  This header file is not encumbered
  *  by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -55,7 +55,7 @@
  *  tolerable version is at least as old as what was current when the header
  *  template was released.
  */
-#define AO_TEMPLATE_VERSION 147459
+#define AO_TEMPLATE_VERSION 147460
 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 # error option template version mismatches autoopts/options.h header
@@ -104,7 +104,8 @@ typedef enum {
  */
 typedef enum {
     GENSHELLOPT_EXIT_SUCCESS = 0,
-    GENSHELLOPT_EXIT_FAILURE = 1
+    GENSHELLOPT_EXIT_FAILURE = 1,
+    GENSHELLOPT_EXIT_LIBOPTS_FAILURE = 70
 } genshellopt_exit_code_t;
 /* * * * * *
  *
@@ -125,7 +126,7 @@ typedef enum {
                 genshelloptOptions.pzCurOpt  = NULL )
 #define START_GENSHELL_OPT       RESTART_GENSHELL_OPT(1)
 #define GENSHELL_USAGE(c)        (*genshelloptOptions.pUsageProc)(&genshelloptOptions, c)
-/* extracted from opthead.tlib near line 469 */
+/* extracted from opthead.tlib near line 484 */
 
 #ifdef  __cplusplus
 extern "C" {
index bd5f87244fd6d72d141ceb37e8885dfd50bc2afb..a827c0eb08127e580730956afd047ec29f6076a4 100644 (file)
@@ -1,6 +1,5 @@
-#include "autoopts/project.h"
 #define  AUTOOPTS_INTERNAL 1
-#include "compat/compat.h"
+#include "autoopts/project.h"
 #define  LOCAL static
 #include "ao-strs.h"
 #include "autoopts/options.h"
index a1380709bbfbf1bc06db6bf401a0cc337aa17327..1ea780806131a9f8e06fabf985095b7832ce3011 100644 (file)
@@ -1,7 +1,7 @@
 
 /**
  *  \file load.c
- *  Time-stamp:      "2012-01-29 19:37:15 bkorb"
+ *  Time-stamp:      "2012-03-31 13:13:34 bkorb"
  *
  *  This file contains the routines that deal with processing text strings
  *  for options, either from a NUL-terminated string passed in or from an
  */
 
 /* = = = START-STATIC-FORWARD = = = */
-static ag_bool
+static bool
 add_prog_path(char * pzBuf, int bufSize, char const * pzName,
               char const * pzProgPath);
 
-static ag_bool
-add_env_val(char * pzBuf, int bufSize, char const * pzName,
-            char const * pzProgPath);
+static bool
+add_env_val(char * pzBuf, int bufSize, char const * pzName);
 
 static char *
 assemble_arg_val(char * pzTxt, tOptionLoadMode mode);
@@ -50,8 +49,8 @@ assemble_arg_val(char * pzTxt, tOptionLoadMode mode);
  * arg:   + char const* + pzName     + The input name +
  * arg:   + char const* + pzProgPath + The full path of the current program +
  *
- * ret-type: ag_bool
- * ret-desc: AG_TRUE if the name was handled, otherwise AG_FALSE.
+ * ret-type: bool
+ * ret-desc: true if the name was handled, otherwise false.
  *           If the name does not start with ``$'', then it is handled
  *           simply by copying the input name to the output buffer and
  *           resolving the name with either
@@ -77,7 +76,7 @@ assemble_arg_val(char * pzTxt, tOptionLoadMode mode);
  *     @code{pzName} string and must either be the entire string or be followed
  *     by the @code{'/'} (backslash on windows) character.
  *
- * err:  @code{AG_FALSE} is returned if:
+ * err:  @code{false} is returned if:
  *       @*
  *       @bullet{} The input name exceeds @code{bufSize} bytes.
  *       @*
@@ -92,14 +91,14 @@ assemble_arg_val(char * pzTxt, tOptionLoadMode mode);
  *       @bullet{} @code{canonicalize_file_name} or @code{realpath} return
  *                 errors (cannot resolve the resulting path).
 =*/
-ag_bool
+bool
 optionMakePath(char * pzBuf, int bufSize, char const * pzName,
                char const * pzProgPath)
 {
     size_t name_len = strlen(pzName);
 
     if (((size_t)bufSize <= name_len) || (name_len == 0))
-        return AG_FALSE;
+        return false;
 
     /*
      *  IF not an environment variable, just copy the data
@@ -113,7 +112,7 @@ optionMakePath(char * pzBuf, int bufSize, char const * pzName,
             if ( (*(pzD++) = *(pzS++)) == NUL)
                 break;
             if (--ct <= 0)
-                return AG_FALSE;
+                return false;
         }
     }
 
@@ -124,37 +123,37 @@ optionMakePath(char * pzBuf, int bufSize, char const * pzName,
      */
     else switch (pzName[1]) {
     case NUL:
-        return AG_FALSE;
+        return false;
 
     case '$':
         if (! add_prog_path(pzBuf, bufSize, pzName, pzProgPath))
-            return AG_FALSE;
+            return false;
         break;
 
     case '@':
         if (program_pkgdatadir[0] == NUL)
-            return AG_FALSE;
+            return false;
 
         if (snprintf(pzBuf, bufSize, "%s%s", program_pkgdatadir, pzName + 2)
             >= bufSize)
-            return AG_FALSE;
+            return false;
         break;
 
     default:
-        if (! add_env_val(pzBuf, bufSize, pzName, pzProgPath))
-            return AG_FALSE;
+        if (! add_env_val(pzBuf, bufSize, pzName))
+            return false;
     }
 
 #if defined(HAVE_CANONICALIZE_FILE_NAME)
     {
         char * pz = canonicalize_file_name(pzBuf);
         if (pz == NULL)
-            return AG_FALSE;
+            return false;
 
         name_len = strlen(pz);
-        if (name_len >= bufSize) {
+        if (name_len >= (size_t)bufSize) {
             free(pz);
-            return AG_FALSE;
+            return false;
         }
 
         memcpy(pzBuf, pz, name_len + 1);
@@ -166,20 +165,20 @@ optionMakePath(char * pzBuf, int bufSize, char const * pzName,
         char z[PATH_MAX+1];
 
         if (realpath(pzBuf, z) == NULL)
-            return AG_FALSE;
+            return false;
 
         name_len = strlen(z);
         if (name_len >= bufSize)
-            return AG_FALSE;
+            return false;
 
         memcpy(pzBuf, z, name_len + 1);
     }
 #endif
 
-    return AG_TRUE;
+    return true;
 }
 
-static ag_bool
+static bool
 add_prog_path(char * pzBuf, int bufSize, char const * pzName,
               char const * pzProgPath)
 {
@@ -193,7 +192,7 @@ add_prog_path(char * pzBuf, int bufSize, char const * pzName,
     case NUL:
         break;
     default:
-        return AG_FALSE;
+        return false;
     }
 
     /*
@@ -207,7 +206,7 @@ add_prog_path(char * pzBuf, int bufSize, char const * pzName,
         pzPath = pathfind(getenv("PATH"), (char*)pzProgPath, "rx");
 
         if (pzPath == NULL)
-            return AG_FALSE;
+            return false;
     }
 
     pz = strrchr(pzPath, DIRCH);
@@ -217,7 +216,7 @@ add_prog_path(char * pzBuf, int bufSize, char const * pzName,
      *  THEN we do not have a path name to our executable file.
      */
     if (pz == NULL)
-        return AG_FALSE;
+        return false;
 
     pzName += skip;
 
@@ -226,7 +225,7 @@ add_prog_path(char * pzBuf, int bufSize, char const * pzName,
      *  The result may be either a file or a directory.
      */
     if ((pz - pzPath)+1 + strlen(pzName) >= (unsigned)bufSize)
-        return AG_FALSE;
+        return false;
 
     memcpy(pzBuf, pzPath, (size_t)((pz - pzPath)+1));
     strcpy(pzBuf + (pz - pzPath) + 1, pzName);
@@ -237,15 +236,14 @@ add_prog_path(char * pzBuf, int bufSize, char const * pzName,
      */
     if (pzPath != pzProgPath)
         AGFREE(pzPath);
-    return AG_TRUE;
+    return true;
 }
 
 
-static ag_bool
-add_env_val(char * pzBuf, int bufSize, char const * pzName,
-            char const * pzProgPath)
+static bool
+add_env_val(char * pzBuf, int bufSize, char const * pzName)
 {
-    char* pzDir = pzBuf;
+    char * pzDir = pzBuf;
 
     for (;;) {
         int ch = (int)*++pzName;
@@ -255,7 +253,7 @@ add_env_val(char * pzBuf, int bufSize, char const * pzName,
     }
 
     if (pzDir == pzBuf)
-        return AG_FALSE;
+        return false;
 
     *pzDir = NUL;
 
@@ -265,34 +263,34 @@ add_env_val(char * pzBuf, int bufSize, char const * pzName,
      *  Environment value not found -- skip the home list entry
      */
     if (pzDir == NULL)
-        return AG_FALSE;
+        return false;
 
     if (strlen(pzDir) + 1 + strlen(pzName) >= (unsigned)bufSize)
-        return AG_FALSE;
+        return false;
 
     sprintf(pzBuf, "%s%s", pzDir, pzName);
-    return AG_TRUE;
+    return true;
 }
 
 
 LOCAL void
 mungeString(char* pzTxt, tOptionLoadMode mode)
 {
-    char* pzE;
+    char * pzE;
 
     if (mode == OPTION_LOAD_KEEP)
         return;
 
     if (IS_WHITESPACE_CHAR(*pzTxt)) {
-        char* pzS = pzTxt;
-        char* pzD = pzTxt;
-        while (IS_WHITESPACE_CHAR(*++pzS))  ;
-        while ((*(pzD++) = *(pzS++)) != NUL)   ;
-        pzE = pzD-1;
+        char * pzS = SPN_WHITESPACE_CHARS(pzTxt+1);
+        size_t l   = strlen(pzS) + 1;
+        memmove(pzTxt, pzS, l);
+        pzE = pzTxt + l - 1;
+
     } else
         pzE = pzTxt + strlen(pzTxt);
 
-    while ((pzE > pzTxt) && IS_WHITESPACE_CHAR(pzE[-1]))  pzE--;
+    pzE  = SPN_WHITESPACE_BACK(pzTxt, pzE);
     *pzE = NUL;
 
     if (mode == OPTION_LOAD_UNCOOKED)
@@ -343,9 +341,10 @@ assemble_arg_val(char * pzTxt, tOptionLoadMode mode)
      */
     space_break = IS_WHITESPACE_CHAR(*pzEnd);
     *(pzEnd++) = NUL;
-    while (IS_WHITESPACE_CHAR(*pzEnd))  pzEnd++;
+
+    pzEnd = SPN_WHITESPACE_CHARS(pzEnd);
     if (space_break && ((*pzEnd == ':') || (*pzEnd == '=')))
-        while (IS_WHITESPACE_CHAR(*++pzEnd))  ;
+        pzEnd = SPN_WHITESPACE_CHARS(pzEnd+1);
 
     return pzEnd;
 }
@@ -365,7 +364,7 @@ loadOptionLine(
     tDirection  direction,
     tOptionLoadMode   load_mode )
 {
-    while (IS_WHITESPACE_CHAR(*pzLine))  pzLine++;
+    pzLine = SPN_WHITESPACE_CHARS(pzLine);
 
     {
         char* pzArg = assemble_arg_val(pzLine, load_mode);
index d9a117399ce1090a1bf953682a9a1fa66d47f761..044f43ee65e34b36dbda8849a04bd5f466630bf8 100644 (file)
@@ -2,7 +2,7 @@ dnl  -*- buffer-read-only: t -*- vi: set ro:
 dnl 
 dnl DO NOT EDIT THIS FILE   (libopts.m4)
 dnl 
-dnl It has been AutoGen-ed  February 26, 2012 at 11:08:37 AM by AutoGen 5.15pre14
+dnl It has been AutoGen-ed  April  7, 2012 at 12:39:34 PM by AutoGen 5.16pre15
 dnl From the definitions    libopts.def
 dnl and the template file   conftest.tpl
 dnl
@@ -17,6 +17,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
   # =================
   AC_CHECK_HEADERS([ \
       dlfcn.h      errno.h       fcntl.h       libgen.h     \
+      stdbool.h \
       memory.h     netinet/in.h  setjmp.h      sys/mman.h   \
       sys/param.h  sys/poll.h    sys/procset.h sys/select.h \
       sys/socket.h sys/stropts.h sys/time.h    sys/un.h     \
@@ -100,7 +101,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
   AC_FUNC_VPRINTF
   AC_FUNC_FORK
   AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr \
-                 strrchr strsignal])
+                 strrchr strsignal fchmod fstat chmod])
   AC_PROG_SED
   [while :
   do
index 1730c8176d9c282d74d624d3e49e3bc2249727b1..79edb7022b8b50e58b603403f026748cdf6cfad5 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * \file makeshell.c
  *
- * Time-stamp:      "2012-01-29 19:01:07 bkorb"
+ * Time-stamp:      "2012-04-07 09:03:16 bkorb"
  *
  *  This module will interpret the options set in the tOptions
  *  structure and create a Bourne shell script capable of parsing them.
@@ -163,9 +163,11 @@ optionParseShell(tOptions * pOpts)
     else if (ENABLED_GENSHELL_OPT(SHELL))
         printf(SHOW_PROG_ENV, pOpts->pzPROGNAME);
 
-    fflush(stdout);
+#ifdef HAVE_FCHMOD
     fchmod(STDOUT_FILENO, 0755);
+#endif
     fclose(stdout);
+
     if (ferror(stdout)) {
         fputs(zOutputFail, stderr);
         exit(EXIT_FAILURE);
@@ -716,7 +718,7 @@ open_out(char const * pzFile)
          */
         script_trailer = pzScan + END_MARK_LEN;
         script_leader  = pzData;
-    } while (AG_FALSE);
+    } while (false);
 
     if (freopen(pzFile, "w" FOPEN_BINARY_FLAG, stdout) != stdout) {
         fprintf(stderr, zFreopenFail, errno, strerror(errno));
index b7f15866e194aee89a5c91ba1b4f6ce8613213c9..ed23fd20360ea12d30baa46fd8ad9ff709dfcb25 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * \file nested.c
  *
- *  Time-stamp:      "2012-01-29 07:00:04 bkorb"
+ *  Time-stamp:      "2012-03-04 13:30:07 bkorb"
  *
  *   Automated Options Nested Values module.
  *
@@ -397,7 +397,8 @@ scan_name(char const* pzName, tOptionValue* pRes)
 static char const*
 scan_xml(char const* pzName, tOptionValue* pRes)
 {
-    size_t nameLen = 1, valLen = 0;
+    size_t nameLen;
+    size_t valLen;
     char const*   pzScan = ++pzName;
     char const*   pzVal;
     tOptionValue  valu;
@@ -425,8 +426,8 @@ scan_xml(char const* pzName, tOptionValue* pRes)
         return pzName;
     }
 
-    pzScan++;
-    while (IS_VALUE_NAME_CHAR((int)*pzScan))  { pzScan++; nameLen++; }
+    pzScan  = SPN_VALUE_NAME_CHARS(pzName+1);
+    nameLen = pzScan - pzName;
     if (nameLen > 64)
         return NULL;
     valu.valType = OPARG_TYPE_STRING;
@@ -434,7 +435,7 @@ scan_xml(char const* pzName, tOptionValue* pRes)
     switch (*pzScan) {
     case ' ':
     case '\t':
-        pzScan = parseAttributes(
+        pzScan = parse_attrs(
             NULL, (char*)pzScan, &option_load_mode, &valu );
         if (*pzScan == '>') {
             pzScan++;
@@ -489,7 +490,7 @@ scan_xml(char const* pzName, tOptionValue* pRes)
         }
         valLen = (pzScan - pzVal);
         pzScan += nameLen + 3;
-        while (IS_WHITESPACE_CHAR(*pzScan))  pzScan++;
+        pzScan = SPN_WHITESPACE_CHARS(pzScan);
     }
 
     switch (valu.valType) {
index e49060aec36d210715ca455d53625c96e6f6e2a9..655a5e542be7e4ecbaabc256e25bc045c29a0ca3 100644 (file)
@@ -54,14 +54,14 @@ typedef enum {
 #define TIME_MAX        0x7FFFFFFF
 
 /* Wrapper around strtoul that does not require a cast.  */
-static unsigned long inline
+inline static unsigned long
 str_const_to_ul (cch_t * str, cch_t ** ppz, int base)
 {
   return strtoul (str, (char **)ppz, base);
 }
 
 /* Wrapper around strtol that does not require a cast.  */
-static long inline
+inline static long
 str_const_to_l (cch_t * str, cch_t ** ppz, int base)
 {
   return strtol (str, (char **)ppz, base);
@@ -70,7 +70,7 @@ str_const_to_l (cch_t * str, cch_t ** ppz, int base)
 /* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME
    with errno set as an error situation, and returning BAD_TIME
    with errno set in an error situation.  */
-static time_t inline
+inline static time_t
 scale_n_add (time_t base, time_t val, int scale)
 {
   if (base == BAD_TIME)
index 4dbbd53be1238d29b8c7cc4e187e2bb61a0a5a34..7eae2b0f5b0467835be5f9ec6d388f798840cae6 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * \file pgusage.c
  *
- * Time-stamp:      "2012-01-29 16:09:14 bkorb"
+ * Time-stamp:      "2012-02-28 19:49:32 bkorb"
  *
  *   Automated Options Paged Usage module.
  *
@@ -43,7 +43,7 @@
  *  This is disabled on platforms without a working fork() function.
 =*/
 void
-optionPagedUsage(tOptions* pOptions, tOptDesc* pOD)
+optionPagedUsage(tOptions * pOptions, tOptDesc * pOD)
 {
 #if ! defined(HAVE_WORKING_FORK)
     if ((pOD->fOptState & OPTST_RESET) != 0)
@@ -66,11 +66,7 @@ optionPagedUsage(tOptions* pOptions, tOptDesc* pOD)
             return;
 
         my_pid  = getpid();
-#ifdef HAVE_SNPRINTF
         snprintf(zPageUsage, sizeof(zPageUsage), TMP_USAGE_FMT, (tAoUL)my_pid);
-#else
-        sprintf(zPageUsage, TMP_USAGE_FMT, (tAoUL)my_pid);
-#endif
         unlink(zPageUsage);
 
         /*
@@ -110,11 +106,8 @@ optionPagedUsage(tOptions* pOptions, tOptDesc* pOD)
         /*
          *  Page the file and remove it when done.
          */
-#ifdef HAVE_SNPRINTF
-        snprintf(zPageUsage, sizeof(zPageUsage), PAGE_USAGE_FMT, pzPager, (tAoUL)my_pid);
-#else
-        sprintf(zPageUsage, PAGE_USAGE_FMT, pzPager, (tAoUL)my_pid);
-#endif
+        snprintf(zPageUsage, sizeof(zPageUsage), PAGE_USAGE_FMT, pzPager,
+                 (tAoUL)my_pid);
         fclose(stderr);
         dup2(STDOUT_FILENO, STDERR_FILENO);
 
index 9f4bbff175f265962dacd4607917156ef62f02b2..f219ba1163631f20e393f3011aee9e2cc556c1bb 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- buffer-read-only: t -*- vi: set ro:
  *
  * Prototypes for autoopts
- * Generated Sun Feb 26 11:08:49 PST 2012
+ * Generated Sat Apr  7 12:39:46 PDT 2012
  */
 #ifndef AUTOOPTS_PROTO_H_GUARD
 #define AUTOOPTS_PROTO_H_GUARD 1
@@ -36,7 +36,7 @@ regular_opts(tOptions * pOpts);
 /*
  *  Extracted from check.c
  */
-LOCAL ag_bool
+LOCAL bool
 is_consistent(tOptions * pOpts);
 
 /*
@@ -46,11 +46,8 @@ LOCAL void
 intern_file_load(tOptions* pOpts);
 
 LOCAL char*
-parseAttributes(
-    tOptions*           pOpts,
-    char*               pzText,
-    tOptionLoadMode*    pMode,
-    tOptionValue*       pType );
+parse_attrs(tOptions * pOpts, char * pzText, tOptionLoadMode * pMode,
+            tOptionValue * pType);
 
 LOCAL tSuccess
 validate_struct(tOptions * pOpts, char const * pzProgram);
index 2c9dde569df890374232257320cb5e42d82769e4..d8e2d91aea22dea900adf3133bcdb45a1af9b3a1 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * \file putshell.c
  *
- * Time-stamp:      "2012-02-12 09:14:49 bkorb"
+ * Time-stamp:      "2012-03-31 13:14:18 bkorb"
  *
  *  This module will interpret the options set in the tOptions
  *  structure and print them to standard out in a fashion that
@@ -142,7 +142,7 @@ print_membership(tOptions * pOpts, tOptDesc * pOD)
     pz = pOD->optArg.argString + 7;
     while (*pz != NUL) {
         printf("typeset -x -i %s_", pOD->pz_NAME);
-        while (IS_PLUS_N_SPACE_CHAR(*pz))  pz++;
+        pz = SPN_PLUS_N_SPACE_CHARS(pz);
 
         for (;;) {
             int ch = *(pz++);
@@ -182,11 +182,13 @@ print_stacked_arg(tOptions * pOpts, tOptDesc * pOD)
 static void
 print_reordering(tOptions * pOpts)
 {
-    int  optIx;
+    unsigned int optIx;
 
     fputs(set_dash, stdout);
 
-    for (optIx = pOpts->curOptIdx; optIx < pOpts->origArgCt; optIx++) {
+    for (optIx = pOpts->curOptIdx;
+         optIx < pOpts->origArgCt;
+         optIx++) {
 
         char* pzArg = pOpts->origArgVect[ optIx ];
 
index 2345d51e3c96a788ecfc9068adff4cac21fb7ded..b8c5b9e274b74ff354f6779c1062b1c9983d951e 100644 (file)
@@ -69,7 +69,7 @@ optionResetEverything(tOptions * pOpts)
 void
 optionResetOpt( tOptions* pOpts, tOptDesc* pOD )
 {
-    static ag_bool reset_active = AG_FALSE;
+    static bool reset_active = false;
 
     tOptState opt_state = OPTSTATE_INITIALIZER(DEFINED);
     char const * pzArg = pOD->optArg.argString;
@@ -91,12 +91,12 @@ optionResetOpt( tOptions* pOpts, tOptDesc* pOD )
         assert(0 == 1);
     }
 
-    reset_active = AG_TRUE;
+    reset_active = true;
 
     if (pzArg[1] == NUL) {
         if (*pzArg == '*') {
             optionResetEverything(pOpts);
-            reset_active = AG_FALSE;
+            reset_active = false;
             return;
         }
 
@@ -124,7 +124,7 @@ optionResetOpt( tOptions* pOpts, tOptDesc* pOD )
      *  Finally, clear the reset flag, too.
      */
     optionReset(pOpts, opt_state.pOD);
-    reset_active = AG_FALSE;
+    reset_active = false;
 }
 /*
  * Local Variables:
index a1357ffecef89774c1efb975802234546aa7a37f..9e95056babaeb7feff1da2d4b377eb5cdce45586 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * \file save.c
  *
- * Time-stamp:      "2012-01-29 19:30:39 bkorb"
+ * Time-stamp:      "2012-03-31 13:15:19 bkorb"
  *
  *  This module's routines will take the currently set options and
  *  store them into an ".rc" file for re-interpretation the next
@@ -192,7 +192,7 @@ find_file_name(tOptions * pOpts, int * p_free_name)
             break; /* found directory -- viz.,  "." */
         }
 
-        if ((dirchp - pzDir) >= sizeof(z))
+        if ((size_t)(dirchp - pzDir) >= sizeof(z))
             goto bogus_name;
 
         memcpy(z, pzDir, (size_t)(dirchp - pzDir));
@@ -201,7 +201,7 @@ find_file_name(tOptions * pOpts, int * p_free_name)
         if ((stat(z, &stBuf) != 0) || ! S_ISDIR(stBuf.st_mode))
             goto bogus_name;
         stBuf.st_mode = S_IFREG; /* file within this directory */
-    } while (0);
+    } while (false);
 
     /*
      *  IF what we found was a directory,
index bb962f78a2212b1d0888fa664acc06e0d67d38e4..094b2a1de3c4dad9d4f0aa0fc4b70654332c31da 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * \file stack.c
  *
- *  Time-stamp:      "2012-01-29 09:42:12 bkorb"
+ *  Time-stamp:      "2012-03-31 13:16:41 bkorb"
  *
  *  This is a special option processing routine that will save the
  *  argument to an option in a FIFO queue.
  *  Invoked for options that are equivalenced to stacked options.
 =*/
 void
-optionUnstackArg(
-    tOptions*  pOpts,
-    tOptDesc*  pOptDesc )
+optionUnstackArg(tOptions * pOpts, tOptDesc * pOptDesc)
 {
-    tArgList* pAL;
+    tArgList * pAL;
+
+    (void)pOpts;
 
     if ((pOptDesc->fOptState & OPTST_RESET) != 0)
         return;
@@ -230,12 +230,12 @@ addArgListEntry(void** ppAL, void* entry)
  *  Keep an entry-ordered list of option arguments.
 =*/
 void
-optionStackArg(
-    tOptions*  pOpts,
-    tOptDesc*  pOD )
+optionStackArg(tOptions * pOpts, tOptDesc * pOD)
 {
     char * pz;
 
+    (void)pOpts;
+
     if ((pOD->fOptState & OPTST_RESET) != 0) {
         tArgList* pAL = (void*)pOD->optCookie;
         int ix;
index d08f9c9dc1fc219a565f71cf358012c235666dbe..54a063affc14629d49633af5660849d38a3cf8bf 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * \file streqvcmp.c
  *
- * Time-stamp:      "2012-01-29 19:03:24 bkorb"
+ * Time-stamp:      "2012-03-31 13:17:39 bkorb"
  *
  *  String Equivalence Comparison
  *
@@ -192,8 +192,8 @@ streqvmap(char From, char To, int ct)
     }
 
     else {
-        int  chTo   = (int)To   & 0xFF;
-        int  chFrom = (int)From & 0xFF;
+        unsigned int chTo   = (int)To   & 0xFF;
+        unsigned int chFrom = (int)From & 0xFF;
 
         do  {
             charmap[chFrom] = (unsigned char)chTo;
index ca0ad53ab3a7be0a82fc5f6496b51f34f2b9c561..9563713e80711f2d7b7e5f94fc47df2d2d6016c6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  This file defines the string_tokenize interface
- * Time-stamp:      "2012-01-29 19:02:51 bkorb"
+ * Time-stamp:      "2012-03-04 13:23:50 bkorb"
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
@@ -128,7 +128,7 @@ alloc_token_list(char const * str)
      *  Trim leading white space.  Use "ENOENT" and a NULL return to indicate
      *  an empty string was passed.
      */
-    while (IS_WHITESPACE_CHAR(*str))  str++;
+    str = SPN_WHITESPACE_CHARS(str);
     if (*str == NUL)  goto enoent_res;
 
     /*
@@ -137,17 +137,15 @@ alloc_token_list(char const * str)
      *  high and we'll squander the space for a few extra pointers.
      */
     {
-        cc_t* pz = (cc_t*)str;
+        char const * pz = str;
 
         do {
             max_token_ct++;
-            while (! IS_WHITESPACE_CHAR(*++pz))
-                if (*pz == NUL) goto found_nul;
-            while (IS_WHITESPACE_CHAR(*pz))  pz++;
+            pz = BRK_WHITESPACE_CHARS(pz+1);
+            pz = SPN_WHITESPACE_CHARS(pz);
         } while (*pz != NUL);
 
-    found_nul:
-        res = malloc(sizeof(*res) + (pz - (cc_t*)str)
+        res = malloc(sizeof(*res) + (pz - str)
                      + (max_token_ct * sizeof(ch_t*)));
     }
 
@@ -249,7 +247,7 @@ ao_string_tokenize(char const* str)
             int ch = (ch_t)*str;
             if (IS_WHITESPACE_CHAR(ch)) {
             found_white_space:
-                while (IS_WHITESPACE_CHAR(*++str))  ;
+                str = SPN_WHITESPACE_CHARS(str+1);
                 break;
             }
 
index 8634cfce53fa7c3890b3d350553bc7e95fc6fba0..ebdc46ae867317a1a13c129b206d07f46b2e58cb 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * \file usage.c
  *
- * Time-stamp:      "2012-01-29 09:57:43 bkorb"
+ * Time-stamp:      "2012-03-31 19:19:26 bkorb"
  *
  *  This module implements the default usage procedure for
  *  Automated Options.  It may be overridden, of course.
 #define OPTPROC_L_N_S  (OPTPROC_LONGOPT | OPTPROC_SHORTOPT)
 
 /* = = = START-STATIC-FORWARD = = = */
-static inline ag_bool
+static inline bool
 do_gnu_usage(tOptions * pOpts);
 
-static inline ag_bool
+static inline bool
 skip_misuse_usage(tOptions * pOpts);
 
 static void
@@ -55,14 +55,14 @@ prt_one_vendor(tOptions * pOptions, tOptDesc * pOD,
                arg_types_t * pAT, char const * usefmt);
 
 static void
-prt_vendor_opts(tOptions * pOpts, arg_types_t * pAT, char const * pOptTitle);
+prt_vendor_opts(tOptions * pOpts, char const * pOptTitle);
 
 static void
 prt_extd_usage(tOptions * pOpts, tOptDesc * pOD,
-               arg_types_t * pAT, char const * pOptTitle);
+               char const * pOptTitle);
 
 static void
-prt_ini_list(char const * const * papz, ag_bool * pInitIntro,
+prt_ini_list(char const * const * papz, bool * pInitIntro,
              char const * pzRc, char const * pzPN);
 
 static void
@@ -116,14 +116,14 @@ set_usage_flags(tOptions * opts, char const * flg_txt)
     };
 #   undef  _aof_
 
-    ao_flags_t flg = 0;
+    unsigned int flg = (ao_flags_t)0;
 
     if (flg_txt == NULL) {
         flg_txt = getenv("AUTOOPTS_USAGE");
         if (flg_txt == NULL) return;
     }
 
-    while (IS_WHITESPACE_CHAR(*flg_txt))  flg_txt++;
+    flg_txt = SPN_WHITESPACE_CHARS(flg_txt);
     if (*flg_txt == NUL)
         return;
 
@@ -147,8 +147,7 @@ set_usage_flags(tOptions * opts, char const * flg_txt)
             return;
 
         flg |= 1 << ix;
-        flg_txt  += fnt->fnm_len;
-        while (IS_WHITESPACE_CHAR(*flg_txt))  flg_txt++;
+        flg_txt = SPN_WHITESPACE_CHARS(flg_txt + fnt->fnm_len);
 
         if (*flg_txt == NUL)
             break;
@@ -157,7 +156,7 @@ set_usage_flags(tOptions * opts, char const * flg_txt)
             /*
              *  skip the comma and following white space
              */
-            while (IS_WHITESPACE_CHAR(*++flg_txt))  ;
+            flg_txt = SPN_WHITESPACE_CHARS(flg_txt + 1);
             if (*flg_txt == NUL)
                 break;
         }
@@ -182,20 +181,20 @@ set_usage_flags(tOptions * opts, char const * flg_txt)
  *  Figure out if we should try to format usage text sort-of like
  *  the way many GNU programs do.
  */
-static inline ag_bool
+static inline bool
 do_gnu_usage(tOptions * pOpts)
 {
-    return (pOpts->fOptSet & OPTPROC_GNUUSAGE) ? AG_TRUE : AG_FALSE;
+    return (pOpts->fOptSet & OPTPROC_GNUUSAGE) ? true : false;
 }
 
 /*
  *  Figure out if we should try to format usage text sort-of like
  *  the way many GNU programs do.
  */
-static inline ag_bool
+static inline bool
 skip_misuse_usage(tOptions * pOpts)
 {
-    return (pOpts->fOptSet & OPTPROC_MISUSE) ? AG_TRUE : AG_FALSE;
+    return (pOpts->fOptSet & OPTPROC_MISUSE) ? true : false;
 }
 
 
@@ -326,16 +325,16 @@ print_usage_details(tOptions * opts, int exit_code)
  *  over-ride this, providing the value of it is set to either "gnu" or
  *  "autoopts".  This routine will @strong{not} return.
  *
- *  If "exitCode" is "EX_USAGE" (normally 64), then output will to to stdout
- *  and the actual exit code will be "EXIT_SUCCESS".
+ *  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
 optionUsage(tOptions * pOptions, int usage_exit_code)
 {
-    int exit_code =
-        (usage_exit_code == EX_USAGE) ? EXIT_SUCCESS : usage_exit_code;
+    int exit_code = (usage_exit_code == AO_EXIT_REQ_USAGE)
+        ? EXIT_SUCCESS : usage_exit_code;
 
-    displayEnum = AG_FALSE;
+    displayEnum = false;
 
     /*
      *  Paged usage will preset option_usage_fp to an output file.
@@ -467,7 +466,7 @@ prt_one_vendor(tOptions * pOptions, tOptDesc * pOD,
         default:                     goto bogus_desc;
         }
 
-        while (IS_WHITESPACE_CHAR(*pzArgType))  pzArgType++;
+        pzArgType = SPN_WHITESPACE_CHARS(pzArgType);
         if (*pzArgType == NUL)
             snprintf(z, sizeof(z), "%s", pOD->pz_Name);
         else
@@ -477,7 +476,7 @@ prt_one_vendor(tOptions * pOptions, tOptDesc * pOD,
         switch (OPTST_GET_ARGTYPE(pOD->fOptState)) {
         case OPARG_TYPE_ENUMERATION:
         case OPARG_TYPE_MEMBERSHIP:
-            displayEnum = (pOD->pOptProc != NULL) ? AG_TRUE : displayEnum;
+            displayEnum = (pOD->pOptProc != NULL) ? true : displayEnum;
         }
     }
 
@@ -494,10 +493,9 @@ bogus_desc:
  *
  * @param pOptions the program option descriptor
  * @param pOD      the option descriptor
- * @param pAT      names of the option argument types
  */
 static void
-prt_vendor_opts(tOptions * pOpts, arg_types_t * pAT, char const * pOptTitle)
+prt_vendor_opts(tOptions * pOpts, char const * pOptTitle)
 {
     static unsigned int const not_vended_mask =
         OPTST_NO_USAGE_MASK | OPTST_DOCUMENT;
@@ -535,7 +533,7 @@ prt_vendor_opts(tOptions * pOpts, arg_types_t * pAT, char const * pOptTitle)
             continue;
 
         prt_one_vendor(pOpts, pOD, &argTypes, vfmt);
-        prt_extd_usage(pOpts, pOD, &argTypes, pOptTitle);
+        prt_extd_usage(pOpts, pOD, pOptTitle);
 
     } while (pOD++, (--ct > 0));
 }
@@ -549,11 +547,11 @@ prt_vendor_opts(tOptions * pOpts, arg_types_t * pAT, char const * pOptTitle)
  */
 static void
 prt_extd_usage(tOptions * pOpts, tOptDesc * pOD,
-               arg_types_t * pAT, char const * pOptTitle)
+               char const * pOptTitle)
 {
     if (  ((pOpts->fOptSet & OPTPROC_VENDOR_OPT) != 0)
        && (pOD->optActualValue == VENDOR_OPTION_VALUE)) {
-        prt_vendor_opts(pOpts, pAT, pOptTitle);
+        prt_vendor_opts(pOpts, pOptTitle);
         return;
     }
 
@@ -666,7 +664,7 @@ prt_extd_usage(tOptions * pOpts, tOptDesc * pOD,
  *   squishy, but important to tell users how to find these files.
  */
 static void
-prt_ini_list(char const * const * papz, ag_bool * pInitIntro,
+prt_ini_list(char const * const * papz, bool * pInitIntro,
              char const * pzRc, char const * pzPN)
 {
     char zPath[AG_PATH_MAX+1];
@@ -675,7 +673,7 @@ prt_ini_list(char const * const * papz, ag_bool * pInitIntro,
         return;
 
     fputs(zPresetIntro, option_usage_fp);
-    *pInitIntro = AG_FALSE;
+    *pInitIntro = false;
 
     for (;;) {
         char const * pzPath = *(papz++);
@@ -792,7 +790,7 @@ prt_one_usage(tOptions * pOptions, tOptDesc * pOD, arg_types_t * pAT)
         switch (OPTST_GET_ARGTYPE(pOD->fOptState)) {
         case OPARG_TYPE_ENUMERATION:
         case OPARG_TYPE_MEMBERSHIP:
-            displayEnum = (pOD->pOptProc != NULL) ? AG_TRUE : displayEnum;
+            displayEnum = (pOD->pOptProc != NULL) ? true : displayEnum;
         }
     }
 
@@ -880,7 +878,7 @@ prt_opt_usage(tOptions * pOpts, int ex_code, char const * pOptTitle)
          *  THEN print all the extra info
          */
         if (ex_code == EXIT_SUCCESS)
-            prt_extd_usage(pOpts, pOD, &argTypes, pOptTitle);
+            prt_extd_usage(pOpts, pOD, pOptTitle);
 
     } while (pOD++, optNo++, (--ct > 0));
 
@@ -895,7 +893,7 @@ prt_opt_usage(tOptions * pOpts, int ex_code, char const * pOptTitle)
 static void
 prt_prog_detail(tOptions* pOptions)
 {
-    ag_bool  initIntro = AG_TRUE;
+    bool  initIntro = true;
 
     /*
      *  Display all the places we look for config files
index bc5fc26d0432d2e007dbc5adf62b5d8d4784f503..b57041049abb8d2a3710421b3a3f22d55c650041 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Generated header for gperf generated source Sun Feb 26 11:08:41 PST 2012
+ *  Generated header for gperf generated source Sat Apr  7 12:39:38 PDT 2012
  *  This file enumerates the list of names and declares the
  *  procedure for mapping string names to the enum value.
  */
index 527cac260e7bd21867845329d624461c49256c26..6357a54fac5299e366c6ba2996be5d7b18e09efa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Generated header for gperf generated source Sun Feb 26 11:08:41 PST 2012
+ *  Generated header for gperf generated source Sat Apr  7 12:39:38 PDT 2012
  *  This file enumerates the list of names and declares the
  *  procedure for mapping string names to the enum value.
  */
index 1f8935dec8a390390fd1654e4b1807a137cf999f..123eed3d8fd93e34c2b6b528467dc0e115a535bc 100644 (file)
@@ -64,7 +64,7 @@ and
 the +4.567 +/- 0.089 secs indicates the time offset and
 error bound of the system clock relative to the server clock.
 
-@include sntp-opts.texi
+@include invoke-sntp.texi
 
 @node Usage
 @comment  node-name,  next,  previous,  up
index f8f76c3b46ccb95987dcd3ed2a5d79a663939ec7..7dcfc0a51cca1d2fd50cc4df3aba7287c36b39a1 100644 (file)
@@ -25,9 +25,9 @@ ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h
 tickadj_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LDADD_NLIST)
 
 EXTRA_DIST=                            \
+       invoke-ntp-keygen.menu          \
+       invoke-ntp-keygen.texi          \
        ntp-keygen-opts.def             \
-       ntp-keygen-opts.menu            \
-       ntp-keygen-opts.texi            \
        ntp-keygen.1ntp-keygenman       \
        ntp-keygen.1ntp-keygenmdoc      \
        ntp-keygen.man.in               \
@@ -38,8 +38,8 @@ BUILT_SOURCES=        ntp-keygen-opts.c ntp-keygen-opts.h
 CLEANFILES=
 DISTCLEANFILES=        .version version.c config.log $(man_MANS)
 noinst_DATA=                           \
-       $(srcdir)/ntp-keygen-opts.menu  \
-       $(srcdir)/ntp-keygen-opts.texi  \
+       $(srcdir)/invoke-ntp-keygen.menu        \
+       $(srcdir)/invoke-ntp-keygen.texi        \
        $(srcdir)/ntp-keygen.man.in     \
        $(srcdir)/ntp-keygen.mdoc.in    \
        $(man_MANS)                     \
@@ -92,11 +92,11 @@ ntp-keygen.$(NTP_KEYGEN_MS): $(srcdir)/ntp-keygen.$(MANTAGFMT).in $(top_builddir
 
 ###
 
-$(srcdir)/ntp-keygen-opts.menu: $(srcdir)/ntp-keygen-opts.texi
+$(srcdir)/invoke-ntp-keygen.menu: $(srcdir)/invoke-ntp-keygen.texi
        @: do-nothing action to avoid default SCCS get, .menu built with .texi
 
-$(srcdir)/ntp-keygen-opts.texi: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
-       $(run_ag) -Taginfo.tpl -DLEVEL=section ntp-keygen-opts.def
+$(srcdir)/invoke-ntp-keygen.texi: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
+       $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-keygen-opts.def
        $(top_srcdir)/scripts/check--help $@
 
 
diff --git a/util/invoke-ntp-keygen.texi b/util/invoke-ntp-keygen.texi
new file mode 100644 (file)
index 0000000..6107a91
--- /dev/null
@@ -0,0 +1,1049 @@
+@node ntp-keygen Invocation
+@section Invoking ntp-keygen
+@pindex ntp-keygen
+@cindex Create a NTP host key
+@ignore
+# 
+# EDIT THIS FILE WITH CAUTION  (invoke-ntp-keygen.texi)
+# 
+# It has been AutoGen-ed  April 14, 2012 at 12:22:58 AM by AutoGen 5.16pre18
+# From the definitions    ntp-keygen-opts.def
+# and the template file   agtexi-cmd.tpl
+@end ignore
+
+
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntp-keygen} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntp-keygen usage::                  ntp-keygen help/usage (-?)
+* ntp-keygen certificate::            certificate option (-c)
+* ntp-keygen cipher::                 cipher option (-C)
+* ntp-keygen id-key::                 id-key option (-e)
+* ntp-keygen gq-params::              gq-params option (-G)
+* ntp-keygen host-key::               host-key option (-H)
+* ntp-keygen iffkey::                 iffkey option (-I)
+* ntp-keygen ident::                  ident option (-i)
+* ntp-keygen lifetime::               lifetime option (-l)
+* ntp-keygen md5key::                 md5key option (-M)
+* ntp-keygen modulus::                modulus option (-m)
+* ntp-keygen pvt-cert::               pvt-cert option (-P)
+* ntp-keygen pvt-passwd::             pvt-passwd option (-p)
+* ntp-keygen get-pvt-passwd::         get-pvt-passwd option (-q)
+* ntp-keygen sign-key::               sign-key option (-S)
+* ntp-keygen subject-name::           subject-name option (-s)
+* ntp-keygen trusted-cert::           trusted-cert option (-T)
+* ntp-keygen mv-params::              mv-params option (-V)
+* ntp-keygen mv-keys::                mv-keys option (-v)
+* ntp-keygen config::                 presetting/configuring ntp-keygen
+* ntp-keygen exit status::            exit status
+* ntp-keygen Description::            Description
+* ntp-keygen Usage::                  Usage
+* ntp-keygen Notes::                  Notes
+* ntp-keygen Bugs::                   Bugs
+@end menu
+
+@node ntp-keygen usage
+@subsection ntp-keygen help/usage (-?)
+@cindex ntp-keygen help
+
+This is the automatically generated usage text for ntp-keygen.
+The text printed is the same whether for the @code{help} option (-?) or the @code{more-help} option (-!).  @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function.  The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}.  Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p271
+USAGE:  ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+  Flg Arg Option-Name    Description
+   -c Str certificate    certificate scheme
+   -C Str cipher         privatekey cipher
+   -d no  debug-level    Increase debug verbosity level
+                                - may appear multiple times
+   -D Str set-debug-level Set the debug verbosity level
+                                - may appear multiple times
+   -e no  id-key         Write IFF or GQ identity keys
+   -G no  gq-params      Generate GQ parameters and keys
+   -H no  host-key       generate RSA host key
+   -I no  iffkey         generate IFF parameters
+   -i Str ident          set Autokey group name
+   -l Num lifetime       set certificate lifetime
+   -M no  md5key         generate MD5 keys
+   -m Num modulus        modulus
+                                - It must be in the range:
+                                  256 to 2048
+   -P no  pvt-cert       generate PC private certificate
+   -p Str pvt-passwd     output private password
+   -q Str get-pvt-passwd input private password
+   -S Str sign-key       generate sign key (RSA or DSA)
+   -s Str subject-name   set host and optionally group name
+   -T no  trusted-cert   trusted certificate (TC scheme)
+   -V Num mv-params      generate <num> MV parameters
+   -v Num mv-keys        update <num> MV keys
+      opt version        Output version information and exit
+   -? no  help           Display extended usage information and exit
+   -! no  more-help      Extended usage information passed thru pager
+   -> opt save-opts      Save the option state to a config file
+   -< Str load-opts      Load options from a config file
+                                - disabled as --no-load-opts
+                                - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named NTP_KEYGEN_*
+
+please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
+@end example
+@exampleindent 4
+
+@node ntp-keygen certificate
+@subsection certificate option (-c)
+@cindex ntp-keygen-certificate
+
+This is the ``certificate scheme'' option.
+This option takes an argument string @file{scheme}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+scheme is one of
+RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+DSA-SHA, or DSA-SHA1.
+
+Select the certificate message digest/signature encryption scheme.
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key.  The default without
+this option is RSA-MD5.
+@node ntp-keygen cipher
+@subsection cipher option (-C)
+@cindex ntp-keygen-cipher
+
+This is the ``privatekey cipher'' option.
+This option takes an argument string @file{cipher}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Select the cipher which is used to encrypt the files containing
+private keys.  The default is three-key triple DES in CBC mode,
+equivalent to "-C des-ede3-cbc".  The openssl tool lists ciphers
+available in "openssl -h" output.
+@node ntp-keygen id-key
+@subsection id-key option (-e)
+@cindex ntp-keygen-id-key
+
+This is the ``write iff or gq identity keys'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Write the IFF or GQ client keys to the standard output.  This is
+intended for automatic key distribution by mail.
+@node ntp-keygen gq-params
+@subsection gq-params option (-G)
+@cindex ntp-keygen-gq-params
+
+This is the ``generate gq parameters and keys'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+@node ntp-keygen host-key
+@subsection host-key option (-H)
+@cindex ntp-keygen-host-key
+
+This is the ``generate rsa host key'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate new host keys, obsoleting any that may exist.
+@node ntp-keygen iffkey
+@subsection iffkey option (-I)
+@cindex ntp-keygen-iffkey
+
+This is the ``generate iff parameters'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate parameters for the IFF identification scheme, obsoleting
+any that may exist.
+@node ntp-keygen ident
+@subsection ident option (-i)
+@cindex ntp-keygen-ident
+
+This is the ``set autokey group name'' option.
+This option takes an argument string @file{group}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Set the optional Autokey group name to name.  This is used in
+the file name of IFF, GQ, and MV client parameters files.  In
+that role, the default is the host name if this option is not
+provided.  The group name, if specified using -i/--ident or
+using -s/--subject-name following an '@' character, is also a
+part of the self-signed host certificate's subject and issuer
+names in the form host@group and should match the 'crypto ident'
+or 'server ident' configuration in ntpd's configuration file. 
+@node ntp-keygen lifetime
+@subsection lifetime option (-l)
+@cindex ntp-keygen-lifetime
+
+This is the ``set certificate lifetime'' option.
+This option takes an argument number @file{lifetime}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Set the certificate expiration to lifetime days from now.
+@node ntp-keygen md5key
+@subsection md5key option (-M)
+@cindex ntp-keygen-md5key
+
+This is the ``generate md5 keys'' option.
+Generate MD5 keys, obsoleting any that may exist.
+@node ntp-keygen modulus
+@subsection modulus option (-m)
+@cindex ntp-keygen-modulus
+
+This is the ``modulus'' option.
+This option takes an argument number @file{modulus}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+The number of bits in the prime modulus.  The default is 512.
+@node ntp-keygen pvt-cert
+@subsection pvt-cert option (-P)
+@cindex ntp-keygen-pvt-cert
+
+This is the ``generate pc private certificate'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate a private certificate.  By default, the program generates
+public certificates.
+@node ntp-keygen pvt-passwd
+@subsection pvt-passwd option (-p)
+@cindex ntp-keygen-pvt-passwd
+
+This is the ``output private password'' option.
+This option takes an argument string @file{passwd}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Encrypt generated files containing private data with the specified
+password and the cipher selected with -C/--cipher.
+@node ntp-keygen get-pvt-passwd
+@subsection get-pvt-passwd option (-q)
+@cindex ntp-keygen-get-pvt-passwd
+
+This is the ``input private password'' option.
+This option takes an argument string @file{passwd}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Set the password for reading files to the specified password.
+@node ntp-keygen sign-key
+@subsection sign-key option (-S)
+@cindex ntp-keygen-sign-key
+
+This is the ``generate sign key (rsa or dsa)'' option.
+This option takes an argument string @file{sign}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate a new sign key of the designated type, obsoleting any
+that may exist.  By default, the program uses the host key as the
+sign key.
+@node ntp-keygen subject-name
+@subsection subject-name option (-s)
+@cindex ntp-keygen-subject-name
+
+This is the ``set host and optionally group name'' option.
+This option takes an argument string @file{host@@group}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Set the Autokey host name, and optionally, group name specified
+following an '@' character.  The host name is used in the file
+name of generated host and signing certificates, without the
+group name.  The host name, and if provided, group name are used
+in host@group form for the host certificate's subject and issuer
+fields.  Specifying '-s @group' is allowed, and results in
+leaving the host name unchanged while appending @group to the
+subject and issuer fields, as with -i group.  The group name, or
+if not provided, the host name are also used in the file names
+of IFF, GQ, and MV client parameter files.
+@node ntp-keygen trusted-cert
+@subsection trusted-cert option (-T)
+@cindex ntp-keygen-trusted-cert
+
+This is the ``trusted certificate (tc scheme)'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate a trusted certificate.  By default, the program generates
+a non-trusted certificate.
+@node ntp-keygen mv-params
+@subsection mv-params option (-V)
+@cindex ntp-keygen-mv-params
+
+This is the ``generate <num> mv parameters'' option.
+This option takes an argument number @file{num}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate parameters and keys for the Mu-Varadharajan (MV)
+identification scheme.
+@node ntp-keygen mv-keys
+@subsection mv-keys option (-v)
+@cindex ntp-keygen-mv-keys
+
+This is the ``update <num> mv keys'' option.
+This option takes an argument number @file{num}.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+This option has no @samp{doc} documentation.
+
+
+@node ntp-keygen config
+@subsection presetting/configuring ntp-keygen
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTP-KEYGEN} and @code{NTP-KEYGEN_<OPTION_NAME>}.  @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTP-KEYGEN} variable will be tokenized and parsed like
+the command line.  The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+@noindent
+@code{libopts} will search in 2 places for configuration files:
+@itemize @bullet
+@item
+$HOME
+@item
+$PWD
+@end itemize
+The environment variables @code{HOME}, and @code{PWD}
+are expanded and replaced when @file{ntp-keygen} runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named @file{.ntprc} is searched for
+within that directory and processed.
+
+
+Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line.  Values may be separated from the option name with a colon,
+equal sign or simply white space.  Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments.  The segments are separated by lines like:
+@example
+[NTP-KEYGEN]
+@end example
+@noindent
+or by
+@example
+<?program ntp-keygen>
+@end example
+@noindent
+Do not mix these styles within one configuration file.
+
+Compound values and carefully constructed string values may also be
+specified using XML syntax:
+@example
+<option-name>
+   <sub-opt>...&lt;...&gt;...</sub-opt>
+</option-name>
+@end example
+@noindent
+yielding an @code{option-name.sub-opt} string value of
+@example
+"...<...>..."
+@end example
+@code{AutoOpts} does not track suboptions.  You simply note that it is a
+hierarchicly valued option.  @code{AutoOpts} does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0.  The optional argument specifies how much licensing
+detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.  Only the
+first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version.  This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntp-keygen exit status
+@subsection ntp-keygen exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@item 66 (EX_NOINPUT)
+A specified configuration file could not be loaded.
+@item 70 (EX_SOFTWARE)
+libopts had an internal operational error.  Please report
+it to autogen-users@@lists.sourceforge.net.  Thank you.
+@end table
+@node ntp-keygen Description
+@subsection ntp-keygen Description
+This program generates cryptographic data files used by the NTPv4
+authentication and identification schemes.
+It generates MD5 key files used in symmetric key cryptography.
+In addition, if the OpenSSL software library has been installed,
+it generates keys, certificate and identity files used in public key
+cryptography.
+These files are used for cookie encryption,
+digital signature and challenge/response identification algorithms
+compatible with the Internet standard security infrastructure.
+All files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in mail to other sites
+and certificate authorities.
+By default, files are not encrypted.
+The
+configuration command
+specifies the read password for previously encrypted files.
+The daemon expires on the spot if the password is missing
+or incorrect.
+For convenience, if a file has been previously encrypted,
+the default read password is the name of the host running
+the program.
+If the previous write password is specified as the host name,
+these files can be read by that host with no explicit password.
+
+File names begin with the prefix
+and end with the postfix
+where
+is the owner name, usually the string returned
+by the Unix gethostname() routine, and
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+command or all files generated
+at a specific time can be removed by a
+command.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+All files are installed by default in the keys directory
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+The safest way to run the
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+then run the program.
+When run for the first time,
+or if all
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+Running the program as other than root and using the Unix
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+in the user home directory.
+However, there should be only one
+most conveniently
+in the root directory, so it is convenient to define the
+environment variable used by the OpenSSL library as the path to
+Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+using the
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+
+All files are installed by default in the keys directory
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+The safest way to run the
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+then run the program.
+When run for the first time,
+or if all
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+Running the program as other than root and using the Unix
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+in the user home directory.
+However, there should be only one
+most conveniently
+in the root directory, so it is convenient to define the
+environment variable used by the OpenSSL library as the path to
+Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+using the
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+seconds.
+seconds.
+
+s Trusted Hosts and Groups
+Each cryptographic configuration involves selection of a signature scheme
+and identification scheme, called a cryptotype,
+as explained in the
+section of
+The default cryptotype uses RSA encryption, MD5 message digest
+and TC identification.
+First, configure a NTP subnet including one or more low-stratum
+trusted hosts from which all other hosts derive synchronization
+directly or indirectly.
+Trusted hosts have trusted certificates;
+all other hosts have nontrusted certificates.
+These hosts will automatically and dynamically build authoritative
+certificate trails to one or more trusted hosts.
+A trusted group is the set of all hosts that have, directly or indirectly,
+a certificate trail ending at a trusted host.
+The trail is defined by static configuration file entries
+or dynamic means described on the
+section of
+On each trusted host as root, change to the keys directory.
+To insure a fresh fileset, remove all
+files.
+Then run
+to generate keys and a trusted certificate.
+On all other hosts do the same, but leave off the
+flag to generate keys and nontrusted certificates.
+When complete, start the NTP daemons beginning at the lowest stratum
+and working up the tree.
+It may take some time for Autokey to instantiate the certificate trails
+throughout the subnet, but setting up the environment is completely automatic.
+If it is necessary to use a different sign key or different digest/signature
+scheme than the default, run
+with the
+option, where
+is either
+or
+The most often need to do this is when a DSA-signed certificate is used.
+If it is necessary to use a different certificate scheme than the default,
+run
+with the
+option and selected
+as needed.
+f
+is run again without these options, it generates a new certificate
+using the same scheme and sign key.
+After setting up the environment it is advisable to update certificates
+from time to time, if only to extend the validity interval.
+Simply run
+with the same flags as before to generate new certificates
+using existing keys.
+However, if the host or sign key is changed,
+should be restarted.
+When
+is restarted, it loads any new files and restarts the protocol.
+Other dependent hosts will continue as usual until signatures are refreshed,
+at which time the protocol is restarted.
+As mentioned on the Autonomous Authentication page,
+the default TC identity scheme is vulnerable to a middleman attack.
+However, there are more secure identity schemes available,
+including PC, IFF, GQ and MV described on the
+page
+(maybe available at
+These schemes are based on a TA, one or more trusted hosts
+and some number of nontrusted hosts.
+Trusted hosts prove identity using values provided by the TA,
+while the remaining hosts prove identity using values provided
+by a trusted host and certificate trails that end on that host.
+The name of a trusted host is also the name of its sugroup
+and also the subject and issuer name on its trusted certificate.
+The TA is not necessarily a trusted host in this sense, but often is.
+In some schemes there are separate keys for servers and clients.
+A server can also be a client of another server,
+but a client can never be a server for another client.
+In general, trusted hosts and nontrusted hosts that operate
+as both server and client have parameter files that contain
+both server and client keys.
+Hosts that operate
+only as clients have key files that contain only client keys.
+The PC scheme supports only one trusted host in the group.
+On trusted host alice run
+to generate the host key file
+and trusted private certificate file
+Copy both files to all group hosts;
+they replace the files which would be generated in other schemes.
+On each host bob install a soft link from the generic name
+to the host key file and soft link
+to the private certificate file.
+Note the generic links are on bob, but point to files generated
+by trusted host alice.
+In this scheme it is not possible to refresh
+either the keys or certificates without copying them
+to all other hosts in the group.
+For the IFF scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host in the group,
+generate the IFF parameter file.
+On trusted host alice run
+to produce her parameter file
+which includes both server and client keys.
+Copy this file to all group hosts that operate as both servers
+and clients and install a soft link from the generic
+to this file.
+If there are no hosts restricted to operate only as clients,
+there is nothing further to do.
+As the IFF scheme is independent
+of keys and certificates, these files can be refreshed as needed.
+If a rogue client has the parameter file, it could masquerade
+as a legitimate server and present a middleman threat.
+To eliminate this threat, the client keys can be extracted
+from the parameter file and distributed to all restricted clients.
+After generating the parameter file, on alice run
+and pipe the output to a file or mail program.
+Copy or mail this file to all restricted clients.
+On these clients install a soft link from the generic
+to this file.
+To further protect the integrity of the keys,
+each file can be encrypted with a secret password.
+For the GQ scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host
+in the group, generate the IFF parameter file.
+On trusted host alice run
+to produce her parameter file
+which includes both server and client keys.
+Copy this file to all group hosts and install a soft link
+from the generic
+to this file.
+In addition, on each host bob install a soft link
+from generic
+to this file.
+As the GQ scheme updates the GQ parameters file and certificate
+at the same time, keys and certificates can be regenerated as needed.
+For the MV scheme, proceed as in the TC scheme to generate keys
+and certificates for all group hosts.
+For illustration assume trish is the TA, alice one of several trusted hosts
+and bob one of her clients.
+On TA trish run
+where
+is the number of revokable keys (typically 5) to produce
+the parameter file
+and client key files
+where
+is the key number (0 \&<
+\&<
+Copy the parameter file to alice and install a soft link
+from the generic
+to this file.
+Copy one of the client key files to alice for later distribution
+to her clients.
+It doesn't matter which client key file goes to alice,
+since they all work the same way.
+Alice copies the client key file to all of her cliens.
+On client bob install a soft link from generic
+to the client key file.
+As the MV scheme is independent of keys and certificates,
+these files can be refreshed as needed.
+@table @samp
+@item Fl
+Select certificate message digest/signature encryption scheme.
+The
+can be one of the following:
+or
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key.
+The default without this option is
+@item Fl
+Enable debugging.
+This option displays the cryptographic data produced in eye-friendly billboards.
+@item Fl
+Write the IFF client keys to the standard output.
+This is intended for automatic key distribution by mail.
+@item Fl
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+@item Fl
+Generate keys for the GQ identification scheme
+using the existing GQ parameters.
+If the GQ parameters do not yet exist, create them first.
+@item Fl
+Generate new host keys, obsoleting any that may exist.
+@item Fl
+Generate parameters for the IFF identification scheme,
+obsoleting any that may exist.
+@item Fl
+Set the suject name to
+This is used as the subject field in certificates
+and in the file name for host and sign keys.
+@item Fl
+Generate MD5 keys, obsoleting any that may exist.
+@item Fl
+Generate a private certificate.
+By default, the program generates public certificates.
+@item Fl
+Encrypt generated files containing private data with
+and the DES-CBC algorithm.
+@item Fl
+Set the password for reading files to password.
+@item Fl
+Generate a new sign key of the designated type,
+obsoleting any that may exist.
+By default, the program uses the host key as the sign key.
+@item Fl
+Set the issuer name to
+This is used for the issuer field in certificates
+and in the file name for identity files.
+@item Fl
+Generate a trusted certificate.
+By default, the program generates a non-trusted certificate.
+@item Fl
+Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+
+@end multitable
+All cryptographically sound key generation schemes must have means
+to randomize the entropy seed used to initialize
+the internal pseudo-random number generator used
+by the library routines.
+The OpenSSL library uses a designated random seed file for this purpose.
+The file must be available when starting the NTP daemon and
+program.
+If a site supports OpenSSL or its companion OpenSSH,
+it is very likely that means to do this are already available.
+It is important to understand that entropy must be evolved
+for each generation, for otherwise the random number sequence
+would be predictable.
+Various means dependent on external events, such as keystroke intervals,
+can be used to do this and some systems have built-in entropy sources.
+Suitable means are described in the OpenSSL software documentation,
+but are outside the scope of this page.
+The entropy seed used by the OpenSSL library is contained in a file,
+usually called
+which must be available when starting the NTP daemon
+or the
+program.
+The NTP daemon will first look for the file
+using the path specified by the
+subcommand of the
+configuration command.
+If not specified in this way, or when starting the
+program,
+the OpenSSL library will look for the file using the path specified
+by the
+environment variable in the user home directory,
+whether root or some other user.
+If the
+environment variable is not present,
+the library will look for the
+file in the user home directory.
+If the file is not available or cannot be written,
+the daemon exits with a message to the system log and the program
+exits with a suitable error message.
+All other file formats begin with two lines.
+The first contains the file name, including the generated host name
+and filestamp.
+The second contains the datestamp in conventional Unix date format.
+Lines beginning with # are considered comments and ignored by the
+program and
+daemon.
+Cryptographic values are encoded first using ASN.1 rules,
+then encrypted if necessary, and finally written PEM-encoded
+printable ASCII format preceded and followed by MIME content identifier lines.
+The format of the symmetric keys file is somewhat different
+than the other files in the interest of backward compatibility.
+Since DES-CBC is deprecated in NTPv4, the only key format of interest
+is MD5 alphanumeric strings.
+Following hte heard the keys are
+entered one per line in the format
+where
+is a positive integer in the range 1-65,535,
+is the string MD5 defining the key format and
+is the key itself,
+which is a printable ASCII string 16 characters or less in length.
+Each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7f excluding space and the
+character.
+Note that the keys used by the
+and
+programs
+are checked against passwords requested by the programs
+and entered by hand, so it is generally appropriate to specify these keys
+in human readable ASCII format.
+The
+program generates a MD5 symmetric keys file
+Since the file contains private shared keys,
+it should be visible only to root and distributed by secure means
+to other subnet hosts.
+The NTP daemon loads the file
+so
+installs a soft link from this name to the generated file.
+Subsequently, similar soft links must be installed by manual
+or automated means on the other subnet hosts.
+While this file is not used with the Autokey Version 2 protocol,
+it is needed to authenticate some remote configuration commands
+used by the
+and
+utilities.
+@node ntp-keygen Usage
+@subsection ntp-keygen Usage
+The
+option specifies the write password and
+option the read password for previously encrypted files.
+The
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
+@node ntp-keygen Notes
+@subsection ntp-keygen Notes
+Portions of this document came from FreeBSD.
+@node ntp-keygen Bugs
+@subsection ntp-keygen Bugs
+It can take quite a while to generate some cryptographic values,
+from one to several minutes with modern architectures
+such as UltraSPARC and up to tens of minutes to an hour
+with older architectures such as SPARC IPC.
+Please report bugs to http://bugs.ntp.org .
diff --git a/util/ntp-keygen-opts.texi b/util/ntp-keygen-opts.texi
deleted file mode 100644 (file)
index d235277..0000000
+++ /dev/null
@@ -1,408 +0,0 @@
-@node ntp-keygen Invocation
-@section Invoking ntp-keygen
-@pindex ntp-keygen
-@cindex Create a NTP host key
-@ignore
-# 
-# EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.texi)
-# 
-# It has been AutoGen-ed  April 11, 2012 at 08:43:44 AM by AutoGen 5.14
-# From the definitions    ntp-keygen-opts.def
-# and the template file   aginfo.tpl
-@end ignore
-
-
-
-This section was generated by @strong{AutoGen},
-the aginfo template and the option descriptions for the @command{ntp-keygen} program.  It documents the @command{ntp-keygen} usage text and option meanings.
-
-This software is released under a specialized copyright license.
-
-@menu
-* ntp-keygen usage::                  ntp-keygen usage help (-?)
-* ntp-keygen certificate::           certificate option (-c)
-* ntp-keygen cipher::                cipher option (-C)
-* ntp-keygen debug-level::           debug-level option (-d)
-* ntp-keygen get-pvt-passwd::        get-pvt-passwd option (-q)
-* ntp-keygen gq-params::             gq-params option (-G)
-* ntp-keygen host-key::              host-key option (-H)
-* ntp-keygen id-key::                id-key option (-e)
-* ntp-keygen ident::                 ident option (-i)
-* ntp-keygen iffkey::                iffkey option (-I)
-* ntp-keygen lifetime::              lifetime option (-l)
-* ntp-keygen md5key::                md5key option (-M)
-* ntp-keygen modulus::               modulus option (-m)
-* ntp-keygen mv-keys::               mv-keys option (-v)
-* ntp-keygen mv-params::             mv-params option (-V)
-* ntp-keygen pvt-cert::              pvt-cert option (-P)
-* ntp-keygen pvt-passwd::            pvt-passwd option (-p)
-* ntp-keygen set-debug-level::       set-debug-level option (-D)
-* ntp-keygen sign-key::              sign-key option (-S)
-* ntp-keygen subject-name::          subject-name option (-s)
-* ntp-keygen trusted-cert::          trusted-cert option (-T)
-@end menu
-
-@node ntp-keygen usage
-@subsection ntp-keygen usage help (-?)
-@cindex ntp-keygen-usage
-
-This is the automatically generated usage text for ntp-keygen:
-
-@exampleindent 0
-@example
-ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p271
-USAGE:  ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
-  Flg Arg Option-Name    Description
-   -c Str certificate    certificate scheme
-   -C Str cipher         privatekey cipher
-   -d no  debug-level    Increase debug verbosity level
-                                - may appear multiple times
-   -D Str set-debug-level Set the debug verbosity level
-                                - may appear multiple times
-   -e no  id-key         Write IFF or GQ identity keys
-   -G no  gq-params      Generate GQ parameters and keys
-   -H no  host-key       generate RSA host key
-   -I no  iffkey         generate IFF parameters
-   -i Str ident          set Autokey group name
-   -l Num lifetime       set certificate lifetime
-   -M no  md5key         generate MD5 keys
-   -m Num modulus        modulus
-                                - It must be in the range:
-                                  256 to 2048
-   -P no  pvt-cert       generate PC private certificate
-   -p Str pvt-passwd     output private password
-   -q Str get-pvt-passwd input private password
-   -S Str sign-key       generate sign key (RSA or DSA)
-   -s Str subject-name   set host and optionally group name
-   -T no  trusted-cert   trusted certificate (TC scheme)
-   -V Num mv-params      generate <num> MV parameters
-   -v Num mv-keys        update <num> MV keys
-      opt version        Output version information and exit
-   -? no  help           Display extended usage information and exit
-   -! no  more-help      Extended usage information passed thru pager
-   -> opt save-opts      Save the option state to a config file
-   -< Str load-opts      Load options from a config file
-                                - disabled as --no-load-opts
-                                - may appear multiple times
-
-Options are specified by doubled hyphens and their name or by a single
-hyphen and the flag character.
-
-
-
-The following option preset mechanisms are supported:
- - reading file $HOME/.ntprc
- - reading file ./.ntprc
- - examining environment variables named NTP_KEYGEN_*
-
-please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
-@end example
-@exampleindent 4
-
-@node ntp-keygen certificate
-@subsection certificate option (-c)
-@cindex ntp-keygen-certificate
-
-This is the ``certificate scheme'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-scheme is one of
-RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
-DSA-SHA, or DSA-SHA1.
-
-Select the certificate message digest/signature encryption scheme.
-Note that RSA schemes must be used with a RSA sign key and DSA
-schemes must be used with a DSA sign key.  The default without
-this option is RSA-MD5.
-
-@node ntp-keygen cipher
-@subsection cipher option (-C)
-@cindex ntp-keygen-cipher
-
-This is the ``privatekey cipher'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Select the cipher which is used to encrypt the files containing
-private keys.  The default is three-key triple DES in CBC mode,
-equivalent to "-C des-ede3-cbc".  The openssl tool lists ciphers
-available in "openssl -h" output.
-
-@node ntp-keygen debug-level
-@subsection debug-level option (-d)
-@cindex ntp-keygen-debug-level
-
-This is the ``increase debug verbosity level'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-
-
-@node ntp-keygen get-pvt-passwd
-@subsection get-pvt-passwd option (-q)
-@cindex ntp-keygen-get-pvt-passwd
-
-This is the ``input private password'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Set the password for reading files to the specified password.
-
-@node ntp-keygen gq-params
-@subsection gq-params option (-G)
-@cindex ntp-keygen-gq-params
-
-This is the ``generate gq parameters and keys'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Generate parameters and keys for the GQ identification scheme,
-obsoleting any that may exist.
-
-@node ntp-keygen host-key
-@subsection host-key option (-H)
-@cindex ntp-keygen-host-key
-
-This is the ``generate rsa host key'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Generate new host keys, obsoleting any that may exist.
-
-@node ntp-keygen id-key
-@subsection id-key option (-e)
-@cindex ntp-keygen-id-key
-
-This is the ``write iff or gq identity keys'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Write the IFF or GQ client keys to the standard output.  This is
-intended for automatic key distribution by mail.
-
-@node ntp-keygen ident
-@subsection ident option (-i)
-@cindex ntp-keygen-ident
-
-This is the ``set autokey group name'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Set the optional Autokey group name to name.  This is used in
-the file name of IFF, GQ, and MV client parameters files.  In
-that role, the default is the host name if this option is not
-provided.  The group name, if specified using -i/--ident or
-using -s/--subject-name following an '@' character, is also a
-part of the self-signed host certificate's subject and issuer
-names in the form host@group and should match the 'crypto ident'
-or 'server ident' configuration in ntpd's configuration file. 
-
-@node ntp-keygen iffkey
-@subsection iffkey option (-I)
-@cindex ntp-keygen-iffkey
-
-This is the ``generate iff parameters'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Generate parameters for the IFF identification scheme, obsoleting
-any that may exist.
-
-@node ntp-keygen lifetime
-@subsection lifetime option (-l)
-@cindex ntp-keygen-lifetime
-
-This is the ``set certificate lifetime'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Set the certificate expiration to lifetime days from now.
-
-@node ntp-keygen md5key
-@subsection md5key option (-M)
-@cindex ntp-keygen-md5key
-
-This is the ``generate md5 keys'' option.
-Generate MD5 keys, obsoleting any that may exist.
-
-@node ntp-keygen modulus
-@subsection modulus option (-m)
-@cindex ntp-keygen-modulus
-
-This is the ``modulus'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-The number of bits in the prime modulus.  The default is 512.
-
-@node ntp-keygen mv-keys
-@subsection mv-keys option (-v)
-@cindex ntp-keygen-mv-keys
-
-This is the ``update <num> mv keys'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-This option has no @samp{doc} documentation.
-
-@node ntp-keygen mv-params
-@subsection mv-params option (-V)
-@cindex ntp-keygen-mv-params
-
-This is the ``generate <num> mv parameters'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Generate parameters and keys for the Mu-Varadharajan (MV)
-identification scheme.
-
-@node ntp-keygen pvt-cert
-@subsection pvt-cert option (-P)
-@cindex ntp-keygen-pvt-cert
-
-This is the ``generate pc private certificate'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Generate a private certificate.  By default, the program generates
-public certificates.
-
-@node ntp-keygen pvt-passwd
-@subsection pvt-passwd option (-p)
-@cindex ntp-keygen-pvt-passwd
-
-This is the ``output private password'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Encrypt generated files containing private data with the specified
-password and the cipher selected with -C/--cipher.
-
-@node ntp-keygen set-debug-level
-@subsection set-debug-level option (-D)
-@cindex ntp-keygen-set-debug-level
-
-This is the ``set the debug verbosity level'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-may appear an unlimited number of times.
-@end itemize
-
-
-
-@node ntp-keygen sign-key
-@subsection sign-key option (-S)
-@cindex ntp-keygen-sign-key
-
-This is the ``generate sign key (rsa or dsa)'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Generate a new sign key of the designated type, obsoleting any
-that may exist.  By default, the program uses the host key as the
-sign key.
-
-@node ntp-keygen subject-name
-@subsection subject-name option (-s)
-@cindex ntp-keygen-subject-name
-
-This is the ``set host and optionally group name'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Set the Autokey host name, and optionally, group name specified
-following an '@' character.  The host name is used in the file
-name of generated host and signing certificates, without the
-group name.  The host name, and if provided, group name are used
-in host@group form for the host certificate's subject and issuer
-fields.  Specifying '-s @group' is allowed, and results in
-leaving the host name unchanged while appending @group to the
-subject and issuer fields, as with -i group.  The group name, or
-if not provided, the host name are also used in the file names
-of IFF, GQ, and MV client parameter files.
-
-@node ntp-keygen trusted-cert
-@subsection trusted-cert option (-T)
-@cindex ntp-keygen-trusted-cert
-
-This is the ``trusted certificate (tc scheme)'' option.
-
-This option has some usage constraints.  It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Generate a trusted certificate.  By default, the program generates
-a non-trusted certificate.