1 /* $NetBSD: sntp-opts.c,v 1.2 2013/12/28 03:20:15 christos Exp $ */ 2 3 /* 4 * EDIT THIS FILE WITH CAUTION (sntp-opts.c) 5 * 6 * It has been AutoGen-ed December 24, 2013 at 11:31:42 AM by AutoGen 5.18.3pre5 7 * From the definitions sntp-opts.def 8 * and the template file options 9 * 10 * Generated from AutoOpts 40:1:15 templates. 11 * 12 * AutoOpts is a copyrighted work. This source file is not encumbered 13 * by AutoOpts licensing, but is provided under the licensing terms chosen 14 * by the sntp author or copyright holder. AutoOpts is 15 * licensed under the terms of the LGPL. The redistributable library 16 * (``libopts'') is licensed under the terms of either the LGPL or, at the 17 * users discretion, the BSD license. See the AutoOpts and/or libopts sources 18 * for details. 19 * 20 * The sntp program is copyrighted and licensed 21 * under the following terms: 22 * 23 * Copyright (C) 1970-2013 The University of Delaware, all rights reserved. 24 * This is free software. It is licensed for use, modification and 25 * redistribution under the terms of the NTP License, copies of which 26 * can be seen at: 27 * <http://ntp.org/license> 28 * <http://opensource.org/licenses/ntp-license.php> 29 * 30 * Permission to use, copy, modify, and distribute this software and its 31 * documentation for any purpose with or without fee is hereby granted, 32 * provided that the above copyright notice appears in all copies and that 33 * both the copyright notice and this permission notice appear in 34 * supporting documentation, and that the name The University of Delaware not be used in 35 * advertising or publicity pertaining to distribution of the software 36 * without specific, written prior permission. The University of Delaware makes no 37 * representations about the suitability this software for any purpose. It 38 * is provided "as is" without express or implied warranty. 39 */ 40 41 #ifndef __doxygen__ 42 #define OPTION_CODE_COMPILE 1 43 #include "sntp-opts.h" 44 #include <sys/types.h> 45 46 #include <limits.h> 47 #include <stdio.h> 48 #include <stdlib.h> 49 #include <errno.h> 50 51 #ifdef __cplusplus 52 extern "C" { 53 #endif 54 extern FILE * option_usage_fp; 55 #define zCopyright (sntp_opt_strs+0) 56 #define zLicenseDescrip (sntp_opt_strs+314) 57 58 /* 59 * global included definitions 60 */ 61 #ifdef __windows 62 extern int atoi(const char*); 63 #else 64 # include <stdlib.h> 65 #endif 66 67 #ifndef NULL 68 # define NULL 0 69 #endif 70 71 /** 72 * static const strings for sntp options 73 */ 74 static char const sntp_opt_strs[2499] = 75 /* 0 */ "sntp 4.2.7p404\n" 76 "Copyright (C) 1970-2013 The University of Delaware, all rights reserved.\n" 77 "This is free software. It is licensed for use, modification and\n" 78 "redistribution under the terms of the NTP License, copies of which\n" 79 "can be seen at:\n" 80 " <http://ntp.org/license>\n" 81 " <http://opensource.org/licenses/ntp-license.php>\n\0" 82 /* 314 */ "Permission to use, copy, modify, and distribute this software and its\n" 83 "documentation for any purpose with or without fee is hereby granted,\n" 84 "provided that the above copyright notice appears in all copies and that\n" 85 "both the copyright notice and this permission notice appear in supporting\n" 86 "documentation, and that the name The University of Delaware not be used in\n" 87 "advertising or publicity pertaining to distribution of the software without\n" 88 "specific, written prior permission. The University of Delaware makes no\n" 89 "representations about the suitability this software for any purpose. It is\n" 90 "provided \"as is\" without express or implied warranty.\n\0" 91 /* 954 */ "Force IPv4 DNS name resolution\0" 92 /* 985 */ "IPV4\0" 93 /* 990 */ "ipv4\0" 94 /* 995 */ "Force IPv6 DNS name resolution\0" 95 /* 1026 */ "IPV6\0" 96 /* 1031 */ "ipv6\0" 97 /* 1036 */ "Enable authentication with the key auth-keynumber\0" 98 /* 1086 */ "AUTHENTICATION\0" 99 /* 1101 */ "authentication\0" 100 /* 1116 */ "Listen to the address specified for broadcast time sync\0" 101 /* 1172 */ "BROADCAST\0" 102 /* 1182 */ "broadcast\0" 103 /* 1192 */ "Concurrently query all IPs returned for host-name\0" 104 /* 1242 */ "CONCURRENT\0" 105 /* 1253 */ "concurrent\0" 106 /* 1264 */ "Increase debug verbosity level\0" 107 /* 1295 */ "DEBUG_LEVEL\0" 108 /* 1307 */ "debug-level\0" 109 /* 1319 */ "Set the debug verbosity level\0" 110 /* 1349 */ "SET_DEBUG_LEVEL\0" 111 /* 1365 */ "set-debug-level\0" 112 /* 1381 */ "The gap (in milliseconds) between time requests\0" 113 /* 1429 */ "GAP\0" 114 /* 1433 */ "gap\0" 115 /* 1437 */ "KoD history filename\0" 116 /* 1458 */ "KOD\0" 117 /* 1462 */ "kod\0" 118 /* 1466 */ "/var/db/ntp-kod\0" 119 /* 1482 */ "Look in this file for the key specified with -a\0" 120 /* 1530 */ "KEYFILE\0" 121 /* 1538 */ "keyfile\0" 122 /* 1546 */ "Log to specified logfile\0" 123 /* 1571 */ "LOGFILE\0" 124 /* 1579 */ "logfile\0" 125 /* 1587 */ "Adjustments less than steplimit msec will be slewed\0" 126 /* 1639 */ "STEPLIMIT\0" 127 /* 1649 */ "steplimit\0" 128 /* 1659 */ "Send int as our NTP protocol version\0" 129 /* 1696 */ "NTPVERSION\0" 130 /* 1707 */ "ntpversion\0" 131 /* 1718 */ "Use the NTP Reserved Port (port 123)\0" 132 /* 1755 */ "USERESERVEDPORT\0" 133 /* 1771 */ "usereservedport\0" 134 /* 1787 */ "OK to 'step' the time with settimeofday(2)\0" 135 /* 1830 */ "STEP\0" 136 /* 1835 */ "step\0" 137 /* 1840 */ "OK to 'slew' the time with adjtime(2)\0" 138 /* 1878 */ "SLEW\0" 139 /* 1883 */ "slew\0" 140 /* 1888 */ "The number of seconds to wait for responses\0" 141 /* 1932 */ "TIMEOUT\0" 142 /* 1940 */ "timeout\0" 143 /* 1948 */ "Wait for pending replies (if not setting the time)\0" 144 /* 1999 */ "WAIT\0" 145 /* 2004 */ "no-wait\0" 146 /* 2012 */ "no\0" 147 /* 2015 */ "display extended usage information and exit\0" 148 /* 2059 */ "help\0" 149 /* 2064 */ "extended usage information passed thru pager\0" 150 /* 2109 */ "more-help\0" 151 /* 2119 */ "output version information and exit\0" 152 /* 2155 */ "version\0" 153 /* 2163 */ "save the option state to a config file\0" 154 /* 2202 */ "save-opts\0" 155 /* 2212 */ "load options from a config file\0" 156 /* 2244 */ "LOAD_OPTS\0" 157 /* 2254 */ "no-load-opts\0" 158 /* 2267 */ "SNTP\0" 159 /* 2272 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.7p404\n" 160 "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n" 161 "\t\t[ hostname-or-IP ...]\n\0" 162 /* 2433 */ "$HOME\0" 163 /* 2439 */ ".\0" 164 /* 2441 */ ".ntprc\0" 165 /* 2448 */ "http://bugs.ntp.org, bugs@ntp.org\0" 166 /* 2482 */ "\n\0" 167 /* 2484 */ "sntp 4.2.7p404"; 168 169 /** 170 * ipv4 option description with 171 * "Must also have options" and "Incompatible options": 172 */ 173 /** Descriptive text for the ipv4 option */ 174 #define IPV4_DESC (sntp_opt_strs+954) 175 /** Upper-cased name for the ipv4 option */ 176 #define IPV4_NAME (sntp_opt_strs+985) 177 /** Name string for the ipv4 option */ 178 #define IPV4_name (sntp_opt_strs+990) 179 /** Other options that appear in conjunction with the ipv4 option */ 180 static int const aIpv4CantList[] = { 181 INDEX_OPT_IPV6, NO_EQUIVALENT }; 182 /** Compiled in flag settings for the ipv4 option */ 183 #define IPV4_FLAGS (OPTST_DISABLED) 184 185 /** 186 * ipv6 option description with 187 * "Must also have options" and "Incompatible options": 188 */ 189 /** Descriptive text for the ipv6 option */ 190 #define IPV6_DESC (sntp_opt_strs+995) 191 /** Upper-cased name for the ipv6 option */ 192 #define IPV6_NAME (sntp_opt_strs+1026) 193 /** Name string for the ipv6 option */ 194 #define IPV6_name (sntp_opt_strs+1031) 195 /** Other options that appear in conjunction with the ipv6 option */ 196 static int const aIpv6CantList[] = { 197 INDEX_OPT_IPV4, NO_EQUIVALENT }; 198 /** Compiled in flag settings for the ipv6 option */ 199 #define IPV6_FLAGS (OPTST_DISABLED) 200 201 /** 202 * authentication option description: 203 */ 204 /** Descriptive text for the authentication option */ 205 #define AUTHENTICATION_DESC (sntp_opt_strs+1036) 206 /** Upper-cased name for the authentication option */ 207 #define AUTHENTICATION_NAME (sntp_opt_strs+1086) 208 /** Name string for the authentication option */ 209 #define AUTHENTICATION_name (sntp_opt_strs+1101) 210 /** Compiled in flag settings for the authentication option */ 211 #define AUTHENTICATION_FLAGS (OPTST_DISABLED \ 212 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 213 214 /** 215 * broadcast option description: 216 */ 217 /** Descriptive text for the broadcast option */ 218 #define BROADCAST_DESC (sntp_opt_strs+1116) 219 /** Upper-cased name for the broadcast option */ 220 #define BROADCAST_NAME (sntp_opt_strs+1172) 221 /** Name string for the broadcast option */ 222 #define BROADCAST_name (sntp_opt_strs+1182) 223 /** Compiled in flag settings for the broadcast option */ 224 #define BROADCAST_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 225 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 226 227 /** 228 * concurrent option description: 229 */ 230 /** Descriptive text for the concurrent option */ 231 #define CONCURRENT_DESC (sntp_opt_strs+1192) 232 /** Upper-cased name for the concurrent option */ 233 #define CONCURRENT_NAME (sntp_opt_strs+1242) 234 /** Name string for the concurrent option */ 235 #define CONCURRENT_name (sntp_opt_strs+1253) 236 /** Compiled in flag settings for the concurrent option */ 237 #define CONCURRENT_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 238 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 239 240 /** 241 * debug-level option description: 242 */ 243 /** Descriptive text for the debug-level option */ 244 #define DEBUG_LEVEL_DESC (sntp_opt_strs+1264) 245 /** Upper-cased name for the debug-level option */ 246 #define DEBUG_LEVEL_NAME (sntp_opt_strs+1295) 247 /** Name string for the debug-level option */ 248 #define DEBUG_LEVEL_name (sntp_opt_strs+1307) 249 /** Compiled in flag settings for the debug-level option */ 250 #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) 251 252 /** 253 * set-debug-level option description: 254 */ 255 /** Descriptive text for the set-debug-level option */ 256 #define SET_DEBUG_LEVEL_DESC (sntp_opt_strs+1319) 257 /** Upper-cased name for the set-debug-level option */ 258 #define SET_DEBUG_LEVEL_NAME (sntp_opt_strs+1349) 259 /** Name string for the set-debug-level option */ 260 #define SET_DEBUG_LEVEL_name (sntp_opt_strs+1365) 261 /** Compiled in flag settings for the set-debug-level option */ 262 #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ 263 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 264 265 /** 266 * gap option description: 267 */ 268 /** Descriptive text for the gap option */ 269 #define GAP_DESC (sntp_opt_strs+1381) 270 /** Upper-cased name for the gap option */ 271 #define GAP_NAME (sntp_opt_strs+1429) 272 /** Name string for the gap option */ 273 #define GAP_name (sntp_opt_strs+1433) 274 /** The compiled in default value for the gap option argument */ 275 #define GAP_DFT_ARG ((char const*)50) 276 /** Compiled in flag settings for the gap option */ 277 #define GAP_FLAGS (OPTST_DISABLED \ 278 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 279 280 /** 281 * kod option description: 282 */ 283 /** Descriptive text for the kod option */ 284 #define KOD_DESC (sntp_opt_strs+1437) 285 /** Upper-cased name for the kod option */ 286 #define KOD_NAME (sntp_opt_strs+1458) 287 /** Name string for the kod option */ 288 #define KOD_name (sntp_opt_strs+1462) 289 /** The compiled in default value for the kod option argument */ 290 #define KOD_DFT_ARG (sntp_opt_strs+1466) 291 /** Compiled in flag settings for the kod option */ 292 #define KOD_FLAGS (OPTST_DISABLED \ 293 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) 294 295 /** 296 * keyfile option description: 297 */ 298 /** Descriptive text for the keyfile option */ 299 #define KEYFILE_DESC (sntp_opt_strs+1482) 300 /** Upper-cased name for the keyfile option */ 301 #define KEYFILE_NAME (sntp_opt_strs+1530) 302 /** Name string for the keyfile option */ 303 #define KEYFILE_name (sntp_opt_strs+1538) 304 /** Compiled in flag settings for the keyfile option */ 305 #define KEYFILE_FLAGS (OPTST_DISABLED \ 306 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) 307 308 /** 309 * logfile option description: 310 */ 311 /** Descriptive text for the logfile option */ 312 #define LOGFILE_DESC (sntp_opt_strs+1546) 313 /** Upper-cased name for the logfile option */ 314 #define LOGFILE_NAME (sntp_opt_strs+1571) 315 /** Name string for the logfile option */ 316 #define LOGFILE_name (sntp_opt_strs+1579) 317 /** Compiled in flag settings for the logfile option */ 318 #define LOGFILE_FLAGS (OPTST_DISABLED \ 319 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) 320 321 /** 322 * steplimit option description: 323 */ 324 /** Descriptive text for the steplimit option */ 325 #define STEPLIMIT_DESC (sntp_opt_strs+1587) 326 /** Upper-cased name for the steplimit option */ 327 #define STEPLIMIT_NAME (sntp_opt_strs+1639) 328 /** Name string for the steplimit option */ 329 #define STEPLIMIT_name (sntp_opt_strs+1649) 330 /** Compiled in flag settings for the steplimit option */ 331 #define STEPLIMIT_FLAGS (OPTST_DISABLED \ 332 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 333 334 /** 335 * ntpversion option description: 336 */ 337 /** Descriptive text for the ntpversion option */ 338 #define NTPVERSION_DESC (sntp_opt_strs+1659) 339 /** Upper-cased name for the ntpversion option */ 340 #define NTPVERSION_NAME (sntp_opt_strs+1696) 341 /** Name string for the ntpversion option */ 342 #define NTPVERSION_name (sntp_opt_strs+1707) 343 /** The compiled in default value for the ntpversion option argument */ 344 #define NTPVERSION_DFT_ARG ((char const*)4) 345 /** Compiled in flag settings for the ntpversion option */ 346 #define NTPVERSION_FLAGS (OPTST_DISABLED \ 347 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 348 349 /** 350 * usereservedport option description: 351 */ 352 /** Descriptive text for the usereservedport option */ 353 #define USERESERVEDPORT_DESC (sntp_opt_strs+1718) 354 /** Upper-cased name for the usereservedport option */ 355 #define USERESERVEDPORT_NAME (sntp_opt_strs+1755) 356 /** Name string for the usereservedport option */ 357 #define USERESERVEDPORT_name (sntp_opt_strs+1771) 358 /** Compiled in flag settings for the usereservedport option */ 359 #define USERESERVEDPORT_FLAGS (OPTST_DISABLED) 360 361 /** 362 * step option description: 363 */ 364 /** Descriptive text for the step option */ 365 #define STEP_DESC (sntp_opt_strs+1787) 366 /** Upper-cased name for the step option */ 367 #define STEP_NAME (sntp_opt_strs+1830) 368 /** Name string for the step option */ 369 #define STEP_name (sntp_opt_strs+1835) 370 /** Compiled in flag settings for the step option */ 371 #define STEP_FLAGS (OPTST_DISABLED) 372 373 /** 374 * slew option description: 375 */ 376 /** Descriptive text for the slew option */ 377 #define SLEW_DESC (sntp_opt_strs+1840) 378 /** Upper-cased name for the slew option */ 379 #define SLEW_NAME (sntp_opt_strs+1878) 380 /** Name string for the slew option */ 381 #define SLEW_name (sntp_opt_strs+1883) 382 /** Compiled in flag settings for the slew option */ 383 #define SLEW_FLAGS (OPTST_DISABLED) 384 385 /** 386 * timeout option description: 387 */ 388 /** Descriptive text for the timeout option */ 389 #define TIMEOUT_DESC (sntp_opt_strs+1888) 390 /** Upper-cased name for the timeout option */ 391 #define TIMEOUT_NAME (sntp_opt_strs+1932) 392 /** Name string for the timeout option */ 393 #define TIMEOUT_name (sntp_opt_strs+1940) 394 /** The compiled in default value for the timeout option argument */ 395 #define TIMEOUT_DFT_ARG ((char const*)5) 396 /** Compiled in flag settings for the timeout option */ 397 #define TIMEOUT_FLAGS (OPTST_DISABLED \ 398 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 399 400 /** 401 * wait option description: 402 */ 403 /** Descriptive text for the wait option */ 404 #define WAIT_DESC (sntp_opt_strs+1948) 405 /** Upper-cased name for the wait option */ 406 #define WAIT_NAME (sntp_opt_strs+1999) 407 /** disablement name for the wait option */ 408 #define NOT_WAIT_name (sntp_opt_strs+2004) 409 /** disablement prefix for the wait option */ 410 #define NOT_WAIT_PFX (sntp_opt_strs+2012) 411 /** Name string for the wait option */ 412 #define WAIT_name (NOT_WAIT_name + 3) 413 /** Compiled in flag settings for the wait option */ 414 #define WAIT_FLAGS (OPTST_INITENABLED) 415 416 /* 417 * Help/More_Help/Version option descriptions: 418 */ 419 #define HELP_DESC (sntp_opt_strs+2015) 420 #define HELP_name (sntp_opt_strs+2059) 421 #ifdef HAVE_WORKING_FORK 422 #define MORE_HELP_DESC (sntp_opt_strs+2064) 423 #define MORE_HELP_name (sntp_opt_strs+2109) 424 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) 425 #else 426 #define MORE_HELP_DESC HELP_DESC 427 #define MORE_HELP_name HELP_name 428 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 429 #endif 430 #ifdef NO_OPTIONAL_OPT_ARGS 431 # define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) 432 #else 433 # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ 434 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) 435 #endif 436 #define VER_DESC (sntp_opt_strs+2119) 437 #define VER_name (sntp_opt_strs+2155) 438 #define SAVE_OPTS_DESC (sntp_opt_strs+2163) 439 #define SAVE_OPTS_name (sntp_opt_strs+2202) 440 #define LOAD_OPTS_DESC (sntp_opt_strs+2212) 441 #define LOAD_OPTS_NAME (sntp_opt_strs+2244) 442 #define NO_LOAD_OPTS_name (sntp_opt_strs+2254) 443 #define LOAD_OPTS_pfx (sntp_opt_strs+2012) 444 #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) 445 /** 446 * Declare option callback procedures 447 */ 448 /* extracted from optmain.tlib near line 723 */ 449 450 #if defined(TEST_SNTP_OPTS) 451 /* 452 * Under test, omit argument processing, or call optionStackArg, 453 * if multiple copies are allowed. 454 */ 455 static tOptProc 456 doOptKeyfile, doOptKod, doOptLogfile, doOptNtpversion, 457 doOptSteplimit, doUsageOpt; 458 459 /* 460 * #define map the "normal" callout procs to the test ones... 461 */ 462 #define DEBUG_LEVEL_OPT_PROC optionStackArg 463 464 465 #else /* NOT defined TEST_SNTP_OPTS */ 466 /* 467 * When not under test, there are different procs to use 468 */ 469 extern tOptProc 470 ntpOptionPrintVersion, optionBooleanVal, optionNestedVal, 471 optionNumericVal, optionPagedUsage, optionResetOpt, 472 optionStackArg, optionTimeDate, optionTimeVal, 473 optionUnstackArg, optionVendorOption, optionVersionStderr; 474 static tOptProc 475 doOptDebug_Level, doOptKeyfile, doOptKod, doOptLogfile, 476 doOptNtpversion, doOptSteplimit, doUsageOpt; 477 478 /** 479 * #define map the "normal" callout procs 480 */ 481 #define DEBUG_LEVEL_OPT_PROC doOptDebug_Level 482 483 #endif /* TEST_SNTP_OPTS */ 484 #define VER_PROC ntpOptionPrintVersion 485 486 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 487 /** 488 * Define the sntp Option Descriptions. 489 * This is an array of OPTION_CT entries, one for each 490 * option that the sntp program responds to. 491 */ 492 static tOptDesc optDesc[OPTION_CT] = { 493 { /* entry idx, value */ 0, VALUE_OPT_IPV4, 494 /* equiv idx, value */ 0, VALUE_OPT_IPV4, 495 /* equivalenced to */ NO_EQUIVALENT, 496 /* min, max, act ct */ 0, 1, 0, 497 /* opt state flags */ IPV4_FLAGS, 0, 498 /* last opt argumnt */ { NULL }, /* --ipv4 */ 499 /* arg list/cookie */ NULL, 500 /* must/cannot opts */ NULL, aIpv4CantList, 501 /* option proc */ NULL, 502 /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name, 503 /* disablement strs */ NULL, NULL }, 504 505 { /* entry idx, value */ 1, VALUE_OPT_IPV6, 506 /* equiv idx, value */ 1, VALUE_OPT_IPV6, 507 /* equivalenced to */ NO_EQUIVALENT, 508 /* min, max, act ct */ 0, 1, 0, 509 /* opt state flags */ IPV6_FLAGS, 0, 510 /* last opt argumnt */ { NULL }, /* --ipv6 */ 511 /* arg list/cookie */ NULL, 512 /* must/cannot opts */ NULL, aIpv6CantList, 513 /* option proc */ NULL, 514 /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name, 515 /* disablement strs */ NULL, NULL }, 516 517 { /* entry idx, value */ 2, VALUE_OPT_AUTHENTICATION, 518 /* equiv idx, value */ 2, VALUE_OPT_AUTHENTICATION, 519 /* equivalenced to */ NO_EQUIVALENT, 520 /* min, max, act ct */ 0, 1, 0, 521 /* opt state flags */ AUTHENTICATION_FLAGS, 0, 522 /* last opt argumnt */ { NULL }, /* --authentication */ 523 /* arg list/cookie */ NULL, 524 /* must/cannot opts */ NULL, NULL, 525 /* option proc */ optionNumericVal, 526 /* desc, NAME, name */ AUTHENTICATION_DESC, AUTHENTICATION_NAME, AUTHENTICATION_name, 527 /* disablement strs */ NULL, NULL }, 528 529 { /* entry idx, value */ 3, VALUE_OPT_BROADCAST, 530 /* equiv idx, value */ 3, VALUE_OPT_BROADCAST, 531 /* equivalenced to */ NO_EQUIVALENT, 532 /* min, max, act ct */ 0, NOLIMIT, 0, 533 /* opt state flags */ BROADCAST_FLAGS, 0, 534 /* last opt argumnt */ { NULL }, /* --broadcast */ 535 /* arg list/cookie */ NULL, 536 /* must/cannot opts */ NULL, NULL, 537 /* option proc */ optionStackArg, 538 /* desc, NAME, name */ BROADCAST_DESC, BROADCAST_NAME, BROADCAST_name, 539 /* disablement strs */ NULL, NULL }, 540 541 { /* entry idx, value */ 4, VALUE_OPT_CONCURRENT, 542 /* equiv idx, value */ 4, VALUE_OPT_CONCURRENT, 543 /* equivalenced to */ NO_EQUIVALENT, 544 /* min, max, act ct */ 0, NOLIMIT, 0, 545 /* opt state flags */ CONCURRENT_FLAGS, 0, 546 /* last opt argumnt */ { NULL }, /* --concurrent */ 547 /* arg list/cookie */ NULL, 548 /* must/cannot opts */ NULL, NULL, 549 /* option proc */ optionStackArg, 550 /* desc, NAME, name */ CONCURRENT_DESC, CONCURRENT_NAME, CONCURRENT_name, 551 /* disablement strs */ NULL, NULL }, 552 553 { /* entry idx, value */ 5, VALUE_OPT_DEBUG_LEVEL, 554 /* equiv idx, value */ 5, VALUE_OPT_DEBUG_LEVEL, 555 /* equivalenced to */ NO_EQUIVALENT, 556 /* min, max, act ct */ 0, NOLIMIT, 0, 557 /* opt state flags */ DEBUG_LEVEL_FLAGS, 0, 558 /* last opt argumnt */ { NULL }, /* --debug-level */ 559 /* arg list/cookie */ NULL, 560 /* must/cannot opts */ NULL, NULL, 561 /* option proc */ DEBUG_LEVEL_OPT_PROC, 562 /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name, 563 /* disablement strs */ NULL, NULL }, 564 565 { /* entry idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL, 566 /* equiv idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL, 567 /* equivalenced to */ NO_EQUIVALENT, 568 /* min, max, act ct */ 0, NOLIMIT, 0, 569 /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0, 570 /* last opt argumnt */ { NULL }, /* --set-debug-level */ 571 /* arg list/cookie */ NULL, 572 /* must/cannot opts */ NULL, NULL, 573 /* option proc */ optionNumericVal, 574 /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name, 575 /* disablement strs */ NULL, NULL }, 576 577 { /* entry idx, value */ 7, VALUE_OPT_GAP, 578 /* equiv idx, value */ 7, VALUE_OPT_GAP, 579 /* equivalenced to */ NO_EQUIVALENT, 580 /* min, max, act ct */ 0, 1, 0, 581 /* opt state flags */ GAP_FLAGS, 0, 582 /* last opt argumnt */ { GAP_DFT_ARG }, 583 /* arg list/cookie */ NULL, 584 /* must/cannot opts */ NULL, NULL, 585 /* option proc */ optionNumericVal, 586 /* desc, NAME, name */ GAP_DESC, GAP_NAME, GAP_name, 587 /* disablement strs */ NULL, NULL }, 588 589 { /* entry idx, value */ 8, VALUE_OPT_KOD, 590 /* equiv idx, value */ 8, VALUE_OPT_KOD, 591 /* equivalenced to */ NO_EQUIVALENT, 592 /* min, max, act ct */ 0, 1, 0, 593 /* opt state flags */ KOD_FLAGS, 0, 594 /* last opt argumnt */ { KOD_DFT_ARG }, 595 /* arg list/cookie */ NULL, 596 /* must/cannot opts */ NULL, NULL, 597 /* option proc */ doOptKod, 598 /* desc, NAME, name */ KOD_DESC, KOD_NAME, KOD_name, 599 /* disablement strs */ NULL, NULL }, 600 601 { /* entry idx, value */ 9, VALUE_OPT_KEYFILE, 602 /* equiv idx, value */ 9, VALUE_OPT_KEYFILE, 603 /* equivalenced to */ NO_EQUIVALENT, 604 /* min, max, act ct */ 0, 1, 0, 605 /* opt state flags */ KEYFILE_FLAGS, 0, 606 /* last opt argumnt */ { NULL }, /* --keyfile */ 607 /* arg list/cookie */ NULL, 608 /* must/cannot opts */ NULL, NULL, 609 /* option proc */ doOptKeyfile, 610 /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name, 611 /* disablement strs */ NULL, NULL }, 612 613 { /* entry idx, value */ 10, VALUE_OPT_LOGFILE, 614 /* equiv idx, value */ 10, VALUE_OPT_LOGFILE, 615 /* equivalenced to */ NO_EQUIVALENT, 616 /* min, max, act ct */ 0, 1, 0, 617 /* opt state flags */ LOGFILE_FLAGS, 0, 618 /* last opt argumnt */ { NULL }, /* --logfile */ 619 /* arg list/cookie */ NULL, 620 /* must/cannot opts */ NULL, NULL, 621 /* option proc */ doOptLogfile, 622 /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name, 623 /* disablement strs */ NULL, NULL }, 624 625 { /* entry idx, value */ 11, VALUE_OPT_STEPLIMIT, 626 /* equiv idx, value */ 11, VALUE_OPT_STEPLIMIT, 627 /* equivalenced to */ NO_EQUIVALENT, 628 /* min, max, act ct */ 0, 1, 0, 629 /* opt state flags */ STEPLIMIT_FLAGS, 0, 630 /* last opt argumnt */ { NULL }, /* --steplimit */ 631 /* arg list/cookie */ NULL, 632 /* must/cannot opts */ NULL, NULL, 633 /* option proc */ doOptSteplimit, 634 /* desc, NAME, name */ STEPLIMIT_DESC, STEPLIMIT_NAME, STEPLIMIT_name, 635 /* disablement strs */ NULL, NULL }, 636 637 { /* entry idx, value */ 12, VALUE_OPT_NTPVERSION, 638 /* equiv idx, value */ 12, VALUE_OPT_NTPVERSION, 639 /* equivalenced to */ NO_EQUIVALENT, 640 /* min, max, act ct */ 0, 1, 0, 641 /* opt state flags */ NTPVERSION_FLAGS, 0, 642 /* last opt argumnt */ { NTPVERSION_DFT_ARG }, 643 /* arg list/cookie */ NULL, 644 /* must/cannot opts */ NULL, NULL, 645 /* option proc */ doOptNtpversion, 646 /* desc, NAME, name */ NTPVERSION_DESC, NTPVERSION_NAME, NTPVERSION_name, 647 /* disablement strs */ NULL, NULL }, 648 649 { /* entry idx, value */ 13, VALUE_OPT_USERESERVEDPORT, 650 /* equiv idx, value */ 13, VALUE_OPT_USERESERVEDPORT, 651 /* equivalenced to */ NO_EQUIVALENT, 652 /* min, max, act ct */ 0, 1, 0, 653 /* opt state flags */ USERESERVEDPORT_FLAGS, 0, 654 /* last opt argumnt */ { NULL }, /* --usereservedport */ 655 /* arg list/cookie */ NULL, 656 /* must/cannot opts */ NULL, NULL, 657 /* option proc */ NULL, 658 /* desc, NAME, name */ USERESERVEDPORT_DESC, USERESERVEDPORT_NAME, USERESERVEDPORT_name, 659 /* disablement strs */ NULL, NULL }, 660 661 { /* entry idx, value */ 14, VALUE_OPT_STEP, 662 /* equiv idx, value */ 14, VALUE_OPT_STEP, 663 /* equivalenced to */ NO_EQUIVALENT, 664 /* min, max, act ct */ 0, 1, 0, 665 /* opt state flags */ STEP_FLAGS, 0, 666 /* last opt argumnt */ { NULL }, /* --step */ 667 /* arg list/cookie */ NULL, 668 /* must/cannot opts */ NULL, NULL, 669 /* option proc */ NULL, 670 /* desc, NAME, name */ STEP_DESC, STEP_NAME, STEP_name, 671 /* disablement strs */ NULL, NULL }, 672 673 { /* entry idx, value */ 15, VALUE_OPT_SLEW, 674 /* equiv idx, value */ 15, VALUE_OPT_SLEW, 675 /* equivalenced to */ NO_EQUIVALENT, 676 /* min, max, act ct */ 0, 1, 0, 677 /* opt state flags */ SLEW_FLAGS, 0, 678 /* last opt argumnt */ { NULL }, /* --slew */ 679 /* arg list/cookie */ NULL, 680 /* must/cannot opts */ NULL, NULL, 681 /* option proc */ NULL, 682 /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name, 683 /* disablement strs */ NULL, NULL }, 684 685 { /* entry idx, value */ 16, VALUE_OPT_TIMEOUT, 686 /* equiv idx, value */ 16, VALUE_OPT_TIMEOUT, 687 /* equivalenced to */ NO_EQUIVALENT, 688 /* min, max, act ct */ 0, 1, 0, 689 /* opt state flags */ TIMEOUT_FLAGS, 0, 690 /* last opt argumnt */ { TIMEOUT_DFT_ARG }, 691 /* arg list/cookie */ NULL, 692 /* must/cannot opts */ NULL, NULL, 693 /* option proc */ optionNumericVal, 694 /* desc, NAME, name */ TIMEOUT_DESC, TIMEOUT_NAME, TIMEOUT_name, 695 /* disablement strs */ NULL, NULL }, 696 697 { /* entry idx, value */ 17, VALUE_OPT_WAIT, 698 /* equiv idx, value */ 17, VALUE_OPT_WAIT, 699 /* equivalenced to */ NO_EQUIVALENT, 700 /* min, max, act ct */ 0, 1, 0, 701 /* opt state flags */ WAIT_FLAGS, 0, 702 /* last opt argumnt */ { NULL }, /* --wait */ 703 /* arg list/cookie */ NULL, 704 /* must/cannot opts */ NULL, NULL, 705 /* option proc */ NULL, 706 /* desc, NAME, name */ WAIT_DESC, WAIT_NAME, WAIT_name, 707 /* disablement strs */ NOT_WAIT_name, NOT_WAIT_PFX }, 708 709 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, 710 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, 711 /* equivalenced to */ NO_EQUIVALENT, 712 /* min, max, act ct */ 0, 1, 0, 713 /* opt state flags */ VER_FLAGS, AOUSE_VERSION, 714 /* last opt argumnt */ { NULL }, 715 /* arg list/cookie */ NULL, 716 /* must/cannot opts */ NULL, NULL, 717 /* option proc */ VER_PROC, 718 /* desc, NAME, name */ VER_DESC, NULL, VER_name, 719 /* disablement strs */ NULL, NULL }, 720 721 722 723 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, 724 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, 725 /* equivalenced to */ NO_EQUIVALENT, 726 /* min, max, act ct */ 0, 1, 0, 727 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, 728 /* last opt argumnt */ { NULL }, 729 /* arg list/cookie */ NULL, 730 /* must/cannot opts */ NULL, NULL, 731 /* option proc */ doUsageOpt, 732 /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, 733 /* disablement strs */ NULL, NULL }, 734 735 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, 736 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, 737 /* equivalenced to */ NO_EQUIVALENT, 738 /* min, max, act ct */ 0, 1, 0, 739 /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, 740 /* last opt argumnt */ { NULL }, 741 /* arg list/cookie */ NULL, 742 /* must/cannot opts */ NULL, NULL, 743 /* option proc */ optionPagedUsage, 744 /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, 745 /* disablement strs */ NULL, NULL }, 746 747 { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, 748 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS, 749 /* equivalenced to */ NO_EQUIVALENT, 750 /* min, max, act ct */ 0, 1, 0, 751 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) 752 | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS, 753 /* last opt argumnt */ { NULL }, 754 /* arg list/cookie */ NULL, 755 /* must/cannot opts */ NULL, NULL, 756 /* option proc */ NULL, 757 /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name, 758 /* disablement strs */ NULL, NULL }, 759 760 { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, 761 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS, 762 /* equivalenced to */ NO_EQUIVALENT, 763 /* min, max, act ct */ 0, NOLIMIT, 0, 764 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) 765 | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS, 766 /* last opt argumnt */ { NULL }, 767 /* arg list/cookie */ NULL, 768 /* must/cannot opts */ NULL, NULL, 769 /* option proc */ optionLoadOpt, 770 /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name, 771 /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx } 772 }; 773 774 775 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 776 /** Reference to the upper cased version of sntp. */ 777 #define zPROGNAME (sntp_opt_strs+2267) 778 /** Reference to the title line for sntp usage. */ 779 #define zUsageTitle (sntp_opt_strs+2272) 780 /** sntp configuration file name. */ 781 #define zRcName (sntp_opt_strs+2441) 782 /** Directories to search for sntp config files. */ 783 static char const * const apzHomeList[3] = { 784 sntp_opt_strs+2433, 785 sntp_opt_strs+2439, 786 NULL }; 787 /** The sntp program bug email address. */ 788 #define zBugsAddr (sntp_opt_strs+2448) 789 /** Clarification/explanation of what sntp does. */ 790 #define zExplain (sntp_opt_strs+2482) 791 /** Extra detail explaining what sntp does. */ 792 #define zDetail (NULL) 793 /** The full version string for sntp. */ 794 #define zFullVersion (sntp_opt_strs+2484) 795 /* extracted from optcode.tlib near line 364 */ 796 797 #if defined(ENABLE_NLS) 798 # define OPTPROC_BASE OPTPROC_TRANSLATE 799 static tOptionXlateProc translate_option_strings; 800 #else 801 # define OPTPROC_BASE OPTPROC_NONE 802 # define translate_option_strings NULL 803 #endif /* ENABLE_NLS */ 804 805 #define sntp_full_usage (NULL) 806 #define sntp_short_usage (NULL) 807 808 #endif /* not defined __doxygen__ */ 809 810 /* 811 * Create the static procedure(s) declared above. 812 */ 813 /** 814 * The callout function that invokes the optionUsage function. 815 * 816 * @param[in] opts the AutoOpts option description structure 817 * @param[in] od the descriptor for the "help" (usage) option. 818 * @noreturn 819 */ 820 static void 821 doUsageOpt(tOptions * opts, tOptDesc * od) 822 { 823 int ex_code; 824 ex_code = SNTP_EXIT_SUCCESS; 825 optionUsage(&sntpOptions, ex_code); 826 /* NOTREACHED */ 827 exit(1); 828 (void)opts; 829 (void)od; 830 } 831 832 #if ! defined(TEST_SNTP_OPTS) 833 834 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 835 /** 836 * Code to handle the debug-level option. 837 * 838 * @param[in] pOptions the sntp options data structure 839 * @param[in,out] pOptDesc the option descriptor for this option. 840 */ 841 static void 842 doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc) 843 { 844 /* 845 * Be sure the flag-code[0] handles special values for the options pointer 846 * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit 847 * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to 848 * reset its state. 849 */ 850 /* extracted from debug-opt.def, line 15 */ 851 OPT_VALUE_SET_DEBUG_LEVEL++; 852 (void)pOptDesc; 853 (void)pOptions; 854 } 855 #endif /* defined(TEST_SNTP_OPTS) */ 856 857 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 858 /** 859 * Code to handle the kod option. 860 * Specifies the filename to be used for the persistent history of KoD 861 * responses received from servers. 862 * @param[in] pOptions the sntp options data structure 863 * @param[in,out] pOptDesc the option descriptor for this option. 864 */ 865 static void 866 doOptKod(tOptions* pOptions, tOptDesc* pOptDesc) 867 { 868 static teOptFileType const type = 869 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN; 870 static tuFileMode mode; 871 #ifndef O_CLOEXEC 872 # define O_CLOEXEC 0 873 #endif 874 mode.file_flags = O_CLOEXEC; 875 876 /* 877 * This function handles special invalid values for "pOptions" 878 */ 879 optionFileCheck(pOptions, pOptDesc, type, mode); 880 } 881 882 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 883 /** 884 * Code to handle the keyfile option. 885 * This option specifies the keyfile. 886 * @code{sntp} will search for the key specified with @option{-a} 887 * @file{keyno} in this file. See @command{ntp.keys(5)} for more 888 * information. 889 * @param[in] pOptions the sntp options data structure 890 * @param[in,out] pOptDesc the option descriptor for this option. 891 */ 892 static void 893 doOptKeyfile(tOptions* pOptions, tOptDesc* pOptDesc) 894 { 895 static teOptFileType const type = 896 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN; 897 static tuFileMode mode; 898 #ifndef O_CLOEXEC 899 # define O_CLOEXEC 0 900 #endif 901 mode.file_flags = O_CLOEXEC; 902 903 /* 904 * This function handles special invalid values for "pOptions" 905 */ 906 optionFileCheck(pOptions, pOptDesc, type, mode); 907 } 908 909 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 910 /** 911 * Code to handle the logfile option. 912 * This option causes the client to write log messages to the specified 913 * @file{logfile}. 914 * @param[in] pOptions the sntp options data structure 915 * @param[in,out] pOptDesc the option descriptor for this option. 916 */ 917 static void 918 doOptLogfile(tOptions* pOptions, tOptDesc* pOptDesc) 919 { 920 static teOptFileType const type = 921 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN; 922 static tuFileMode mode; 923 #ifndef O_CLOEXEC 924 # define O_CLOEXEC 0 925 #endif 926 mode.file_flags = O_CLOEXEC; 927 928 /* 929 * This function handles special invalid values for "pOptions" 930 */ 931 optionFileCheck(pOptions, pOptDesc, type, mode); 932 } 933 934 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 935 /** 936 * Code to handle the steplimit option. 937 * If the time adjustment is less than @file{steplimit} milliseconds, 938 * slew the amount using @command{adjtime(2)}. Otherwise, step the 939 * correction using @command{settimeofday(2)}. 940 * @param[in] pOptions the sntp options data structure 941 * @param[in,out] pOptDesc the option descriptor for this option. 942 */ 943 static void 944 doOptSteplimit(tOptions* pOptions, tOptDesc* pOptDesc) 945 { 946 static struct {long rmin, rmax;} const rng[1] = { 947 { 0, LONG_MAX } }; 948 int ix; 949 950 if (pOptions <= OPTPROC_EMIT_LIMIT) 951 goto emit_ranges; 952 optionNumericVal(pOptions, pOptDesc); 953 954 for (ix = 0; ix < 1; ix++) { 955 if (pOptDesc->optArg.argInt < rng[ix].rmin) 956 continue; /* ranges need not be ordered. */ 957 if (pOptDesc->optArg.argInt == rng[ix].rmin) 958 return; 959 if (rng[ix].rmax == LONG_MIN) 960 continue; 961 if (pOptDesc->optArg.argInt <= rng[ix].rmax) 962 return; 963 } 964 965 option_usage_fp = stderr; 966 967 emit_ranges: 968 optionShowRange(pOptions, pOptDesc, (void *)(intptr_t)rng, 1); 969 } 970 971 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 972 /** 973 * Code to handle the ntpversion option. 974 * When sending requests to a remote server, tell them we are running 975 * NTP protocol version @file{ntpversion} . 976 * @param[in] pOptions the sntp options data structure 977 * @param[in,out] pOptDesc the option descriptor for this option. 978 */ 979 static void 980 doOptNtpversion(tOptions* pOptions, tOptDesc* pOptDesc) 981 { 982 static struct {long rmin, rmax;} const rng[1] = { 983 { 0, 7 } }; 984 int ix; 985 986 if (pOptions <= OPTPROC_EMIT_LIMIT) 987 goto emit_ranges; 988 optionNumericVal(pOptions, pOptDesc); 989 990 for (ix = 0; ix < 1; ix++) { 991 if (pOptDesc->optArg.argInt < rng[ix].rmin) 992 continue; /* ranges need not be ordered. */ 993 if (pOptDesc->optArg.argInt == rng[ix].rmin) 994 return; 995 if (rng[ix].rmax == LONG_MIN) 996 continue; 997 if (pOptDesc->optArg.argInt <= rng[ix].rmax) 998 return; 999 } 1000 1001 option_usage_fp = stderr; 1002 1003 emit_ranges: 1004 optionShowRange(pOptions, pOptDesc, (void *)(intptr_t)rng, 1); 1005 } 1006 /* extracted from optmain.tlib near line 46 */ 1007 1008 #if defined(TEST_SNTP_OPTS) /* TEST-MAIN-PROCEDURE: */ 1009 1010 extern void optionPutShell(tOptions*); 1011 1012 /** 1013 * Generated main procedure. This will emit text that a Bourne shell can 1014 * process to handle its command line arguments. 1015 * 1016 * @param[in] argc argument count 1017 * @param[in] argv argument vector 1018 * @returns program exit code 1019 */ 1020 int 1021 main(int argc, char ** argv) 1022 { 1023 int res = SNTP_EXIT_SUCCESS; 1024 (void)optionProcess(&sntpOptions, argc, argv); 1025 optionPutShell(&sntpOptions); 1026 res = ferror(stdout); 1027 if (res != 0) 1028 fputs("output error writing to stdout\n", stderr); 1029 return res; 1030 } 1031 #endif /* TEST_SNTP_OPTS END-TEST-MAIN-PROCEDURE */ 1032 /* extracted from optmain.tlib near line 1245 */ 1033 1034 /** 1035 * The directory containing the data associated with sntp. 1036 */ 1037 #ifndef PKGDATADIR 1038 # define PKGDATADIR "" 1039 #endif 1040 1041 /** 1042 * Information about the person or institution that packaged sntp 1043 * for the current distribution. 1044 */ 1045 #ifndef WITH_PACKAGER 1046 # define sntp_packager_info NULL 1047 #else 1048 /** Packager information for sntp. */ 1049 static char const sntp_packager_info[] = 1050 "Packaged by " WITH_PACKAGER 1051 1052 # ifdef WITH_PACKAGER_VERSION 1053 " ("WITH_PACKAGER_VERSION")" 1054 # endif 1055 1056 # ifdef WITH_PACKAGER_BUG_REPORTS 1057 "\nReport sntp bugs to " WITH_PACKAGER_BUG_REPORTS 1058 # endif 1059 "\n"; 1060 #endif 1061 #ifndef __doxygen__ 1062 1063 #endif /* __doxygen__ */ 1064 /** 1065 * The option definitions for sntp. The one structure that 1066 * binds them all. 1067 */ 1068 tOptions sntpOptions = { 1069 OPTIONS_STRUCT_VERSION, 1070 0, NULL, /* original argc + argv */ 1071 ( OPTPROC_BASE 1072 + OPTPROC_ERRSTOP 1073 + OPTPROC_SHORTOPT 1074 + OPTPROC_LONGOPT 1075 + OPTPROC_NO_REQ_OPT 1076 + OPTPROC_NEGATIONS 1077 + OPTPROC_ENVIRON 1078 + OPTPROC_MISUSE 1079 + OPTPROC_SHELL_OUTPUT ), 1080 0, NULL, /* current option index, current option */ 1081 NULL, NULL, zPROGNAME, 1082 zRcName, zCopyright, zLicenseDescrip, 1083 zFullVersion, apzHomeList, zUsageTitle, 1084 zExplain, zDetail, optDesc, 1085 zBugsAddr, /* address to send bugs to */ 1086 NULL, NULL, /* extensions/saved state */ 1087 optionUsage, /* usage procedure */ 1088 translate_option_strings, /* translation procedure */ 1089 /* 1090 * Indexes to special options 1091 */ 1092 { INDEX_OPT_MORE_HELP, /* more-help option index */ 1093 INDEX_OPT_SAVE_OPTS, /* save option index */ 1094 NO_EQUIVALENT, /* '-#' option index */ 1095 NO_EQUIVALENT /* index of default opt */ 1096 }, 1097 23 /* full option count */, 18 /* user option count */, 1098 sntp_full_usage, sntp_short_usage, 1099 NULL, NULL, 1100 PKGDATADIR, sntp_packager_info 1101 }; 1102 1103 #if ENABLE_NLS 1104 /** 1105 * This code is designed to translate translatable option text for the 1106 * sntp program. These translations happen upon entry 1107 * to optionProcess(). 1108 */ 1109 #include <stdio.h> 1110 #include <stdlib.h> 1111 #include <string.h> 1112 #include <unistd.h> 1113 #ifdef HAVE_DCGETTEXT 1114 # include <gettext.h> 1115 #endif 1116 #include <autoopts/usage-txt.h> 1117 1118 static char * AO_gettext(char const * pz); 1119 static void coerce_it(void ** s); 1120 1121 /** 1122 * AutoGen specific wrapper function for gettext. It relies on the macro _() 1123 * to convert from English to the target language, then strdup-duplicates the 1124 * result string. It tries the "libopts" domain first, then whatever has been 1125 * set via the \a textdomain(3) call. 1126 * 1127 * @param[in] pz the input text used as a lookup key. 1128 * @returns the translated text (if there is one), 1129 * or the original text (if not). 1130 */ 1131 static char * 1132 AO_gettext(char const * pz) 1133 { 1134 char * res; 1135 if (pz == NULL) 1136 return NULL; 1137 #ifdef HAVE_DCGETTEXT 1138 /* 1139 * While processing the option_xlateable_txt data, try to use the 1140 * "libopts" domain. Once we switch to the option descriptor data, 1141 * do *not* use that domain. 1142 */ 1143 if (option_xlateable_txt.field_ct != 0) { 1144 res = dgettext("libopts", pz); 1145 if (res == pz) 1146 res = (char *)(void *)_(pz); 1147 } else 1148 res = (char *)(void *)_(pz); 1149 #else 1150 res = (char *)(void *)_(pz); 1151 #endif 1152 if (res == pz) 1153 return res; 1154 res = strdup(res); 1155 if (res == NULL) { 1156 fputs(_("No memory for duping translated strings\n"), stderr); 1157 exit(SNTP_EXIT_FAILURE); 1158 } 1159 return res; 1160 } 1161 1162 /** 1163 * All the pointers we use are marked "* const", but they are stored in 1164 * writable memory. Coerce the mutability and set the pointer. 1165 */ 1166 static void coerce_it(void ** s) { *s = AO_gettext(*s); 1167 } 1168 1169 /** 1170 * Translate all the translatable strings in the sntpOptions 1171 * structure defined above. This is done only once. 1172 */ 1173 static void 1174 translate_option_strings(void) 1175 { 1176 tOptions * const opts = &sntpOptions; 1177 1178 /* 1179 * Guard against re-translation. It won't work. The strings will have 1180 * been changed by the first pass through this code. One shot only. 1181 */ 1182 if (option_xlateable_txt.field_ct != 0) { 1183 /* 1184 * Do the translations. The first pointer follows the field count 1185 * field. The field count field is the size of a pointer. 1186 */ 1187 char ** ppz = (char**)(void*)&(option_xlateable_txt); 1188 int ix = option_xlateable_txt.field_ct; 1189 1190 do { 1191 ppz++; /* skip over field_ct */ 1192 *ppz = AO_gettext(*ppz); 1193 } while (--ix > 0); 1194 /* prevent re-translation and disable "libopts" domain lookup */ 1195 option_xlateable_txt.field_ct = 0; 1196 1197 coerce_it((void*)&(opts->pzCopyright)); 1198 coerce_it((void*)&(opts->pzCopyNotice)); 1199 coerce_it((void*)&(opts->pzFullVersion)); 1200 coerce_it((void*)&(opts->pzUsageTitle)); 1201 coerce_it((void*)&(opts->pzExplain)); 1202 coerce_it((void*)&(opts->pzDetail)); 1203 { 1204 tOptDesc * od = opts->pOptDesc; 1205 for (ix = opts->optCt; ix > 0; ix--, od++) 1206 coerce_it((void*)&(od->pzText)); 1207 } 1208 } 1209 } 1210 #endif /* ENABLE_NLS */ 1211 1212 #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT 1213 /** I18N function strictly for xgettext. Do not compile. */ 1214 static void bogus_function(void) { 1215 /* TRANSLATORS: 1216 1217 The following dummy function was crated solely so that xgettext can 1218 extract the correct strings. These strings are actually referenced 1219 by a field name in the sntpOptions structure noted in the 1220 comments below. The literal text is defined in sntp_opt_strs. 1221 1222 NOTE: the strings below are segmented with respect to the source string 1223 sntp_opt_strs. The strings above are handed off for translation 1224 at run time a paragraph at a time. Consequently, they are presented here 1225 for translation a paragraph at a time. 1226 1227 ALSO: often the description for an option will reference another option 1228 by name. These are set off with apostrophe quotes (I hope). Do not 1229 translate option names. 1230 */ 1231 /* referenced via sntpOptions.pzCopyright */ 1232 puts(_("sntp 4.2.7p404\n\ 1233 Copyright (C) 1970-2013 The University of Delaware, all rights reserved.\n\ 1234 This is free software. It is licensed for use, modification and\n\ 1235 redistribution under the terms of the NTP License, copies of which\n\ 1236 can be seen at:\n")); 1237 puts(_(" <http://ntp.org/license>\n\ 1238 <http://opensource.org/licenses/ntp-license.php>\n")); 1239 1240 /* referenced via sntpOptions.pzCopyNotice */ 1241 puts(_("Permission to use, copy, modify, and distribute this software and its\n\ 1242 documentation for any purpose with or without fee is hereby granted,\n\ 1243 provided that the above copyright notice appears in all copies and that\n\ 1244 both the copyright notice and this permission notice appear in supporting\n\ 1245 documentation, and that the name The University of Delaware not be used in\n\ 1246 advertising or publicity pertaining to distribution of the software without\n\ 1247 specific, written prior permission. The University of Delaware makes no\n\ 1248 representations about the suitability this software for any purpose. It is\n\ 1249 provided \"as is\" without express or implied warranty.\n")); 1250 1251 /* referenced via sntpOptions.pOptDesc->pzText */ 1252 puts(_("Force IPv4 DNS name resolution")); 1253 1254 /* referenced via sntpOptions.pOptDesc->pzText */ 1255 puts(_("Force IPv6 DNS name resolution")); 1256 1257 /* referenced via sntpOptions.pOptDesc->pzText */ 1258 puts(_("Enable authentication with the key auth-keynumber")); 1259 1260 /* referenced via sntpOptions.pOptDesc->pzText */ 1261 puts(_("Listen to the address specified for broadcast time sync")); 1262 1263 /* referenced via sntpOptions.pOptDesc->pzText */ 1264 puts(_("Concurrently query all IPs returned for host-name")); 1265 1266 /* referenced via sntpOptions.pOptDesc->pzText */ 1267 puts(_("Increase debug verbosity level")); 1268 1269 /* referenced via sntpOptions.pOptDesc->pzText */ 1270 puts(_("Set the debug verbosity level")); 1271 1272 /* referenced via sntpOptions.pOptDesc->pzText */ 1273 puts(_("The gap (in milliseconds) between time requests")); 1274 1275 /* referenced via sntpOptions.pOptDesc->pzText */ 1276 puts(_("KoD history filename")); 1277 1278 /* referenced via sntpOptions.pOptDesc->pzText */ 1279 puts(_("Look in this file for the key specified with -a")); 1280 1281 /* referenced via sntpOptions.pOptDesc->pzText */ 1282 puts(_("Log to specified logfile")); 1283 1284 /* referenced via sntpOptions.pOptDesc->pzText */ 1285 puts(_("Adjustments less than steplimit msec will be slewed")); 1286 1287 /* referenced via sntpOptions.pOptDesc->pzText */ 1288 puts(_("Send int as our NTP protocol version")); 1289 1290 /* referenced via sntpOptions.pOptDesc->pzText */ 1291 puts(_("Use the NTP Reserved Port (port 123)")); 1292 1293 /* referenced via sntpOptions.pOptDesc->pzText */ 1294 puts(_("OK to 'step' the time with settimeofday(2)")); 1295 1296 /* referenced via sntpOptions.pOptDesc->pzText */ 1297 puts(_("OK to 'slew' the time with adjtime(2)")); 1298 1299 /* referenced via sntpOptions.pOptDesc->pzText */ 1300 puts(_("The number of seconds to wait for responses")); 1301 1302 /* referenced via sntpOptions.pOptDesc->pzText */ 1303 puts(_("Wait for pending replies (if not setting the time)")); 1304 1305 /* referenced via sntpOptions.pOptDesc->pzText */ 1306 puts(_("display extended usage information and exit")); 1307 1308 /* referenced via sntpOptions.pOptDesc->pzText */ 1309 puts(_("extended usage information passed thru pager")); 1310 1311 /* referenced via sntpOptions.pOptDesc->pzText */ 1312 puts(_("output version information and exit")); 1313 1314 /* referenced via sntpOptions.pOptDesc->pzText */ 1315 puts(_("save the option state to a config file")); 1316 1317 /* referenced via sntpOptions.pOptDesc->pzText */ 1318 puts(_("load options from a config file")); 1319 1320 /* referenced via sntpOptions.pzUsageTitle */ 1321 puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.7p404\n\ 1322 Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\ 1323 \t\t[ hostname-or-IP ...]\n")); 1324 1325 /* referenced via sntpOptions.pzExplain */ 1326 puts(_("\n")); 1327 1328 /* referenced via sntpOptions.pzFullVersion */ 1329 puts(_("sntp 4.2.7p404")); 1330 1331 /* referenced via sntpOptions.pzFullUsage */ 1332 puts(_("<<<NOT-FOUND>>>")); 1333 1334 /* referenced via sntpOptions.pzShortUsage */ 1335 puts(_("<<<NOT-FOUND>>>")); 1336 /* LIBOPTS-MESSAGES: */ 1337 #line 67 "../autoopts.c" 1338 puts(_("allocation of %d bytes failed\n")); 1339 #line 93 "../autoopts.c" 1340 puts(_("allocation of %d bytes failed\n")); 1341 #line 53 "../init.c" 1342 puts(_("AutoOpts function called without option descriptor\n")); 1343 #line 90 "../init.c" 1344 puts(_("\tThis exceeds the compiled library version: ")); 1345 #line 88 "../init.c" 1346 puts(_("Automated Options Processing Error!\n" 1347 "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); 1348 #line 80 "../autoopts.c" 1349 puts(_("realloc of %d bytes at 0x%p failed\n")); 1350 #line 92 "../init.c" 1351 puts(_("\tThis is less than the minimum library version: ")); 1352 #line 121 "../version.c" 1353 puts(_("Automated Options version %s\n" 1354 "\tCopyright (C) 1999-2013 by Bruce Korb - all rights reserved\n")); 1355 #line 82 "../makeshell.c" 1356 puts(_("(AutoOpts bug): %s.\n")); 1357 #line 90 "../reset.c" 1358 puts(_("optionResetOpt() called, but reset-option not configured")); 1359 #line 292 "../usage.c" 1360 puts(_("could not locate the 'help' option")); 1361 #line 336 "../autoopts.c" 1362 puts(_("optionProcess() was called with invalid data")); 1363 #line 748 "../usage.c" 1364 puts(_("invalid argument type specified")); 1365 #line 598 "../find.c" 1366 puts(_("defaulted to option with optional arg")); 1367 #line 76 "../alias.c" 1368 puts(_("aliasing option is out of range.")); 1369 #line 234 "../enum.c" 1370 puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); 1371 #line 108 "../find.c" 1372 puts(_(" The following options match:\n")); 1373 #line 293 "../find.c" 1374 puts(_("%s: ambiguous option name: %s (matches %d options)\n")); 1375 #line 161 "../check.c" 1376 puts(_("%s: Command line arguments required\n")); 1377 #line 43 "../alias.c" 1378 puts(_("%d %s%s options allowed\n")); 1379 #line 89 "../makeshell.c" 1380 puts(_("%s error %d (%s) calling %s for '%s'\n")); 1381 #line 301 "../makeshell.c" 1382 puts(_("interprocess pipe")); 1383 #line 168 "../version.c" 1384 puts(_("error: version option argument '%c' invalid. Use:\n" 1385 "\t'v' - version only\n" 1386 "\t'c' - version and copyright\n" 1387 "\t'n' - version and full copyright notice\n")); 1388 #line 58 "../check.c" 1389 puts(_("%s error: the '%s' and '%s' options conflict\n")); 1390 #line 217 "../find.c" 1391 puts(_("%s: The '%s' option has been disabled.")); 1392 #line 430 "../find.c" 1393 puts(_("%s: The '%s' option has been disabled.")); 1394 #line 38 "../alias.c" 1395 puts(_("-equivalence")); 1396 #line 469 "../find.c" 1397 puts(_("%s: illegal option -- %c\n")); 1398 #line 110 "../reset.c" 1399 puts(_("%s: illegal option -- %c\n")); 1400 #line 271 "../find.c" 1401 puts(_("%s: illegal option -- %s\n")); 1402 #line 755 "../find.c" 1403 puts(_("%s: illegal option -- %s\n")); 1404 #line 118 "../reset.c" 1405 puts(_("%s: illegal option -- %s\n")); 1406 #line 335 "../find.c" 1407 puts(_("%s: unknown vendor extension option -- %s\n")); 1408 #line 159 "../enum.c" 1409 puts(_(" or an integer from %d through %d\n")); 1410 #line 169 "../enum.c" 1411 puts(_(" or an integer from %d through %d\n")); 1412 #line 747 "../usage.c" 1413 puts(_("%s error: invalid option descriptor for %s\n")); 1414 #line 1081 "../usage.c" 1415 puts(_("%s error: invalid option descriptor for %s\n")); 1416 #line 385 "../find.c" 1417 puts(_("%s: invalid option name: %s\n")); 1418 #line 527 "../find.c" 1419 puts(_("%s: The '%s' option requires an argument.\n")); 1420 #line 156 "../autoopts.c" 1421 puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" 1422 "\t'%s' and '%s'.")); 1423 #line 94 "../check.c" 1424 puts(_("%s error: The %s option is required\n")); 1425 #line 632 "../find.c" 1426 puts(_("%s: The '%s' option cannot have an argument.\n")); 1427 #line 151 "../check.c" 1428 puts(_("%s: Command line arguments are not allowed.\n")); 1429 #line 535 "../save.c" 1430 puts(_("error %d (%s) creating %s\n")); 1431 #line 234 "../enum.c" 1432 puts(_("%s error: '%s' does not match any %s keywords.\n")); 1433 #line 93 "../reset.c" 1434 puts(_("%s error: The '%s' option requires an argument.\n")); 1435 #line 184 "../save.c" 1436 puts(_("error %d (%s) stat-ing %s\n")); 1437 #line 238 "../save.c" 1438 puts(_("error %d (%s) stat-ing %s\n")); 1439 #line 143 "../restore.c" 1440 puts(_("%s error: no saved option state\n")); 1441 #line 231 "../autoopts.c" 1442 puts(_("'%s' is not a command line option.\n")); 1443 #line 114 "../time.c" 1444 puts(_("%s error: '%s' is not a recognizable date/time.\n")); 1445 #line 132 "../save.c" 1446 puts(_("'%s' not defined\n")); 1447 #line 53 "../time.c" 1448 puts(_("%s error: '%s' is not a recognizable time duration.\n")); 1449 #line 92 "../check.c" 1450 puts(_("%s error: The %s option must appear %d times.\n")); 1451 #line 157 "../numeric.c" 1452 puts(_("%s error: '%s' is not a recognizable number.\n")); 1453 #line 200 "../enum.c" 1454 puts(_("%s error: %s exceeds %s keyword count\n")); 1455 #line 330 "../usage.c" 1456 puts(_("Try '%s %s' for more information.\n")); 1457 #line 45 "../alias.c" 1458 puts(_("one %s%s option allowed\n")); 1459 #line 203 "../makeshell.c" 1460 puts(_("standard output")); 1461 #line 938 "../makeshell.c" 1462 puts(_("standard output")); 1463 #line 274 "../usage.c" 1464 puts(_("standard output")); 1465 #line 415 "../usage.c" 1466 puts(_("standard output")); 1467 #line 625 "../usage.c" 1468 puts(_("standard output")); 1469 #line 175 "../version.c" 1470 puts(_("standard output")); 1471 #line 274 "../usage.c" 1472 puts(_("standard error")); 1473 #line 415 "../usage.c" 1474 puts(_("standard error")); 1475 #line 625 "../usage.c" 1476 puts(_("standard error")); 1477 #line 175 "../version.c" 1478 puts(_("standard error")); 1479 #line 203 "../makeshell.c" 1480 puts(_("write")); 1481 #line 938 "../makeshell.c" 1482 puts(_("write")); 1483 #line 273 "../usage.c" 1484 puts(_("write")); 1485 #line 414 "../usage.c" 1486 puts(_("write")); 1487 #line 624 "../usage.c" 1488 puts(_("write")); 1489 #line 174 "../version.c" 1490 puts(_("write")); 1491 #line 60 "../numeric.c" 1492 puts(_("%s error: %s option value %ld is out of range.\n")); 1493 #line 44 "../check.c" 1494 puts(_("%s error: %s option requires the %s option\n")); 1495 #line 131 "../save.c" 1496 puts(_("%s warning: cannot save options - %s not regular file\n")); 1497 #line 183 "../save.c" 1498 puts(_("%s warning: cannot save options - %s not regular file\n")); 1499 #line 237 "../save.c" 1500 puts(_("%s warning: cannot save options - %s not regular file\n")); 1501 #line 256 "../save.c" 1502 puts(_("%s warning: cannot save options - %s not regular file\n")); 1503 #line 534 "../save.c" 1504 puts(_("%s warning: cannot save options - %s not regular file\n")); 1505 /* END-LIBOPTS-MESSAGES */ 1506 1507 /* USAGE-TEXT: */ 1508 #line 873 "../usage.c" 1509 puts(_("\t\t\t\t- an alternate for '%s'\n")); 1510 #line 1148 "../usage.c" 1511 puts(_("Version, usage and configuration options:")); 1512 #line 924 "../usage.c" 1513 puts(_("\t\t\t\t- default option for unnamed options\n")); 1514 #line 837 "../usage.c" 1515 puts(_("\t\t\t\t- disabled as '--%s'\n")); 1516 #line 1117 "../usage.c" 1517 puts(_(" --- %-14s %s\n")); 1518 #line 1115 "../usage.c" 1519 puts(_("This option has been disabled")); 1520 #line 864 "../usage.c" 1521 puts(_("\t\t\t\t- enabled by default\n")); 1522 #line 40 "../alias.c" 1523 puts(_("%s error: only ")); 1524 #line 1194 "../usage.c" 1525 puts(_(" - examining environment variables named %s_*\n")); 1526 #line 168 "../file.c" 1527 puts(_("\t\t\t\t- file must not pre-exist\n")); 1528 #line 172 "../file.c" 1529 puts(_("\t\t\t\t- file must pre-exist\n")); 1530 #line 380 "../usage.c" 1531 puts(_("Options are specified by doubled hyphens and their name or by a single\n" 1532 "hyphen and the flag character.\n")); 1533 #line 916 "../makeshell.c" 1534 puts(_("\n" 1535 "= = = = = = = =\n\n" 1536 "This incarnation of genshell will produce\n" 1537 "a shell script to parse the options for %s:\n\n")); 1538 #line 166 "../enum.c" 1539 puts(_(" or an integer mask with any of the lower %d bits set\n")); 1540 #line 897 "../usage.c" 1541 puts(_("\t\t\t\t- is a set membership option\n")); 1542 #line 918 "../usage.c" 1543 puts(_("\t\t\t\t- must appear between %d and %d times\n")); 1544 #line 382 "../usage.c" 1545 puts(_("Options are specified by single or double hyphens and their name.\n")); 1546 #line 904 "../usage.c" 1547 puts(_("\t\t\t\t- may appear multiple times\n")); 1548 #line 891 "../usage.c" 1549 puts(_("\t\t\t\t- may not be preset\n")); 1550 #line 1309 "../usage.c" 1551 puts(_(" Arg Option-Name Description\n")); 1552 #line 1245 "../usage.c" 1553 puts(_(" Flg Arg Option-Name Description\n")); 1554 #line 1303 "../usage.c" 1555 puts(_(" Flg Arg Option-Name Description\n")); 1556 #line 1304 "../usage.c" 1557 puts(_(" %3s %s")); 1558 #line 1310 "../usage.c" 1559 puts(_(" %3s %s")); 1560 #line 387 "../usage.c" 1561 puts(_("The '-#<number>' option may omit the hash char\n")); 1562 #line 383 "../usage.c" 1563 puts(_("All arguments are named options.\n")); 1564 #line 971 "../usage.c" 1565 puts(_(" - reading file %s")); 1566 #line 409 "../usage.c" 1567 puts(_("\n" 1568 "Please send bug reports to: <%s>\n")); 1569 #line 100 "../version.c" 1570 puts(_("\n" 1571 "Please send bug reports to: <%s>\n")); 1572 #line 129 "../version.c" 1573 puts(_("\n" 1574 "Please send bug reports to: <%s>\n")); 1575 #line 903 "../usage.c" 1576 puts(_("\t\t\t\t- may NOT appear - preset only\n")); 1577 #line 944 "../usage.c" 1578 puts(_("\n" 1579 "The following option preset mechanisms are supported:\n")); 1580 #line 1192 "../usage.c" 1581 puts(_("\n" 1582 "The following option preset mechanisms are supported:\n")); 1583 #line 682 "../usage.c" 1584 puts(_("prohibits these options:\n")); 1585 #line 677 "../usage.c" 1586 puts(_("prohibits the option '%s'\n")); 1587 #line 81 "../numeric.c" 1588 puts(_("%s%ld to %ld")); 1589 #line 79 "../numeric.c" 1590 puts(_("%sgreater than or equal to %ld")); 1591 #line 75 "../numeric.c" 1592 puts(_("%s%ld exactly")); 1593 #line 68 "../numeric.c" 1594 puts(_("%sit must lie in one of the ranges:\n")); 1595 #line 68 "../numeric.c" 1596 puts(_("%sit must be in the range:\n")); 1597 #line 88 "../numeric.c" 1598 puts(_(", or\n")); 1599 #line 66 "../numeric.c" 1600 puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); 1601 #line 77 "../numeric.c" 1602 puts(_("%sless than or equal to %ld")); 1603 #line 390 "../usage.c" 1604 puts(_("Operands and options may be intermixed. They will be reordered.\n")); 1605 #line 652 "../usage.c" 1606 puts(_("requires the option '%s'\n")); 1607 #line 655 "../usage.c" 1608 puts(_("requires these options:\n")); 1609 #line 1321 "../usage.c" 1610 puts(_(" Arg Option-Name Req? Description\n")); 1611 #line 1315 "../usage.c" 1612 puts(_(" Flg Arg Option-Name Req? Description\n")); 1613 #line 167 "../enum.c" 1614 puts(_("or you may use a numeric representation. Preceding these with a '!'\n" 1615 "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" 1616 "will set them all. Multiple entries may be passed as an option\n" 1617 "argument list.\n")); 1618 #line 910 "../usage.c" 1619 puts(_("\t\t\t\t- may appear up to %d times\n")); 1620 #line 77 "../enum.c" 1621 puts(_("The valid \"%s\" option keywords are:\n")); 1622 #line 1152 "../usage.c" 1623 puts(_("The next option supports vendor supported extra options:")); 1624 #line 773 "../usage.c" 1625 puts(_("These additional options are:")); 1626 /* END-USAGE-TEXT */ 1627 } 1628 #endif /* uncompilable code */ 1629 #ifdef __cplusplus 1630 } 1631 #endif 1632 /* sntp-opts.c ends here */ 1633