/*
* EDIT THIS FILE WITH CAUTION (clktest-opts.c)
*
- * It has been AutoGen-ed November 17, 2009 at 06:37:09 AM by AutoGen 5.10
+ * It has been AutoGen-ed February 22, 2011 at 12:28:58 AM by AutoGen 5.11.6
* From the definitions clktest-opts.def
* and the template file options
*
- * Generated from AutoOpts 33:0:8 templates.
- */
-
-/*
- * This file was produced by an AutoOpts template. AutoOpts is a
- * copyrighted work. This source file is not encumbered by AutoOpts
- * licensing, but is provided under the licensing terms chosen by the
- * clktest author or copyright holder. AutoOpts is licensed under
- * the terms of the LGPL. The redistributable library (``libopts'') is
- * licensed under the terms of either the LGPL or, at the users discretion,
- * the BSD license. See the AutoOpts and/or libopts sources for details.
+ * Generated from AutoOpts 34:0:9 templates.
+ *
+ * AutoOpts is a copyrighted work. This source file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the clktest author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
*
* This source file is copyrighted and licensed under the following terms:
*
- * clktest copyright (c) 1970-2009 David L. Mills and/or others - all rights reserved
+ * clktest copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
*/
/* TRANSLATORS: choose the translation for option names wisely because you
cannot ever change your mind. */
tSCC zCopyright[] =
- "clktest copyright (c) 1970-2009 David L. Mills and/or others, all rights reserved"
-/* extracted from /deacon/backroom/ntp-dev/include/copyright.def near line 8 */
+ "clktest copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
+/* extracted from copyright.def near line 8 */
;
tSCC zCopyrightNotice[24] =
"see html/copyright.html";
/*
* Speed option description:
*/
-tSCC zSpeedText[] =
+static char const zSpeedText[] =
"Set the rate according to the speed";
-tSCC zSpeed_NAME[] = "SPEED";
-tSCC zSpeed_Name[] = "speed";
+static char const zSpeed_NAME[] = "SPEED";
+static char const zSpeed_Name[] = "speed";
#define SPEED_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Debug option description:
*/
-tSCC zDebugText[] =
+static char const zDebugText[] =
"Turn on debugging output";
-tSCC zDebug_NAME[] = "DEBUG";
-tSCC zDebug_Name[] = "debug";
+static char const zDebug_NAME[] = "DEBUG";
+static char const zDebug_Name[] = "debug";
#define DEBUG_FLAGS (OPTST_DISABLED)
/*
* Crmod option description:
*/
-tSCC zCrmodText[] =
+static char const zCrmodText[] =
"Turn on CRMOD flag";
-tSCC zCrmod_NAME[] = "CRMOD";
-tSCC zCrmod_Name[] = "crmod";
+static char const zCrmod_NAME[] = "CRMOD";
+static char const zCrmod_Name[] = "crmod";
#define CRMOD_FLAGS (OPTST_DISABLED)
/*
* Command option description with
* "Must also have options" and "Incompatible options":
*/
-tSCC zCommandText[] =
+static char const zCommandText[] =
"";
-tSCC zCommand_NAME[] = "COMMAND";
-tSCC zCommand_Name[] = "command";
+static char const zCommand_NAME[] = "COMMAND";
+static char const zCommand_Name[] = "command";
static const int
aCommandMustList[] = {
INDEX_OPT_TIMEOUT, NO_EQUIVALENT };
/*
* Timeout option description:
*/
-tSCC zTimeoutText[] =
+static char const zTimeoutText[] =
"Limit wait for command completion";
-tSCC zTimeout_NAME[] = "TIMEOUT";
-tSCC zTimeout_Name[] = "timeout";
+static char const zTimeout_NAME[] = "TIMEOUT";
+static char const zTimeout_Name[] = "timeout";
#define TIMEOUT_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
/*
* Help/More_Help/Version option descriptions:
*/
-tSCC zHelpText[] = "Display extended usage information and exit";
-tSCC zHelp_Name[] = "help";
+static char const zHelpText[] = "Display extended usage information and exit";
+static char const zHelp_Name[] = "help";
#ifdef HAVE_WORKING_FORK
#define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
-tSCC zMore_Help_Name[] = "more-help";
-tSCC zMore_HelpText[] = "Extended usage information passed thru pager";
+static char const zMore_Help_Name[] = "more-help";
+static char const zMore_HelpText[] = "Extended usage information passed thru pager";
#else
#define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
#define zMore_Help_Name NULL
OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
#endif
-tSCC zVersionText[] = "Output version information and exit";
-tSCC zVersion_Name[] = "version";
-tSCC zSave_OptsText[] = "Save the option state to a config file";
-tSCC zSave_Opts_Name[] = "save-opts";
-tSCC zLoad_OptsText[] = "Load options from a config file";
-tSCC zLoad_Opts_NAME[] = "LOAD_OPTS";
-tSCC zNotLoad_Opts_Name[] = "no-load-opts";
-tSCC zNotLoad_Opts_Pfx[] = "no";
+static char const zVersionText[] = "Output version information and exit";
+static char const zVersion_Name[] = "version";
+static char const zSave_OptsText[] = "Save the option state to a config file";
+static char const zSave_Opts_Name[] = "save-opts";
+static char const zLoad_OptsText[] = "Load options from a config file";
+static char const zLoad_Opts_NAME[] = "LOAD_OPTS";
+static char const zNotLoad_Opts_Name[] = "no-load-opts";
+static char const zNotLoad_Opts_Pfx[] = "no";
#define zLoad_Opts_Name (zNotLoad_Opts_Name + 3)
/*
* Declare option callback procedures
* Under test, omit argument processing, or call optionStackArg,
* if multiple copies are allowed.
*/
-extern tOptProc
- optionPagedUsage, optionVersionStderr;
static tOptProc
doOptTimeout, doUsageOpt;
* When not under test, there are different procs to use
*/
extern tOptProc
- optionPagedUsage, optionPrintVersion;
+ optionBooleanVal, optionNestedVal, optionNumericVal,
+ optionPagedUsage, optionPrintVersion, optionResetOpt,
+ optionStackArg, optionTimeVal, optionUnstackArg,
+ optionVersionStderr;
static tOptProc
doOptCrmod, doOptSpeed, doOptTimeout, doUsageOpt;
*
* Define the Clktest Option Environment
*/
-tSCC zPROGNAME[] = "CLKTEST";
-tSCC zUsageTitle[] =
-"clktest - test the clock line discipline - Ver. 4.2.5p245-RC\n\
+static char const zPROGNAME[8] = "CLKTEST";
+static char const zUsageTitle[127] =
+"clktest - test the clock line discipline - Ver. 4.2.6p3\n\
USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... <tty_device>\n";
-tSCC zRcName[] = ".ntprc";
-tSCC* apzHomeList[] = {
- "$HOME",
- ".",
- NULL };
+static char const zRcName[7] = ".ntprc";
+static char const * const apzHomeList[3] = {
+ "$HOME",
+ ".",
+ NULL };
-tSCC zBugsAddr[] = "http://bugs.ntp.org, bugs@ntp.org";
+static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org";
#define zExplain NULL
-tSCC zDetail[] = "\n\
-Clktest can be used to test the clock line discipline (CLKLDISC,\n\
-it must be available), and to take a look at radio clocks attached\n\
-to a serial port.\n";
-tSCC zFullVersion[] = CLKTEST_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 495 */
+static char const zDetail[164] = "\n\
+Clktest can be used to test the clock line discipline (CLKLDISC, it must\n\
+be available), and to take a look at radio clocks attached to a serial\n\
+port.\n";
+static char const zFullVersion[] = CLKTEST_FULL_VERSION;
+/* extracted from optcode.tlib near line 504 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
#define clktest_full_usage NULL
#define clktest_short_usage NULL
+#ifndef PKGDATADIR
+# define PKGDATADIR ""
+#endif
+
+#ifndef WITH_PACKAGER
+# define clktest_packager_info NULL
+#else
+static char const clktest_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport clktest bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+
tOptions clktestOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
+ OPTPROC_LONGOPT
+ OPTPROC_NO_REQ_OPT
+ OPTPROC_ENVIRON
- + OPTPROC_ARGS_REQ ),
+ + OPTPROC_ARGS_REQ
+ + OPTPROC_MISUSE ),
0, NULL, /* current option index, current option */
NULL, NULL, zPROGNAME,
zRcName, zCopyright, zCopyrightNotice,
zExplain, zDetail, optDesc,
zBugsAddr, /* address to send bugs to */
NULL, NULL, /* extensions/saved state */
- optionUsage, /* usage procedure */
+ optionUsage, /* usage procedure */
translate_option_strings, /* translation procedure */
/*
* Indexes to special options
},
10 /* full option count */, 5 /* user option count */,
clktest_full_usage, clktest_short_usage,
- NULL, NULL
+ NULL, NULL,
+ PKGDATADIR, clktest_packager_info
};
/*
tOptDesc* pOptDesc )
{
(void)pOptions;
- USAGE( EXIT_SUCCESS );
+ USAGE(EXIT_SUCCESS);
}
#if ! defined(TEST_CLKTEST_OPTS)
}
pOptDesc->optArg.argInt = val;
}
-/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 109 */
+/* extracted from optmain.tlib near line 107 */
#if defined(TEST_CLKTEST_OPTS) /* TEST MAIN PROCEDURE: */
-extern void optionPutShell( tOptions* );
+extern void optionPutShell(tOptions*);
int
main(int argc, char** argv)
{
int res = EXIT_SUCCESS;
- (void)optionProcess( &clktestOptions, argc, argv );
- optionPutShell( &clktestOptions );
+ (void)optionProcess(&clktestOptions, argc, argv);
+ optionPutShell(&clktestOptions);
+ res = ferror(stdout);
+ if (res != 0)
+ fputs("output error writing to stdout\n", stderr);
return res;
}
#endif /* defined TEST_CLKTEST_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 627 */
+/* extracted from optcode.tlib near line 657 */
#if ENABLE_NLS
#include <stdio.h>
#include <unistd.h>
#include <autoopts/usage-txt.h>
-static char* AO_gettext( char const* pz );
+static char* AO_gettext(char const* pz);
static void coerce_it(void** s);
static char*
-AO_gettext( char const* pz )
+AO_gettext(char const* pz)
{
char* pzRes;
if (pz == NULL)
pzRes = _(pz);
if (pzRes == pz)
return pzRes;
- pzRes = strdup( pzRes );
+ pzRes = strdup(pzRes);
if (pzRes == NULL) {
- fputs( _("No memory for duping translated strings\n"), stderr );
- exit( EXIT_FAILURE );
+ fputs(_("No memory for duping translated strings\n"), stderr);
+ exit(EXIT_FAILURE);
}
return pzRes;
}
* This invokes the translation code (e.g. gettext(3)).
*/
static void
-translate_option_strings( void )
+translate_option_strings(void)
{
/*
* Guard against re-translation. It won't work. The strings will have
* been changed by the first pass through this code. One shot only.
*/
if (option_usage_text.field_ct != 0) {
-
/*
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
COERSION(pzUsageTitle);
COERSION(pzExplain);
COERSION(pzDetail);
+ COERSION(pzPackager);
option_usage_text.field_ct = 0;
for (ix = clktestOptions.optCt; ix > 0; ix--, pOD++)
/*
* EDIT THIS FILE WITH CAUTION (clktest-opts.h)
*
- * It has been AutoGen-ed November 17, 2009 at 06:37:09 AM by AutoGen 5.10
+ * It has been AutoGen-ed February 22, 2011 at 12:28:58 AM by AutoGen 5.11.6
* From the definitions clktest-opts.def
* and the template file options
*
- * Generated from AutoOpts 33:0:8 templates.
- */
-
-/*
- * This file was produced by an AutoOpts template. AutoOpts is a
- * copyrighted work. This header file is not encumbered by AutoOpts
- * licensing, but is provided under the licensing terms chosen by the
- * clktest author or copyright holder. AutoOpts is licensed under
- * the terms of the LGPL. The redistributable library (``libopts'') is
- * licensed under the terms of either the LGPL or, at the users discretion,
- * the BSD license. See the AutoOpts and/or libopts sources for details.
+ * Generated from AutoOpts 34:0:9 templates.
+ *
+ * AutoOpts is a copyrighted work. This header file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the clktest author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
*
* This source file is copyrighted and licensed under the following terms:
*
- * clktest copyright (c) 1970-2009 David L. Mills and/or others - all rights reserved
+ * clktest copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
*/
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 135168
+#define AO_TEMPLATE_VERSION 139264
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
} teOptIndex;
#define OPTION_CT 10
-#define CLKTEST_VERSION "4.2.5p245-RC"
-#define CLKTEST_FULL_VERSION "clktest - test the clock line discipline - Ver. 4.2.5p245-RC"
+#define CLKTEST_VERSION "4.2.6p3"
+#define CLKTEST_FULL_VERSION "clktest - test the clock line discipline - Ver. 4.2.6p3"
/*
* Interface defines for all options. Replace "n" with the UPPER_CASED
* option name (as in the teOptIndex enumeration above).
- * e.g. HAVE_OPT( SPEED )
+ * e.g. HAVE_OPT(SPEED)
*/
#define DESC(n) (clktestOptions.pOptDesc[INDEX_OPT_## n])
#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
- if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
+ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
+/* * * * * *
+ *
+ * Enumeration of clktest exit codes
+ */
+typedef enum {
+ CLKTEST_EXIT_SUCCESS = 0,
+ CLKTEST_EXIT_FAILURE = 1
+} clktest_exit_code_t;
+
/* * * * * *
*
* Globals exported from the test the clock line discipline option definitions
/*
* Interface defines not associated with particular options
*/
-#define ERRSKIP_OPTERR STMTS( clktestOptions.fOptSet &= ~OPTPROC_ERRSTOP )
-#define ERRSTOP_OPTERR STMTS( clktestOptions.fOptSet |= OPTPROC_ERRSTOP )
+#define ERRSKIP_OPTERR STMTS(clktestOptions.fOptSet &= ~OPTPROC_ERRSTOP)
+#define ERRSTOP_OPTERR STMTS(clktestOptions.fOptSet |= OPTPROC_ERRSTOP)
#define RESTART_OPT(n) STMTS( \
clktestOptions.curOptIdx = (n); \
- clktestOptions.pzCurOpt = NULL )
+ clktestOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
-#define USAGE(c) (*clktestOptions.pUsageProc)( &clktestOptions, c )
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */
+#define USAGE(c) (*clktestOptions.pUsageProc)(&clktestOptions, c)
+/* extracted from opthead.tlib near line 435 */
/* * * * * *
*
#if defined(ENABLE_NLS)
# ifndef _
# include <stdio.h>
- static inline char* aoGetsText( char const* pz ) {
+ static inline char* aoGetsText(char const* pz) {
if (pz == NULL) return NULL;
- return (char*)gettext( pz );
+ return (char*)gettext(pz);
}
# define _(s) aoGetsText(s)
# endif /* _() */
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.c)
*
- * It has been AutoGen-ed January 3, 2011 at 09:15:35 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:28:59 AM by AutoGen 5.11.6
* From the definitions ntpd-opts.def
* and the template file options
*
cannot ever change your mind. */
tSCC zCopyright[] =
"ntpd copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from copyright.def near line 8 */
;
tSCC zCopyrightNotice[24] =
"see html/copyright.html";
#define zExplain NULL
static char const zDetail[7] = "\n\n";
static char const zFullVersion[] = NTPD_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 504 */
+/* extracted from optcode.tlib near line 504 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
# define PKGDATADIR ""
#endif
+#ifndef WITH_PACKAGER
+# define ntpd_packager_info NULL
+#else
+static char const ntpd_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntpd bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+
tOptions ntpdOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
zExplain, zDetail, optDesc,
zBugsAddr, /* address to send bugs to */
NULL, NULL, /* extensions/saved state */
- optionUsage, /* usage procedure */
+ optionUsage, /* usage procedure */
translate_option_strings, /* translation procedure */
/*
* Indexes to special options
35 /* full option count */, 32 /* user option count */,
ntpd_full_usage, ntpd_short_usage,
NULL, NULL,
- PKGDATADIR
+ PKGDATADIR, ntpd_packager_info
};
/*
}
#endif /* defined DEBUG */
#endif /* defined(TEST_NTPD_OPTS) */
-/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */
+/* extracted from optmain.tlib near line 107 */
#if defined(TEST_NTPD_OPTS) /* TEST MAIN PROCEDURE: */
return res;
}
#endif /* defined TEST_NTPD_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 641 */
+/* extracted from optcode.tlib near line 657 */
#if ENABLE_NLS
#include <stdio.h>
* been changed by the first pass through this code. One shot only.
*/
if (option_usage_text.field_ct != 0) {
-
/*
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
COERSION(pzUsageTitle);
COERSION(pzExplain);
COERSION(pzDetail);
+ COERSION(pzPackager);
option_usage_text.field_ct = 0;
for (ix = ntpdOptions.optCt; ix > 0; ix--, pOD++)
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
*
- * It has been AutoGen-ed January 3, 2011 at 09:15:35 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:28:59 AM by AutoGen 5.11.6
* From the definitions ntpd-opts.def
* and the template file options
*
ntpdOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntpdOptions.pUsageProc)(&ntpdOptions, c)
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 435 */
+/* extracted from opthead.tlib near line 435 */
/* * * * * *
*
/*
* EDIT THIS FILE WITH CAUTION (ntpdsim-opts.c)
*
- * It has been AutoGen-ed November 17, 2009 at 06:37:12 AM by AutoGen 5.10
+ * It has been AutoGen-ed February 22, 2011 at 12:29:00 AM by AutoGen 5.11.6
* From the definitions ntpdsim-opts.def
* and the template file options
*
- * Generated from AutoOpts 33:0:8 templates.
- */
-
-/*
- * This file was produced by an AutoOpts template. AutoOpts is a
- * copyrighted work. This source file is not encumbered by AutoOpts
- * licensing, but is provided under the licensing terms chosen by the
- * ntpdsim author or copyright holder. AutoOpts is licensed under
- * the terms of the LGPL. The redistributable library (``libopts'') is
- * licensed under the terms of either the LGPL or, at the users discretion,
- * the BSD license. See the AutoOpts and/or libopts sources for details.
+ * Generated from AutoOpts 34:0:9 templates.
+ *
+ * AutoOpts is a copyrighted work. This source file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntpdsim author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
*
* This source file is copyrighted and licensed under the following terms:
*
- * ntpdsim copyright (c) 1970-2009 David L. Mills and/or others - all rights reserved
+ * ntpdsim copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
*/
/* TRANSLATORS: choose the translation for option names wisely because you
cannot ever change your mind. */
tSCC zCopyright[] =
- "ntpdsim copyright (c) 1970-2009 David L. Mills and/or others, all rights reserved"
-/* extracted from /deacon/backroom/ntp-dev/include/copyright.def near line 8 */
+ "ntpdsim copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
+/* extracted from copyright.def near line 8 */
;
tSCC zCopyrightNotice[24] =
"see html/copyright.html";
#endif
/*
- * Ipv4 option description:
+ * Ipv4 option description with
+ * "Must also have options" and "Incompatible options":
*/
-tSCC zIpv4Text[] =
+static char const zIpv4Text[] =
"Force IPv4 DNS name resolution";
-tSCC zIpv4_NAME[] = "IPV4";
-tSCC zIpv4_Name[] = "ipv4";
+static char const zIpv4_NAME[] = "IPV4";
+static char const zIpv4_Name[] = "ipv4";
+static const int
+ aIpv4CantList[] = {
+ INDEX_OPT_IPV6, NO_EQUIVALENT };
#define IPV4_FLAGS (OPTST_DISABLED)
/*
- * Ipv6 option description:
+ * Ipv6 option description with
+ * "Must also have options" and "Incompatible options":
*/
-tSCC zIpv6Text[] =
+static char const zIpv6Text[] =
"Force IPv6 DNS name resolution";
-tSCC zIpv6_NAME[] = "IPV6";
-tSCC zIpv6_Name[] = "ipv6";
+static char const zIpv6_NAME[] = "IPV6";
+static char const zIpv6_Name[] = "ipv6";
+static const int
+ aIpv6CantList[] = {
+ INDEX_OPT_IPV4, NO_EQUIVALENT };
#define IPV6_FLAGS (OPTST_DISABLED)
/*
* Authreq option description with
* "Must also have options" and "Incompatible options":
*/
-tSCC zAuthreqText[] =
+static char const zAuthreqText[] =
"Require crypto authentication";
-tSCC zAuthreq_NAME[] = "AUTHREQ";
-tSCC zAuthreq_Name[] = "authreq";
+static char const zAuthreq_NAME[] = "AUTHREQ";
+static char const zAuthreq_Name[] = "authreq";
static const int
aAuthreqCantList[] = {
INDEX_OPT_AUTHNOREQ, NO_EQUIVALENT };
* Authnoreq option description with
* "Must also have options" and "Incompatible options":
*/
-tSCC zAuthnoreqText[] =
+static char const zAuthnoreqText[] =
"Do not require crypto authentication";
-tSCC zAuthnoreq_NAME[] = "AUTHNOREQ";
-tSCC zAuthnoreq_Name[] = "authnoreq";
+static char const zAuthnoreq_NAME[] = "AUTHNOREQ";
+static char const zAuthnoreq_Name[] = "authnoreq";
static const int
aAuthnoreqCantList[] = {
INDEX_OPT_AUTHREQ, NO_EQUIVALENT };
/*
* Bcastsync option description:
*/
-tSCC zBcastsyncText[] =
+static char const zBcastsyncText[] =
"Allow us to sync to broadcast servers";
-tSCC zBcastsync_NAME[] = "BCASTSYNC";
-tSCC zBcastsync_Name[] = "bcastsync";
+static char const zBcastsync_NAME[] = "BCASTSYNC";
+static char const zBcastsync_Name[] = "bcastsync";
#define BCASTSYNC_FLAGS (OPTST_DISABLED)
/*
* Configfile option description:
*/
-tSCC zConfigfileText[] =
+static char const zConfigfileText[] =
"configuration file name";
-tSCC zConfigfile_NAME[] = "CONFIGFILE";
-tSCC zConfigfile_Name[] = "configfile";
+static char const zConfigfile_NAME[] = "CONFIGFILE";
+static char const zConfigfile_Name[] = "configfile";
#define CONFIGFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
* Debug_Level option description:
*/
#ifdef DEBUG
-tSCC zDebug_LevelText[] =
+static char const zDebug_LevelText[] =
"Increase output debug message level";
-tSCC zDebug_Level_NAME[] = "DEBUG_LEVEL";
-tSCC zDebug_Level_Name[] = "debug-level";
+static char const zDebug_Level_NAME[] = "DEBUG_LEVEL";
+static char const zDebug_Level_Name[] = "debug-level";
#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED)
#else /* disable Debug_Level */
#define DEBUG_LEVEL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
#define zDebug_Level_NAME NULL
-#define zDebug_LevelText NULL
-#define zDebug_Level_Name NULL
+static char const zDebug_Level_Name[] = "debug-level";
+static char const zDebug_LevelText[] = "this package was built using 'configure --disable--debug'";
#endif /* DEBUG */
/*
* Set_Debug_Level option description:
*/
#ifdef DEBUG
-tSCC zSet_Debug_LevelText[] =
+static char const zSet_Debug_LevelText[] =
"Set the output debug message level";
-tSCC zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL";
-tSCC zSet_Debug_Level_Name[] = "set-debug-level";
+static char const zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL";
+static char const zSet_Debug_Level_Name[] = "set-debug-level";
#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
#else /* disable Set_Debug_Level */
#define SET_DEBUG_LEVEL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
#define zSet_Debug_Level_NAME NULL
-#define zSet_Debug_LevelText NULL
-#define zSet_Debug_Level_Name NULL
+static char const zSet_Debug_Level_Name[] = "set-debug-level";
+static char const zSet_Debug_LevelText[] = "this package was built using 'configure --disable--debug'";
#endif /* DEBUG */
/*
* Driftfile option description:
*/
-tSCC zDriftfileText[] =
+static char const zDriftfileText[] =
"frequency drift file name";
-tSCC zDriftfile_NAME[] = "DRIFTFILE";
-tSCC zDriftfile_Name[] = "driftfile";
+static char const zDriftfile_NAME[] = "DRIFTFILE";
+static char const zDriftfile_Name[] = "driftfile";
#define DRIFTFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Panicgate option description:
*/
-tSCC zPanicgateText[] =
+static char const zPanicgateText[] =
"Allow the first adjustment to be Big";
-tSCC zPanicgate_NAME[] = "PANICGATE";
-tSCC zPanicgate_Name[] = "panicgate";
+static char const zPanicgate_NAME[] = "PANICGATE";
+static char const zPanicgate_Name[] = "panicgate";
#define PANICGATE_FLAGS (OPTST_DISABLED)
/*
* Jaildir option description:
*/
#ifdef HAVE_DROPROOT
-tSCC zJaildirText[] =
+static char const zJaildirText[] =
"Jail directory";
-tSCC zJaildir_NAME[] = "JAILDIR";
-tSCC zJaildir_Name[] = "jaildir";
+static char const zJaildir_NAME[] = "JAILDIR";
+static char const zJaildir_Name[] = "jaildir";
#define JAILDIR_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
#else /* disable Jaildir */
#define JAILDIR_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
#define zJaildir_NAME NULL
-#define zJaildirText NULL
-#define zJaildir_Name NULL
+static char const zJaildir_Name[] = "jaildir";
+static char const zJaildirText[] = "built without --enable-clockctl or --enable-linuxcaps";
#endif /* HAVE_DROPROOT */
/*
* Interface option description:
*/
-tSCC zInterfaceText[] =
+static char const zInterfaceText[] =
"Listen on an interface name or address";
-tSCC zInterface_NAME[] = "INTERFACE";
-tSCC zInterface_Name[] = "interface";
+static char const zInterface_NAME[] = "INTERFACE";
+static char const zInterface_Name[] = "interface";
#define INTERFACE_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Keyfile option description:
*/
-tSCC zKeyfileText[] =
+static char const zKeyfileText[] =
"path to symmetric keys";
-tSCC zKeyfile_NAME[] = "KEYFILE";
-tSCC zKeyfile_Name[] = "keyfile";
+static char const zKeyfile_NAME[] = "KEYFILE";
+static char const zKeyfile_Name[] = "keyfile";
#define KEYFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Logfile option description:
*/
-tSCC zLogfileText[] =
+static char const zLogfileText[] =
"path to the log file";
-tSCC zLogfile_NAME[] = "LOGFILE";
-tSCC zLogfile_Name[] = "logfile";
+static char const zLogfile_NAME[] = "LOGFILE";
+static char const zLogfile_Name[] = "logfile";
#define LOGFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Novirtualips option description:
*/
-tSCC zNovirtualipsText[] =
+static char const zNovirtualipsText[] =
"Do not listen to virtual interfaces";
-tSCC zNovirtualips_NAME[] = "NOVIRTUALIPS";
-tSCC zNovirtualips_Name[] = "novirtualips";
+static char const zNovirtualips_NAME[] = "NOVIRTUALIPS";
+static char const zNovirtualips_Name[] = "novirtualips";
#define NOVIRTUALIPS_FLAGS (OPTST_DISABLED)
/*
* Modifymmtimer option description:
*/
#ifdef SYS_WINNT
-tSCC zModifymmtimerText[] =
+static char const zModifymmtimerText[] =
"Modify Multimedia Timer (Windows only)";
-tSCC zModifymmtimer_NAME[] = "MODIFYMMTIMER";
-tSCC zModifymmtimer_Name[] = "modifymmtimer";
+static char const zModifymmtimer_NAME[] = "MODIFYMMTIMER";
+static char const zModifymmtimer_Name[] = "modifymmtimer";
#define MODIFYMMTIMER_FLAGS (OPTST_DISABLED)
#else /* disable Modifymmtimer */
/*
* Nofork option description:
*/
-tSCC zNoforkText[] =
+static char const zNoforkText[] =
"Do not fork";
-tSCC zNofork_NAME[] = "NOFORK";
-tSCC zNofork_Name[] = "nofork";
+static char const zNofork_NAME[] = "NOFORK";
+static char const zNofork_Name[] = "nofork";
#define NOFORK_FLAGS (OPTST_DISABLED)
/*
* Nice option description:
*/
-tSCC zNiceText[] =
+static char const zNiceText[] =
"Run at high priority";
-tSCC zNice_NAME[] = "NICE";
-tSCC zNice_Name[] = "nice";
+static char const zNice_NAME[] = "NICE";
+static char const zNice_Name[] = "nice";
#define NICE_FLAGS (OPTST_DISABLED)
/*
* Pidfile option description:
*/
-tSCC zPidfileText[] =
+static char const zPidfileText[] =
"path to the PID file";
-tSCC zPidfile_NAME[] = "PIDFILE";
-tSCC zPidfile_Name[] = "pidfile";
+static char const zPidfile_NAME[] = "PIDFILE";
+static char const zPidfile_Name[] = "pidfile";
#define PIDFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Priority option description:
*/
-tSCC zPriorityText[] =
+static char const zPriorityText[] =
"Process priority";
-tSCC zPriority_NAME[] = "PRIORITY";
-tSCC zPriority_Name[] = "priority";
+static char const zPriority_NAME[] = "PRIORITY";
+static char const zPriority_Name[] = "priority";
#define PRIORITY_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
/*
* Quit option description:
*/
-tSCC zQuitText[] =
+static char const zQuitText[] =
"Set the time and quit";
-tSCC zQuit_NAME[] = "QUIT";
-tSCC zQuit_Name[] = "quit";
+static char const zQuit_NAME[] = "QUIT";
+static char const zQuit_Name[] = "quit";
#define QUIT_FLAGS (OPTST_DISABLED)
/*
* Propagationdelay option description:
*/
-tSCC zPropagationdelayText[] =
+static char const zPropagationdelayText[] =
"Broadcast/propagation delay";
-tSCC zPropagationdelay_NAME[] = "PROPAGATIONDELAY";
-tSCC zPropagationdelay_Name[] = "propagationdelay";
+static char const zPropagationdelay_NAME[] = "PROPAGATIONDELAY";
+static char const zPropagationdelay_Name[] = "propagationdelay";
#define PROPAGATIONDELAY_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
* Saveconfigquit option description:
*/
#ifdef SAVECONFIG
-tSCC zSaveconfigquitText[] =
+static char const zSaveconfigquitText[] =
"Save parsed configuration and quit";
-tSCC zSaveconfigquit_NAME[] = "SAVECONFIGQUIT";
-tSCC zSaveconfigquit_Name[] = "saveconfigquit";
+static char const zSaveconfigquit_NAME[] = "SAVECONFIGQUIT";
+static char const zSaveconfigquit_Name[] = "saveconfigquit";
#define SAVECONFIGQUIT_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Statsdir option description:
*/
-tSCC zStatsdirText[] =
+static char const zStatsdirText[] =
"Statistics file location";
-tSCC zStatsdir_NAME[] = "STATSDIR";
-tSCC zStatsdir_Name[] = "statsdir";
+static char const zStatsdir_NAME[] = "STATSDIR";
+static char const zStatsdir_Name[] = "statsdir";
#define STATSDIR_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Trustedkey option description:
*/
-tSCC zTrustedkeyText[] =
+static char const zTrustedkeyText[] =
"Trusted key number";
-tSCC zTrustedkey_NAME[] = "TRUSTEDKEY";
-tSCC zTrustedkey_Name[] = "trustedkey";
+static char const zTrustedkey_NAME[] = "TRUSTEDKEY";
+static char const zTrustedkey_Name[] = "trustedkey";
#define TRUSTEDKEY_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
* User option description:
*/
#ifdef HAVE_DROPROOT
-tSCC zUserText[] =
+static char const zUserText[] =
"Run as userid (or userid:groupid)";
-tSCC zUser_NAME[] = "USER";
-tSCC zUser_Name[] = "user";
+static char const zUser_NAME[] = "USER";
+static char const zUser_Name[] = "user";
#define USER_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
#else /* disable User */
#define USER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
#define zUser_NAME NULL
-#define zUserText NULL
-#define zUser_Name NULL
+static char const zUser_Name[] = "user";
+static char const zUserText[] = "built without --enable-clockctl or --enable-linuxcaps";
#endif /* HAVE_DROPROOT */
/*
* Updateinterval option description:
*/
-tSCC zUpdateintervalText[] =
+static char const zUpdateintervalText[] =
"interval in seconds between scans for new or dropped interfaces";
-tSCC zUpdateinterval_NAME[] = "UPDATEINTERVAL";
-tSCC zUpdateinterval_Name[] = "updateinterval";
+static char const zUpdateinterval_NAME[] = "UPDATEINTERVAL";
+static char const zUpdateinterval_Name[] = "updateinterval";
#define UPDATEINTERVAL_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
/*
* Var option description:
*/
-tSCC zVarText[] =
+static char const zVarText[] =
"make ARG an ntp variable (RW)";
-tSCC zVar_NAME[] = "VAR";
-tSCC zVar_Name[] = "var";
+static char const zVar_NAME[] = "VAR";
+static char const zVar_Name[] = "var";
#define VAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Dvar option description:
*/
-tSCC zDvarText[] =
+static char const zDvarText[] =
"make ARG an ntp variable (RW|DEF)";
-tSCC zDvar_NAME[] = "DVAR";
-tSCC zDvar_Name[] = "dvar";
+static char const zDvar_NAME[] = "DVAR";
+static char const zDvar_Name[] = "dvar";
#define DVAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Slew option description:
*/
-tSCC zSlewText[] =
+static char const zSlewText[] =
"Slew up to 600 seconds";
-tSCC zSlew_NAME[] = "SLEW";
-tSCC zSlew_Name[] = "slew";
+static char const zSlew_NAME[] = "SLEW";
+static char const zSlew_Name[] = "slew";
#define SLEW_FLAGS (OPTST_DISABLED)
/*
* Usepcc option description:
*/
#ifdef SYS_WINNT
-tSCC zUsepccText[] =
+static char const zUsepccText[] =
"Use CPU cycle counter (Windows only)";
-tSCC zUsepcc_NAME[] = "USEPCC";
-tSCC zUsepcc_Name[] = "usepcc";
+static char const zUsepcc_NAME[] = "USEPCC";
+static char const zUsepcc_Name[] = "usepcc";
#define USEPCC_FLAGS (OPTST_DISABLED)
#else /* disable Usepcc */
* Pccfreq option description:
*/
#ifdef SYS_WINNT
-tSCC zPccfreqText[] =
+static char const zPccfreqText[] =
"Force CPU cycle counter use (Windows only)";
-tSCC zPccfreq_NAME[] = "PCCFREQ";
-tSCC zPccfreq_Name[] = "pccfreq";
+static char const zPccfreq_NAME[] = "PCCFREQ";
+static char const zPccfreq_Name[] = "pccfreq";
#define PCCFREQ_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Help/More_Help/Version option descriptions:
*/
-tSCC zHelpText[] = "Display extended usage information and exit";
-tSCC zHelp_Name[] = "help";
+static char const zHelpText[] = "Display extended usage information and exit";
+static char const zHelp_Name[] = "help";
#ifdef HAVE_WORKING_FORK
#define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
-tSCC zMore_Help_Name[] = "more-help";
-tSCC zMore_HelpText[] = "Extended usage information passed thru pager";
+static char const zMore_Help_Name[] = "more-help";
+static char const zMore_HelpText[] = "Extended usage information passed thru pager";
#else
#define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
#define zMore_Help_Name NULL
OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
#endif
-tSCC zVersionText[] = "Output version information and exit";
-tSCC zVersion_Name[] = "version";
-tSCC zSave_OptsText[] = "Save the option state to a config file";
-tSCC zSave_Opts_Name[] = "save-opts";
-tSCC zLoad_OptsText[] = "Load options from a config file";
-tSCC zLoad_Opts_NAME[] = "LOAD_OPTS";
-tSCC zNotLoad_Opts_Name[] = "no-load-opts";
-tSCC zNotLoad_Opts_Pfx[] = "no";
+static char const zVersionText[] = "Output version information and exit";
+static char const zVersion_Name[] = "version";
+static char const zSave_OptsText[] = "Save the option state to a config file";
+static char const zSave_Opts_Name[] = "save-opts";
+static char const zLoad_OptsText[] = "Load options from a config file";
+static char const zLoad_Opts_NAME[] = "LOAD_OPTS";
+static char const zNotLoad_Opts_Name[] = "no-load-opts";
+static char const zNotLoad_Opts_Pfx[] = "no";
#define zLoad_Opts_Name (zNotLoad_Opts_Name + 3)
/*
* Declare option callback procedures
* Under test, omit argument processing, or call optionStackArg,
* if multiple copies are allowed.
*/
-extern tOptProc
- optionNumericVal, optionPagedUsage, optionStackArg,
- optionVersionStderr;
static tOptProc
doUsageOpt;
* When not under test, there are different procs to use
*/
extern tOptProc
- optionNumericVal, optionPagedUsage, optionPrintVersion, optionStackArg;
+ optionBooleanVal, optionNestedVal, optionNumericVal,
+ optionPagedUsage, optionPrintVersion, optionResetOpt,
+ optionStackArg, optionTimeVal, optionUnstackArg,
+ optionVersionStderr;
static tOptProc
doUsageOpt;
*/
static tOptDesc optDesc[ OPTION_CT ] = {
{ /* entry idx, value */ 0, VALUE_OPT_IPV4,
- /* equiv idx, value */ NO_EQUIVALENT, 0,
+ /* equiv idx, value */ 0, VALUE_OPT_IPV4,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ IPV4_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
- /* must/cannot opts */ NULL, NULL,
+ /* must/cannot opts */ NULL, aIpv4CantList,
/* option proc */ NULL,
/* desc, NAME, name */ zIpv4Text, zIpv4_NAME, zIpv4_Name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 1, VALUE_OPT_IPV6,
- /* equiv idx, value */ NOLIMIT, NOLIMIT,
- /* equivalenced to */ INDEX_OPT_IPV4,
+ /* equiv idx, value */ 1, VALUE_OPT_IPV6,
+ /* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ IPV6_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
- /* must/cannot opts */ NULL, NULL,
+ /* must/cannot opts */ NULL, aIpv6CantList,
/* option proc */ NULL,
/* desc, NAME, name */ zIpv6Text, zIpv6_NAME, zIpv6_Name,
/* disablement strs */ NULL, NULL },
*
* Define the Ntpdsim Option Environment
*/
-tSCC zPROGNAME[] = "NTPDSIM";
-tSCC zUsageTitle[] =
-"ntpdsim - NTP daemon simulation program - Ver. 4.2.5p245-RC\n\
+static char const zPROGNAME[8] = "NTPDSIM";
+static char const zUsageTitle[113] =
+"ntpdsim - NTP daemon simulation program - Ver. 4.2.6p3\n\
USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n";
-tSCC zRcName[] = ".ntprc";
-tSCC* apzHomeList[] = {
- "$HOME",
- ".",
- NULL };
+static char const zRcName[7] = ".ntprc";
+static char const * const apzHomeList[3] = {
+ "$HOME",
+ ".",
+ NULL };
-tSCC zBugsAddr[] = "http://bugs.ntp.org, bugs@ntp.org";
+static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org";
#define zExplain NULL
-tSCC zDetail[] = "\n\n";
-tSCC zFullVersion[] = NTPDSIM_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 495 */
+static char const zDetail[7] = "\n\n";
+static char const zFullVersion[] = NTPDSIM_FULL_VERSION;
+/* extracted from optcode.tlib near line 504 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
#define ntpdsim_full_usage NULL
#define ntpdsim_short_usage NULL
+#ifndef PKGDATADIR
+# define PKGDATADIR ""
+#endif
+
+#ifndef WITH_PACKAGER
+# define ntpdsim_packager_info NULL
+#else
+static char const ntpdsim_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntpdsim bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+
tOptions ntpdsimOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
+ OPTPROC_LONGOPT
+ OPTPROC_NO_REQ_OPT
+ OPTPROC_ENVIRON
- + OPTPROC_NO_ARGS ),
+ + OPTPROC_NO_ARGS
+ + OPTPROC_MISUSE ),
0, NULL, /* current option index, current option */
NULL, NULL, zPROGNAME,
zRcName, zCopyright, zCopyrightNotice,
zExplain, zDetail, optDesc,
zBugsAddr, /* address to send bugs to */
NULL, NULL, /* extensions/saved state */
- optionUsage, /* usage procedure */
+ optionUsage, /* usage procedure */
translate_option_strings, /* translation procedure */
/*
* Indexes to special options
},
37 /* full option count */, 32 /* user option count */,
ntpdsim_full_usage, ntpdsim_short_usage,
- NULL, NULL
+ NULL, NULL,
+ PKGDATADIR, ntpdsim_packager_info
};
/*
tOptDesc* pOptDesc )
{
(void)pOptions;
- USAGE( EXIT_SUCCESS );
+ USAGE(EXIT_SUCCESS);
}
#if ! defined(TEST_NTPDSIM_OPTS)
static void
doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
{
- /* extracted from ntpdbase-opts.def, line 98 */
+ /* extracted from ntpdbase-opts.def, line 100 */
DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
}
#endif /* defined DEBUG */
#endif /* defined(TEST_NTPDSIM_OPTS) */
-/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 109 */
+/* extracted from optmain.tlib near line 107 */
#if defined(TEST_NTPDSIM_OPTS) /* TEST MAIN PROCEDURE: */
-extern void optionPutShell( tOptions* );
+extern void optionPutShell(tOptions*);
int
main(int argc, char** argv)
{
int res = EXIT_SUCCESS;
- (void)optionProcess( &ntpdsimOptions, argc, argv );
- optionPutShell( &ntpdsimOptions );
+ (void)optionProcess(&ntpdsimOptions, argc, argv);
+ optionPutShell(&ntpdsimOptions);
+ res = ferror(stdout);
+ if (res != 0)
+ fputs("output error writing to stdout\n", stderr);
return res;
}
#endif /* defined TEST_NTPDSIM_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 627 */
+/* extracted from optcode.tlib near line 657 */
#if ENABLE_NLS
#include <stdio.h>
#include <unistd.h>
#include <autoopts/usage-txt.h>
-static char* AO_gettext( char const* pz );
+static char* AO_gettext(char const* pz);
static void coerce_it(void** s);
static char*
-AO_gettext( char const* pz )
+AO_gettext(char const* pz)
{
char* pzRes;
if (pz == NULL)
pzRes = _(pz);
if (pzRes == pz)
return pzRes;
- pzRes = strdup( pzRes );
+ pzRes = strdup(pzRes);
if (pzRes == NULL) {
- fputs( _("No memory for duping translated strings\n"), stderr );
- exit( EXIT_FAILURE );
+ fputs(_("No memory for duping translated strings\n"), stderr);
+ exit(EXIT_FAILURE);
}
return pzRes;
}
* This invokes the translation code (e.g. gettext(3)).
*/
static void
-translate_option_strings( void )
+translate_option_strings(void)
{
/*
* Guard against re-translation. It won't work. The strings will have
* been changed by the first pass through this code. One shot only.
*/
if (option_usage_text.field_ct != 0) {
-
/*
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
COERSION(pzUsageTitle);
COERSION(pzExplain);
COERSION(pzDetail);
+ COERSION(pzPackager);
option_usage_text.field_ct = 0;
for (ix = ntpdsimOptions.optCt; ix > 0; ix--, pOD++)
/*
* EDIT THIS FILE WITH CAUTION (ntpdsim-opts.h)
*
- * It has been AutoGen-ed November 17, 2009 at 06:37:12 AM by AutoGen 5.10
+ * It has been AutoGen-ed February 22, 2011 at 12:29:00 AM by AutoGen 5.11.6
* From the definitions ntpdsim-opts.def
* and the template file options
*
- * Generated from AutoOpts 33:0:8 templates.
- */
-
-/*
- * This file was produced by an AutoOpts template. AutoOpts is a
- * copyrighted work. This header file is not encumbered by AutoOpts
- * licensing, but is provided under the licensing terms chosen by the
- * ntpdsim author or copyright holder. AutoOpts is licensed under
- * the terms of the LGPL. The redistributable library (``libopts'') is
- * licensed under the terms of either the LGPL or, at the users discretion,
- * the BSD license. See the AutoOpts and/or libopts sources for details.
+ * Generated from AutoOpts 34:0:9 templates.
+ *
+ * AutoOpts is a copyrighted work. This header file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntpdsim author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
*
* This source file is copyrighted and licensed under the following terms:
*
- * ntpdsim copyright (c) 1970-2009 David L. Mills and/or others - all rights reserved
+ * ntpdsim copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
*/
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 135168
+#define AO_TEMPLATE_VERSION 139264
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
} teOptIndex;
#define OPTION_CT 37
-#define NTPDSIM_VERSION "4.2.5p245-RC"
-#define NTPDSIM_FULL_VERSION "ntpdsim - NTP daemon simulation program - Ver. 4.2.5p245-RC"
+#define NTPDSIM_VERSION "4.2.6p3"
+#define NTPDSIM_FULL_VERSION "ntpdsim - NTP daemon simulation program - Ver. 4.2.6p3"
/*
* Interface defines for all options. Replace "n" with the UPPER_CASED
* option name (as in the teOptIndex enumeration above).
- * e.g. HAVE_OPT( IPV4 )
+ * e.g. HAVE_OPT(IPV4)
*/
#define DESC(n) (ntpdsimOptions.pOptDesc[INDEX_OPT_## n])
#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
- if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
+ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
+/* * * * * *
+ *
+ * Enumeration of ntpdsim exit codes
+ */
+typedef enum {
+ NTPDSIM_EXIT_SUCCESS = 0,
+ NTPDSIM_EXIT_FAILURE = 1
+} ntpdsim_exit_code_t;
+
/*
* Make sure there are no #define name conflicts with the option names
*/
* Interface defines for specific options.
*/
#define VALUE_OPT_IPV4 '4'
-
-#define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
-#define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
#define VALUE_OPT_IPV6 '6'
#define VALUE_OPT_AUTHREQ 'a'
#define VALUE_OPT_AUTHNOREQ 'A'
/*
* Interface defines not associated with particular options
*/
-#define ERRSKIP_OPTERR STMTS( ntpdsimOptions.fOptSet &= ~OPTPROC_ERRSTOP )
-#define ERRSTOP_OPTERR STMTS( ntpdsimOptions.fOptSet |= OPTPROC_ERRSTOP )
+#define ERRSKIP_OPTERR STMTS(ntpdsimOptions.fOptSet &= ~OPTPROC_ERRSTOP)
+#define ERRSTOP_OPTERR STMTS(ntpdsimOptions.fOptSet |= OPTPROC_ERRSTOP)
#define RESTART_OPT(n) STMTS( \
ntpdsimOptions.curOptIdx = (n); \
- ntpdsimOptions.pzCurOpt = NULL )
+ ntpdsimOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
-#define USAGE(c) (*ntpdsimOptions.pUsageProc)( &ntpdsimOptions, c )
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */
+#define USAGE(c) (*ntpdsimOptions.pUsageProc)(&ntpdsimOptions, c)
+/* extracted from opthead.tlib near line 435 */
/* * * * * *
*
#if defined(ENABLE_NLS)
# ifndef _
# include <stdio.h>
- static inline char* aoGetsText( char const* pz ) {
+ static inline char* aoGetsText(char const* pz) {
if (pz == NULL) return NULL;
- return (char*)gettext( pz );
+ return (char*)gettext(pz);
}
# define _(s) aoGetsText(s)
# endif /* _() */
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.c)
*
- * It has been AutoGen-ed January 3, 2011 at 09:18:12 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:29:00 AM by AutoGen 5.11.6
* From the definitions ntpdc-opts.def
* and the template file options
*
cannot ever change your mind. */
tSCC zCopyright[] =
"ntpdc copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from copyright.def near line 8 */
;
tSCC zCopyrightNotice[24] =
"see html/copyright.html";
static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org";
#define zExplain NULL
-static char const zDetail[618] = "\n\
-The\n\
-[= prog-name =]\n\
-utility program is used to query an NTP daemon about its\n\
-current state and to request changes in that state.\n\
-It uses NTP mode 7 control message formats described in the source code.\n\
-The program may\n\
+static char const zDetail[601] = "\n\
+The [= prog-name =] utility program is used to query an NTP daemon about\n\
+its current state and to request changes in that state. It uses NTP mode\n\
+7 control message formats described in the source code. The program may\n\
be run either in interactive mode or controlled using command line\n\
-arguments.\n\
-Extensive state and statistics information is available\n\
-through the\n\
-[= prog-name =]\n\
-interface.\n\
-In addition, nearly all the\n\
-configuration options which can be specified at startup using\n\
-ntpd's configuration file may also be specified at run time using\n\
-[= prog-name =] .\n";
+arguments. Extensive state and statistics information is available\n\
+through the [= prog-name =] interface. In addition, nearly all the\n\
+configuration options which can be specified at startup using ntpd's\n\
+configuration file may also be specified at run time using [= prog-name =]\n\
+.\n";
static char const zFullVersion[] = NTPDC_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 504 */
+/* extracted from optcode.tlib near line 504 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
# define PKGDATADIR ""
#endif
+#ifndef WITH_PACKAGER
+# define ntpdc_packager_info NULL
+#else
+static char const ntpdc_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntpdc bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+
tOptions ntpdcOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
zExplain, zDetail, optDesc,
zBugsAddr, /* address to send bugs to */
NULL, NULL, /* extensions/saved state */
- optionUsage, /* usage procedure */
+ optionUsage, /* usage procedure */
translate_option_strings, /* translation procedure */
/*
* Indexes to special options
15 /* full option count */, 10 /* user option count */,
ntpdc_full_usage, ntpdc_short_usage,
NULL, NULL,
- PKGDATADIR
+ PKGDATADIR, ntpdc_packager_info
};
/*
static void
doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
{
- /* extracted from ../include/debug-opt.def, line 27 */
+ /* extracted from debug-opt.def, line 27 */
DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
}
#endif /* defined(TEST_NTPDC_OPTS) */
-/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */
+/* extracted from optmain.tlib near line 107 */
#if defined(TEST_NTPDC_OPTS) /* TEST MAIN PROCEDURE: */
return res;
}
#endif /* defined TEST_NTPDC_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 641 */
+/* extracted from optcode.tlib near line 657 */
#if ENABLE_NLS
#include <stdio.h>
* been changed by the first pass through this code. One shot only.
*/
if (option_usage_text.field_ct != 0) {
-
/*
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
COERSION(pzUsageTitle);
COERSION(pzExplain);
COERSION(pzDetail);
+ COERSION(pzPackager);
option_usage_text.field_ct = 0;
for (ix = ntpdcOptions.optCt; ix > 0; ix--, pOD++)
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.h)
*
- * It has been AutoGen-ed January 3, 2011 at 09:18:12 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:29:00 AM by AutoGen 5.11.6
* From the definitions ntpdc-opts.def
* and the template file options
*
ntpdcOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntpdcOptions.pUsageProc)(&ntpdcOptions, c)
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 435 */
+/* extracted from opthead.tlib near line 435 */
/* * * * * *
*
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.c)
*
- * It has been AutoGen-ed January 3, 2011 at 09:18:23 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:29:01 AM by AutoGen 5.11.6
* From the definitions ntpq-opts.def
* and the template file options
*
cannot ever change your mind. */
tSCC zCopyright[] =
"ntpq copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from copyright.def near line 8 */
;
tSCC zCopyrightNotice[24] =
"see html/copyright.html";
static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org";
#define zExplain NULL
-static char const zDetail[389] = "\n\
-The\n\
-[= prog-name =]\n\
-utility program is used to query NTP servers which\n\
-implement the standard NTP mode 6 control message formats defined\n\
-in Appendix B of the NTPv3 specification RFC1305, requesting\n\
-information about current state and/or changes in that state.\n\
-The same formats are used in NTPv4, although some of the\n\
-variables have changed and new ones added.\n";
+static char const zDetail[384] = "\n\
+The [= prog-name =] utility program is used to query NTP servers which\n\
+implement the standard NTP mode 6 control message formats defined in\n\
+Appendix B of the NTPv3 specification RFC1305, requesting information\n\
+about current state and/or changes in that state. The same formats are\n\
+used in NTPv4, although some of the variables have changed and new ones\n\
+added.\n";
static char const zFullVersion[] = NTPQ_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 504 */
+/* extracted from optcode.tlib near line 504 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
# define PKGDATADIR ""
#endif
+#ifndef WITH_PACKAGER
+# define ntpq_packager_info NULL
+#else
+static char const ntpq_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntpq bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+
tOptions ntpqOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
zExplain, zDetail, optDesc,
zBugsAddr, /* address to send bugs to */
NULL, NULL, /* extensions/saved state */
- optionUsage, /* usage procedure */
+ optionUsage, /* usage procedure */
translate_option_strings, /* translation procedure */
/*
* Indexes to special options
14 /* full option count */, 9 /* user option count */,
ntpq_full_usage, ntpq_short_usage,
NULL, NULL,
- PKGDATADIR
+ PKGDATADIR, ntpq_packager_info
};
/*
static void
doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
{
- /* extracted from ../include/debug-opt.def, line 27 */
+ /* extracted from debug-opt.def, line 27 */
DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
}
#endif /* defined(TEST_NTPQ_OPTS) */
-/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */
+/* extracted from optmain.tlib near line 107 */
#if defined(TEST_NTPQ_OPTS) /* TEST MAIN PROCEDURE: */
return res;
}
#endif /* defined TEST_NTPQ_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 641 */
+/* extracted from optcode.tlib near line 657 */
#if ENABLE_NLS
#include <stdio.h>
* been changed by the first pass through this code. One shot only.
*/
if (option_usage_text.field_ct != 0) {
-
/*
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
COERSION(pzUsageTitle);
COERSION(pzExplain);
COERSION(pzDetail);
+ COERSION(pzPackager);
option_usage_text.field_ct = 0;
for (ix = ntpqOptions.optCt; ix > 0; ix--, pOD++)
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.h)
*
- * It has been AutoGen-ed January 3, 2011 at 09:18:22 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:29:01 AM by AutoGen 5.11.6
* From the definitions ntpq-opts.def
* and the template file options
*
ntpqOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntpqOptions.pUsageProc)(&ntpqOptions, c)
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 435 */
+/* extracted from opthead.tlib near line 435 */
/* * * * * *
*
/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c)
*
- * It has been AutoGen-ed January 3, 2011 at 09:18:39 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:29:02 AM by AutoGen 5.11.6
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
cannot ever change your mind. */
tSCC zCopyright[] =
"ntpsnmpd copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from copyright.def near line 8 */
;
tSCC zCopyrightNotice[24] =
"see html/copyright.html";
#define zExplain NULL
#define zDetail NULL
static char const zFullVersion[] = NTPSNMPD_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 504 */
+/* extracted from optcode.tlib near line 504 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
# define PKGDATADIR ""
#endif
+#ifndef WITH_PACKAGER
+# define ntpsnmpd_packager_info NULL
+#else
+static char const ntpsnmpd_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntpsnmpd bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+
tOptions ntpsnmpdOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
zExplain, zDetail, optDesc,
zBugsAddr, /* address to send bugs to */
NULL, NULL, /* extensions/saved state */
- optionUsage, /* usage procedure */
+ optionUsage, /* usage procedure */
translate_option_strings, /* translation procedure */
/*
* Indexes to special options
8 /* full option count */, 3 /* user option count */,
ntpsnmpd_full_usage, ntpsnmpd_short_usage,
NULL, NULL,
- PKGDATADIR
+ PKGDATADIR, ntpsnmpd_packager_info
};
/*
(void)pOptions;
USAGE(EXIT_SUCCESS);
}
-/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */
+/* extracted from optmain.tlib near line 107 */
#if defined(TEST_NTPSNMPD_OPTS) /* TEST MAIN PROCEDURE: */
return res;
}
#endif /* defined TEST_NTPSNMPD_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 641 */
+/* extracted from optcode.tlib near line 657 */
#if ENABLE_NLS
#include <stdio.h>
* been changed by the first pass through this code. One shot only.
*/
if (option_usage_text.field_ct != 0) {
-
/*
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
COERSION(pzUsageTitle);
COERSION(pzExplain);
COERSION(pzDetail);
+ COERSION(pzPackager);
option_usage_text.field_ct = 0;
for (ix = ntpsnmpdOptions.optCt; ix > 0; ix--, pOD++)
/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h)
*
- * It has been AutoGen-ed January 3, 2011 at 09:18:38 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:29:02 AM by AutoGen 5.11.6
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
ntpsnmpdOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntpsnmpdOptions.pUsageProc)(&ntpsnmpdOptions, c)
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 435 */
+/* extracted from opthead.tlib near line 435 */
/* * * * * *
*
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
- Copyright (c) 2010 by Bruce Korb - all rights reserved
+ Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
- Copyright (c) 2010 by Bruce Korb - all rights reserved
+ Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
COPYING.gplv3 COPYING.lgplv3 COPYING.mbsd \
MakeDefs.inc README ag-char-map.h \
autoopts/options.h autoopts/usage-txt.h autoopts.c \
- autoopts.h boolean.c compat/snprintf.c \
- compat/windows-config.h compat/strdup.c compat/compat.h \
- compat/pathfind.c compat/strchr.c configfile.c \
+ autoopts.h boolean.c compat/strchr.c \
+ compat/strdup.c compat/compat.h compat/snprintf.c \
+ compat/pathfind.c compat/windows-config.h configfile.c \
cook.c enumeration.c environment.c \
file.c genshell.c genshell.h \
load.c m4/liboptschk.m4 m4/libopts.m4 \
THIS TARBALL IS NOT A FULL DISTRIBUTION.
The contents of this tarball is designed to be incorporated into
-software packages that utilize the AutoOpts option automation
-package and are intended to be installed on systems that may not
-have libopts installed. It is redistributable under the terms
-of either the LGPL (see COPYING.lgpl) or under the terms of
-the advertising clause free BSD license (see COPYING.mbsd).
+software packages that utilize the AutoOpts option automation package
+and are intended to be installed on systems that may not have libopts
+installed. It is redistributable under the terms of either the LGPL
+(see COPYING.lgpl) or under the terms of the advertising clause free BSD
+license (see COPYING.mbsd).
Usage Instructions for autoconf/automake/libtoolized projects:
This is one macro where you *MUST* remember to *NOT* quote
the argument. If you do, automake will get lost.
-2. Add the following to your ``configure.ac'' file:
-
- LIBOPTS_CHECK
-
- or:
-
- LIBOPTS_CHECK([relative/path/to/libopts])
-
- This macro will automatically invoke
-
- AC_CONFIG_FILES( [relative/path/to/libopts/Makefile] )
-
- The default ``relative/path/to/libopts'' is simply
- ``libopts''.
+2. Add an invocation of either LIBOPTS_CHECK or LIBOPTS_CHECK_NOBUILD
+ to your configure.ac file. See LIBOPTS_CHECK: below for details.
3. Add the following to your top level ``Makefile.am'' file:
SUBDIRS += $(LIBOPTS_DIR)
endif
- where ``<...>'' can be whatever other files or directories
- you may need. The SUBDIRS must be properly ordered.
- *PLEASE NOTE* it is crucial that the SUBDIRS be set under the
- control of an automake conditional. To work correctly,
- automake has to know the range of possible values of SUBDIRS.
- It's a magical name with magical properties. ``NEED_LIBOPTS''
- will be correctly set by the ``LIBOPTS_CHECK'' macro, above.
+ where ``<...>'' can be whatever other files or directories you may
+ need. The SUBDIRS must be properly ordered. *PLEASE NOTE* it is
+ crucial that the SUBDIRS be set under the control of an automake
+ conditional. To work correctly, automake has to know the range of
+ possible values of SUBDIRS. It's a magical name with magical
+ properties. ``NEED_LIBOPTS'' will be correctly set by the
+ ``LIBOPTS_CHECK'' macro, above.
4. Add ``$(LIBOPTS_CFLAGS)'' to relevant compiler flags and
``$(LIBOPTS_LDADD)'' to relevant link options whereever
prog.1 : prog-opts.def
autogen -Tagman-cmd.tpl -bprog prog-opts.def
- prog-invoke.texi : prog-opts.def
- autogen -Taginfo.tpl -bprog-invoke prog-opts.def
+ invoke-prog.texi : prog-opts.def
+ autogen -Tagtexi-cmd.tpl prog-opts.def
If your package does not utilize the auto* tools, then you
will need to hand craft the rules for building the library.
+LIBOPTS_CHECK:
+
+The arguments to both macro are a relative path to the directory with
+the libopts source code. It is optional and defaults to "libopts".
+These macros work as follows:
+
+1. LIBOPTS_CHECK([libopts/rel/path/optional])
+
+ Adds two command-line options to the generated configure script,
+ --enable-local-libopts and --disable-libopts-install. AC_SUBST's
+ LIBOPTS_CFLAGS, LIBOPTS_LDADD, and LIBOPTS_DIR for use in
+ Makefile.am files. Adds Automake conditional NEED_LIBOPTS which
+ will be true when the local copy of libopts should be built. Uses
+ AC_CONFIG_FILES([$libopts-dir/Makefile]) to cause the local libopts
+ into the package build. If the optional relative path to libopts is
+ not provided, it defaults to simply "libopts".
+
+2. LIBOPTS_CHECK_NOBUILD([libopts/rel/path/optional])
+
+ This variant of LIBOPTS_CHECK is useful when multiple configure.ac
+ files in a package make use of a single libopts tearoff. In that
+ case, only one of the configure.ac files should build libopts and
+ others should simply use it. Consider this package arrangment:
+
+ all-tools/
+ configure.ac
+ common-tools/
+ configure.ac
+ libopts/
+
+ The parent package all-tools contains a subpackage common-tools
+ which can be torn off and used independently. Programs configured
+ by both configure.ac files link against the common-tools/libopts
+ tearoff, when not using the system's libopts. The top-level
+ configure.ac uses LIBOPTS_CHECK_NOBUILD([common-tools/libopts]),
+ while common-tools/configure.ac uses LIBOPTS_CHECK. The difference
+ is LIBOPTS_CHECK_NOBUILD will never build the libopts tearoff,
+ leaving that to the subpackage configure.ac's LIBOPTS_CHECK.
+ Specifically, LIBOPTS_CHECK_NOBUILD always results in the
+ NEED_LIBOPTS Automake conditional being false, and does not invoke
+ AC_CONFIG_FILES(path-to-libopts/Makefile).
+
LICENSING:
-This material is Copyright (c) 1993-2010 by Bruce Korb.
-You are licensed to use this under the terms of either
-the GNU Lesser General Public License (see: COPYING.lgpl), or,
-at your option, the modified Berkeley Software Distribution
-License (see: COPYING.mbsd). Both of these files should be
-included with this tarball.
+This material is Copyright (c) 1992-2011 by Bruce Korb. You are
+licensed to use this under the terms of either the GNU Lesser General
+Public License (see: COPYING.lgpl), or, at your option, the modified
+Berkeley Software Distribution License (see: COPYING.mbsd). Both of
+these files should be included with this tarball.
/*
- * Character mapping generated 12/18/10 12:13:30
+ * Character mapping generated 02/17/11 16:58:35
*
* This file contains the character classifications
* used by AutoGen and AutoOpts for identifying tokens.
* This file is part of AutoGen.
- * AutoGen Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
* AutoGen is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
// used by AutoGen and AutoOpts for identifying tokens.
//
// This file is part of AutoGen.
-// AutoGen Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+// AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
//
// AutoGen is free software: you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the Free Software
/**
* \file autoopts.c
*
- * Time-stamp: "2010-12-18 12:09:04 bkorb"
+ * Time-stamp: "2011-01-06 12:44:21 bkorb"
*
* This file contains all of the routines that must be linked into
* an executable to use the generated option processing. The optional
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
* line arguments.
*/
-/*
- * doImmediateOpts - scan the command line for immediate action options
+/**
+ * scan the command line for immediate action options.
+ * This is only called the first time through.
*/
LOCAL tSuccess
doImmediateOpts(tOptions* pOpts)
tOptState optState = OPTSTATE_INITIALIZER(PRESET);
switch (nextOption(pOpts, &optState)) {
- case FAILURE: goto optionsDone;
+ case FAILURE: goto failed_option;
case PROBLEM: return SUCCESS; /* no more args */
case SUCCESS: break;
}
/*
- * IF this *is* an immediate-attribute option, then do it.
+ * IF this is an immediate-attribute option, then do it.
*/
if (! DO_IMMEDIATELY(optState.flags))
continue;
if (! SUCCESSFUL(handle_opt(pOpts, &optState)))
break;
- } optionsDone:;
+ } failed_option:;
if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0)
(*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
+
return FAILURE;
}
-
+/**
+ * Process all the options from our current position onward. (This allows
+ * interspersed options and arguments for the few non-standard programs that
+ * require it.) Thus, do not rewind option indexes because some programs
+ * choose to re-invoke after a non-option.
+ */
LOCAL tSuccess
doRegularOpts(tOptions* pOpts)
{
- /*
- * Now, process all the options from our current position onward.
- * (This allows interspersed options and arguments for the few
- * non-standard programs that require it.)
- */
for (;;) {
tOptState optState = OPTSTATE_INITIALIZER(DEFINED);
switch (nextOption(pOpts, &optState)) {
- case FAILURE: goto optionsDone;
+ case FAILURE: goto failed_option;
case PROBLEM: return SUCCESS; /* no more args */
case SUCCESS: break;
}
/*
- * IF this is not being processed normally (i.e. is immediate action)
+ * IF this is an immediate action option,
* THEN skip it (unless we are supposed to do it a second time).
*/
if (! DO_NORMALLY(optState.flags)) {
if (! DO_SECOND_TIME(optState.flags))
continue;
- optState.pOD->optOccCt--; /* don't count last time */
+ optState.pOD->optOccCt--; /* don't count this repetition */
}
if (! SUCCESSFUL(handle_opt(pOpts, &optState)))
break;
- } optionsDone:;
+ } failed_option:;
+
if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0)
(*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
+
return FAILURE;
}
-/*
- * doPresets - check for preset values from a config file or the envrionment
+/**
+ * check for preset values from a config files or envrionment variables
*/
static tSuccess
doPresets(tOptions* pOpts)
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* DO NOT EDIT THIS FILE (options.h)
*
- * It has been AutoGen-ed December 18, 2010 at 12:13:34 PM by AutoGen 5.11.6pre4
+ * It has been AutoGen-ed February 17, 2011 at 04:58:38 PM by AutoGen 5.11.6
* From the definitions funcs.def
* and the template file options_h
*
* This file defines all the global structures and special values
* used in the automated option processing library.
*
- * Automated Options copyright (c) 1992-Y by Bruce Korb
+ * Automated Options Copyright (C) 1992-2011 by Bruce Korb
*
* AutoOpts is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
optArgBucket_t const * const originalOptArgArray;
void * const * const originalOptArgCookie;
char const * const pzPkgDataDir;
+ char const * const pzPackager;
};
/*
extern token_list_t* ao_string_tokenize(char const*);
-/* From: configfile.c line 71
+/* From: configfile.c line 80
*
* configFileLoad - parse a configuration file
*
extern const tOptionValue* configFileLoad(char const*);
-/* From: configfile.c line 936
+/* From: configfile.c line 1059
*
* optionFileLoad - Load the locatable config files, in order
*
extern int optionFileLoad(tOptions*, char const*);
-/* From: configfile.c line 203
+/* From: configfile.c line 212
*
* optionFindNextValue - find a hierarcicaly valued option instance
*
extern const tOptionValue* optionFindNextValue(const tOptDesc*, const tOptionValue*, char const*, char const*);
-/* From: configfile.c line 129
+/* From: configfile.c line 138
*
* optionFindValue - find a hierarcicaly valued option instance
*
extern void optionFree(tOptions*);
-/* From: configfile.c line 272
+/* From: configfile.c line 281
*
* optionGetValue - get a specific value from a hierarcical list
*
extern void optionLoadLine(tOptions*, char const*);
-/* From: configfile.c line 331
+/* From: configfile.c line 340
*
* optionNextValue - get the next value from a hierarchical list
*
extern void optionOnlyUsage(tOptions*, int);
-/* From: autoopts.c line 1071
+/* From: autoopts.c line 1075
*
* optionProcess - this is the main option processing routine
*
extern void optionUnloadNested(tOptionValue const *);
-/* From: version.c line 36
+/* From: version.c line 31
*
* optionVersion - return the compiled AutoOpts version number
*
*
* DO NOT EDIT THIS FILE (usage-txt.h)
*
- * It has been AutoGen-ed December 18, 2010 at 12:13:32 PM by AutoGen 5.11.6pre4
+ * It has been AutoGen-ed February 17, 2011 at 04:58:36 PM by AutoGen 5.11.6
* From the definitions usage-txt.def
* and the template file usage-txt.tpl
*
"\tThis is less than the minimum library version: \0"
"strdup of %d byte string failed\n\0"
"Automated Options version %s\n"
- "\tcopyright (c) 1999-2010 by Bruce Korb - all rights reserved\n\0"
+ "\tcopyright (c) 1999-2011 by Bruce Korb - all rights reserved\n\0"
"AutoOpts lib error: defaulted to option with optional arg\n\0"
"(AutoOpts bug): Aliasing option is out of range.\0"
"all\0"
"ERROR: only \0"
" - examining environment variables named %s_*\n\0"
" \0"
- "Options are specified by doubled hyphens and their name\n"
- "or by a single hyphen and the flag character.\n\0"
+ "Options are specified by doubled hyphens and their name or by a single\n"
+ "hyphen and the flag character.\n\0"
"%%-%ds %%s\n\0"
"fs error %d (%s) on fork - cannot obtain %s usage\n\0"
"fs error %d (%s) on freopen\n\0"
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
* compat.h is free software.
* This file is part of AutoGen.
*
- * AutoGen Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoGen is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*
* This file is part of AutoGen.
*
- * AutoGen Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoGen is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
/**
* \file configfile.c
*
- * Time-stamp: "2010-12-16 14:03:06 bkorb"
+ * Time-stamp: "2011-01-06 16:11:24 bkorb"
*
* configuration/rc/ini file handling.
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
static char *
handle_section(tOptions * pOpts, char * pzText);
+static int
+parse_xml_encoding(char ** ppz);
+
+static char *
+trim_xml_text(char * pztxt, char const * pznm, tOptionLoadMode mode);
+
+static void
+cook_xml_text(char * pzData);
+
static char *
handle_struct(tOptions * pOpts, tOptState * pOS, char * pzText, int dir);
return pzText;
}
+/**
+ * parse XML encodings
+ */
+static int
+parse_xml_encoding(char ** ppz)
+{
+# define XMLTABLE \
+ _xmlNm_(amp, '&') \
+ _xmlNm_(lt, '<') \
+ _xmlNm_(gt, '>') \
+ _xmlNm_(ff, '\f') \
+ _xmlNm_(ht, '\t') \
+ _xmlNm_(cr, '\r') \
+ _xmlNm_(vt, '\v') \
+ _xmlNm_(bel, '\a') \
+ _xmlNm_(nl, '\n') \
+ _xmlNm_(space, ' ') \
+ _xmlNm_(quot, '"') \
+ _xmlNm_(apos, '\'')
+
+ static struct {
+ char const * const nm_str;
+ unsigned short nm_len;
+ short nm_val;
+ } const xml_names[] = {
+# define _xmlNm_(_n, _v) { #_n ";", sizeof(#_n), _v },
+ XMLTABLE
+# undef _xmlNm_
+# undef XMLTABLE
+ };
+
+ static int const nm_ct = sizeof(xml_names) / sizeof(xml_names[0]);
+ int base = 10;
+
+ char * pz = *ppz;
+
+ if (*pz == '#') {
+ pz++;
+ goto parse_number;
+ }
+
+ if (IS_DEC_DIGIT_CHAR(*pz)) {
+ unsigned long v;
+
+ parse_number:
+ switch (*pz) {
+ case 'x': case 'X':
+ /*
+ * Some forms specify hex with: &#xNN;
+ */
+ base = 16;
+ pz++;
+ break;
+
+ case '0':
+ /*
+ *  is hex and  is decimal. Cool.
+ * Ya gotta love it.
+ */
+ if (pz[1] == '0')
+ base = 16;
+ break;
+ }
+
+ v = strtoul(pz, &pz, base);
+ if ((*pz != ';') || (v > 0x7F))
+ return NUL;
+ *ppz = pz + 1;
+ return (int)v;
+ }
+
+ {
+ int ix = 0;
+ do {
+ if (strncmp(pz, xml_names[ix].nm_str, xml_names[ix].nm_len)
+ == 0) {
+ *ppz = pz + xml_names[ix].nm_len;
+ return xml_names[ix].nm_val;
+ }
+ } while (++ix < nm_ct);
+ }
+
+ return NUL;
+}
+
+/**
+ * Find the end marker for the named section of XML.
+ * Trim that text there, trimming trailing white space for all modes
+ * except for OPTION_LOAD_UNCOOKED.
+ */
+static char *
+trim_xml_text(char * pztxt, 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 */;
+
+ if (len > sizeof(z))
+ pz = AGALOC(len, "scan name");
+
+ sprintf(pz, fmt, pznm);
+ *pztxt = ' ';
+ pztxt = strstr(pztxt, pz);
+ if (pz != z) AGFREE(pz);
+
+ if (pztxt == NULL)
+ return pztxt;
+
+ if (mode != OPTION_LOAD_UNCOOKED)
+ while (IS_WHITESPACE_CHAR(pztxt[-1])) len++, pztxt--;
+
+ *pztxt = NUL;
+ return pztxt + len - 1 /* for NUL byte */;
+}
+
+/**
+ */
+static void
+cook_xml_text(char * pzData)
+{
+ char * pzs = pzData;
+ char * pzd = pzData;
+ char bf[4];
+ bf[2] = NUL;
+
+ for (;;) {
+ int ch = ((int)*(pzs++)) & 0xFF;
+ switch (ch) {
+ case NUL:
+ *pzd = NUL;
+ return;
+
+ case '&':
+ *(pzd++) = \
+ ch = parse_xml_encoding(&pzs);
+ if (ch == NUL)
+ return;
+ break;
+
+ case '%':
+ bf[0] = *(pzs++);
+ bf[1] = *(pzs++);
+ if ((bf[0] == NUL) || (bf[1] == NUL)) {
+ *pzd = NUL;
+ return;
+ }
+
+ ch = strtoul(bf, NULL, 16);
+ /* FALLTHROUGH */
+
+ default:
+ *(pzd++) = ch;
+ }
+ }
+}
/**
* "pzText" points to a '<' character, followed by an alpha.
*/
*pcNulPoint = NUL;
pzData = ++pzText;
-
- /*
- * Find the end of the option text and NUL terminate it
- */
- {
- char z[64], *pz = z;
- size_t len = strlen(pzName) + 4;
- if (len > sizeof(z))
- pz = AGALOC(len, "scan name");
-
- sprintf(pz, "</%s>", pzName);
- *pzText = ' ';
- pzText = strstr(pzText, pz);
- if (pz != z) AGFREE(pz);
-
- if (pzText == NULL)
- return pzText;
-
- *pzText = NUL;
-
- pzText += len-1;
- }
+ pzText = trim_xml_text(pzText, pzName, mode);
+ if (pzText == NULL)
+ return pzText;
/*
* Rejoin the name and value for parsing by "loadOptionLine()".
memset(pcNulPoint, ' ', pzData - pcNulPoint);
/*
- * If we are getting a "string" value, the process the XML-ish
- * %XX hex characters.
+ * If we are getting a "string" value that is to be cooked,
+ * then process the XML-ish &xx; XML-ish and %XX hex characters.
*/
- if (valu.valType == OPARG_TYPE_STRING) {
- char * pzSrc = pzData;
- char * pzDst = pzData;
- char bf[4];
- bf[2] = NUL;
-
- for (;;) {
- int ch = ((int)*(pzSrc++)) & 0xFF;
- switch (ch) {
- case NUL: goto string_fixup_done;
-
- case '%':
- bf[0] = *(pzSrc++);
- bf[1] = *(pzSrc++);
- if ((bf[0] == NUL) || (bf[1] == NUL))
- goto string_fixup_done;
- ch = strtoul(bf, NULL, 16);
- /* FALLTHROUGH */
-
- default:
- *(pzDst++) = ch;
- }
- } string_fixup_done:;
- *pzDst = NUL;
- }
+ if ( (valu.valType == OPARG_TYPE_STRING)
+ && (mode == OPTION_LOAD_COOKED))
+ cook_xml_text(pzData);
/*
* "pzName" points to what looks like text for one option/configurable.
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* DO NOT EDIT THIS FILE (genshell.c)
*
- * It has been AutoGen-ed December 18, 2010 at 12:13:31 PM by AutoGen 5.11.6pre4
+ * It has been AutoGen-ed February 17, 2011 at 04:58:35 PM by AutoGen 5.11.6
* From the definitions genshell.def
* and the template file options
*
*
* This source file is copyrighted and licensed under the following terms:
*
- * genshellopt copyright (c) 1999-2009 Bruce Korb - all rights reserved
+ * genshellopt copyright (c) 1999-2011 Bruce Korb - all rights reserved
*
* genshellopt is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
/* TRANSLATORS: choose the translation for option names wisely because you
cannot ever change your mind. */
tSCC zCopyright[] =
- "genshellopt copyright (c) 1999-2009 Bruce Korb, all rights reserved";
+ "genshellopt copyright (c) 1999-2011 Bruce Korb, all rights reserved";
tSCC zCopyrightNotice[610] =
"genshellopt is free software: you can redistribute it and/or modify it under\n\
the terms of the GNU General Public License as published by the Free Software\n\
static char const zBugsAddr[36] = "autogen-users@lists.sourceforge.net";
static char const zExplain[] = "\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\n\
-will be extracted from the script file.\n";
-static char const zDetail[234] = "\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";
+static char const zDetail[237] = "\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";
+by the newly generated text. The first ``#!'' line will be regenerated.\n";
static char const zFullVersion[] = GENSHELLOPT_FULL_VERSION;
-/* extracted from /old-home/bkorb/ag/ag/autoopts/tpl/optcode.tpl near line 504 */
+/* extracted from optcode.tlib near line 504 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
# define PKGDATADIR ""
#endif
+#ifndef WITH_PACKAGER
+# define genshellopt_packager_info NULL
+#else
+static char const genshellopt_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport genshellopt bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+
tOptions genshelloptOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
zExplain, zDetail, optDesc,
zBugsAddr, /* address to send bugs to */
NULL, NULL, /* extensions/saved state */
- genshelloptUsage, /* usage procedure */
+ genshelloptUsage, /* usage procedure */
translate_option_strings, /* translation procedure */
/*
* Indexes to special options
5 /* full option count */, 2 /* user option count */,
genshellopt_full_usage, genshellopt_short_usage,
NULL, NULL,
- PKGDATADIR
+ PKGDATADIR, genshellopt_packager_info
};
/*
(void)pOptions;
USAGE(EXIT_SUCCESS);
}
-/* extracted from /old-home/bkorb/ag/ag/autoopts/tpl/optcode.tpl near line 641 */
+/* extracted from optcode.tlib near line 657 */
#if ENABLE_NLS
#include <stdio.h>
* been changed by the first pass through this code. One shot only.
*/
if (option_usage_text.field_ct != 0) {
-
/*
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
COERSION(pzUsageTitle);
COERSION(pzExplain);
COERSION(pzDetail);
+ COERSION(pzPackager);
option_usage_text.field_ct = 0;
for (ix = genshelloptOptions.optCt; ix > 0; ix--, pOD++)
*
* DO NOT EDIT THIS FILE (genshell.h)
*
- * It has been AutoGen-ed December 18, 2010 at 12:13:31 PM by AutoGen 5.11.6pre4
+ * It has been AutoGen-ed February 17, 2011 at 04:58:35 PM by AutoGen 5.11.6
* From the definitions genshell.def
* and the template file options
*
*
* This source file is copyrighted and licensed under the following terms:
*
- * genshellopt copyright (c) 1999-2009 Bruce Korb - all rights reserved
+ * genshellopt copyright (c) 1999-2011 Bruce Korb - all rights reserved
*
* genshellopt is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
genshelloptOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*genshelloptOptions.pUsageProc)(&genshelloptOptions, c)
-/* extracted from /old-home/bkorb/ag/ag/autoopts/tpl/opthead.tpl near line 435 */
+/* extracted from opthead.tlib near line 435 */
/* * * * * *
*
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
dnl
dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed December 21, 2010 at 02:20:29 PM by AutoGen 5.11.6pre6
+dnl It has been AutoGen-ed February 17, 2011 at 04:58:33 PM by AutoGen 5.11.6
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
dnl
AC_DEFUN([LIBOPTS_WITH_REGEX_HEADER],[
AC_ARG_WITH([regex-header],
- AC_HELP_STRING([--with-regex-header], [a reg expr header is specified]),
+ AS_HELP_STRING([--with-regex-header], [a reg expr header is specified]),
[libopts_cv_with_regex_header=${with_regex_header}],
AC_CACHE_CHECK([whether a reg expr header is specified], libopts_cv_with_regex_header,
libopts_cv_with_regex_header=no)
) # end of AC_ARG_WITH
-
if test "X${libopts_cv_with_regex_header}" != Xno
then
AC_DEFINE_UNQUOTED([REGEX_HEADER],[<${libopts_cv_with_regex_header}>])
AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[
AC_ARG_WITH([libregex],
- AC_HELP_STRING([--with-libregex], [libregex installation prefix]),
+ AS_HELP_STRING([--with-libregex], [libregex installation prefix]),
[libopts_cv_with_libregex_root=${with_libregex}],
AC_CACHE_CHECK([whether with-libregex was specified], libopts_cv_with_libregex_root,
libopts_cv_with_libregex_root=no)
) # end of AC_ARG_WITH libregex
- if test "${with_libguile+set}" = set && \
+ if test "${with_libregex+set}" = set && \
test "${withval}" = no
then ## disabled by request
libopts_cv_with_libregex_root=no
else
AC_ARG_WITH([libregex-cflags],
- AC_HELP_STRING([--with-libregex-cflags], [libregex compile flags]),
+ AS_HELP_STRING([--with-libregex-cflags], [libregex compile flags]),
[libopts_cv_with_libregex_cflags=${with_regex_cflags}],
AC_CACHE_CHECK([whether with-libregex-cflags was specified], libopts_cv_with_libregex_cflags,
libopts_cv_with_libregex_cflags=no)
) # end of AC_ARG_WITH libregex-cflags
AC_ARG_WITH([libregex-libs],
- AC_HELP_STRING([--with-libregex-libs], [libregex link command arguments]),
+ AS_HELP_STRING([--with-libregex-libs], [libregex link command arguments]),
[libopts_cv_with_libregex_libs=${with_regex_libs}],
AC_CACHE_CHECK([whether with-libregex-libs was specified], libopts_cv_with_libregex_libs,
libopts_cv_with_libregex_libs=no)
[libopts_cv_with_libregex=no]) # end of AC_TRY_RUN
]) # end of AC_CACHE_VAL for libopts_cv_with_libregex
AC_MSG_RESULT([${libopts_cv_with_libregex}])
-
if test "X${libopts_cv_with_libregex}" != Xno
then
AC_DEFINE([WITH_LIBREGEX],[1],
) # end of TRY_RUN
]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind
AC_MSG_RESULT([${libopts_cv_run_pathfind}])
-
if test "X${libopts_cv_run_pathfind}" != Xno
then
AC_DEFINE([HAVE_PATHFIND],[1],
dzero=\`ls -lL /dev/zero | egrep ^c......r\`
test -z "${dzero}" && exit 1
echo ${dzero}`
- if test $? -ne 0
- then libopts_cv_test_dev_zero=no
- elif test -z "$libopts_cv_test_dev_zero"
+ if test $? -ne 0 || test -z "$libopts_cv_test_dev_zero"
then libopts_cv_test_dev_zero=no
fi
]) # end of CACHE_VAL of libopts_cv_test_dev_zero
AC_MSG_RESULT([${libopts_cv_test_dev_zero}])
-
if test "X${libopts_cv_test_dev_zero}" != Xno
then
AC_DEFINE([HAVE_DEV_ZERO],[1],
) # end of TRY_RUN
]) # end of AC_CACHE_VAL for libopts_cv_run_realpath
AC_MSG_RESULT([${libopts_cv_run_realpath}])
-
if test "X${libopts_cv_run_realpath}" != Xno
then
AC_DEFINE([HAVE_REALPATH],[1],
) # end of TRY_RUN
]) # end of AC_CACHE_VAL for libopts_cv_run_strftime
AC_MSG_RESULT([${libopts_cv_run_strftime}])
-
if test "X${libopts_cv_run_strftime}" != Xno
then
AC_DEFINE([HAVE_STRFTIME],[1],
) # end of TRY_RUN
]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary
AC_MSG_RESULT([${libopts_cv_run_fopen_binary}])
-
if test "X${libopts_cv_run_fopen_binary}" != Xno
then
AC_DEFINE([FOPEN_BINARY_FLAG],"b",
) # end of TRY_RUN
]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text
AC_MSG_RESULT([${libopts_cv_run_fopen_text}])
-
if test "X${libopts_cv_run_fopen_text}" != Xno
then
AC_DEFINE([FOPEN_TEXT_FLAG],"t",
AC_DEFUN([LIBOPTS_DISABLE_OPTIONAL_ARGS],[
AC_ARG_ENABLE([optional-args],
- AC_HELP_STRING([--disable-optional-args], [not wanting optional option args]),
+ AS_HELP_STRING([--disable-optional-args], [not wanting optional option args]),
[libopts_cv_enable_optional_args=${enable_optional_args}],
AC_CACHE_CHECK([whether not wanting optional option args], libopts_cv_enable_optional_args,
libopts_cv_enable_optional_args=yes)
) # end of AC_ARG_ENABLE
-
if test "X${libopts_cv_enable_optional_args}" = Xno
then
AC_DEFINE([NO_OPTIONAL_OPT_ARGS], [1],
dnl "INVOKE_LIBOPTS_MACROS" macro iff we are building libopts.
dnl
dnl This file is part of AutoGen.
-dnl AutoGen Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+dnl AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
dnl
dnl AutoGen is free software: you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by the
])
dnl AC_CONFIG_FILES conditionalization requires using AM_COND_IF, however
dnl AM_COND_IF is new to Automake 1.11. To use it on new Automake without
-dnl requiring same, a fallback implementation for older Autoconf is provided.
+dnl requiring same, a fallback implementation for older Automake is provided.
dnl Note that disabling of AC_CONFIG_FILES requires Automake 1.11, this code
dnl is correct only in terms of m4sh generated script.
m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
# liboptschk.m4 serial 2 (autogen - 5.11.4)
-dnl Copyright (c) 2005-2010 by Bruce Korb - all rights reserved
+dnl Copyright (c) 2005-2011 by Bruce Korb - all rights reserved
dnl
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
/* Parse a time duration and return a seconds count
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
Written by Bruce Korb <bkorb@gnu.org>, 2008.
This program is free software: you can redistribute it and/or modify
/* Parse a time duration and return a seconds count
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
Written by Bruce Korb <bkorb@gnu.org>, 2008.
This program is free software: you can redistribute it and/or modify
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Sat Dec 18 12:13:39 PST 2010
+ * Generated Thu Feb 17 16:58:43 PST 2011
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
/*
* \file usage.c
*
- * Time-stamp: "2010-12-18 11:41:41 bkorb"
+ * Time-stamp: "2011-02-01 14:42:37 bkorb"
*
* This module implements the default usage procedure for
* Automated Options. It may be overridden, of course.
/*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
case 0: fputs(zOptsOnly, option_usage_fp); break;
}
- if ((opts->fOptSet & OPTPROC_NUM_OPT) != 0) {
+ if ((opts->fOptSet & OPTPROC_NUM_OPT) != 0)
fputs(zNumberOpt, option_usage_fp);
- }
- if ((opts->fOptSet & OPTPROC_REORDER) != 0) {
+ if ((opts->fOptSet & OPTPROC_REORDER) != 0)
fputs(zReorder, option_usage_fp);
- }
if (opts->pzExplain != NULL)
fputs(opts->pzExplain, option_usage_fp);
if (exit_code == EXIT_SUCCESS)
prt_prog_detail(opts);
- if (opts->pzBugAddr != NULL)
+ /*
+ * Give bug notification preference to the packager information
+ */
+ if (HAS_pzPkgDataDir(opts) && (opts->pzPackager != NULL))
+ fputs(opts->pzPackager, option_usage_fp);
+
+ else if (opts->pzBugAddr != NULL)
fprintf(option_usage_fp, zPlsSendBugs, opts->pzBugAddr);
fflush(option_usage_fp);
/*
- * Generated header for gperf generated source Sat Dec 18 12:13:31 PST 2010
+ * Generated header for gperf generated source Thu Feb 17 16:58:35 PST 2011
* This file enumerates the list of names and declares the
* procedure for mapping string names to the enum value.
*/
/*
- * Time-stamp: "2010-09-05 05:53:20 bkorb"
+ * Time-stamp: "2011-02-01 13:20:14 bkorb"
*
* This module implements the default usage procedure for
* Automated Options. It may be overridden, of course.
/*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (c) 1992-2010 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
* 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd
*/
-/* = = = START-STATIC-FORWARD = = = */
-static void
-printVersion(tOptions* pOpts, tOptDesc* pOD, FILE* fp);
-/* = = = END-STATIC-FORWARD = = = */
-
/*=export_func optionVersion
*
* what: return the compiled AutoOpts version number
return zVersion;
}
-
static void
-printVersion(tOptions* pOpts, tOptDesc* pOD, FILE* fp)
+print_ver(tOptions* pOpts, tOptDesc* pOD, FILE* fp)
{
char swCh;
}
fprintf(fp, zAO_Ver, optionVersion());
- if (pOpts->pzBugAddr != NULL)
+
+ if (HAS_pzPkgDataDir(pOpts) && (pOpts->pzPackager != NULL))
+ fputs(pOpts->pzPackager, fp);
+ else if (pOpts->pzBugAddr != NULL)
fprintf(fp, zPlsSendBugs, pOpts->pzBugAddr);
break;
void
optionPrintVersion(tOptions* pOpts, tOptDesc* pOD)
{
- printVersion(pOpts, pOD, stdout);
+ print_ver(pOpts, pOD, stdout);
}
/*=export_func optionVersionStderr
void
optionVersionStderr(tOptions* pOpts, tOptDesc* pOD)
{
- printVersion(pOpts, pOD, stderr);
+ print_ver(pOpts, pOD, stderr);
}
/*
/*
- * Generated header for gperf generated source Sat Dec 18 12:13:30 PST 2010
+ * Generated header for gperf generated source Thu Feb 17 16:58:35 PST 2011
* This file enumerates the list of names and declares the
* procedure for mapping string names to the enum value.
*/
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.c)
*
- * It has been AutoGen-ed January 3, 2011 at 09:07:39 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:29:02 AM by AutoGen 5.11.6
* From the definitions sntp-opts.def
* and the template file options
*
cannot ever change your mind. */
tSCC zCopyright[] =
"sntp copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from copyright.def near line 8 */
;
tSCC zCopyrightNotice[24] =
"see html/copyright.html";
static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org";
static char const zExplain[] = "\n\n";
static char const zDetail[352] = "\n\
-sntp implements the Simple Network Time Protocol, and is used to query\n\
-an NTP or SNTP server and either display the time or set the local\n\
-system's time (given suitable privilege).\n\n\
+sntp implements the Simple Network Time Protocol, and is used to query an\n\
+NTP or SNTP server and either display the time or set the local system's\n\
+time (given suitable privilege).\n\n\
It can be run interactively from the command line or as a cron job.\n\n\
NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC\n\
1305.\n";
static char const zFullVersion[] = SNTP_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 504 */
+/* extracted from optcode.tlib near line 504 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
# define PKGDATADIR ""
#endif
+#ifndef WITH_PACKAGER
+# define sntp_packager_info NULL
+#else
+static char const sntp_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport sntp bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+
tOptions sntpOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
zExplain, zDetail, optDesc,
zBugsAddr, /* address to send bugs to */
NULL, NULL, /* extensions/saved state */
- optionUsage, /* usage procedure */
+ optionUsage, /* usage procedure */
translate_option_strings, /* translation procedure */
/*
* Indexes to special options
17 /* full option count */, 12 /* user option count */,
sntp_full_usage, sntp_short_usage,
NULL, NULL,
- PKGDATADIR
+ PKGDATADIR, sntp_packager_info
};
/*
(void)pOptions;
USAGE(EXIT_SUCCESS);
}
-/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */
+/* extracted from optmain.tlib near line 107 */
#if defined(TEST_SNTP_OPTS) /* TEST MAIN PROCEDURE: */
return res;
}
#endif /* defined TEST_SNTP_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 641 */
+/* extracted from optcode.tlib near line 657 */
#if ENABLE_NLS
#include <stdio.h>
* been changed by the first pass through this code. One shot only.
*/
if (option_usage_text.field_ct != 0) {
-
/*
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
COERSION(pzUsageTitle);
COERSION(pzExplain);
COERSION(pzDetail);
+ COERSION(pzPackager);
option_usage_text.field_ct = 0;
for (ix = sntpOptions.optCt; ix > 0; ix--, pOD++)
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.h)
*
- * It has been AutoGen-ed January 3, 2011 at 09:07:39 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:29:02 AM by AutoGen 5.11.6
* From the definitions sntp-opts.def
* and the template file options
*
sntpOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*sntpOptions.pUsageProc)(&sntpOptions, c)
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 435 */
+/* extracted from opthead.tlib near line 435 */
/* * * * * *
*
/*
* EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c)
*
- * It has been AutoGen-ed January 3, 2011 at 09:18:50 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:29:04 AM by AutoGen 5.11.6
* From the definitions ntp-keygen-opts.def
* and the template file options
*
cannot ever change your mind. */
tSCC zCopyright[] =
"ntp-keygen copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from ../include/copyright.def near line 8 */
+/* extracted from copyright.def near line 8 */
;
tSCC zCopyrightNotice[24] =
"see html/copyright.html";
static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org";
#define zExplain NULL
-static char const zDetail[98] = "\n\
-If there is no new host key, look for an existing one.\n\
-If one is not found, create it.\n";
+static char const zDetail[99] = "\n\
+If there is no new host key, look for an existing one. If one is not\n\
+found, create it.\n";
static char const zFullVersion[] = NTP_KEYGEN_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 504 */
+/* extracted from optcode.tlib near line 504 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
# define PKGDATADIR ""
#endif
+#ifndef WITH_PACKAGER
+# define ntp_keygen_packager_info NULL
+#else
+static char const ntp_keygen_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntp_keygen bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+
tOptions ntp_keygenOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
zExplain, zDetail, optDesc,
zBugsAddr, /* address to send bugs to */
NULL, NULL, /* extensions/saved state */
- optionUsage, /* usage procedure */
+ optionUsage, /* usage procedure */
translate_option_strings, /* translation procedure */
/*
* Indexes to special options
23 /* full option count */, 18 /* user option count */,
ntp_keygen_full_usage, ntp_keygen_short_usage,
NULL, NULL,
- PKGDATADIR
+ PKGDATADIR, ntp_keygen_packager_info
};
/*
static void
doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
{
- /* extracted from ../include/debug-opt.def, line 27 */
+ /* extracted from debug-opt.def, line 27 */
DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
}
#endif /* defined(TEST_NTP_KEYGEN_OPTS) */
pOptDesc->optArg.argInt = val;
}
#endif /* defined OPENSSL */
-/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */
+/* extracted from optmain.tlib near line 107 */
#if defined(TEST_NTP_KEYGEN_OPTS) /* TEST MAIN PROCEDURE: */
return res;
}
#endif /* defined TEST_NTP_KEYGEN_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 641 */
+/* extracted from optcode.tlib near line 657 */
#if ENABLE_NLS
#include <stdio.h>
* been changed by the first pass through this code. One shot only.
*/
if (option_usage_text.field_ct != 0) {
-
/*
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
COERSION(pzUsageTitle);
COERSION(pzExplain);
COERSION(pzDetail);
+ COERSION(pzPackager);
option_usage_text.field_ct = 0;
for (ix = ntp_keygenOptions.optCt; ix > 0; ix--, pOD++)
/*
* EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h)
*
- * It has been AutoGen-ed January 3, 2011 at 09:18:50 PM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed February 22, 2011 at 12:29:03 AM by AutoGen 5.11.6
* From the definitions ntp-keygen-opts.def
* and the template file options
*
ntp_keygenOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntp_keygenOptions.pUsageProc)(&ntp_keygenOptions, c)
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 435 */
+/* extracted from opthead.tlib near line 435 */
/* * * * * *
*