2 * EDIT THIS FILE WITH CAUTION (ntpdsim-opts.c)
4 * It has been AutoGen-ed Tuesday December 8, 2009 at 08:13:13 AM EST
5 * From the definitions ntpdsim-opts.def
6 * and the template file options
8 * Generated from AutoOpts 29:0:4 templates.
12 * This file was produced by an AutoOpts template. AutoOpts is a
13 * copyrighted work. This source file is not encumbered by AutoOpts
14 * licensing, but is provided under the licensing terms chosen by the
15 * ntpdsim author or copyright holder. AutoOpts is licensed under
16 * the terms of the LGPL. The redistributable library (``libopts'') is
17 * licensed under the terms of either the LGPL or, at the users discretion,
18 * the BSD license. See the AutoOpts and/or libopts sources for details.
20 * This source file is copyrighted and licensed under the following terms:
22 * ntpdsim copyright 1970-2009 David L. Mills and/or others - all rights reserved
24 * see html/copyright.html
30 #define OPTION_CODE_COMPILE 1
31 #include "ntpdsim-opts.h"
37 "ntpdsim copyright (c) 1970-2009 David L. Mills and/or others, all rights reserved";
38 tSCC zCopyrightNotice[] =
40 /* extracted from ../include/copyright.def near line 8 */
41 "see html/copyright.html";
42 extern tUsageProc optionUsage;
45 * global included definitions
48 extern int atoi(const char*);
57 # define EXIT_SUCCESS 0
60 # define EXIT_FAILURE 1
63 * Ipv4 option description:
66 "Force IPv4 DNS name resolution";
67 tSCC zIpv4_NAME[] = "IPV4";
68 tSCC zIpv4_Name[] = "ipv4";
69 #define IPV4_FLAGS (OPTST_DISABLED)
72 * Ipv6 option description:
75 "Force IPv6 DNS name resolution";
76 tSCC zIpv6_NAME[] = "IPV6";
77 tSCC zIpv6_Name[] = "ipv6";
78 #define IPV6_FLAGS (OPTST_DISABLED)
81 * Authreq option description with
82 * "Must also have options" and "Incompatible options":
85 "Require crypto authentication";
86 tSCC zAuthreq_NAME[] = "AUTHREQ";
87 tSCC zAuthreq_Name[] = "authreq";
89 aAuthreqCantList[] = {
90 INDEX_OPT_AUTHNOREQ, NO_EQUIVALENT };
91 #define AUTHREQ_FLAGS (OPTST_DISABLED)
94 * Authnoreq option description with
95 * "Must also have options" and "Incompatible options":
97 tSCC zAuthnoreqText[] =
98 "Do not require crypto authentication";
99 tSCC zAuthnoreq_NAME[] = "AUTHNOREQ";
100 tSCC zAuthnoreq_Name[] = "authnoreq";
102 aAuthnoreqCantList[] = {
103 INDEX_OPT_AUTHREQ, NO_EQUIVALENT };
104 #define AUTHNOREQ_FLAGS (OPTST_DISABLED)
107 * Bcastsync option description:
109 tSCC zBcastsyncText[] =
110 "Allow us to sync to broadcast servers";
111 tSCC zBcastsync_NAME[] = "BCASTSYNC";
112 tSCC zBcastsync_Name[] = "bcastsync";
113 #define BCASTSYNC_FLAGS (OPTST_DISABLED)
116 * Simbroadcastdelay option description:
118 tSCC zSimbroadcastdelayText[] =
119 "Simulator broadcast delay";
120 tSCC zSimbroadcastdelay_NAME[] = "SIMBROADCASTDELAY";
121 tSCC zSimbroadcastdelay_Name[] = "simbroadcastdelay";
122 #define SIMBROADCASTDELAY_FLAGS (OPTST_DISABLED \
123 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
126 * Configfile option description:
128 tSCC zConfigfileText[] =
129 "configuration file name";
130 tSCC zConfigfile_NAME[] = "CONFIGFILE";
131 tSCC zConfigfile_Name[] = "configfile";
132 #define CONFIGFILE_FLAGS (OPTST_DISABLED \
133 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
136 * Phasenoise option description:
138 tSCC zPhasenoiseText[] =
140 tSCC zPhasenoise_NAME[] = "PHASENOISE";
141 tSCC zPhasenoise_Name[] = "phasenoise";
142 #define PHASENOISE_FLAGS (OPTST_DISABLED \
143 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
146 * Debug_Level option description:
149 tSCC zDebug_LevelText[] =
150 "Increase output debug message level";
151 tSCC zDebug_Level_NAME[] = "DEBUG_LEVEL";
152 tSCC zDebug_Level_Name[] = "debug-level";
153 #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED)
155 #else /* disable Debug_Level */
156 #define VALUE_OPT_DEBUG_LEVEL NO_EQUIVALENT
157 #define DEBUG_LEVEL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
158 #define zDebug_LevelText NULL
159 #define zDebug_Level_NAME NULL
160 #define zDebug_Level_Name NULL
164 * Set_Debug_Level option description:
167 tSCC zSet_Debug_LevelText[] =
168 "Set the output debug message level";
169 tSCC zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL";
170 tSCC zSet_Debug_Level_Name[] = "set-debug-level";
171 #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \
172 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
174 #else /* disable Set_Debug_Level */
175 #define VALUE_OPT_SET_DEBUG_LEVEL NO_EQUIVALENT
176 #define SET_DEBUG_LEVEL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
177 #define zSet_Debug_LevelText NULL
178 #define zSet_Debug_Level_NAME NULL
179 #define zSet_Debug_Level_Name NULL
183 * Driftfile option description:
185 tSCC zDriftfileText[] =
186 "frequency drift file name";
187 tSCC zDriftfile_NAME[] = "DRIFTFILE";
188 tSCC zDriftfile_Name[] = "driftfile";
189 #define DRIFTFILE_FLAGS (OPTST_DISABLED \
190 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
193 * Panicgate option description:
195 tSCC zPanicgateText[] =
196 "Allow the first adjustment to be Big";
197 tSCC zPanicgate_NAME[] = "PANICGATE";
198 tSCC zPanicgate_Name[] = "panicgate";
199 #define PANICGATE_FLAGS (OPTST_DISABLED)
202 * Simslew option description:
204 tSCC zSimslewText[] =
206 tSCC zSimslew_NAME[] = "SIMSLEW";
207 tSCC zSimslew_Name[] = "simslew";
208 #define SIMSLEW_FLAGS (OPTST_DISABLED \
209 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
212 * Jaildir option description:
214 tSCC zJaildirText[] =
216 tSCC zJaildir_NAME[] = "JAILDIR";
217 tSCC zJaildir_Name[] = "jaildir";
218 #define JAILDIR_FLAGS (OPTST_DISABLED \
219 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
222 * Interface option description:
224 tSCC zInterfaceText[] =
225 "Listen on interface";
226 tSCC zInterface_NAME[] = "INTERFACE";
227 tSCC zInterface_Name[] = "interface";
228 #define INTERFACE_FLAGS (OPTST_DISABLED | OPTST_STACKED \
229 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
232 * Keyfile option description:
234 tSCC zKeyfileText[] =
235 "path to symmetric keys";
236 tSCC zKeyfile_NAME[] = "KEYFILE";
237 tSCC zKeyfile_Name[] = "keyfile";
238 #define KEYFILE_FLAGS (OPTST_DISABLED \
239 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
242 * Logfile option description:
244 tSCC zLogfileText[] =
245 "path to the log file";
246 tSCC zLogfile_NAME[] = "LOGFILE";
247 tSCC zLogfile_Name[] = "logfile";
248 #define LOGFILE_FLAGS (OPTST_DISABLED \
249 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
252 * Novirtualips option description:
254 tSCC zNovirtualipsText[] =
255 "Do not listen to virtual IPs";
256 tSCC zNovirtualips_NAME[] = "NOVIRTUALIPS";
257 tSCC zNovirtualips_Name[] = "novirtualips";
258 #define NOVIRTUALIPS_FLAGS (OPTST_DISABLED)
261 * Modifymmtimer option description:
264 tSCC zModifymmtimerText[] =
265 "Modify Multimedia Timer (Windows only)";
266 tSCC zModifymmtimer_NAME[] = "MODIFYMMTIMER";
267 tSCC zModifymmtimer_Name[] = "modifymmtimer";
268 #define MODIFYMMTIMER_FLAGS (OPTST_DISABLED)
270 #else /* disable Modifymmtimer */
271 #define VALUE_OPT_MODIFYMMTIMER NO_EQUIVALENT
272 #define MODIFYMMTIMER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
273 #define zModifymmtimerText NULL
274 #define zModifymmtimer_NAME NULL
275 #define zModifymmtimer_Name NULL
276 #endif /* SYS_WINNT */
279 * Nofork option description:
283 tSCC zNofork_NAME[] = "NOFORK";
284 tSCC zNofork_Name[] = "nofork";
285 #define NOFORK_FLAGS (OPTST_DISABLED)
288 * Nice option description:
291 "Run at high priority";
292 tSCC zNice_NAME[] = "NICE";
293 tSCC zNice_Name[] = "nice";
294 #define NICE_FLAGS (OPTST_DISABLED)
297 * Servertime option description:
299 tSCC zServertimeText[] =
301 tSCC zServertime_NAME[] = "SERVERTIME";
302 tSCC zServertime_Name[] = "servertime";
303 #define SERVERTIME_FLAGS (OPTST_DISABLED \
304 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
307 * Pidfile option description:
309 tSCC zPidfileText[] =
310 "path to the PID file";
311 tSCC zPidfile_NAME[] = "PIDFILE";
312 tSCC zPidfile_Name[] = "pidfile";
313 #define PIDFILE_FLAGS (OPTST_DISABLED \
314 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
317 * Priority option description:
319 tSCC zPriorityText[] =
321 tSCC zPriority_NAME[] = "PRIORITY";
322 tSCC zPriority_Name[] = "priority";
323 #define PRIORITY_FLAGS (OPTST_DISABLED \
324 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
327 * Quit option description:
330 "Set the time and quit";
331 tSCC zQuit_NAME[] = "QUIT";
332 tSCC zQuit_Name[] = "quit";
333 #define QUIT_FLAGS (OPTST_DISABLED)
336 * Propagationdelay option description:
338 tSCC zPropagationdelayText[] =
339 "Broadcast/propagation delay";
340 tSCC zPropagationdelay_NAME[] = "PROPAGATIONDELAY";
341 tSCC zPropagationdelay_Name[] = "propagationdelay";
342 #define PROPAGATIONDELAY_FLAGS (OPTST_DISABLED \
343 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
346 * Updateinterval option description:
348 tSCC zUpdateintervalText[] =
349 "interval in seconds between scans for new or dropped interfaces";
350 tSCC zUpdateinterval_NAME[] = "UPDATEINTERVAL";
351 tSCC zUpdateinterval_Name[] = "updateinterval";
352 #define UPDATEINTERVAL_FLAGS (OPTST_DISABLED \
353 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
356 * Statsdir option description:
358 tSCC zStatsdirText[] =
359 "Statistics file location";
360 tSCC zStatsdir_NAME[] = "STATSDIR";
361 tSCC zStatsdir_Name[] = "statsdir";
362 #define STATSDIR_FLAGS (OPTST_DISABLED \
363 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
366 * Endsimtime option description:
368 tSCC zEndsimtimeText[] =
369 "Simulation end time";
370 tSCC zEndsimtime_NAME[] = "ENDSIMTIME";
371 tSCC zEndsimtime_Name[] = "endsimtime";
372 #define ENDSIMTIME_FLAGS (OPTST_DISABLED \
373 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
376 * Trustedkey option description:
378 tSCC zTrustedkeyText[] =
379 "Trusted key number";
380 tSCC zTrustedkey_NAME[] = "TRUSTEDKEY";
381 tSCC zTrustedkey_Name[] = "trustedkey";
382 #define TRUSTEDKEY_FLAGS (OPTST_DISABLED | OPTST_STACKED \
383 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
386 * Freqerr option description:
388 tSCC zFreqerrText[] =
389 "Simulation frequency error";
390 tSCC zFreqerr_NAME[] = "FREQERR";
391 tSCC zFreqerr_Name[] = "freqerr";
392 #define FREQERR_FLAGS (OPTST_DISABLED \
393 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
396 * Walknoise option description:
398 tSCC zWalknoiseText[] =
399 "Simulation random walk noise";
400 tSCC zWalknoise_NAME[] = "WALKNOISE";
401 tSCC zWalknoise_Name[] = "walknoise";
402 #define WALKNOISE_FLAGS (OPTST_DISABLED \
403 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
406 * User option description:
409 "Run as userid (or userid:groupid)";
410 tSCC zUser_NAME[] = "USER";
411 tSCC zUser_Name[] = "user";
412 #define USER_FLAGS (OPTST_DISABLED \
413 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
416 * Var option description:
419 "make ARG an ntp variable (RW)";
420 tSCC zVar_NAME[] = "VAR";
421 tSCC zVar_Name[] = "var";
422 #define VAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
423 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
426 * Dvar option description:
429 "make ARG an ntp variable (RW|DEF)";
430 tSCC zDvar_NAME[] = "DVAR";
431 tSCC zDvar_Name[] = "dvar";
432 #define DVAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
433 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
436 * Slew option description:
439 "Slew up to 600 seconds";
440 tSCC zSlew_NAME[] = "SLEW";
441 tSCC zSlew_Name[] = "slew";
442 #define SLEW_FLAGS (OPTST_DISABLED)
445 * Ndelay option description:
448 "Simulation network delay";
449 tSCC zNdelay_NAME[] = "NDELAY";
450 tSCC zNdelay_Name[] = "ndelay";
451 #define NDELAY_FLAGS (OPTST_DISABLED \
452 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
455 * Pdelay option description:
458 "Simulation processing delay";
459 tSCC zPdelay_NAME[] = "PDELAY";
460 tSCC zPdelay_Name[] = "pdelay";
461 #define PDELAY_FLAGS (OPTST_DISABLED \
462 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
465 * Help/More_Help/Version option descriptions:
467 tSCC zHelpText[] = "Display usage information and exit";
468 tSCC zHelp_Name[] = "help";
470 tSCC zMore_HelpText[] = "Extended usage information passed thru pager";
471 tSCC zMore_Help_Name[] = "more-help";
473 tSCC zVersionText[] = "Output version information and exit";
474 tSCC zVersion_Name[] = "version";
477 * Save/Load_Opts option description:
479 tSCC zSave_OptsText[] = "Save the option state to a config file";
480 tSCC zSave_Opts_Name[] = "save-opts";
482 tSCC zLoad_OptsText[] = "Load options from a config file";
483 tSCC zLoad_Opts_NAME[] = "LOAD_OPTS";
485 tSCC zNotLoad_Opts_Name[] = "no-load-opts";
486 tSCC zNotLoad_Opts_Pfx[] = "no";
487 #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3)
489 * Declare option callback procedures
492 static tOptProc doOptSet_Debug_Level;
493 #else /* not DEBUG */
494 # define doOptSet_Debug_Level NULL
495 #endif /* def/not DEBUG */
496 #if defined(TEST_NTPDSIM_OPTS)
498 * Under test, omit argument processing, or call optionStackArg,
499 * if multiple copies are allowed.
502 optionNumericVal, optionPagedUsage, optionStackArg,
508 * #define map the "normal" callout procs to the test ones...
510 #define SET_DEBUG_LEVEL_OPT_PROC optionStackArg
513 #else /* NOT defined TEST_NTPDSIM_OPTS */
515 * When not under test, there are different procs to use
518 optionNumericVal, optionPagedUsage, optionPrintVersion, optionStackArg;
523 * #define map the "normal" callout procs
525 #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level
527 #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level
528 #endif /* defined(TEST_NTPDSIM_OPTS) */
529 #ifdef TEST_NTPDSIM_OPTS
530 # define DOVERPROC optionVersionStderr
532 # define DOVERPROC optionPrintVersion
533 #endif /* TEST_NTPDSIM_OPTS */
535 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
537 * Define the Ntpdsim Option Descriptions.
539 static tOptDesc optDesc[ OPTION_CT ] = {
540 { /* entry idx, value */ 0, VALUE_OPT_IPV4,
541 /* equiv idx, value */ NO_EQUIVALENT, 0,
542 /* equivalenced to */ NO_EQUIVALENT,
543 /* min, max, act ct */ 0, 1, 0,
544 /* opt state flags */ IPV4_FLAGS, 0,
545 /* last opt argumnt */ { NULL },
546 /* arg list/cookie */ NULL,
547 /* must/cannot opts */ NULL, NULL,
548 /* option proc */ NULL,
549 /* desc, NAME, name */ zIpv4Text, zIpv4_NAME, zIpv4_Name,
550 /* disablement strs */ NULL, NULL },
552 { /* entry idx, value */ 1, VALUE_OPT_IPV6,
553 /* equiv idx, value */ NOLIMIT, NOLIMIT,
554 /* equivalenced to */ INDEX_OPT_IPV4,
555 /* min, max, act ct */ 0, 1, 0,
556 /* opt state flags */ IPV6_FLAGS, 0,
557 /* last opt argumnt */ { NULL },
558 /* arg list/cookie */ NULL,
559 /* must/cannot opts */ NULL, NULL,
560 /* option proc */ NULL,
561 /* desc, NAME, name */ zIpv6Text, zIpv6_NAME, zIpv6_Name,
562 /* disablement strs */ NULL, NULL },
564 { /* entry idx, value */ 2, VALUE_OPT_AUTHREQ,
565 /* equiv idx, value */ 2, VALUE_OPT_AUTHREQ,
566 /* equivalenced to */ NO_EQUIVALENT,
567 /* min, max, act ct */ 0, 1, 0,
568 /* opt state flags */ AUTHREQ_FLAGS, 0,
569 /* last opt argumnt */ { NULL },
570 /* arg list/cookie */ NULL,
571 /* must/cannot opts */ NULL, aAuthreqCantList,
572 /* option proc */ NULL,
573 /* desc, NAME, name */ zAuthreqText, zAuthreq_NAME, zAuthreq_Name,
574 /* disablement strs */ NULL, NULL },
576 { /* entry idx, value */ 3, VALUE_OPT_AUTHNOREQ,
577 /* equiv idx, value */ 3, VALUE_OPT_AUTHNOREQ,
578 /* equivalenced to */ NO_EQUIVALENT,
579 /* min, max, act ct */ 0, 1, 0,
580 /* opt state flags */ AUTHNOREQ_FLAGS, 0,
581 /* last opt argumnt */ { NULL },
582 /* arg list/cookie */ NULL,
583 /* must/cannot opts */ NULL, aAuthnoreqCantList,
584 /* option proc */ NULL,
585 /* desc, NAME, name */ zAuthnoreqText, zAuthnoreq_NAME, zAuthnoreq_Name,
586 /* disablement strs */ NULL, NULL },
588 { /* entry idx, value */ 4, VALUE_OPT_BCASTSYNC,
589 /* equiv idx, value */ 4, VALUE_OPT_BCASTSYNC,
590 /* equivalenced to */ NO_EQUIVALENT,
591 /* min, max, act ct */ 0, 1, 0,
592 /* opt state flags */ BCASTSYNC_FLAGS, 0,
593 /* last opt argumnt */ { NULL },
594 /* arg list/cookie */ NULL,
595 /* must/cannot opts */ NULL, NULL,
596 /* option proc */ NULL,
597 /* desc, NAME, name */ zBcastsyncText, zBcastsync_NAME, zBcastsync_Name,
598 /* disablement strs */ NULL, NULL },
600 { /* entry idx, value */ 5, VALUE_OPT_SIMBROADCASTDELAY,
601 /* equiv idx, value */ 5, VALUE_OPT_SIMBROADCASTDELAY,
602 /* equivalenced to */ NO_EQUIVALENT,
603 /* min, max, act ct */ 0, 1, 0,
604 /* opt state flags */ SIMBROADCASTDELAY_FLAGS, 0,
605 /* last opt argumnt */ { NULL },
606 /* arg list/cookie */ NULL,
607 /* must/cannot opts */ NULL, NULL,
608 /* option proc */ NULL,
609 /* desc, NAME, name */ zSimbroadcastdelayText, zSimbroadcastdelay_NAME, zSimbroadcastdelay_Name,
610 /* disablement strs */ NULL, NULL },
612 { /* entry idx, value */ 6, VALUE_OPT_CONFIGFILE,
613 /* equiv idx, value */ 6, VALUE_OPT_CONFIGFILE,
614 /* equivalenced to */ NO_EQUIVALENT,
615 /* min, max, act ct */ 0, 1, 0,
616 /* opt state flags */ CONFIGFILE_FLAGS, 0,
617 /* last opt argumnt */ { NULL },
618 /* arg list/cookie */ NULL,
619 /* must/cannot opts */ NULL, NULL,
620 /* option proc */ NULL,
621 /* desc, NAME, name */ zConfigfileText, zConfigfile_NAME, zConfigfile_Name,
622 /* disablement strs */ NULL, NULL },
624 { /* entry idx, value */ 7, VALUE_OPT_PHASENOISE,
625 /* equiv idx, value */ 7, VALUE_OPT_PHASENOISE,
626 /* equivalenced to */ NO_EQUIVALENT,
627 /* min, max, act ct */ 0, 1, 0,
628 /* opt state flags */ PHASENOISE_FLAGS, 0,
629 /* last opt argumnt */ { NULL },
630 /* arg list/cookie */ NULL,
631 /* must/cannot opts */ NULL, NULL,
632 /* option proc */ NULL,
633 /* desc, NAME, name */ zPhasenoiseText, zPhasenoise_NAME, zPhasenoise_Name,
634 /* disablement strs */ NULL, NULL },
636 { /* entry idx, value */ 8, VALUE_OPT_DEBUG_LEVEL,
637 /* equiv idx, value */ 8, VALUE_OPT_DEBUG_LEVEL,
638 /* equivalenced to */ NO_EQUIVALENT,
639 /* min, max, act ct */ 0, NOLIMIT, 0,
640 /* opt state flags */ DEBUG_LEVEL_FLAGS, 0,
641 /* last opt argumnt */ { NULL },
642 /* arg list/cookie */ NULL,
643 /* must/cannot opts */ NULL, NULL,
644 /* option proc */ NULL,
645 /* desc, NAME, name */ zDebug_LevelText, zDebug_Level_NAME, zDebug_Level_Name,
646 /* disablement strs */ NULL, NULL },
648 { /* entry idx, value */ 9, VALUE_OPT_SET_DEBUG_LEVEL,
649 /* equiv idx, value */ 9, VALUE_OPT_SET_DEBUG_LEVEL,
650 /* equivalenced to */ NO_EQUIVALENT,
651 /* min, max, act ct */ 0, NOLIMIT, 0,
652 /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0,
653 /* last opt argumnt */ { NULL },
654 /* arg list/cookie */ NULL,
655 /* must/cannot opts */ NULL, NULL,
656 /* option proc */ SET_DEBUG_LEVEL_OPT_PROC,
657 /* desc, NAME, name */ zSet_Debug_LevelText, zSet_Debug_Level_NAME, zSet_Debug_Level_Name,
658 /* disablement strs */ NULL, NULL },
660 { /* entry idx, value */ 10, VALUE_OPT_DRIFTFILE,
661 /* equiv idx, value */ 10, VALUE_OPT_DRIFTFILE,
662 /* equivalenced to */ NO_EQUIVALENT,
663 /* min, max, act ct */ 0, 1, 0,
664 /* opt state flags */ DRIFTFILE_FLAGS, 0,
665 /* last opt argumnt */ { NULL },
666 /* arg list/cookie */ NULL,
667 /* must/cannot opts */ NULL, NULL,
668 /* option proc */ NULL,
669 /* desc, NAME, name */ zDriftfileText, zDriftfile_NAME, zDriftfile_Name,
670 /* disablement strs */ NULL, NULL },
672 { /* entry idx, value */ 11, VALUE_OPT_PANICGATE,
673 /* equiv idx, value */ 11, VALUE_OPT_PANICGATE,
674 /* equivalenced to */ NO_EQUIVALENT,
675 /* min, max, act ct */ 0, 1, 0,
676 /* opt state flags */ PANICGATE_FLAGS, 0,
677 /* last opt argumnt */ { NULL },
678 /* arg list/cookie */ NULL,
679 /* must/cannot opts */ NULL, NULL,
680 /* option proc */ NULL,
681 /* desc, NAME, name */ zPanicgateText, zPanicgate_NAME, zPanicgate_Name,
682 /* disablement strs */ NULL, NULL },
684 { /* entry idx, value */ 12, VALUE_OPT_SIMSLEW,
685 /* equiv idx, value */ 12, VALUE_OPT_SIMSLEW,
686 /* equivalenced to */ NO_EQUIVALENT,
687 /* min, max, act ct */ 0, 1, 0,
688 /* opt state flags */ SIMSLEW_FLAGS, 0,
689 /* last opt argumnt */ { NULL },
690 /* arg list/cookie */ NULL,
691 /* must/cannot opts */ NULL, NULL,
692 /* option proc */ NULL,
693 /* desc, NAME, name */ zSimslewText, zSimslew_NAME, zSimslew_Name,
694 /* disablement strs */ NULL, NULL },
696 { /* entry idx, value */ 13, VALUE_OPT_JAILDIR,
697 /* equiv idx, value */ 13, VALUE_OPT_JAILDIR,
698 /* equivalenced to */ NO_EQUIVALENT,
699 /* min, max, act ct */ 0, 1, 0,
700 /* opt state flags */ JAILDIR_FLAGS, 0,
701 /* last opt argumnt */ { NULL },
702 /* arg list/cookie */ NULL,
703 /* must/cannot opts */ NULL, NULL,
704 /* option proc */ NULL,
705 /* desc, NAME, name */ zJaildirText, zJaildir_NAME, zJaildir_Name,
706 /* disablement strs */ NULL, NULL },
708 { /* entry idx, value */ 14, VALUE_OPT_INTERFACE,
709 /* equiv idx, value */ 14, VALUE_OPT_INTERFACE,
710 /* equivalenced to */ NO_EQUIVALENT,
711 /* min, max, act ct */ 0, NOLIMIT, 0,
712 /* opt state flags */ INTERFACE_FLAGS, 0,
713 /* last opt argumnt */ { NULL },
714 /* arg list/cookie */ NULL,
715 /* must/cannot opts */ NULL, NULL,
716 /* option proc */ optionStackArg,
717 /* desc, NAME, name */ zInterfaceText, zInterface_NAME, zInterface_Name,
718 /* disablement strs */ NULL, NULL },
720 { /* entry idx, value */ 15, VALUE_OPT_KEYFILE,
721 /* equiv idx, value */ 15, VALUE_OPT_KEYFILE,
722 /* equivalenced to */ NO_EQUIVALENT,
723 /* min, max, act ct */ 0, 1, 0,
724 /* opt state flags */ KEYFILE_FLAGS, 0,
725 /* last opt argumnt */ { NULL },
726 /* arg list/cookie */ NULL,
727 /* must/cannot opts */ NULL, NULL,
728 /* option proc */ NULL,
729 /* desc, NAME, name */ zKeyfileText, zKeyfile_NAME, zKeyfile_Name,
730 /* disablement strs */ NULL, NULL },
732 { /* entry idx, value */ 16, VALUE_OPT_LOGFILE,
733 /* equiv idx, value */ 16, VALUE_OPT_LOGFILE,
734 /* equivalenced to */ NO_EQUIVALENT,
735 /* min, max, act ct */ 0, 1, 0,
736 /* opt state flags */ LOGFILE_FLAGS, 0,
737 /* last opt argumnt */ { NULL },
738 /* arg list/cookie */ NULL,
739 /* must/cannot opts */ NULL, NULL,
740 /* option proc */ NULL,
741 /* desc, NAME, name */ zLogfileText, zLogfile_NAME, zLogfile_Name,
742 /* disablement strs */ NULL, NULL },
744 { /* entry idx, value */ 17, VALUE_OPT_NOVIRTUALIPS,
745 /* equiv idx, value */ 17, VALUE_OPT_NOVIRTUALIPS,
746 /* equivalenced to */ NO_EQUIVALENT,
747 /* min, max, act ct */ 0, 1, 0,
748 /* opt state flags */ NOVIRTUALIPS_FLAGS, 0,
749 /* last opt argumnt */ { NULL },
750 /* arg list/cookie */ NULL,
751 /* must/cannot opts */ NULL, NULL,
752 /* option proc */ NULL,
753 /* desc, NAME, name */ zNovirtualipsText, zNovirtualips_NAME, zNovirtualips_Name,
754 /* disablement strs */ NULL, NULL },
756 { /* entry idx, value */ 18, VALUE_OPT_MODIFYMMTIMER,
757 /* equiv idx, value */ 18, VALUE_OPT_MODIFYMMTIMER,
758 /* equivalenced to */ NO_EQUIVALENT,
759 /* min, max, act ct */ 0, 1, 0,
760 /* opt state flags */ MODIFYMMTIMER_FLAGS, 0,
761 /* last opt argumnt */ { NULL },
762 /* arg list/cookie */ NULL,
763 /* must/cannot opts */ NULL, NULL,
764 /* option proc */ NULL,
765 /* desc, NAME, name */ zModifymmtimerText, zModifymmtimer_NAME, zModifymmtimer_Name,
766 /* disablement strs */ NULL, NULL },
768 { /* entry idx, value */ 19, VALUE_OPT_NOFORK,
769 /* equiv idx, value */ 19, VALUE_OPT_NOFORK,
770 /* equivalenced to */ NO_EQUIVALENT,
771 /* min, max, act ct */ 0, 1, 0,
772 /* opt state flags */ NOFORK_FLAGS, 0,
773 /* last opt argumnt */ { NULL },
774 /* arg list/cookie */ NULL,
775 /* must/cannot opts */ NULL, NULL,
776 /* option proc */ NULL,
777 /* desc, NAME, name */ zNoforkText, zNofork_NAME, zNofork_Name,
778 /* disablement strs */ NULL, NULL },
780 { /* entry idx, value */ 20, VALUE_OPT_NICE,
781 /* equiv idx, value */ 20, VALUE_OPT_NICE,
782 /* equivalenced to */ NO_EQUIVALENT,
783 /* min, max, act ct */ 0, 1, 0,
784 /* opt state flags */ NICE_FLAGS, 0,
785 /* last opt argumnt */ { NULL },
786 /* arg list/cookie */ NULL,
787 /* must/cannot opts */ NULL, NULL,
788 /* option proc */ NULL,
789 /* desc, NAME, name */ zNiceText, zNice_NAME, zNice_Name,
790 /* disablement strs */ NULL, NULL },
792 { /* entry idx, value */ 21, VALUE_OPT_SERVERTIME,
793 /* equiv idx, value */ 21, VALUE_OPT_SERVERTIME,
794 /* equivalenced to */ NO_EQUIVALENT,
795 /* min, max, act ct */ 0, 1, 0,
796 /* opt state flags */ SERVERTIME_FLAGS, 0,
797 /* last opt argumnt */ { NULL },
798 /* arg list/cookie */ NULL,
799 /* must/cannot opts */ NULL, NULL,
800 /* option proc */ NULL,
801 /* desc, NAME, name */ zServertimeText, zServertime_NAME, zServertime_Name,
802 /* disablement strs */ NULL, NULL },
804 { /* entry idx, value */ 22, VALUE_OPT_PIDFILE,
805 /* equiv idx, value */ 22, VALUE_OPT_PIDFILE,
806 /* equivalenced to */ NO_EQUIVALENT,
807 /* min, max, act ct */ 0, 1, 0,
808 /* opt state flags */ PIDFILE_FLAGS, 0,
809 /* last opt argumnt */ { NULL },
810 /* arg list/cookie */ NULL,
811 /* must/cannot opts */ NULL, NULL,
812 /* option proc */ NULL,
813 /* desc, NAME, name */ zPidfileText, zPidfile_NAME, zPidfile_Name,
814 /* disablement strs */ NULL, NULL },
816 { /* entry idx, value */ 23, VALUE_OPT_PRIORITY,
817 /* equiv idx, value */ 23, VALUE_OPT_PRIORITY,
818 /* equivalenced to */ NO_EQUIVALENT,
819 /* min, max, act ct */ 0, 1, 0,
820 /* opt state flags */ PRIORITY_FLAGS, 0,
821 /* last opt argumnt */ { NULL },
822 /* arg list/cookie */ NULL,
823 /* must/cannot opts */ NULL, NULL,
824 /* option proc */ optionNumericVal,
825 /* desc, NAME, name */ zPriorityText, zPriority_NAME, zPriority_Name,
826 /* disablement strs */ NULL, NULL },
828 { /* entry idx, value */ 24, VALUE_OPT_QUIT,
829 /* equiv idx, value */ 24, VALUE_OPT_QUIT,
830 /* equivalenced to */ NO_EQUIVALENT,
831 /* min, max, act ct */ 0, 1, 0,
832 /* opt state flags */ QUIT_FLAGS, 0,
833 /* last opt argumnt */ { NULL },
834 /* arg list/cookie */ NULL,
835 /* must/cannot opts */ NULL, NULL,
836 /* option proc */ NULL,
837 /* desc, NAME, name */ zQuitText, zQuit_NAME, zQuit_Name,
838 /* disablement strs */ NULL, NULL },
840 { /* entry idx, value */ 25, VALUE_OPT_PROPAGATIONDELAY,
841 /* equiv idx, value */ 25, VALUE_OPT_PROPAGATIONDELAY,
842 /* equivalenced to */ NO_EQUIVALENT,
843 /* min, max, act ct */ 0, 1, 0,
844 /* opt state flags */ PROPAGATIONDELAY_FLAGS, 0,
845 /* last opt argumnt */ { NULL },
846 /* arg list/cookie */ NULL,
847 /* must/cannot opts */ NULL, NULL,
848 /* option proc */ NULL,
849 /* desc, NAME, name */ zPropagationdelayText, zPropagationdelay_NAME, zPropagationdelay_Name,
850 /* disablement strs */ NULL, NULL },
852 { /* entry idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
853 /* equiv idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
854 /* equivalenced to */ NO_EQUIVALENT,
855 /* min, max, act ct */ 0, 1, 0,
856 /* opt state flags */ UPDATEINTERVAL_FLAGS, 0,
857 /* last opt argumnt */ { NULL },
858 /* arg list/cookie */ NULL,
859 /* must/cannot opts */ NULL, NULL,
860 /* option proc */ optionNumericVal,
861 /* desc, NAME, name */ zUpdateintervalText, zUpdateinterval_NAME, zUpdateinterval_Name,
862 /* disablement strs */ NULL, NULL },
864 { /* entry idx, value */ 27, VALUE_OPT_STATSDIR,
865 /* equiv idx, value */ 27, VALUE_OPT_STATSDIR,
866 /* equivalenced to */ NO_EQUIVALENT,
867 /* min, max, act ct */ 0, 1, 0,
868 /* opt state flags */ STATSDIR_FLAGS, 0,
869 /* last opt argumnt */ { NULL },
870 /* arg list/cookie */ NULL,
871 /* must/cannot opts */ NULL, NULL,
872 /* option proc */ NULL,
873 /* desc, NAME, name */ zStatsdirText, zStatsdir_NAME, zStatsdir_Name,
874 /* disablement strs */ NULL, NULL },
876 { /* entry idx, value */ 28, VALUE_OPT_ENDSIMTIME,
877 /* equiv idx, value */ 28, VALUE_OPT_ENDSIMTIME,
878 /* equivalenced to */ NO_EQUIVALENT,
879 /* min, max, act ct */ 0, 1, 0,
880 /* opt state flags */ ENDSIMTIME_FLAGS, 0,
881 /* last opt argumnt */ { NULL },
882 /* arg list/cookie */ NULL,
883 /* must/cannot opts */ NULL, NULL,
884 /* option proc */ NULL,
885 /* desc, NAME, name */ zEndsimtimeText, zEndsimtime_NAME, zEndsimtime_Name,
886 /* disablement strs */ NULL, NULL },
888 { /* entry idx, value */ 29, VALUE_OPT_TRUSTEDKEY,
889 /* equiv idx, value */ 29, VALUE_OPT_TRUSTEDKEY,
890 /* equivalenced to */ NO_EQUIVALENT,
891 /* min, max, act ct */ 0, NOLIMIT, 0,
892 /* opt state flags */ TRUSTEDKEY_FLAGS, 0,
893 /* last opt argumnt */ { NULL },
894 /* arg list/cookie */ NULL,
895 /* must/cannot opts */ NULL, NULL,
896 /* option proc */ optionStackArg,
897 /* desc, NAME, name */ zTrustedkeyText, zTrustedkey_NAME, zTrustedkey_Name,
898 /* disablement strs */ NULL, NULL },
900 { /* entry idx, value */ 30, VALUE_OPT_FREQERR,
901 /* equiv idx, value */ 30, VALUE_OPT_FREQERR,
902 /* equivalenced to */ NO_EQUIVALENT,
903 /* min, max, act ct */ 0, 1, 0,
904 /* opt state flags */ FREQERR_FLAGS, 0,
905 /* last opt argumnt */ { NULL },
906 /* arg list/cookie */ NULL,
907 /* must/cannot opts */ NULL, NULL,
908 /* option proc */ NULL,
909 /* desc, NAME, name */ zFreqerrText, zFreqerr_NAME, zFreqerr_Name,
910 /* disablement strs */ NULL, NULL },
912 { /* entry idx, value */ 31, VALUE_OPT_WALKNOISE,
913 /* equiv idx, value */ 31, VALUE_OPT_WALKNOISE,
914 /* equivalenced to */ NO_EQUIVALENT,
915 /* min, max, act ct */ 0, 1, 0,
916 /* opt state flags */ WALKNOISE_FLAGS, 0,
917 /* last opt argumnt */ { NULL },
918 /* arg list/cookie */ NULL,
919 /* must/cannot opts */ NULL, NULL,
920 /* option proc */ NULL,
921 /* desc, NAME, name */ zWalknoiseText, zWalknoise_NAME, zWalknoise_Name,
922 /* disablement strs */ NULL, NULL },
924 { /* entry idx, value */ 32, VALUE_OPT_USER,
925 /* equiv idx, value */ 32, VALUE_OPT_USER,
926 /* equivalenced to */ NO_EQUIVALENT,
927 /* min, max, act ct */ 0, 1, 0,
928 /* opt state flags */ USER_FLAGS, 0,
929 /* last opt argumnt */ { NULL },
930 /* arg list/cookie */ NULL,
931 /* must/cannot opts */ NULL, NULL,
932 /* option proc */ NULL,
933 /* desc, NAME, name */ zUserText, zUser_NAME, zUser_Name,
934 /* disablement strs */ NULL, NULL },
936 { /* entry idx, value */ 33, VALUE_OPT_VAR,
937 /* equiv idx, value */ 33, VALUE_OPT_VAR,
938 /* equivalenced to */ NO_EQUIVALENT,
939 /* min, max, act ct */ 0, NOLIMIT, 0,
940 /* opt state flags */ VAR_FLAGS, 0,
941 /* last opt argumnt */ { NULL },
942 /* arg list/cookie */ NULL,
943 /* must/cannot opts */ NULL, NULL,
944 /* option proc */ optionStackArg,
945 /* desc, NAME, name */ zVarText, zVar_NAME, zVar_Name,
946 /* disablement strs */ NULL, NULL },
948 { /* entry idx, value */ 34, VALUE_OPT_DVAR,
949 /* equiv idx, value */ 34, VALUE_OPT_DVAR,
950 /* equivalenced to */ NO_EQUIVALENT,
951 /* min, max, act ct */ 0, NOLIMIT, 0,
952 /* opt state flags */ DVAR_FLAGS, 0,
953 /* last opt argumnt */ { NULL },
954 /* arg list/cookie */ NULL,
955 /* must/cannot opts */ NULL, NULL,
956 /* option proc */ optionStackArg,
957 /* desc, NAME, name */ zDvarText, zDvar_NAME, zDvar_Name,
958 /* disablement strs */ NULL, NULL },
960 { /* entry idx, value */ 35, VALUE_OPT_SLEW,
961 /* equiv idx, value */ 35, VALUE_OPT_SLEW,
962 /* equivalenced to */ NO_EQUIVALENT,
963 /* min, max, act ct */ 0, 1, 0,
964 /* opt state flags */ SLEW_FLAGS, 0,
965 /* last opt argumnt */ { NULL },
966 /* arg list/cookie */ NULL,
967 /* must/cannot opts */ NULL, NULL,
968 /* option proc */ NULL,
969 /* desc, NAME, name */ zSlewText, zSlew_NAME, zSlew_Name,
970 /* disablement strs */ NULL, NULL },
972 { /* entry idx, value */ 36, VALUE_OPT_NDELAY,
973 /* equiv idx, value */ 36, VALUE_OPT_NDELAY,
974 /* equivalenced to */ NO_EQUIVALENT,
975 /* min, max, act ct */ 0, 1, 0,
976 /* opt state flags */ NDELAY_FLAGS, 0,
977 /* last opt argumnt */ { NULL },
978 /* arg list/cookie */ NULL,
979 /* must/cannot opts */ NULL, NULL,
980 /* option proc */ NULL,
981 /* desc, NAME, name */ zNdelayText, zNdelay_NAME, zNdelay_Name,
982 /* disablement strs */ NULL, NULL },
984 { /* entry idx, value */ 37, VALUE_OPT_PDELAY,
985 /* equiv idx, value */ 37, VALUE_OPT_PDELAY,
986 /* equivalenced to */ NO_EQUIVALENT,
987 /* min, max, act ct */ 0, 1, 0,
988 /* opt state flags */ PDELAY_FLAGS, 0,
989 /* last opt argumnt */ { NULL },
990 /* arg list/cookie */ NULL,
991 /* must/cannot opts */ NULL, NULL,
992 /* option proc */ NULL,
993 /* desc, NAME, name */ zPdelayText, zPdelay_NAME, zPdelay_Name,
994 /* disablement strs */ NULL, NULL },
996 #ifdef NO_OPTIONAL_OPT_ARGS
997 # define VERSION_OPT_FLAGS OPTST_IMM | OPTST_NO_INIT
999 # define VERSION_OPT_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
1000 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
1003 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
1004 /* equiv idx value */ NO_EQUIVALENT, 0,
1005 /* equivalenced to */ NO_EQUIVALENT,
1006 /* min, max, act ct */ 0, 1, 0,
1007 /* opt state flags */ VERSION_OPT_FLAGS, 0,
1008 /* last opt argumnt */ { NULL },
1009 /* arg list/cookie */ NULL,
1010 /* must/cannot opts */ NULL, NULL,
1011 /* option proc */ DOVERPROC,
1012 /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
1013 /* disablement strs */ NULL, NULL },
1015 #undef VERSION_OPT_FLAGS
1018 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
1019 /* equiv idx value */ NO_EQUIVALENT, 0,
1020 /* equivalenced to */ NO_EQUIVALENT,
1021 /* min, max, act ct */ 0, 1, 0,
1022 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
1023 /* last opt argumnt */ { NULL },
1024 /* arg list/cookie */ NULL,
1025 /* must/cannot opts */ NULL, NULL,
1026 /* option proc */ doUsageOpt,
1027 /* desc, NAME, name */ zHelpText, NULL, zHelp_Name,
1028 /* disablement strs */ NULL, NULL },
1030 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
1031 /* equiv idx value */ NO_EQUIVALENT, 0,
1032 /* equivalenced to */ NO_EQUIVALENT,
1033 /* min, max, act ct */ 0, 1, 0,
1034 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
1035 /* last opt argumnt */ { NULL },
1036 /* arg list/cookie */ NULL,
1037 /* must/cannot opts */ NULL, NULL,
1038 /* option proc */ optionPagedUsage,
1039 /* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name,
1040 /* disablement strs */ NULL, NULL },
1042 { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
1043 /* equiv idx value */ NO_EQUIVALENT, 0,
1044 /* equivalenced to */ NO_EQUIVALENT,
1045 /* min, max, act ct */ 0, 1, 0,
1046 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
1047 | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0,
1048 /* last opt argumnt */ { NULL },
1049 /* arg list/cookie */ NULL,
1050 /* must/cannot opts */ NULL, NULL,
1051 /* option proc */ NULL,
1052 /* desc, NAME, name */ zSave_OptsText, NULL, zSave_Opts_Name,
1053 /* disablement strs */ NULL, NULL },
1055 { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
1056 /* equiv idx value */ NO_EQUIVALENT, 0,
1057 /* equivalenced to */ NO_EQUIVALENT,
1058 /* min, max, act ct */ 0, NOLIMIT, 0,
1059 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) \
1060 | OPTST_DISABLE_IMM, 0,
1061 /* last opt argumnt */ { NULL },
1062 /* arg list/cookie */ NULL,
1063 /* must/cannot opts */ NULL, NULL,
1064 /* option proc */ optionLoadOpt,
1065 /* desc, NAME, name */ zLoad_OptsText, zLoad_Opts_NAME, zLoad_Opts_Name,
1066 /* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx }
1069 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1071 * Define the Ntpdsim Option Environment
1073 tSCC zPROGNAME[] = "NTPDSIM";
1074 tSCC zUsageTitle[] =
1075 "ntpdsim - NTP daemon simulation program - Ver. 4.2.4p8\n\
1076 USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n";
1077 tSCC zRcName[] = ".ntprc";
1078 tSCC* apzHomeList[] = {
1083 tSCC zBugsAddr[] = "http://bugs.ntp.org, bugs@ntp.org";
1084 #define zExplain NULL
1085 tSCC zDetail[] = "\n\n";
1086 tSCC zFullVersion[] = NTPDSIM_FULL_VERSION;
1087 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/optcode.tpl near line 408 */
1089 #if defined(ENABLE_NLS)
1090 # define OPTPROC_BASE OPTPROC_TRANSLATE
1091 static tOptionXlateProc translate_option_strings;
1093 # define OPTPROC_BASE OPTPROC_NONE
1094 # define translate_option_strings NULL
1095 #endif /* ENABLE_NLS */
1097 tOptions ntpdsimOptions = {
1098 OPTIONS_STRUCT_VERSION,
1099 0, NULL, /* original argc + argv */
1104 + OPTPROC_NO_REQ_OPT
1107 + OPTPROC_HAS_IMMED ),
1108 0, NULL, /* current option index, current option */
1109 NULL, NULL, zPROGNAME,
1110 zRcName, zCopyright, zCopyrightNotice,
1111 zFullVersion, apzHomeList, zUsageTitle,
1112 zExplain, zDetail, optDesc,
1113 zBugsAddr, /* address to send bugs to */
1114 NULL, NULL, /* extensions/saved state */
1115 optionUsage, /* usage procedure */
1116 translate_option_strings, /* translation procedure */
1118 * Indexes to special options
1120 { INDEX_OPT_MORE_HELP,
1121 INDEX_OPT_SAVE_OPTS,
1122 NO_EQUIVALENT /* index of '-#' option */,
1123 NO_EQUIVALENT /* index of default opt */
1125 43 /* full option count */, 38 /* user option count */
1129 * Create the static procedure(s) declared above.
1134 tOptDesc* pOptDesc )
1136 USAGE( EXIT_SUCCESS );
1139 #if ! defined(TEST_NTPDSIM_OPTS)
1143 * For the set-debug-level option, when DEBUG is #define-d.
1147 doOptSet_Debug_Level(
1149 tOptDesc* pOptDesc )
1151 /* extracted from ../include/debug-opt.def, line 29 */
1152 DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
1154 #endif /* defined DEBUG */
1156 #endif /* defined(TEST_NTPDSIM_OPTS) */
1158 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/optmain.tpl near line 92 */
1160 #if defined(TEST_NTPDSIM_OPTS) /* TEST MAIN PROCEDURE: */
1163 main( int argc, char** argv )
1165 int res = EXIT_SUCCESS;
1166 (void)optionProcess( &ntpdsimOptions, argc, argv );
1168 void optionPutShell( tOptions* );
1169 optionPutShell( &ntpdsimOptions );
1173 #endif /* defined TEST_NTPDSIM_OPTS */
1174 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/optcode.tpl near line 514 */
1181 #include <autoopts/usage-txt.h>
1183 static char* AO_gettext( char const* pz );
1184 static void coerce_it(void** s);
1187 AO_gettext( char const* pz )
1195 pzRes = strdup( pzRes );
1196 if (pzRes == NULL) {
1197 fputs( _("No memory for duping translated strings\n"), stderr );
1198 exit( EXIT_FAILURE );
1203 static void coerce_it(void** s) { *s = AO_gettext(*s); }
1204 #define COERSION(_f) \
1205 coerce_it((void*)&(ntpdsimOptions._f))
1208 * This invokes the translation code (e.g. gettext(3)).
1211 translate_option_strings( void )
1214 * Guard against re-translation. It won't work. The strings will have
1215 * been changed by the first pass through this code. One shot only.
1217 if (option_usage_text.field_ct == 0)
1220 * Do the translations. The first pointer follows the field count field.
1221 * The field count field is the size of a pointer.
1224 char** ppz = (char**)(void*)&(option_usage_text);
1225 int ix = option_usage_text.field_ct;
1229 *ppz = AO_gettext(*ppz);
1232 option_usage_text.field_ct = 0;
1235 tOptDesc* pOD = ntpdsimOptions.pOptDesc;
1236 int ix = ntpdsimOptions.optCt;
1239 pOD->pzText = AO_gettext(pOD->pzText);
1240 pOD->pz_NAME = AO_gettext(pOD->pz_NAME);
1241 pOD->pz_Name = AO_gettext(pOD->pz_Name);
1242 pOD->pz_DisableName = AO_gettext(pOD->pz_DisableName);
1243 pOD->pz_DisablePfx = AO_gettext(pOD->pz_DisablePfx);
1249 COERSION(pzCopyright);
1250 COERSION(pzCopyNotice);
1251 COERSION(pzFullVersion);
1252 COERSION(pzUsageTitle);
1253 COERSION(pzExplain);
1257 #endif /* ENABLE_NLS */
1262 /* ntpdsim-opts.c ends here */