2 * EDIT THIS FILE WITH CAUTION (sntp-opts.c)
4 * It has been AutoGen-ed Tuesday December 8, 2009 at 08:14:49 AM EST
5 * From the definitions sntp-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 * sntp 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 * sntp copyright 1970-2006 ntp.org - all rights reserved
24 * General Public Licence for the software known as MSNTP
25 * ------------------------------------------------------
27 * (c) Copyright, N.M. Maclaren, 1996, 1997, 2000
28 * (c) Copyright, University of Cambridge, 1996, 1997, 2000
32 * Free use of MSNTP in source and binary forms is permitted, provided that this
33 * entire licence is duplicated in all copies, and that any documentation,
34 * announcements, and other materials related to use acknowledge that the software
35 * was developed by N.M. Maclaren (hereafter refered to as the Author) at the
36 * University of Cambridge. Neither the name of the Author nor the University of
37 * Cambridge may be used to endorse or promote products derived from this material
38 * without specific prior written permission.
40 * The Author and the University of Cambridge retain the copyright and all other
41 * legal rights to the software and make it available non-exclusively. All users
42 * must ensure that the software in all its derivations carries a copyright notice
44 * (c) Copyright N.M. Maclaren,
45 * (c) Copyright University of Cambridge.
51 * Because the MSNTP software is licensed free of charge, the Author and the
52 * University of Cambridge provide absolutely no warranty, either expressed or
53 * implied, including, but not limited to, the implied warranties of
54 * merchantability and fitness for a particular purpose. The entire risk as to
55 * the quality and performance of the MSNTP software is with you. Should MSNTP
56 * prove defective, you assume the cost of all necessary servicing or repair.
58 * In no event, unless required by law, will the Author or the University of
59 * Cambridge, or any other party who may modify and redistribute this software as
60 * permitted in accordance with the provisions below, be liable for damages for
61 * any losses whatsoever, including but not limited to lost profits, lost monies,
62 * lost or corrupted data, or other special, incidental or consequential losses
63 * that may arise out of the use or inability to use the MSNTP software.
69 * Permission is hereby granted for copying and distribution of copies of the
70 * MSNTP source and binary files, and of any part thereof, subject to the
71 * following licence conditions:
73 * 1. You may distribute MSNTP or components of MSNTP, with or without additions
74 * developed by you or by others. No charge, other than an "at-cost" distribution
75 * fee, may be charged for copies, derivations, or distributions of this material
76 * without the express written consent of the copyright holders.
78 * 2. You may also distribute MSNTP along with any other product for sale,
79 * provided that the cost of the bundled package is the same regardless of whether
80 * MSNTP is included or not, and provided that those interested only in MSNTP must
81 * be notified that it is a product freely available from the University of
84 * 3. If you distribute MSNTP software or parts of MSNTP, with or without
85 * additions developed by you or others, then you must either make available the
86 * source to all portions of the MSNTP system (exclusive of any additions made by
87 * you or by others) upon request, or instead you may notify anyone requesting
88 * source that it is freely available from the University of Cambridge.
90 * 4. You may not omit any of the copyright notices on either the source files,
91 * the executable files, or the documentation.
93 * 5. You may not omit transmission of this License agreement with whatever
94 * portions of MSNTP that are distributed.
96 * 6. Any users of this software must be notified that it is without warranty or
97 * guarantee of any nature, express or implied, nor is there any fitness for use
109 #define OPTION_CODE_COMPILE 1
110 #include "sntp-opts.h"
116 "sntp copyright (c) 1970-2006 ntp.org, all rights reserved";
117 tSCC zCopyrightNotice[] =
119 /* extracted from sntp-opts.def near line 12 */
120 " General Public Licence for the software known as MSNTP\n\
121 ------------------------------------------------------\n\n\
122 \t (c) Copyright, N.M. Maclaren, 1996, 1997, 2000\n\
123 \t (c) Copyright, University of Cambridge, 1996, 1997, 2000\n\n\n\n\
124 Free use of MSNTP in source and binary forms is permitted, provided that this\n\
125 entire licence is duplicated in all copies, and that any documentation,\n\
126 announcements, and other materials related to use acknowledge that the software\n\
127 was developed by N.M. Maclaren (hereafter refered to as the Author) at the\n\
128 University of Cambridge. Neither the name of the Author nor the University of\n\
129 Cambridge may be used to endorse or promote products derived from this material\n\
130 without specific prior written permission.\n\n\
131 The Author and the University of Cambridge retain the copyright and all other\n\
132 legal rights to the software and make it available non-exclusively. All users\n\
133 must ensure that the software in all its derivations carries a copyright notice\n\
135 \t (c) Copyright N.M. Maclaren,\n\
136 \t (c) Copyright University of Cambridge.\n\n\n\n\
138 Because the MSNTP software is licensed free of charge, the Author and the\n\
139 University of Cambridge provide absolutely no warranty, either expressed or\n\
140 implied, including, but not limited to, the implied warranties of\n\
141 merchantability and fitness for a particular purpose. The entire risk as to\n\
142 the quality and performance of the MSNTP software is with you. Should MSNTP\n\
143 prove defective, you assume the cost of all necessary servicing or repair.\n\n\
144 In no event, unless required by law, will the Author or the University of\n\
145 Cambridge, or any other party who may modify and redistribute this software as\n\
146 permitted in accordance with the provisions below, be liable for damages for\n\
147 any losses whatsoever, including but not limited to lost profits, lost monies,\n\
148 lost or corrupted data, or other special, incidental or consequential losses\n\
149 that may arise out of the use or inability to use the MSNTP software.\n\n\n\n\
151 Permission is hereby granted for copying and distribution of copies of the\n\
152 MSNTP source and binary files, and of any part thereof, subject to the\n\
153 following licence conditions:\n\n\
154 1. You may distribute MSNTP or components of MSNTP, with or without additions\n\
155 developed by you or by others. No charge, other than an \"at-cost\" distribution\n\
156 fee, may be charged for copies, derivations, or distributions of this material\n\
157 without the express written consent of the copyright holders.\n\n\
158 2. You may also distribute MSNTP along with any other product for sale,\n\
159 provided that the cost of the bundled package is the same regardless of whether\n\
160 MSNTP is included or not, and provided that those interested only in MSNTP must\n\
161 be notified that it is a product freely available from the University of\n\
163 3. If you distribute MSNTP software or parts of MSNTP, with or without\n\
164 additions developed by you or others, then you must either make available the\n\
165 source to all portions of the MSNTP system (exclusive of any additions made by\n\
166 you or by others) upon request, or instead you may notify anyone requesting\n\
167 source that it is freely available from the University of Cambridge.\n\n\
168 4. You may not omit any of the copyright notices on either the source files,\n\
169 the executable files, or the documentation.\n\n\
170 5. You may not omit transmission of this License agreement with whatever\n\
171 portions of MSNTP that are distributed.\n\n\
172 6. Any users of this software must be notified that it is without warranty or\n\
173 guarantee of any nature, express or implied, nor is there any fitness for use\n\
178 extern tUsageProc optionUsage;
184 # define EXIT_SUCCESS 0
187 # define EXIT_FAILURE 1
190 * Ipv4 option description:
193 "Force IPv4 DNS name resolution";
194 tSCC zIpv4_NAME[] = "IPV4";
195 tSCC zIpv4_Name[] = "ipv4";
196 #define IPV4_FLAGS (OPTST_DISABLED)
199 * Ipv6 option description:
202 "Force IPv6 DNS name resolution";
203 tSCC zIpv6_NAME[] = "IPV6";
204 tSCC zIpv6_Name[] = "ipv6";
205 #define IPV6_FLAGS (OPTST_DISABLED)
208 * Unprivport option description:
210 tSCC zUnprivportText[] =
211 "Use an unprivileged port";
212 tSCC zUnprivport_NAME[] = "UNPRIVPORT";
213 tSCC zUnprivport_Name[] = "unprivport";
214 #define UNPRIVPORT_FLAGS (OPTST_DISABLED)
217 * Normalverbose option description with
218 * "Must also have options" and "Incompatible options":
220 tSCC zNormalverboseText[] =
222 tSCC zNormalverbose_NAME[] = "NORMALVERBOSE";
223 tSCC zNormalverbose_Name[] = "normalverbose";
225 aNormalverboseCantList[] = {
226 INDEX_OPT_EXTRAVERBOSE,
227 INDEX_OPT_MEGAVERBOSE, NO_EQUIVALENT };
228 #define NORMALVERBOSE_FLAGS (OPTST_DISABLED)
231 * Extraverbose option description with
232 * "Must also have options" and "Incompatible options":
234 tSCC zExtraverboseText[] =
236 tSCC zExtraverbose_NAME[] = "EXTRAVERBOSE";
237 tSCC zExtraverbose_Name[] = "extraverbose";
239 aExtraverboseCantList[] = {
240 INDEX_OPT_NORMALVERBOSE,
241 INDEX_OPT_MEGAVERBOSE, NO_EQUIVALENT };
242 #define EXTRAVERBOSE_FLAGS (OPTST_DISABLED)
245 * Megaverbose option description with
246 * "Must also have options" and "Incompatible options":
248 tSCC zMegaverboseText[] =
250 tSCC zMegaverbose_NAME[] = "MEGAVERBOSE";
251 tSCC zMegaverbose_Name[] = "megaverbose";
253 aMegaverboseCantList[] = {
254 INDEX_OPT_NORMALVERBOSE,
255 INDEX_OPT_EXTRAVERBOSE, NO_EQUIVALENT };
256 #define MEGAVERBOSE_FLAGS (OPTST_DISABLED)
259 * Settimeofday option description with
260 * "Must also have options" and "Incompatible options":
262 tSCC zSettimeofdayText[] =
263 "Set (step) the time with settimeofday()";
264 tSCC zSettimeofday_NAME[] = "SETTIMEOFDAY";
265 tSCC zSettimeofday_Name[] = "settimeofday";
267 aSettimeofdayCantList[] = {
268 INDEX_OPT_ADJTIME, NO_EQUIVALENT };
269 #define SETTIMEOFDAY_FLAGS (OPTST_DISABLED)
272 * Adjtime option description with
273 * "Must also have options" and "Incompatible options":
275 tSCC zAdjtimeText[] =
276 "Set (slew) the time with adjtime()";
277 tSCC zAdjtime_NAME[] = "ADJTIME";
278 tSCC zAdjtime_Name[] = "adjtime";
280 aAdjtimeCantList[] = {
281 INDEX_OPT_SETTIMEOFDAY, NO_EQUIVALENT };
282 #define ADJTIME_FLAGS (OPTST_DISABLED)
285 * Help/More_Help/Version option descriptions:
287 tSCC zHelpText[] = "Display usage information and exit";
288 tSCC zHelp_Name[] = "help";
290 tSCC zMore_HelpText[] = "Extended usage information passed thru pager";
291 tSCC zMore_Help_Name[] = "more-help";
293 tSCC zVersionText[] = "Output version information and exit";
294 tSCC zVersion_Name[] = "version";
297 * Save/Load_Opts option description:
299 tSCC zSave_OptsText[] = "Save the option state to a config file";
300 tSCC zSave_Opts_Name[] = "save-opts";
302 tSCC zLoad_OptsText[] = "Load options from a config file";
303 tSCC zLoad_Opts_NAME[] = "LOAD_OPTS";
305 tSCC zNotLoad_Opts_Name[] = "no-load-opts";
306 tSCC zNotLoad_Opts_Pfx[] = "no";
307 #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3)
309 * Declare option callback procedures
311 #if defined(TEST_SNTP_OPTS)
313 * Under test, omit argument processing, or call optionStackArg,
314 * if multiple copies are allowed.
317 optionPagedUsage, optionVersionStderr;
321 #else /* NOT defined TEST_SNTP_OPTS */
323 * When not under test, there are different procs to use
326 optionPagedUsage, optionPrintVersion;
329 #endif /* defined(TEST_SNTP_OPTS) */
330 #ifdef TEST_SNTP_OPTS
331 # define DOVERPROC optionVersionStderr
333 # define DOVERPROC optionPrintVersion
334 #endif /* TEST_SNTP_OPTS */
336 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
338 * Define the Sntp Option Descriptions.
340 static tOptDesc optDesc[ OPTION_CT ] = {
341 { /* entry idx, value */ 0, VALUE_OPT_IPV4,
342 /* equiv idx, value */ NO_EQUIVALENT, 0,
343 /* equivalenced to */ NO_EQUIVALENT,
344 /* min, max, act ct */ 0, 1, 0,
345 /* opt state flags */ IPV4_FLAGS, 0,
346 /* last opt argumnt */ { NULL },
347 /* arg list/cookie */ NULL,
348 /* must/cannot opts */ NULL, NULL,
349 /* option proc */ NULL,
350 /* desc, NAME, name */ zIpv4Text, zIpv4_NAME, zIpv4_Name,
351 /* disablement strs */ NULL, NULL },
353 { /* entry idx, value */ 1, VALUE_OPT_IPV6,
354 /* equiv idx, value */ NOLIMIT, NOLIMIT,
355 /* equivalenced to */ INDEX_OPT_IPV4,
356 /* min, max, act ct */ 0, 1, 0,
357 /* opt state flags */ IPV6_FLAGS, 0,
358 /* last opt argumnt */ { NULL },
359 /* arg list/cookie */ NULL,
360 /* must/cannot opts */ NULL, NULL,
361 /* option proc */ NULL,
362 /* desc, NAME, name */ zIpv6Text, zIpv6_NAME, zIpv6_Name,
363 /* disablement strs */ NULL, NULL },
365 { /* entry idx, value */ 2, VALUE_OPT_UNPRIVPORT,
366 /* equiv idx, value */ 2, VALUE_OPT_UNPRIVPORT,
367 /* equivalenced to */ NO_EQUIVALENT,
368 /* min, max, act ct */ 0, 1, 0,
369 /* opt state flags */ UNPRIVPORT_FLAGS, 0,
370 /* last opt argumnt */ { NULL },
371 /* arg list/cookie */ NULL,
372 /* must/cannot opts */ NULL, NULL,
373 /* option proc */ NULL,
374 /* desc, NAME, name */ zUnprivportText, zUnprivport_NAME, zUnprivport_Name,
375 /* disablement strs */ NULL, NULL },
377 { /* entry idx, value */ 3, VALUE_OPT_NORMALVERBOSE,
378 /* equiv idx, value */ 3, VALUE_OPT_NORMALVERBOSE,
379 /* equivalenced to */ NO_EQUIVALENT,
380 /* min, max, act ct */ 0, 1, 0,
381 /* opt state flags */ NORMALVERBOSE_FLAGS, 0,
382 /* last opt argumnt */ { NULL },
383 /* arg list/cookie */ NULL,
384 /* must/cannot opts */ NULL, aNormalverboseCantList,
385 /* option proc */ NULL,
386 /* desc, NAME, name */ zNormalverboseText, zNormalverbose_NAME, zNormalverbose_Name,
387 /* disablement strs */ NULL, NULL },
389 { /* entry idx, value */ 4, VALUE_OPT_EXTRAVERBOSE,
390 /* equiv idx, value */ 4, VALUE_OPT_EXTRAVERBOSE,
391 /* equivalenced to */ NO_EQUIVALENT,
392 /* min, max, act ct */ 0, 1, 0,
393 /* opt state flags */ EXTRAVERBOSE_FLAGS, 0,
394 /* last opt argumnt */ { NULL },
395 /* arg list/cookie */ NULL,
396 /* must/cannot opts */ NULL, aExtraverboseCantList,
397 /* option proc */ NULL,
398 /* desc, NAME, name */ zExtraverboseText, zExtraverbose_NAME, zExtraverbose_Name,
399 /* disablement strs */ NULL, NULL },
401 { /* entry idx, value */ 5, VALUE_OPT_MEGAVERBOSE,
402 /* equiv idx, value */ 5, VALUE_OPT_MEGAVERBOSE,
403 /* equivalenced to */ NO_EQUIVALENT,
404 /* min, max, act ct */ 0, 1, 0,
405 /* opt state flags */ MEGAVERBOSE_FLAGS, 0,
406 /* last opt argumnt */ { NULL },
407 /* arg list/cookie */ NULL,
408 /* must/cannot opts */ NULL, aMegaverboseCantList,
409 /* option proc */ NULL,
410 /* desc, NAME, name */ zMegaverboseText, zMegaverbose_NAME, zMegaverbose_Name,
411 /* disablement strs */ NULL, NULL },
413 { /* entry idx, value */ 6, VALUE_OPT_SETTIMEOFDAY,
414 /* equiv idx, value */ 6, VALUE_OPT_SETTIMEOFDAY,
415 /* equivalenced to */ NO_EQUIVALENT,
416 /* min, max, act ct */ 0, 1, 0,
417 /* opt state flags */ SETTIMEOFDAY_FLAGS, 0,
418 /* last opt argumnt */ { NULL },
419 /* arg list/cookie */ NULL,
420 /* must/cannot opts */ NULL, aSettimeofdayCantList,
421 /* option proc */ NULL,
422 /* desc, NAME, name */ zSettimeofdayText, zSettimeofday_NAME, zSettimeofday_Name,
423 /* disablement strs */ NULL, NULL },
425 { /* entry idx, value */ 7, VALUE_OPT_ADJTIME,
426 /* equiv idx, value */ 7, VALUE_OPT_ADJTIME,
427 /* equivalenced to */ NO_EQUIVALENT,
428 /* min, max, act ct */ 0, 1, 0,
429 /* opt state flags */ ADJTIME_FLAGS, 0,
430 /* last opt argumnt */ { NULL },
431 /* arg list/cookie */ NULL,
432 /* must/cannot opts */ NULL, aAdjtimeCantList,
433 /* option proc */ NULL,
434 /* desc, NAME, name */ zAdjtimeText, zAdjtime_NAME, zAdjtime_Name,
435 /* disablement strs */ NULL, NULL },
437 #ifdef NO_OPTIONAL_OPT_ARGS
438 # define VERSION_OPT_FLAGS OPTST_IMM | OPTST_NO_INIT
440 # define VERSION_OPT_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
441 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
444 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
445 /* equiv idx value */ NO_EQUIVALENT, 0,
446 /* equivalenced to */ NO_EQUIVALENT,
447 /* min, max, act ct */ 0, 1, 0,
448 /* opt state flags */ VERSION_OPT_FLAGS, 0,
449 /* last opt argumnt */ { NULL },
450 /* arg list/cookie */ NULL,
451 /* must/cannot opts */ NULL, NULL,
452 /* option proc */ DOVERPROC,
453 /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
454 /* disablement strs */ NULL, NULL },
456 #undef VERSION_OPT_FLAGS
459 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
460 /* equiv idx value */ NO_EQUIVALENT, 0,
461 /* equivalenced to */ NO_EQUIVALENT,
462 /* min, max, act ct */ 0, 1, 0,
463 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
464 /* last opt argumnt */ { NULL },
465 /* arg list/cookie */ NULL,
466 /* must/cannot opts */ NULL, NULL,
467 /* option proc */ doUsageOpt,
468 /* desc, NAME, name */ zHelpText, NULL, zHelp_Name,
469 /* disablement strs */ NULL, NULL },
471 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
472 /* equiv idx value */ NO_EQUIVALENT, 0,
473 /* equivalenced to */ NO_EQUIVALENT,
474 /* min, max, act ct */ 0, 1, 0,
475 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
476 /* last opt argumnt */ { NULL },
477 /* arg list/cookie */ NULL,
478 /* must/cannot opts */ NULL, NULL,
479 /* option proc */ optionPagedUsage,
480 /* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name,
481 /* disablement strs */ NULL, NULL },
483 { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
484 /* equiv idx value */ NO_EQUIVALENT, 0,
485 /* equivalenced to */ NO_EQUIVALENT,
486 /* min, max, act ct */ 0, 1, 0,
487 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
488 | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0,
489 /* last opt argumnt */ { NULL },
490 /* arg list/cookie */ NULL,
491 /* must/cannot opts */ NULL, NULL,
492 /* option proc */ NULL,
493 /* desc, NAME, name */ zSave_OptsText, NULL, zSave_Opts_Name,
494 /* disablement strs */ NULL, NULL },
496 { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
497 /* equiv idx value */ NO_EQUIVALENT, 0,
498 /* equivalenced to */ NO_EQUIVALENT,
499 /* min, max, act ct */ 0, NOLIMIT, 0,
500 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) \
501 | OPTST_DISABLE_IMM, 0,
502 /* last opt argumnt */ { NULL },
503 /* arg list/cookie */ NULL,
504 /* must/cannot opts */ NULL, NULL,
505 /* option proc */ optionLoadOpt,
506 /* desc, NAME, name */ zLoad_OptsText, zLoad_Opts_NAME, zLoad_Opts_Name,
507 /* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx }
510 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
512 * Define the Sntp Option Environment
514 tSCC zPROGNAME[] = "SNTP";
516 "sntp - standard SNTP program - Ver. 4.2.4p8\n\
517 USAGE: %s [ -<flag> | --<name> ]...\n";
518 tSCC zRcName[] = ".ntprc";
519 tSCC* apzHomeList[] = {
524 tSCC zBugsAddr[] = "http://bugs.ntp.org, bugs@ntp.org";
525 #define zExplain NULL
526 tSCC zDetail[] = "\n\
528 can be used as a SNTP client to query a NTP or SNTP server and either display\n\
529 the time or set the local system's time (given suitable privilege). It can be\n\
530 run as an interactive command or in a\n\
533 NTP is the Network Time Protocol (RFC 1305) and SNTP is the\n\
534 Simple Network Time Protocol (RFC 2030, which supersedes RFC 1769).\n";
535 tSCC zFullVersion[] = SNTP_FULL_VERSION;
536 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/optcode.tpl near line 408 */
538 #if defined(ENABLE_NLS)
539 # define OPTPROC_BASE OPTPROC_TRANSLATE
540 static tOptionXlateProc translate_option_strings;
542 # define OPTPROC_BASE OPTPROC_NONE
543 # define translate_option_strings NULL
544 #endif /* ENABLE_NLS */
546 tOptions sntpOptions = {
547 OPTIONS_STRUCT_VERSION,
548 0, NULL, /* original argc + argv */
556 + OPTPROC_HAS_IMMED ),
557 0, NULL, /* current option index, current option */
558 NULL, NULL, zPROGNAME,
559 zRcName, zCopyright, zCopyrightNotice,
560 zFullVersion, apzHomeList, zUsageTitle,
561 zExplain, zDetail, optDesc,
562 zBugsAddr, /* address to send bugs to */
563 NULL, NULL, /* extensions/saved state */
564 optionUsage, /* usage procedure */
565 translate_option_strings, /* translation procedure */
567 * Indexes to special options
569 { INDEX_OPT_MORE_HELP,
571 NO_EQUIVALENT /* index of '-#' option */,
572 NO_EQUIVALENT /* index of default opt */
574 13 /* full option count */, 8 /* user option count */
578 * Create the static procedure(s) declared above.
585 USAGE( EXIT_SUCCESS );
587 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/optmain.tpl near line 92 */
589 #if defined(TEST_SNTP_OPTS) /* TEST MAIN PROCEDURE: */
592 main( int argc, char** argv )
594 int res = EXIT_SUCCESS;
595 (void)optionProcess( &sntpOptions, argc, argv );
597 void optionPutShell( tOptions* );
598 optionPutShell( &sntpOptions );
602 #endif /* defined TEST_SNTP_OPTS */
603 /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/optcode.tpl near line 514 */
610 #include <autoopts/usage-txt.h>
612 static char* AO_gettext( char const* pz );
613 static void coerce_it(void** s);
616 AO_gettext( char const* pz )
624 pzRes = strdup( pzRes );
626 fputs( _("No memory for duping translated strings\n"), stderr );
627 exit( EXIT_FAILURE );
632 static void coerce_it(void** s) { *s = AO_gettext(*s); }
633 #define COERSION(_f) \
634 coerce_it((void*)&(sntpOptions._f))
637 * This invokes the translation code (e.g. gettext(3)).
640 translate_option_strings( void )
643 * Guard against re-translation. It won't work. The strings will have
644 * been changed by the first pass through this code. One shot only.
646 if (option_usage_text.field_ct == 0)
649 * Do the translations. The first pointer follows the field count field.
650 * The field count field is the size of a pointer.
653 char** ppz = (char**)(void*)&(option_usage_text);
654 int ix = option_usage_text.field_ct;
658 *ppz = AO_gettext(*ppz);
661 option_usage_text.field_ct = 0;
664 tOptDesc* pOD = sntpOptions.pOptDesc;
665 int ix = sntpOptions.optCt;
668 pOD->pzText = AO_gettext(pOD->pzText);
669 pOD->pz_NAME = AO_gettext(pOD->pz_NAME);
670 pOD->pz_Name = AO_gettext(pOD->pz_Name);
671 pOD->pz_DisableName = AO_gettext(pOD->pz_DisableName);
672 pOD->pz_DisablePfx = AO_gettext(pOD->pz_DisablePfx);
678 COERSION(pzCopyright);
679 COERSION(pzCopyNotice);
680 COERSION(pzFullVersion);
681 COERSION(pzUsageTitle);
686 #endif /* ENABLE_NLS */
691 /* sntp-opts.c ends here */