From: Dave Hart Date: Sat, 20 Nov 2010 23:22:10 +0000 (+0000) Subject: remove Autogen 5.10 --wait-sync workaround from ntpdbase-opts.def, ntpd.c X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abc4aa6c77add2f4577ff36344d246102f3f37dc;p=thirdparty%2Fntp.git remove Autogen 5.10 --wait-sync workaround from ntpdbase-opts.def, ntpd.c bk: 4ce85822L1RTAamsUgRzR6A0nad2XQ --- diff --git a/ntpd/ntpd-opts.c b/ntpd/ntpd-opts.c index 2c0dcf4e60..cb6633b1a6 100644 --- a/ntpd/ntpd-opts.c +++ b/ntpd/ntpd-opts.c @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntpd-opts.c) * - * It has been AutoGen-ed November 17, 2010 at 10:07:55 AM by AutoGen 5.10 + * It has been AutoGen-ed November 20, 2010 at 10:16:13 PM by AutoGen 5.11.2 * From the definitions ntpd-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 - * ntpd 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 33:3:8 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 ntpd 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: * @@ -70,10 +68,10 @@ extern tUsageProc optionUsage; * 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 }; @@ -83,10 +81,10 @@ static const int * 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 }; @@ -96,10 +94,10 @@ static const int * 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 }; @@ -109,10 +107,10 @@ static const int * 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 }; @@ -121,19 +119,19 @@ static const int /* * 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)) @@ -141,121 +139,121 @@ tSCC zConfigfile_Name[] = "configfile"; * 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 -tSCC zDebug_Level_Name[] = "debug-level"; -tSCC zDebug_LevelText[] = "this package was built using 'configure --disable--debug'"; +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 -tSCC zSet_Debug_Level_Name[] = "set-debug-level"; -tSCC zSet_Debug_LevelText[] = "this package was built using 'configure --disable--debug'"; +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 -tSCC zJaildir_Name[] = "jaildir"; -tSCC zJaildirText[] = "built without --enable-clockctl or --enable-linuxcaps"; +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 */ @@ -269,10 +267,10 @@ tSCC zModifymmtimer_Name[] = "modifymmtimer"; * Nofork option description with * "Must also have options" and "Incompatible options": */ -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"; static const int aNoforkCantList[] = { INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT }; @@ -281,29 +279,29 @@ static const int /* * 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)) @@ -311,10 +309,10 @@ tSCC zPriority_Name[] = "priority"; * Quit option description with * "Must also have options" and "Incompatible options": */ -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"; static const int aQuitCantList[] = { INDEX_OPT_SAVECONFIGQUIT, @@ -324,10 +322,10 @@ static const int /* * 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)) @@ -336,10 +334,10 @@ tSCC zPropagationdelay_Name[] = "propagationdelay"; * "Must also have options" and "Incompatible options": */ #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"; static const int aSaveconfigquitCantList[] = { INDEX_OPT_QUIT, @@ -358,20 +356,20 @@ static const int /* * 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)) @@ -379,47 +377,47 @@ tSCC zTrustedkey_Name[] = "trustedkey"; * 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 -tSCC zUser_Name[] = "user"; -tSCC zUserText[] = "built without --enable-clockctl or --enable-linuxcaps"; +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)) @@ -428,17 +426,17 @@ tSCC zDvar_Name[] = "dvar"; * "Must also have options" and "Incompatible options": */ #ifdef HAVE_WORKING_FORK -tSCC zWait_SyncText[] = +static char const zWait_SyncText[] = "Seconds to wait for first clock sync"; -tSCC zWait_Sync_NAME[] = "WAIT_SYNC"; -tSCC zWait_Sync_Name[] = "wait-sync"; +static char const zWait_Sync_NAME[] = "WAIT_SYNC"; +static char const zWait_Sync_Name[] = "wait-sync"; static const int aWait_SyncCantList[] = { INDEX_OPT_NOFORK, INDEX_OPT_QUIT, INDEX_OPT_SAVECONFIGQUIT, NO_EQUIVALENT }; #define WAIT_SYNC_FLAGS (OPTST_DISABLED \ - | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) #else /* disable Wait_Sync */ #define WAIT_SYNC_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) @@ -451,20 +449,20 @@ static const int /* * 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 */ @@ -478,10 +476,10 @@ tSCC zUsepcc_Name[] = "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)) @@ -495,12 +493,12 @@ tSCC zPccfreq_Name[] = "pccfreq"; /* * 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 @@ -513,8 +511,8 @@ tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif -tSCC zVersionText[] = "Output version information and exit"; -tSCC zVersion_Name[] = "version"; +static char const zVersionText[] = "Output version information and exit"; +static char const zVersion_Name[] = "version"; /* * Declare option callback procedures */ @@ -523,19 +521,11 @@ tSCC zVersion_Name[] = "version"; #else /* not DEBUG */ # define doOptSet_Debug_Level NULL #endif /* def/not DEBUG */ -#ifdef HAVE_WORKING_FORK - static tOptProc doOptWait_Sync; -#else /* not HAVE_WORKING_FORK */ -# define doOptWait_Sync NULL -#endif /* def/not HAVE_WORKING_FORK */ #if defined(TEST_NTPD_OPTS) /* * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ -extern tOptProc - optionNumericVal, optionPagedUsage, optionStackArg, - optionVersionStderr; static tOptProc doUsageOpt; @@ -543,7 +533,6 @@ static tOptProc * #define map the "normal" callout procs to the test ones... */ #define SET_DEBUG_LEVEL_OPT_PROC optionStackArg -#define WAIT_SYNC_OPT_PROC optionStackArg #else /* NOT defined TEST_NTPD_OPTS */ @@ -551,7 +540,10 @@ static tOptProc * 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; @@ -559,10 +551,8 @@ static tOptProc * #define map the "normal" callout procs */ #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level -#define WAIT_SYNC_OPT_PROC doOptWait_Sync #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level -#define WAIT_SYNC_OPT_PROC doOptWait_Sync #endif /* defined(TEST_NTPD_OPTS) */ #ifdef TEST_NTPD_OPTS # define DOVERPROC optionVersionStderr @@ -931,7 +921,7 @@ static tOptDesc optDesc[ OPTION_CT ] = { /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aWait_SyncCantList, - /* option proc */ WAIT_SYNC_OPT_PROC, + /* option proc */ optionNumericVal, /* desc, NAME, name */ zWait_SyncText, zWait_Sync_NAME, zWait_Sync_Name, /* disablement strs */ NULL, NULL }, @@ -1026,7 +1016,7 @@ tSCC zBugsAddr[] = "http://bugs.ntp.org, bugs@ntp.org"; #define zExplain NULL tSCC zDetail[] = "\n\n"; tSCC zFullVersion[] = NTPD_FULL_VERSION; -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 495 */ +/* extracted from /usr/local/share/autogen/optcode.tpl near line 493 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -1047,7 +1037,8 @@ tOptions ntpdOptions = { + OPTPROC_SHORTOPT + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT - + OPTPROC_ENVIRON ), + + OPTPROC_ENVIRON + + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zCopyrightNotice, @@ -1079,7 +1070,7 @@ doUsageOpt( tOptDesc* pOptDesc ) { (void)pOptions; - USAGE( EXIT_SUCCESS ); + USAGE(EXIT_SUCCESS); } #if ! defined(TEST_NTPD_OPTS) @@ -1097,39 +1088,25 @@ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); } #endif /* defined DEBUG */ #endif /* defined(TEST_NTPD_OPTS) */ - -#if ! defined(TEST_NTPD_OPTS) - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * For the wait-sync option, when HAVE_WORKING_FORK is #define-d. - */ -#ifdef HAVE_WORKING_FORK -static void -doOptWait_Sync(tOptions* pOptions, tOptDesc* pOptDesc) -{ - /* extracted from ntpdbase-opts.def, line 423 */ -extern tOptProc optionNumericVal; -optionNumericVal(pOptions, pOptDesc); -} -#endif /* defined HAVE_WORKING_FORK */ -#endif /* defined(TEST_NTPD_OPTS) */ -/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 109 */ +/* extracted from /usr/local/share/autogen/optmain.tpl near line 107 */ #if defined(TEST_NTPD_OPTS) /* TEST MAIN PROCEDURE: */ -extern void optionPutShell( tOptions* ); +extern void optionPutShell(tOptions*); int main(int argc, char** argv) { int res = EXIT_SUCCESS; - (void)optionProcess( &ntpdOptions, argc, argv ); - optionPutShell( &ntpdOptions ); + (void)optionProcess(&ntpdOptions, argc, argv); + optionPutShell(&ntpdOptions); + res = ferror(stdout); + if (res != 0) + fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_NTPD_OPTS */ -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 627 */ +/* extracted from /usr/local/share/autogen/optcode.tpl near line 626 */ #if ENABLE_NLS #include @@ -1138,11 +1115,11 @@ main(int argc, char** argv) #include #include -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) @@ -1150,10 +1127,10 @@ AO_gettext( char const* pz ) 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; } @@ -1166,7 +1143,7 @@ static void coerce_it(void** s) { *s = AO_gettext(*s); } * 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 diff --git a/ntpd/ntpd-opts.h b/ntpd/ntpd-opts.h index 67c30725ac..68cae1c732 100644 --- a/ntpd/ntpd-opts.h +++ b/ntpd/ntpd-opts.h @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntpd-opts.h) * - * It has been AutoGen-ed November 17, 2010 at 10:07:55 AM by AutoGen 5.10 + * It has been AutoGen-ed November 20, 2010 at 10:16:12 PM by AutoGen 5.11.2 * From the definitions ntpd-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 - * ntpd 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 33:3:8 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 ntpd 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: * @@ -41,7 +39,7 @@ * 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 135171 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -97,7 +95,7 @@ typedef enum { /* * 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) (ntpdOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) @@ -111,7 +109,7 @@ typedef enum { #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 ) @@ -325,6 +323,10 @@ typedef enum { #define VALUE_OPT_VAR 27 #define VALUE_OPT_DVAR 28 #define VALUE_OPT_WAIT_SYNC 'w' +#ifdef HAVE_WORKING_FORK + +#define OPT_VALUE_WAIT_SYNC (DESC(WAIT_SYNC).optArg.argInt) +#endif /* HAVE_WORKING_FORK */ #define VALUE_OPT_SLEW 'x' #define VALUE_OPT_USEPCC 31 #define VALUE_OPT_PCCFREQ 32 @@ -334,14 +336,14 @@ typedef enum { /* * Interface defines not associated with particular options */ -#define ERRSKIP_OPTERR STMTS( ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP ) -#define ERRSTOP_OPTERR STMTS( ntpdOptions.fOptSet |= OPTPROC_ERRSTOP ) +#define ERRSKIP_OPTERR STMTS(ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(ntpdOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ ntpdOptions.curOptIdx = (n); \ - ntpdOptions.pzCurOpt = NULL ) + 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 409 */ +#define USAGE(c) (*ntpdOptions.pUsageProc)(&ntpdOptions, c) +/* extracted from /usr/local/share/autogen/opthead.tpl near line 408 */ /* * * * * * * @@ -356,9 +358,9 @@ extern tOptions ntpdOptions; #if defined(ENABLE_NLS) # ifndef _ # include - 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 /* _() */ diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index 84531899e2..422977d68b 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -754,8 +754,7 @@ ntpdmain( do { /* 'loop' once */ if (!HAVE_OPT( WAIT_SYNC )) break; -/* should be wait_sync = OPT_VALUE_WAIT_SYNC; after Autogen 5.10 fixed */ - wait_sync = DESC(WAIT_SYNC).optArg.argInt; + wait_sync = OPT_VALUE_WAIT_SYNC; if (wait_sync <= 0) { wait_sync = 0; break; diff --git a/ntpd/ntpdbase-opts.def b/ntpd/ntpdbase-opts.def index 80ec5159b1..5a7f0e2433 100644 --- a/ntpd/ntpdbase-opts.def +++ b/ntpd/ntpdbase-opts.def @@ -417,12 +417,7 @@ flag = { ifdef = HAVE_WORKING_FORK; name = wait-sync; value = w; - /* arg-type = number; */ /* doesn't compile on Windows with Autogen 5.10 output, instead: */ - arg-type = string; - flag-code = <<- _EOF_ - extern tOptProc optionNumericVal; - optionNumericVal(pOptions, pOptDesc); - _EOF_; + arg-type = number; flags-cant = nofork; flags-cant = quit; flags-cant = saveconfigquit;