xref: /netbsd-src/external/bsd/ntp/dist/sntp/sntp-opts.c (revision eabc0478de71e4e011a5b4e0392741e01d491794)
1*eabc0478Schristos /*	$NetBSD: sntp-opts.c,v 1.16 2024/08/18 20:47:20 christos Exp $	*/
2abb0f93cSkardel 
3abb0f93cSkardel /*
4abb0f93cSkardel  *  EDIT THIS FILE WITH CAUTION  (sntp-opts.c)
5abb0f93cSkardel  *
6*eabc0478Schristos  *  It has been AutoGen-ed  May 25, 2024 at 12:02:07 AM by AutoGen 5.18.16
7abb0f93cSkardel  *  From the definitions    sntp-opts.def
8abb0f93cSkardel  *  and the template file   options
9abb0f93cSkardel  *
10*eabc0478Schristos  * Generated from AutoOpts 42:1:17 templates.
11f003fb54Skardel  *
12f003fb54Skardel  *  AutoOpts is a copyrighted work.  This source file is not encumbered
13f003fb54Skardel  *  by AutoOpts licensing, but is provided under the licensing terms chosen
14f003fb54Skardel  *  by the sntp author or copyright holder.  AutoOpts is
15f003fb54Skardel  *  licensed under the terms of the LGPL.  The redistributable library
16f003fb54Skardel  *  (``libopts'') is licensed under the terms of either the LGPL or, at the
17f003fb54Skardel  *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
18f003fb54Skardel  *  for details.
19abb0f93cSkardel  *
208585484eSchristos  * The sntp program is copyrighted and licensed
218585484eSchristos  * under the following terms:
22abb0f93cSkardel  *
23*eabc0478Schristos  *  Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.
248585484eSchristos  *  This is free software. It is licensed for use, modification and
258585484eSchristos  *  redistribution under the terms of the NTP License, copies of which
268585484eSchristos  *  can be seen at:
278585484eSchristos  *    <http://ntp.org/license>
288585484eSchristos  *    <http://opensource.org/licenses/ntp-license.php>
29f003fb54Skardel  *
308585484eSchristos  *  Permission to use, copy, modify, and distribute this software and its
318585484eSchristos  *  documentation for any purpose with or without fee is hereby granted,
328585484eSchristos  *  provided that the above copyright notice appears in all copies and that
338585484eSchristos  *  both the copyright notice and this permission notice appear in
348585484eSchristos  *  supporting documentation, and that the name The University of Delaware not be used in
358585484eSchristos  *  advertising or publicity pertaining to distribution of the software
367476e6e4Schristos  *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
378585484eSchristos  *  representations about the suitability this software for any purpose. It
388585484eSchristos  *  is provided "as is" without express or implied warranty.
39abb0f93cSkardel  */
40abb0f93cSkardel 
418585484eSchristos #ifndef __doxygen__
428585484eSchristos #define OPTION_CODE_COMPILE 1
438585484eSchristos #include "sntp-opts.h"
44abb0f93cSkardel #include <sys/types.h>
45*eabc0478Schristos #include <sys/stat.h>
46f003fb54Skardel 
47*eabc0478Schristos #include <errno.h>
48*eabc0478Schristos #include <fcntl.h>
49abb0f93cSkardel #include <limits.h>
50abb0f93cSkardel #include <stdio.h>
51abb0f93cSkardel #include <stdlib.h>
52*eabc0478Schristos #include <string.h>
53*eabc0478Schristos #include <unistd.h>
54abb0f93cSkardel 
55abb0f93cSkardel #ifdef  __cplusplus
56abb0f93cSkardel extern "C" {
57abb0f93cSkardel #endif
58f003fb54Skardel extern FILE * option_usage_fp;
598585484eSchristos #define zCopyright      (sntp_opt_strs+0)
60ccc794f0Schristos #define zLicenseDescrip (sntp_opt_strs+341)
61abb0f93cSkardel 
628585484eSchristos /*
638585484eSchristos  *  global included definitions
648585484eSchristos  */
658585484eSchristos #ifdef __windows
668585484eSchristos   extern int atoi(const char*);
678585484eSchristos #else
688585484eSchristos # include <stdlib.h>
698585484eSchristos #endif
70abb0f93cSkardel 
71abb0f93cSkardel #ifndef NULL
72abb0f93cSkardel #  define NULL 0
73abb0f93cSkardel #endif
74abb0f93cSkardel 
758585484eSchristos /**
768585484eSchristos  *  static const strings for sntp options
778585484eSchristos  */
78*eabc0478Schristos static char const sntp_opt_strs[2567] =
79*eabc0478Schristos /*     0 */ "sntp 4.2.8p18\n"
80*eabc0478Schristos             "Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n"
818585484eSchristos             "This is free software. It is licensed for use, modification and\n"
828585484eSchristos             "redistribution under the terms of the NTP License, copies of which\n"
838585484eSchristos             "can be seen at:\n"
848585484eSchristos             "  <http://ntp.org/license>\n"
858585484eSchristos             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
86ccc794f0Schristos /*   341 */ "Permission to use, copy, modify, and distribute this software and its\n"
878585484eSchristos             "documentation for any purpose with or without fee is hereby granted,\n"
888585484eSchristos             "provided that the above copyright notice appears in all copies and that\n"
898585484eSchristos             "both the copyright notice and this permission notice appear in supporting\n"
908585484eSchristos             "documentation, and that the name The University of Delaware not be used in\n"
918585484eSchristos             "advertising or publicity pertaining to distribution of the software without\n"
927476e6e4Schristos             "specific, written prior permission.  The University of Delaware and Network\n"
937476e6e4Schristos             "Time Foundation makes no representations about the suitability this\n"
947476e6e4Schristos             "software for any purpose.  It is provided \"as is\" without express or\n"
957476e6e4Schristos             "implied warranty.\n\0"
96ccc794f0Schristos /*  1009 */ "Force IPv4 DNS name resolution\0"
97ccc794f0Schristos /*  1040 */ "IPV4\0"
98ccc794f0Schristos /*  1045 */ "ipv4\0"
99ccc794f0Schristos /*  1050 */ "Force IPv6 DNS name resolution\0"
100ccc794f0Schristos /*  1081 */ "IPV6\0"
101ccc794f0Schristos /*  1086 */ "ipv6\0"
102ccc794f0Schristos /*  1091 */ "Enable authentication with the key auth-keynumber\0"
103ccc794f0Schristos /*  1141 */ "AUTHENTICATION\0"
104ccc794f0Schristos /*  1156 */ "authentication\0"
105ccc794f0Schristos /*  1171 */ "Listen to the address specified for broadcast time sync\0"
106ccc794f0Schristos /*  1227 */ "BROADCAST\0"
107ccc794f0Schristos /*  1237 */ "broadcast\0"
108ccc794f0Schristos /*  1247 */ "Concurrently query all IPs returned for host-name\0"
109ccc794f0Schristos /*  1297 */ "CONCURRENT\0"
110ccc794f0Schristos /*  1308 */ "concurrent\0"
111ccc794f0Schristos /*  1319 */ "Increase debug verbosity level\0"
112ccc794f0Schristos /*  1350 */ "DEBUG_LEVEL\0"
113ccc794f0Schristos /*  1362 */ "debug-level\0"
114ccc794f0Schristos /*  1374 */ "Set the debug verbosity level\0"
115ccc794f0Schristos /*  1404 */ "SET_DEBUG_LEVEL\0"
116ccc794f0Schristos /*  1420 */ "set-debug-level\0"
117ccc794f0Schristos /*  1436 */ "The gap (in milliseconds) between time requests\0"
118ccc794f0Schristos /*  1484 */ "GAP\0"
119ccc794f0Schristos /*  1488 */ "gap\0"
120ccc794f0Schristos /*  1492 */ "KoD history filename\0"
121ccc794f0Schristos /*  1513 */ "KOD\0"
122ccc794f0Schristos /*  1517 */ "kod\0"
123ccc794f0Schristos /*  1521 */ "/var/db/ntp-kod\0"
124ccc794f0Schristos /*  1537 */ "Look in this file for the key specified with -a\0"
125ccc794f0Schristos /*  1585 */ "KEYFILE\0"
126ccc794f0Schristos /*  1593 */ "keyfile\0"
1274eea345dSchristos /*  1601 */ "/etc/ntp.keys\0"
1284eea345dSchristos /*  1615 */ "Log to specified logfile\0"
1294eea345dSchristos /*  1640 */ "LOGFILE\0"
1304eea345dSchristos /*  1648 */ "logfile\0"
1314eea345dSchristos /*  1656 */ "Adjustments less than steplimit msec will be slewed\0"
1324eea345dSchristos /*  1708 */ "STEPLIMIT\0"
1334eea345dSchristos /*  1718 */ "steplimit\0"
1344eea345dSchristos /*  1728 */ "Send int as our NTP protocol version\0"
1354eea345dSchristos /*  1765 */ "NTPVERSION\0"
1364eea345dSchristos /*  1776 */ "ntpversion\0"
1374eea345dSchristos /*  1787 */ "Use the NTP Reserved Port (port 123)\0"
1384eea345dSchristos /*  1824 */ "USERESERVEDPORT\0"
1394eea345dSchristos /*  1840 */ "usereservedport\0"
1404eea345dSchristos /*  1856 */ "OK to 'step' the time with settimeofday(2)\0"
1414eea345dSchristos /*  1899 */ "STEP\0"
1424eea345dSchristos /*  1904 */ "step\0"
1434eea345dSchristos /*  1909 */ "OK to 'slew' the time with adjtime(2)\0"
1444eea345dSchristos /*  1947 */ "SLEW\0"
1454eea345dSchristos /*  1952 */ "slew\0"
1464eea345dSchristos /*  1957 */ "The number of seconds to wait for responses\0"
1474eea345dSchristos /*  2001 */ "TIMEOUT\0"
1484eea345dSchristos /*  2009 */ "timeout\0"
1494eea345dSchristos /*  2017 */ "Wait for pending replies (if not setting the time)\0"
1504eea345dSchristos /*  2068 */ "WAIT\0"
1514eea345dSchristos /*  2073 */ "no-wait\0"
1524eea345dSchristos /*  2081 */ "no\0"
1534eea345dSchristos /*  2084 */ "display extended usage information and exit\0"
1544eea345dSchristos /*  2128 */ "help\0"
1554eea345dSchristos /*  2133 */ "extended usage information passed thru pager\0"
1564eea345dSchristos /*  2178 */ "more-help\0"
1574eea345dSchristos /*  2188 */ "output version information and exit\0"
1584eea345dSchristos /*  2224 */ "version\0"
1594eea345dSchristos /*  2232 */ "save the option state to a config file\0"
1604eea345dSchristos /*  2271 */ "save-opts\0"
1614eea345dSchristos /*  2281 */ "load options from a config file\0"
1624eea345dSchristos /*  2313 */ "LOAD_OPTS\0"
1634eea345dSchristos /*  2323 */ "no-load-opts\0"
1644eea345dSchristos /*  2336 */ "SNTP\0"
165*eabc0478Schristos /*  2341 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p18\n"
1668585484eSchristos             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
1678585484eSchristos             "\t\t[ hostname-or-IP ...]\n\0"
1684eea345dSchristos /*  2501 */ "$HOME\0"
1694eea345dSchristos /*  2507 */ ".\0"
1704eea345dSchristos /*  2509 */ ".ntprc\0"
171*eabc0478Schristos /*  2516 */ "https://bugs.ntp.org, bugs@ntp.org\0"
172*eabc0478Schristos /*  2551 */ "\n\0"
173*eabc0478Schristos /*  2553 */ "sntp 4.2.8p18";
1748585484eSchristos 
1758585484eSchristos /**
1768585484eSchristos  *  ipv4 option description with
177abb0f93cSkardel  *  "Must also have options" and "Incompatible options":
178abb0f93cSkardel  */
1798585484eSchristos /** Descriptive text for the ipv4 option */
180ccc794f0Schristos #define IPV4_DESC      (sntp_opt_strs+1009)
1818585484eSchristos /** Upper-cased name for the ipv4 option */
182ccc794f0Schristos #define IPV4_NAME      (sntp_opt_strs+1040)
1838585484eSchristos /** Name string for the ipv4 option */
184ccc794f0Schristos #define IPV4_name      (sntp_opt_strs+1045)
1858585484eSchristos /** Other options that appear in conjunction with the ipv4 option */
1868585484eSchristos static int const aIpv4CantList[] = {
187abb0f93cSkardel     INDEX_OPT_IPV6, NO_EQUIVALENT };
1888585484eSchristos /** Compiled in flag settings for the ipv4 option */
189abb0f93cSkardel #define IPV4_FLAGS     (OPTST_DISABLED)
190abb0f93cSkardel 
1918585484eSchristos /**
1928585484eSchristos  *  ipv6 option description with
193abb0f93cSkardel  *  "Must also have options" and "Incompatible options":
194abb0f93cSkardel  */
1958585484eSchristos /** Descriptive text for the ipv6 option */
196ccc794f0Schristos #define IPV6_DESC      (sntp_opt_strs+1050)
1978585484eSchristos /** Upper-cased name for the ipv6 option */
198ccc794f0Schristos #define IPV6_NAME      (sntp_opt_strs+1081)
1998585484eSchristos /** Name string for the ipv6 option */
200ccc794f0Schristos #define IPV6_name      (sntp_opt_strs+1086)
2018585484eSchristos /** Other options that appear in conjunction with the ipv6 option */
2028585484eSchristos static int const aIpv6CantList[] = {
203abb0f93cSkardel     INDEX_OPT_IPV4, NO_EQUIVALENT };
2048585484eSchristos /** Compiled in flag settings for the ipv6 option */
205abb0f93cSkardel #define IPV6_FLAGS     (OPTST_DISABLED)
206abb0f93cSkardel 
2078585484eSchristos /**
2088585484eSchristos  *  authentication option description:
209abb0f93cSkardel  */
2108585484eSchristos /** Descriptive text for the authentication option */
211ccc794f0Schristos #define AUTHENTICATION_DESC      (sntp_opt_strs+1091)
2128585484eSchristos /** Upper-cased name for the authentication option */
213ccc794f0Schristos #define AUTHENTICATION_NAME      (sntp_opt_strs+1141)
2148585484eSchristos /** Name string for the authentication option */
215ccc794f0Schristos #define AUTHENTICATION_name      (sntp_opt_strs+1156)
2168585484eSchristos /** Compiled in flag settings for the authentication option */
217abb0f93cSkardel #define AUTHENTICATION_FLAGS     (OPTST_DISABLED \
218abb0f93cSkardel         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
219abb0f93cSkardel 
2208585484eSchristos /**
2218585484eSchristos  *  broadcast option description:
222abb0f93cSkardel  */
2238585484eSchristos /** Descriptive text for the broadcast option */
224ccc794f0Schristos #define BROADCAST_DESC      (sntp_opt_strs+1171)
2258585484eSchristos /** Upper-cased name for the broadcast option */
226ccc794f0Schristos #define BROADCAST_NAME      (sntp_opt_strs+1227)
2278585484eSchristos /** Name string for the broadcast option */
228ccc794f0Schristos #define BROADCAST_name      (sntp_opt_strs+1237)
2298585484eSchristos /** Compiled in flag settings for the broadcast option */
2308585484eSchristos #define BROADCAST_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
231abb0f93cSkardel         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
232abb0f93cSkardel 
2338585484eSchristos /**
2348585484eSchristos  *  concurrent option description:
2358585484eSchristos  */
2368585484eSchristos /** Descriptive text for the concurrent option */
237ccc794f0Schristos #define CONCURRENT_DESC      (sntp_opt_strs+1247)
2388585484eSchristos /** Upper-cased name for the concurrent option */
239ccc794f0Schristos #define CONCURRENT_NAME      (sntp_opt_strs+1297)
2408585484eSchristos /** Name string for the concurrent option */
241ccc794f0Schristos #define CONCURRENT_name      (sntp_opt_strs+1308)
2428585484eSchristos /** Compiled in flag settings for the concurrent option */
2438585484eSchristos #define CONCURRENT_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
2448585484eSchristos         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
2458585484eSchristos 
2468585484eSchristos /**
2478585484eSchristos  *  debug-level option description:
2488585484eSchristos  */
2498585484eSchristos /** Descriptive text for the debug-level option */
250ccc794f0Schristos #define DEBUG_LEVEL_DESC      (sntp_opt_strs+1319)
2518585484eSchristos /** Upper-cased name for the debug-level option */
252ccc794f0Schristos #define DEBUG_LEVEL_NAME      (sntp_opt_strs+1350)
2538585484eSchristos /** Name string for the debug-level option */
254ccc794f0Schristos #define DEBUG_LEVEL_name      (sntp_opt_strs+1362)
2558585484eSchristos /** Compiled in flag settings for the debug-level option */
2568585484eSchristos #define DEBUG_LEVEL_FLAGS     (OPTST_DISABLED)
2578585484eSchristos 
2588585484eSchristos /**
2598585484eSchristos  *  set-debug-level option description:
2608585484eSchristos  */
2618585484eSchristos /** Descriptive text for the set-debug-level option */
262ccc794f0Schristos #define SET_DEBUG_LEVEL_DESC      (sntp_opt_strs+1374)
2638585484eSchristos /** Upper-cased name for the set-debug-level option */
264ccc794f0Schristos #define SET_DEBUG_LEVEL_NAME      (sntp_opt_strs+1404)
2658585484eSchristos /** Name string for the set-debug-level option */
266ccc794f0Schristos #define SET_DEBUG_LEVEL_name      (sntp_opt_strs+1420)
2678585484eSchristos /** Compiled in flag settings for the set-debug-level option */
2688585484eSchristos #define SET_DEBUG_LEVEL_FLAGS     (OPTST_DISABLED \
2698585484eSchristos         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
2708585484eSchristos 
2718585484eSchristos /**
2728585484eSchristos  *  gap option description:
2738585484eSchristos  */
2748585484eSchristos /** Descriptive text for the gap option */
275ccc794f0Schristos #define GAP_DESC      (sntp_opt_strs+1436)
2768585484eSchristos /** Upper-cased name for the gap option */
277ccc794f0Schristos #define GAP_NAME      (sntp_opt_strs+1484)
2788585484eSchristos /** Name string for the gap option */
279ccc794f0Schristos #define GAP_name      (sntp_opt_strs+1488)
2808585484eSchristos /** The compiled in default value for the gap option argument */
2818585484eSchristos #define GAP_DFT_ARG   ((char const*)50)
2828585484eSchristos /** Compiled in flag settings for the gap option */
2838585484eSchristos #define GAP_FLAGS     (OPTST_DISABLED \
2848585484eSchristos         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
2858585484eSchristos 
2868585484eSchristos /**
2878585484eSchristos  *  kod option description:
2888585484eSchristos  */
2898585484eSchristos /** Descriptive text for the kod option */
290ccc794f0Schristos #define KOD_DESC      (sntp_opt_strs+1492)
2918585484eSchristos /** Upper-cased name for the kod option */
292ccc794f0Schristos #define KOD_NAME      (sntp_opt_strs+1513)
2938585484eSchristos /** Name string for the kod option */
294ccc794f0Schristos #define KOD_name      (sntp_opt_strs+1517)
2958585484eSchristos /** The compiled in default value for the kod option argument */
296ccc794f0Schristos #define KOD_DFT_ARG   (sntp_opt_strs+1521)
2978585484eSchristos /** Compiled in flag settings for the kod option */
2988585484eSchristos #define KOD_FLAGS     (OPTST_DISABLED \
2998585484eSchristos         | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
3008585484eSchristos 
3018585484eSchristos /**
3028585484eSchristos  *  keyfile option description:
3038585484eSchristos  */
3048585484eSchristos /** Descriptive text for the keyfile option */
305ccc794f0Schristos #define KEYFILE_DESC      (sntp_opt_strs+1537)
3068585484eSchristos /** Upper-cased name for the keyfile option */
307ccc794f0Schristos #define KEYFILE_NAME      (sntp_opt_strs+1585)
3088585484eSchristos /** Name string for the keyfile option */
309ccc794f0Schristos #define KEYFILE_name      (sntp_opt_strs+1593)
3104eea345dSchristos /** The compiled in default value for the keyfile option argument */
3114eea345dSchristos #define KEYFILE_DFT_ARG   (sntp_opt_strs+1601)
3128585484eSchristos /** Compiled in flag settings for the keyfile option */
3138585484eSchristos #define KEYFILE_FLAGS     (OPTST_DISABLED \
3148585484eSchristos         | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
3158585484eSchristos 
3168585484eSchristos /**
3178585484eSchristos  *  logfile option description:
3188585484eSchristos  */
3198585484eSchristos /** Descriptive text for the logfile option */
3204eea345dSchristos #define LOGFILE_DESC      (sntp_opt_strs+1615)
3218585484eSchristos /** Upper-cased name for the logfile option */
3224eea345dSchristos #define LOGFILE_NAME      (sntp_opt_strs+1640)
3238585484eSchristos /** Name string for the logfile option */
3244eea345dSchristos #define LOGFILE_name      (sntp_opt_strs+1648)
3258585484eSchristos /** Compiled in flag settings for the logfile option */
3268585484eSchristos #define LOGFILE_FLAGS     (OPTST_DISABLED \
3278585484eSchristos         | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
3288585484eSchristos 
3298585484eSchristos /**
3308585484eSchristos  *  steplimit option description:
3318585484eSchristos  */
3328585484eSchristos /** Descriptive text for the steplimit option */
3334eea345dSchristos #define STEPLIMIT_DESC      (sntp_opt_strs+1656)
3348585484eSchristos /** Upper-cased name for the steplimit option */
3354eea345dSchristos #define STEPLIMIT_NAME      (sntp_opt_strs+1708)
3368585484eSchristos /** Name string for the steplimit option */
3374eea345dSchristos #define STEPLIMIT_name      (sntp_opt_strs+1718)
3388585484eSchristos /** Compiled in flag settings for the steplimit option */
3398585484eSchristos #define STEPLIMIT_FLAGS     (OPTST_DISABLED \
3408585484eSchristos         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
3418585484eSchristos 
3428585484eSchristos /**
3438585484eSchristos  *  ntpversion option description:
3448585484eSchristos  */
3458585484eSchristos /** Descriptive text for the ntpversion option */
3464eea345dSchristos #define NTPVERSION_DESC      (sntp_opt_strs+1728)
3478585484eSchristos /** Upper-cased name for the ntpversion option */
3484eea345dSchristos #define NTPVERSION_NAME      (sntp_opt_strs+1765)
3498585484eSchristos /** Name string for the ntpversion option */
3504eea345dSchristos #define NTPVERSION_name      (sntp_opt_strs+1776)
3518585484eSchristos /** The compiled in default value for the ntpversion option argument */
3528585484eSchristos #define NTPVERSION_DFT_ARG   ((char const*)4)
3538585484eSchristos /** Compiled in flag settings for the ntpversion option */
3548585484eSchristos #define NTPVERSION_FLAGS     (OPTST_DISABLED \
3558585484eSchristos         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
3568585484eSchristos 
3578585484eSchristos /**
3588585484eSchristos  *  usereservedport option description:
3598585484eSchristos  */
3608585484eSchristos /** Descriptive text for the usereservedport option */
3614eea345dSchristos #define USERESERVEDPORT_DESC      (sntp_opt_strs+1787)
3628585484eSchristos /** Upper-cased name for the usereservedport option */
3634eea345dSchristos #define USERESERVEDPORT_NAME      (sntp_opt_strs+1824)
3648585484eSchristos /** Name string for the usereservedport option */
3654eea345dSchristos #define USERESERVEDPORT_name      (sntp_opt_strs+1840)
3668585484eSchristos /** Compiled in flag settings for the usereservedport option */
3678585484eSchristos #define USERESERVEDPORT_FLAGS     (OPTST_DISABLED)
3688585484eSchristos 
3698585484eSchristos /**
3708585484eSchristos  *  step option description:
3718585484eSchristos  */
3728585484eSchristos /** Descriptive text for the step option */
3734eea345dSchristos #define STEP_DESC      (sntp_opt_strs+1856)
3748585484eSchristos /** Upper-cased name for the step option */
3754eea345dSchristos #define STEP_NAME      (sntp_opt_strs+1899)
3768585484eSchristos /** Name string for the step option */
3774eea345dSchristos #define STEP_name      (sntp_opt_strs+1904)
3788585484eSchristos /** Compiled in flag settings for the step option */
3798585484eSchristos #define STEP_FLAGS     (OPTST_DISABLED)
3808585484eSchristos 
3818585484eSchristos /**
3828585484eSchristos  *  slew option description:
3838585484eSchristos  */
3848585484eSchristos /** Descriptive text for the slew option */
3854eea345dSchristos #define SLEW_DESC      (sntp_opt_strs+1909)
3868585484eSchristos /** Upper-cased name for the slew option */
3874eea345dSchristos #define SLEW_NAME      (sntp_opt_strs+1947)
3888585484eSchristos /** Name string for the slew option */
3894eea345dSchristos #define SLEW_name      (sntp_opt_strs+1952)
3908585484eSchristos /** Compiled in flag settings for the slew option */
3918585484eSchristos #define SLEW_FLAGS     (OPTST_DISABLED)
3928585484eSchristos 
3938585484eSchristos /**
3948585484eSchristos  *  timeout option description:
3958585484eSchristos  */
3968585484eSchristos /** Descriptive text for the timeout option */
3974eea345dSchristos #define TIMEOUT_DESC      (sntp_opt_strs+1957)
3988585484eSchristos /** Upper-cased name for the timeout option */
3994eea345dSchristos #define TIMEOUT_NAME      (sntp_opt_strs+2001)
4008585484eSchristos /** Name string for the timeout option */
4014eea345dSchristos #define TIMEOUT_name      (sntp_opt_strs+2009)
4028585484eSchristos /** The compiled in default value for the timeout option argument */
4038585484eSchristos #define TIMEOUT_DFT_ARG   ((char const*)5)
4048585484eSchristos /** Compiled in flag settings for the timeout option */
4058585484eSchristos #define TIMEOUT_FLAGS     (OPTST_DISABLED \
4068585484eSchristos         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
4078585484eSchristos 
4088585484eSchristos /**
4098585484eSchristos  *  wait option description:
4108585484eSchristos  */
4118585484eSchristos /** Descriptive text for the wait option */
4124eea345dSchristos #define WAIT_DESC      (sntp_opt_strs+2017)
4138585484eSchristos /** Upper-cased name for the wait option */
4144eea345dSchristos #define WAIT_NAME      (sntp_opt_strs+2068)
4158585484eSchristos /** disablement name for the wait option */
4164eea345dSchristos #define NOT_WAIT_name  (sntp_opt_strs+2073)
4178585484eSchristos /** disablement prefix for the wait option */
4184eea345dSchristos #define NOT_WAIT_PFX   (sntp_opt_strs+2081)
4198585484eSchristos /** Name string for the wait option */
4208585484eSchristos #define WAIT_name      (NOT_WAIT_name + 3)
4218585484eSchristos /** Compiled in flag settings for the wait option */
4228585484eSchristos #define WAIT_FLAGS     (OPTST_INITENABLED)
4238585484eSchristos 
424abb0f93cSkardel /*
425abb0f93cSkardel  *  Help/More_Help/Version option descriptions:
426abb0f93cSkardel  */
4274eea345dSchristos #define HELP_DESC       (sntp_opt_strs+2084)
4284eea345dSchristos #define HELP_name       (sntp_opt_strs+2128)
429abb0f93cSkardel #ifdef HAVE_WORKING_FORK
4304eea345dSchristos #define MORE_HELP_DESC  (sntp_opt_strs+2133)
4314eea345dSchristos #define MORE_HELP_name  (sntp_opt_strs+2178)
4328585484eSchristos #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
433abb0f93cSkardel #else
4348585484eSchristos #define MORE_HELP_DESC  HELP_DESC
4358585484eSchristos #define MORE_HELP_name  HELP_name
4368585484eSchristos #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
437abb0f93cSkardel #endif
438abb0f93cSkardel #ifdef NO_OPTIONAL_OPT_ARGS
4398585484eSchristos #  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
440abb0f93cSkardel #else
4418585484eSchristos #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
4428585484eSchristos                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
443abb0f93cSkardel #endif
4444eea345dSchristos #define VER_DESC        (sntp_opt_strs+2188)
4454eea345dSchristos #define VER_name        (sntp_opt_strs+2224)
4464eea345dSchristos #define SAVE_OPTS_DESC  (sntp_opt_strs+2232)
4474eea345dSchristos #define SAVE_OPTS_name  (sntp_opt_strs+2271)
4484eea345dSchristos #define LOAD_OPTS_DESC     (sntp_opt_strs+2281)
4494eea345dSchristos #define LOAD_OPTS_NAME     (sntp_opt_strs+2313)
4504eea345dSchristos #define NO_LOAD_OPTS_name  (sntp_opt_strs+2323)
4514eea345dSchristos #define LOAD_OPTS_pfx      (sntp_opt_strs+2081)
4528585484eSchristos #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
4538585484eSchristos /**
454abb0f93cSkardel  *  Declare option callback procedures
455abb0f93cSkardel  */
456abb0f93cSkardel extern tOptProc
4578585484eSchristos     ntpOptionPrintVersion, optionBooleanVal,      optionNestedVal,
4588585484eSchristos     optionNumericVal,      optionPagedUsage,      optionResetOpt,
459f003fb54Skardel     optionStackArg,        optionTimeDate,        optionTimeVal,
460ea66d795Schristos     optionUnstackArg,      optionVendorOption;
461abb0f93cSkardel static tOptProc
4628585484eSchristos     doOptDebug_Level, doOptKeyfile,     doOptKod,         doOptLogfile,
4638585484eSchristos     doOptNtpversion,  doOptSteplimit,   doUsageOpt;
4648585484eSchristos #define VER_PROC        ntpOptionPrintVersion
4658585484eSchristos 
4668585484eSchristos /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
4678585484eSchristos /**
4688585484eSchristos  *  Define the sntp Option Descriptions.
4698585484eSchristos  * This is an array of OPTION_CT entries, one for each
4708585484eSchristos  * option that the sntp program responds to.
471abb0f93cSkardel  */
472abb0f93cSkardel static tOptDesc optDesc[OPTION_CT] = {
473abb0f93cSkardel   {  /* entry idx, value */ 0, VALUE_OPT_IPV4,
474abb0f93cSkardel      /* equiv idx, value */ 0, VALUE_OPT_IPV4,
475abb0f93cSkardel      /* equivalenced to  */ NO_EQUIVALENT,
476abb0f93cSkardel      /* min, max, act ct */ 0, 1, 0,
477abb0f93cSkardel      /* opt state flags  */ IPV4_FLAGS, 0,
4788585484eSchristos      /* last opt argumnt */ { NULL }, /* --ipv4 */
479abb0f93cSkardel      /* arg list/cookie  */ NULL,
480abb0f93cSkardel      /* must/cannot opts */ NULL, aIpv4CantList,
481abb0f93cSkardel      /* option proc      */ NULL,
4828585484eSchristos      /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name,
483abb0f93cSkardel      /* disablement strs */ NULL, NULL },
484abb0f93cSkardel 
485abb0f93cSkardel   {  /* entry idx, value */ 1, VALUE_OPT_IPV6,
486abb0f93cSkardel      /* equiv idx, value */ 1, VALUE_OPT_IPV6,
487abb0f93cSkardel      /* equivalenced to  */ NO_EQUIVALENT,
488abb0f93cSkardel      /* min, max, act ct */ 0, 1, 0,
489abb0f93cSkardel      /* opt state flags  */ IPV6_FLAGS, 0,
4908585484eSchristos      /* last opt argumnt */ { NULL }, /* --ipv6 */
491abb0f93cSkardel      /* arg list/cookie  */ NULL,
492abb0f93cSkardel      /* must/cannot opts */ NULL, aIpv6CantList,
493abb0f93cSkardel      /* option proc      */ NULL,
4948585484eSchristos      /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name,
495abb0f93cSkardel      /* disablement strs */ NULL, NULL },
496abb0f93cSkardel 
4978585484eSchristos   {  /* entry idx, value */ 2, VALUE_OPT_AUTHENTICATION,
4988585484eSchristos      /* equiv idx, value */ 2, VALUE_OPT_AUTHENTICATION,
499abb0f93cSkardel      /* equivalenced to  */ NO_EQUIVALENT,
500abb0f93cSkardel      /* min, max, act ct */ 0, 1, 0,
501abb0f93cSkardel      /* opt state flags  */ AUTHENTICATION_FLAGS, 0,
5028585484eSchristos      /* last opt argumnt */ { NULL }, /* --authentication */
503abb0f93cSkardel      /* arg list/cookie  */ NULL,
504abb0f93cSkardel      /* must/cannot opts */ NULL, NULL,
505abb0f93cSkardel      /* option proc      */ optionNumericVal,
5068585484eSchristos      /* desc, NAME, name */ AUTHENTICATION_DESC, AUTHENTICATION_NAME, AUTHENTICATION_name,
507abb0f93cSkardel      /* disablement strs */ NULL, NULL },
508abb0f93cSkardel 
5098585484eSchristos   {  /* entry idx, value */ 3, VALUE_OPT_BROADCAST,
5108585484eSchristos      /* equiv idx, value */ 3, VALUE_OPT_BROADCAST,
5118585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
5128585484eSchristos      /* min, max, act ct */ 0, NOLIMIT, 0,
5138585484eSchristos      /* opt state flags  */ BROADCAST_FLAGS, 0,
5148585484eSchristos      /* last opt argumnt */ { NULL }, /* --broadcast */
5158585484eSchristos      /* arg list/cookie  */ NULL,
5168585484eSchristos      /* must/cannot opts */ NULL, NULL,
5178585484eSchristos      /* option proc      */ optionStackArg,
5188585484eSchristos      /* desc, NAME, name */ BROADCAST_DESC, BROADCAST_NAME, BROADCAST_name,
5198585484eSchristos      /* disablement strs */ NULL, NULL },
5208585484eSchristos 
5218585484eSchristos   {  /* entry idx, value */ 4, VALUE_OPT_CONCURRENT,
5228585484eSchristos      /* equiv idx, value */ 4, VALUE_OPT_CONCURRENT,
5238585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
5248585484eSchristos      /* min, max, act ct */ 0, NOLIMIT, 0,
5258585484eSchristos      /* opt state flags  */ CONCURRENT_FLAGS, 0,
5268585484eSchristos      /* last opt argumnt */ { NULL }, /* --concurrent */
5278585484eSchristos      /* arg list/cookie  */ NULL,
5288585484eSchristos      /* must/cannot opts */ NULL, NULL,
5298585484eSchristos      /* option proc      */ optionStackArg,
5308585484eSchristos      /* desc, NAME, name */ CONCURRENT_DESC, CONCURRENT_NAME, CONCURRENT_name,
5318585484eSchristos      /* disablement strs */ NULL, NULL },
5328585484eSchristos 
5338585484eSchristos   {  /* entry idx, value */ 5, VALUE_OPT_DEBUG_LEVEL,
5348585484eSchristos      /* equiv idx, value */ 5, VALUE_OPT_DEBUG_LEVEL,
5358585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
5368585484eSchristos      /* min, max, act ct */ 0, NOLIMIT, 0,
5378585484eSchristos      /* opt state flags  */ DEBUG_LEVEL_FLAGS, 0,
5388585484eSchristos      /* last opt argumnt */ { NULL }, /* --debug-level */
5398585484eSchristos      /* arg list/cookie  */ NULL,
5408585484eSchristos      /* must/cannot opts */ NULL, NULL,
541ea66d795Schristos      /* option proc      */ doOptDebug_Level,
5428585484eSchristos      /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
5438585484eSchristos      /* disablement strs */ NULL, NULL },
5448585484eSchristos 
5458585484eSchristos   {  /* entry idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL,
5468585484eSchristos      /* equiv idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL,
5478585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
5488585484eSchristos      /* min, max, act ct */ 0, NOLIMIT, 0,
5498585484eSchristos      /* opt state flags  */ SET_DEBUG_LEVEL_FLAGS, 0,
5508585484eSchristos      /* last opt argumnt */ { NULL }, /* --set-debug-level */
5518585484eSchristos      /* arg list/cookie  */ NULL,
5528585484eSchristos      /* must/cannot opts */ NULL, NULL,
5538585484eSchristos      /* option proc      */ optionNumericVal,
5548585484eSchristos      /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
5558585484eSchristos      /* disablement strs */ NULL, NULL },
5568585484eSchristos 
5578585484eSchristos   {  /* entry idx, value */ 7, VALUE_OPT_GAP,
5588585484eSchristos      /* equiv idx, value */ 7, VALUE_OPT_GAP,
5598585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
5608585484eSchristos      /* min, max, act ct */ 0, 1, 0,
5618585484eSchristos      /* opt state flags  */ GAP_FLAGS, 0,
5628585484eSchristos      /* last opt argumnt */ { GAP_DFT_ARG },
5638585484eSchristos      /* arg list/cookie  */ NULL,
5648585484eSchristos      /* must/cannot opts */ NULL, NULL,
5658585484eSchristos      /* option proc      */ optionNumericVal,
5668585484eSchristos      /* desc, NAME, name */ GAP_DESC, GAP_NAME, GAP_name,
5678585484eSchristos      /* disablement strs */ NULL, NULL },
5688585484eSchristos 
5698585484eSchristos   {  /* entry idx, value */ 8, VALUE_OPT_KOD,
5708585484eSchristos      /* equiv idx, value */ 8, VALUE_OPT_KOD,
5718585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
5728585484eSchristos      /* min, max, act ct */ 0, 1, 0,
5738585484eSchristos      /* opt state flags  */ KOD_FLAGS, 0,
5748585484eSchristos      /* last opt argumnt */ { KOD_DFT_ARG },
5758585484eSchristos      /* arg list/cookie  */ NULL,
5768585484eSchristos      /* must/cannot opts */ NULL, NULL,
5778585484eSchristos      /* option proc      */ doOptKod,
5788585484eSchristos      /* desc, NAME, name */ KOD_DESC, KOD_NAME, KOD_name,
5798585484eSchristos      /* disablement strs */ NULL, NULL },
5808585484eSchristos 
5818585484eSchristos   {  /* entry idx, value */ 9, VALUE_OPT_KEYFILE,
5828585484eSchristos      /* equiv idx, value */ 9, VALUE_OPT_KEYFILE,
583abb0f93cSkardel      /* equivalenced to  */ NO_EQUIVALENT,
584abb0f93cSkardel      /* min, max, act ct */ 0, 1, 0,
585abb0f93cSkardel      /* opt state flags  */ KEYFILE_FLAGS, 0,
5864eea345dSchristos      /* last opt argumnt */ { KEYFILE_DFT_ARG },
5878585484eSchristos      /* arg list/cookie  */ NULL,
5888585484eSchristos      /* must/cannot opts */ NULL, NULL,
5898585484eSchristos      /* option proc      */ doOptKeyfile,
5908585484eSchristos      /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name,
5918585484eSchristos      /* disablement strs */ NULL, NULL },
5928585484eSchristos 
5938585484eSchristos   {  /* entry idx, value */ 10, VALUE_OPT_LOGFILE,
5948585484eSchristos      /* equiv idx, value */ 10, VALUE_OPT_LOGFILE,
5958585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
5968585484eSchristos      /* min, max, act ct */ 0, 1, 0,
5978585484eSchristos      /* opt state flags  */ LOGFILE_FLAGS, 0,
5988585484eSchristos      /* last opt argumnt */ { NULL }, /* --logfile */
5998585484eSchristos      /* arg list/cookie  */ NULL,
6008585484eSchristos      /* must/cannot opts */ NULL, NULL,
6018585484eSchristos      /* option proc      */ doOptLogfile,
6028585484eSchristos      /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name,
6038585484eSchristos      /* disablement strs */ NULL, NULL },
6048585484eSchristos 
6058585484eSchristos   {  /* entry idx, value */ 11, VALUE_OPT_STEPLIMIT,
6068585484eSchristos      /* equiv idx, value */ 11, VALUE_OPT_STEPLIMIT,
6078585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
6088585484eSchristos      /* min, max, act ct */ 0, 1, 0,
6098585484eSchristos      /* opt state flags  */ STEPLIMIT_FLAGS, 0,
6108585484eSchristos      /* last opt argumnt */ { NULL }, /* --steplimit */
6118585484eSchristos      /* arg list/cookie  */ NULL,
6128585484eSchristos      /* must/cannot opts */ NULL, NULL,
6138585484eSchristos      /* option proc      */ doOptSteplimit,
6148585484eSchristos      /* desc, NAME, name */ STEPLIMIT_DESC, STEPLIMIT_NAME, STEPLIMIT_name,
6158585484eSchristos      /* disablement strs */ NULL, NULL },
6168585484eSchristos 
6178585484eSchristos   {  /* entry idx, value */ 12, VALUE_OPT_NTPVERSION,
6188585484eSchristos      /* equiv idx, value */ 12, VALUE_OPT_NTPVERSION,
6198585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
6208585484eSchristos      /* min, max, act ct */ 0, 1, 0,
6218585484eSchristos      /* opt state flags  */ NTPVERSION_FLAGS, 0,
6228585484eSchristos      /* last opt argumnt */ { NTPVERSION_DFT_ARG },
6238585484eSchristos      /* arg list/cookie  */ NULL,
6248585484eSchristos      /* must/cannot opts */ NULL, NULL,
6258585484eSchristos      /* option proc      */ doOptNtpversion,
6268585484eSchristos      /* desc, NAME, name */ NTPVERSION_DESC, NTPVERSION_NAME, NTPVERSION_name,
6278585484eSchristos      /* disablement strs */ NULL, NULL },
6288585484eSchristos 
6298585484eSchristos   {  /* entry idx, value */ 13, VALUE_OPT_USERESERVEDPORT,
6308585484eSchristos      /* equiv idx, value */ 13, VALUE_OPT_USERESERVEDPORT,
6318585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
6328585484eSchristos      /* min, max, act ct */ 0, 1, 0,
6338585484eSchristos      /* opt state flags  */ USERESERVEDPORT_FLAGS, 0,
6348585484eSchristos      /* last opt argumnt */ { NULL }, /* --usereservedport */
635abb0f93cSkardel      /* arg list/cookie  */ NULL,
636abb0f93cSkardel      /* must/cannot opts */ NULL, NULL,
637abb0f93cSkardel      /* option proc      */ NULL,
6388585484eSchristos      /* desc, NAME, name */ USERESERVEDPORT_DESC, USERESERVEDPORT_NAME, USERESERVEDPORT_name,
639abb0f93cSkardel      /* disablement strs */ NULL, NULL },
640abb0f93cSkardel 
6418585484eSchristos   {  /* entry idx, value */ 14, VALUE_OPT_STEP,
6428585484eSchristos      /* equiv idx, value */ 14, VALUE_OPT_STEP,
643abb0f93cSkardel      /* equivalenced to  */ NO_EQUIVALENT,
644abb0f93cSkardel      /* min, max, act ct */ 0, 1, 0,
6458585484eSchristos      /* opt state flags  */ STEP_FLAGS, 0,
6468585484eSchristos      /* last opt argumnt */ { NULL }, /* --step */
6478585484eSchristos      /* arg list/cookie  */ NULL,
6488585484eSchristos      /* must/cannot opts */ NULL, NULL,
6498585484eSchristos      /* option proc      */ NULL,
6508585484eSchristos      /* desc, NAME, name */ STEP_DESC, STEP_NAME, STEP_name,
6518585484eSchristos      /* disablement strs */ NULL, NULL },
6528585484eSchristos 
6538585484eSchristos   {  /* entry idx, value */ 15, VALUE_OPT_SLEW,
6548585484eSchristos      /* equiv idx, value */ 15, VALUE_OPT_SLEW,
6558585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
6568585484eSchristos      /* min, max, act ct */ 0, 1, 0,
6578585484eSchristos      /* opt state flags  */ SLEW_FLAGS, 0,
6588585484eSchristos      /* last opt argumnt */ { NULL }, /* --slew */
6598585484eSchristos      /* arg list/cookie  */ NULL,
6608585484eSchristos      /* must/cannot opts */ NULL, NULL,
6618585484eSchristos      /* option proc      */ NULL,
6628585484eSchristos      /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name,
6638585484eSchristos      /* disablement strs */ NULL, NULL },
6648585484eSchristos 
6658585484eSchristos   {  /* entry idx, value */ 16, VALUE_OPT_TIMEOUT,
6668585484eSchristos      /* equiv idx, value */ 16, VALUE_OPT_TIMEOUT,
6678585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
6688585484eSchristos      /* min, max, act ct */ 0, 1, 0,
6698585484eSchristos      /* opt state flags  */ TIMEOUT_FLAGS, 0,
6708585484eSchristos      /* last opt argumnt */ { TIMEOUT_DFT_ARG },
6718585484eSchristos      /* arg list/cookie  */ NULL,
6728585484eSchristos      /* must/cannot opts */ NULL, NULL,
6738585484eSchristos      /* option proc      */ optionNumericVal,
6748585484eSchristos      /* desc, NAME, name */ TIMEOUT_DESC, TIMEOUT_NAME, TIMEOUT_name,
6758585484eSchristos      /* disablement strs */ NULL, NULL },
6768585484eSchristos 
6778585484eSchristos   {  /* entry idx, value */ 17, VALUE_OPT_WAIT,
6788585484eSchristos      /* equiv idx, value */ 17, VALUE_OPT_WAIT,
6798585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
6808585484eSchristos      /* min, max, act ct */ 0, 1, 0,
6818585484eSchristos      /* opt state flags  */ WAIT_FLAGS, 0,
6828585484eSchristos      /* last opt argumnt */ { NULL }, /* --wait */
6838585484eSchristos      /* arg list/cookie  */ NULL,
6848585484eSchristos      /* must/cannot opts */ NULL, NULL,
6858585484eSchristos      /* option proc      */ NULL,
6868585484eSchristos      /* desc, NAME, name */ WAIT_DESC, WAIT_NAME, WAIT_name,
6878585484eSchristos      /* disablement strs */ NOT_WAIT_name, NOT_WAIT_PFX },
6888585484eSchristos 
6898585484eSchristos   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
6908585484eSchristos      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_VERSION,
6918585484eSchristos      /* equivalenced to  */ NO_EQUIVALENT,
6928585484eSchristos      /* min, max, act ct */ 0, 1, 0,
6938585484eSchristos      /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
694abb0f93cSkardel      /* last opt argumnt */ { NULL },
695abb0f93cSkardel      /* arg list/cookie  */ NULL,
696abb0f93cSkardel      /* must/cannot opts */ NULL, NULL,
6978585484eSchristos      /* option proc      */ VER_PROC,
6988585484eSchristos      /* desc, NAME, name */ VER_DESC, NULL, VER_name,
699abb0f93cSkardel      /* disablement strs */ NULL, NULL },
700abb0f93cSkardel 
701abb0f93cSkardel 
702abb0f93cSkardel 
703abb0f93cSkardel   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
7048585484eSchristos      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_HELP,
705abb0f93cSkardel      /* equivalenced to  */ NO_EQUIVALENT,
706abb0f93cSkardel      /* min, max, act ct */ 0, 1, 0,
7078585484eSchristos      /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
708abb0f93cSkardel      /* last opt argumnt */ { NULL },
709abb0f93cSkardel      /* arg list/cookie  */ NULL,
710abb0f93cSkardel      /* must/cannot opts */ NULL, NULL,
711abb0f93cSkardel      /* option proc      */ doUsageOpt,
7128585484eSchristos      /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
713abb0f93cSkardel      /* disablement strs */ NULL, NULL },
714abb0f93cSkardel 
715abb0f93cSkardel   {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
7168585484eSchristos      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
717abb0f93cSkardel      /* equivalenced to  */ NO_EQUIVALENT,
718abb0f93cSkardel      /* min, max, act ct */ 0, 1, 0,
7198585484eSchristos      /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
720abb0f93cSkardel      /* last opt argumnt */ { NULL },
721abb0f93cSkardel      /* arg list/cookie  */ NULL,
722abb0f93cSkardel      /* must/cannot opts */ NULL,  NULL,
723abb0f93cSkardel      /* option proc      */ optionPagedUsage,
7248585484eSchristos      /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
725abb0f93cSkardel      /* disablement strs */ NULL, NULL },
726abb0f93cSkardel 
727abb0f93cSkardel   {  /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
7288585484eSchristos      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
729abb0f93cSkardel      /* equivalenced to  */ NO_EQUIVALENT,
730abb0f93cSkardel      /* min, max, act ct */ 0, 1, 0,
731abb0f93cSkardel      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
7328585484eSchristos                        | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
733abb0f93cSkardel      /* last opt argumnt */ { NULL },
734abb0f93cSkardel      /* arg list/cookie  */ NULL,
735abb0f93cSkardel      /* must/cannot opts */ NULL,  NULL,
736abb0f93cSkardel      /* option proc      */ NULL,
7378585484eSchristos      /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
738abb0f93cSkardel      /* disablement strs */ NULL, NULL },
739abb0f93cSkardel 
740abb0f93cSkardel   {  /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
7418585484eSchristos      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
742abb0f93cSkardel      /* equivalenced to  */ NO_EQUIVALENT,
743abb0f93cSkardel      /* min, max, act ct */ 0, NOLIMIT, 0,
744abb0f93cSkardel      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
7458585484eSchristos 			  | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
746abb0f93cSkardel      /* last opt argumnt */ { NULL },
747abb0f93cSkardel      /* arg list/cookie  */ NULL,
748abb0f93cSkardel      /* must/cannot opts */ NULL, NULL,
749abb0f93cSkardel      /* option proc      */ optionLoadOpt,
7508585484eSchristos      /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
7518585484eSchristos      /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
752abb0f93cSkardel };
753abb0f93cSkardel 
754abb0f93cSkardel 
7558585484eSchristos /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
7568585484eSchristos /** Reference to the upper cased version of sntp. */
7574eea345dSchristos #define zPROGNAME       (sntp_opt_strs+2336)
7588585484eSchristos /** Reference to the title line for sntp usage. */
7594eea345dSchristos #define zUsageTitle     (sntp_opt_strs+2341)
7608585484eSchristos /** sntp configuration file name. */
7614eea345dSchristos #define zRcName         (sntp_opt_strs+2509)
7628585484eSchristos /** Directories to search for sntp config files. */
7638585484eSchristos static char const * const apzHomeList[3] = {
7644eea345dSchristos     sntp_opt_strs+2501,
7654eea345dSchristos     sntp_opt_strs+2507,
7668585484eSchristos     NULL };
7678585484eSchristos /** The sntp program bug email address. */
7684eea345dSchristos #define zBugsAddr       (sntp_opt_strs+2516)
7698585484eSchristos /** Clarification/explanation of what sntp does. */
770*eabc0478Schristos #define zExplain        (sntp_opt_strs+2551)
7718585484eSchristos /** Extra detail explaining what sntp does. */
7728585484eSchristos #define zDetail         (NULL)
7738585484eSchristos /** The full version string for sntp. */
774*eabc0478Schristos #define zFullVersion    (sntp_opt_strs+2553)
775*eabc0478Schristos /* extracted from optcode.tlib near line 342 */
776abb0f93cSkardel 
777abb0f93cSkardel #if defined(ENABLE_NLS)
778abb0f93cSkardel # define OPTPROC_BASE OPTPROC_TRANSLATE
779abb0f93cSkardel   static tOptionXlateProc translate_option_strings;
780abb0f93cSkardel #else
781abb0f93cSkardel # define OPTPROC_BASE OPTPROC_NONE
782abb0f93cSkardel # define translate_option_strings NULL
783abb0f93cSkardel #endif /* ENABLE_NLS */
784abb0f93cSkardel 
7858585484eSchristos #define sntp_full_usage (NULL)
7868585484eSchristos #define sntp_short_usage (NULL)
787abb0f93cSkardel 
7888585484eSchristos #endif /* not defined __doxygen__ */
7898585484eSchristos 
7908585484eSchristos /*
7918585484eSchristos  *  Create the static procedure(s) declared above.
7928585484eSchristos  */
7938585484eSchristos /**
7948585484eSchristos  * The callout function that invokes the optionUsage function.
7958585484eSchristos  *
7968585484eSchristos  * @param[in] opts the AutoOpts option description structure
7978585484eSchristos  * @param[in] od   the descriptor for the "help" (usage) option.
7988585484eSchristos  * @noreturn
7998585484eSchristos  */
8008585484eSchristos static void
8018585484eSchristos doUsageOpt(tOptions * opts, tOptDesc * od)
8028585484eSchristos {
8038585484eSchristos     int ex_code;
8048585484eSchristos     ex_code = SNTP_EXIT_SUCCESS;
8058585484eSchristos     optionUsage(&sntpOptions, ex_code);
8068585484eSchristos     /* NOTREACHED */
807*eabc0478Schristos     exit(SNTP_EXIT_FAILURE);
8088585484eSchristos     (void)opts;
8098585484eSchristos     (void)od;
8108585484eSchristos }
8118585484eSchristos 
8128585484eSchristos /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
8138585484eSchristos /**
8148585484eSchristos  * Code to handle the debug-level option.
8158585484eSchristos  *
8168585484eSchristos  * @param[in] pOptions the sntp options data structure
8178585484eSchristos  * @param[in,out] pOptDesc the option descriptor for this option.
8188585484eSchristos  */
8198585484eSchristos static void
8208585484eSchristos doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
8218585484eSchristos {
8228585484eSchristos     /*
8238585484eSchristos      * Be sure the flag-code[0] handles special values for the options pointer
8248585484eSchristos      * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
8258585484eSchristos      * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
8268585484eSchristos      * reset its state.
8278585484eSchristos      */
8288585484eSchristos     /* extracted from debug-opt.def, line 15 */
8298585484eSchristos OPT_VALUE_SET_DEBUG_LEVEL++;
8308585484eSchristos     (void)pOptDesc;
8318585484eSchristos     (void)pOptions;
8328585484eSchristos }
8338585484eSchristos 
8348585484eSchristos /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
8358585484eSchristos /**
8368585484eSchristos  * Code to handle the kod option.
8378585484eSchristos  * Specifies the filename to be used for the persistent history of KoD
838ea66d795Schristos  * responses received from servers.  If the file does not exist, a
839ea66d795Schristos  * warning message will be displayed.  The file will not be created.
8408585484eSchristos  * @param[in] pOptions the sntp options data structure
8418585484eSchristos  * @param[in,out] pOptDesc the option descriptor for this option.
8428585484eSchristos  */
8438585484eSchristos static void
8448585484eSchristos doOptKod(tOptions* pOptions, tOptDesc* pOptDesc)
8458585484eSchristos {
8468585484eSchristos     static teOptFileType const  type =
8478585484eSchristos         FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
8488585484eSchristos     static tuFileMode           mode;
8498585484eSchristos #ifndef O_CLOEXEC
8508585484eSchristos #  define O_CLOEXEC 0
8518585484eSchristos #endif
8528585484eSchristos     mode.file_flags = O_CLOEXEC;
8538585484eSchristos 
8548585484eSchristos     /*
8558585484eSchristos      * This function handles special invalid values for "pOptions"
8568585484eSchristos      */
8578585484eSchristos     optionFileCheck(pOptions, pOptDesc, type, mode);
8588585484eSchristos }
8598585484eSchristos 
8608585484eSchristos /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
8618585484eSchristos /**
8628585484eSchristos  * Code to handle the keyfile option.
8638585484eSchristos  * This option specifies the keyfile.
8648585484eSchristos  * @code{sntp} will search for the key specified with @option{-a}
8658585484eSchristos  * @file{keyno} in this file.  See @command{ntp.keys(5)} for more
8668585484eSchristos  * information.
8678585484eSchristos  * @param[in] pOptions the sntp options data structure
8688585484eSchristos  * @param[in,out] pOptDesc the option descriptor for this option.
8698585484eSchristos  */
8708585484eSchristos static void
8718585484eSchristos doOptKeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
8728585484eSchristos {
8738585484eSchristos     static teOptFileType const  type =
8748585484eSchristos         FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
8758585484eSchristos     static tuFileMode           mode;
8768585484eSchristos #ifndef O_CLOEXEC
8778585484eSchristos #  define O_CLOEXEC 0
8788585484eSchristos #endif
8798585484eSchristos     mode.file_flags = O_CLOEXEC;
8808585484eSchristos 
8818585484eSchristos     /*
8828585484eSchristos      * This function handles special invalid values for "pOptions"
8838585484eSchristos      */
8848585484eSchristos     optionFileCheck(pOptions, pOptDesc, type, mode);
8858585484eSchristos }
8868585484eSchristos 
8878585484eSchristos /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
8888585484eSchristos /**
8898585484eSchristos  * Code to handle the logfile option.
8908585484eSchristos  * This option causes the client to write log messages to the specified
8918585484eSchristos  * @file{logfile}.
8928585484eSchristos  * @param[in] pOptions the sntp options data structure
8938585484eSchristos  * @param[in,out] pOptDesc the option descriptor for this option.
8948585484eSchristos  */
8958585484eSchristos static void
8968585484eSchristos doOptLogfile(tOptions* pOptions, tOptDesc* pOptDesc)
8978585484eSchristos {
8988585484eSchristos     static teOptFileType const  type =
8998585484eSchristos         FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
9008585484eSchristos     static tuFileMode           mode;
9018585484eSchristos #ifndef O_CLOEXEC
9028585484eSchristos #  define O_CLOEXEC 0
9038585484eSchristos #endif
9048585484eSchristos     mode.file_flags = O_CLOEXEC;
9058585484eSchristos 
9068585484eSchristos     /*
9078585484eSchristos      * This function handles special invalid values for "pOptions"
9088585484eSchristos      */
9098585484eSchristos     optionFileCheck(pOptions, pOptDesc, type, mode);
9108585484eSchristos }
9118585484eSchristos 
9128585484eSchristos /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
9138585484eSchristos /**
9148585484eSchristos  * Code to handle the steplimit option.
9158585484eSchristos  * If the time adjustment is less than @file{steplimit} milliseconds,
9168585484eSchristos  * slew the amount using @command{adjtime(2)}.  Otherwise, step the
9177476e6e4Schristos  * correction using @command{settimeofday(2)}.  The default value is 0,
9187476e6e4Schristos  * which means all adjustments will be stepped.  This is a feature, as
9197476e6e4Schristos  * different situations demand different values.
9208585484eSchristos  * @param[in] pOptions the sntp options data structure
9218585484eSchristos  * @param[in,out] pOptDesc the option descriptor for this option.
9228585484eSchristos  */
9238585484eSchristos static void
9248585484eSchristos doOptSteplimit(tOptions* pOptions, tOptDesc* pOptDesc)
9258585484eSchristos {
9268585484eSchristos     static struct {long rmin, rmax;} const rng[1] = {
9278585484eSchristos         { 0, LONG_MAX } };
9288585484eSchristos     int  ix;
9298585484eSchristos 
9308585484eSchristos     if (pOptions <= OPTPROC_EMIT_LIMIT)
9318585484eSchristos         goto emit_ranges;
9328585484eSchristos     optionNumericVal(pOptions, pOptDesc);
9338585484eSchristos 
9348585484eSchristos     for (ix = 0; ix < 1; ix++) {
9358585484eSchristos         if (pOptDesc->optArg.argInt < rng[ix].rmin)
9368585484eSchristos             continue;  /* ranges need not be ordered. */
9378585484eSchristos         if (pOptDesc->optArg.argInt == rng[ix].rmin)
9388585484eSchristos             return;
9398585484eSchristos         if (rng[ix].rmax == LONG_MIN)
9408585484eSchristos             continue;
9418585484eSchristos         if (pOptDesc->optArg.argInt <= rng[ix].rmax)
9428585484eSchristos             return;
9438585484eSchristos     }
9448585484eSchristos 
9458585484eSchristos     option_usage_fp = stderr;
9468585484eSchristos 
9478585484eSchristos  emit_ranges:
9485d681e99Schristos optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
9498585484eSchristos }
9508585484eSchristos 
9518585484eSchristos /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
9528585484eSchristos /**
9538585484eSchristos  * Code to handle the ntpversion option.
9548585484eSchristos  * When sending requests to a remote server, tell them we are running
9558585484eSchristos  * NTP protocol version @file{ntpversion} .
9568585484eSchristos  * @param[in] pOptions the sntp options data structure
9578585484eSchristos  * @param[in,out] pOptDesc the option descriptor for this option.
9588585484eSchristos  */
9598585484eSchristos static void
9608585484eSchristos doOptNtpversion(tOptions* pOptions, tOptDesc* pOptDesc)
9618585484eSchristos {
9628585484eSchristos     static struct {long rmin, rmax;} const rng[1] = {
9638585484eSchristos         { 0, 7 } };
9648585484eSchristos     int  ix;
9658585484eSchristos 
9668585484eSchristos     if (pOptions <= OPTPROC_EMIT_LIMIT)
9678585484eSchristos         goto emit_ranges;
9688585484eSchristos     optionNumericVal(pOptions, pOptDesc);
9698585484eSchristos 
9708585484eSchristos     for (ix = 0; ix < 1; ix++) {
9718585484eSchristos         if (pOptDesc->optArg.argInt < rng[ix].rmin)
9728585484eSchristos             continue;  /* ranges need not be ordered. */
9738585484eSchristos         if (pOptDesc->optArg.argInt == rng[ix].rmin)
9748585484eSchristos             return;
9758585484eSchristos         if (rng[ix].rmax == LONG_MIN)
9768585484eSchristos             continue;
9778585484eSchristos         if (pOptDesc->optArg.argInt <= rng[ix].rmax)
9788585484eSchristos             return;
9798585484eSchristos     }
9808585484eSchristos 
9818585484eSchristos     option_usage_fp = stderr;
9828585484eSchristos 
9838585484eSchristos  emit_ranges:
9845d681e99Schristos optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
9858585484eSchristos }
9865d681e99Schristos /* extracted from optmain.tlib near line 1250 */
9878585484eSchristos 
9888585484eSchristos /**
9898585484eSchristos  * The directory containing the data associated with sntp.
9908585484eSchristos  */
991f003fb54Skardel #ifndef  PKGDATADIR
992f003fb54Skardel # define PKGDATADIR ""
993f003fb54Skardel #endif
994f003fb54Skardel 
9958585484eSchristos /**
9968585484eSchristos  * Information about the person or institution that packaged sntp
9978585484eSchristos  * for the current distribution.
9988585484eSchristos  */
999f003fb54Skardel #ifndef  WITH_PACKAGER
1000f003fb54Skardel # define sntp_packager_info NULL
1001f003fb54Skardel #else
10028585484eSchristos /** Packager information for sntp. */
1003f003fb54Skardel static char const sntp_packager_info[] =
1004f003fb54Skardel     "Packaged by " WITH_PACKAGER
1005f003fb54Skardel 
1006f003fb54Skardel # ifdef WITH_PACKAGER_VERSION
1007f003fb54Skardel         " ("WITH_PACKAGER_VERSION")"
1008f003fb54Skardel # endif
1009f003fb54Skardel 
1010f003fb54Skardel # ifdef WITH_PACKAGER_BUG_REPORTS
1011f003fb54Skardel     "\nReport sntp bugs to " WITH_PACKAGER_BUG_REPORTS
1012f003fb54Skardel # endif
1013f003fb54Skardel     "\n";
1014f003fb54Skardel #endif
10158585484eSchristos #ifndef __doxygen__
1016f003fb54Skardel 
10178585484eSchristos #endif /* __doxygen__ */
10188585484eSchristos /**
10198585484eSchristos  * The option definitions for sntp.  The one structure that
10208585484eSchristos  * binds them all.
10218585484eSchristos  */
1022abb0f93cSkardel tOptions sntpOptions = {
1023abb0f93cSkardel     OPTIONS_STRUCT_VERSION,
1024abb0f93cSkardel     0, NULL,                    /* original argc + argv    */
1025abb0f93cSkardel     ( OPTPROC_BASE
1026abb0f93cSkardel     + OPTPROC_ERRSTOP
1027abb0f93cSkardel     + OPTPROC_SHORTOPT
1028abb0f93cSkardel     + OPTPROC_LONGOPT
1029abb0f93cSkardel     + OPTPROC_NO_REQ_OPT
10308585484eSchristos     + OPTPROC_NEGATIONS
1031abb0f93cSkardel     + OPTPROC_ENVIRON
1032ea66d795Schristos     + OPTPROC_MISUSE ),
1033abb0f93cSkardel     0, NULL,                    /* current option index, current option */
1034abb0f93cSkardel     NULL,         NULL,         zPROGNAME,
1035f003fb54Skardel     zRcName,      zCopyright,   zLicenseDescrip,
1036abb0f93cSkardel     zFullVersion, apzHomeList,  zUsageTitle,
1037abb0f93cSkardel     zExplain,     zDetail,      optDesc,
1038abb0f93cSkardel     zBugsAddr,                  /* address to send bugs to */
1039abb0f93cSkardel     NULL, NULL,                 /* extensions/saved state  */
1040abb0f93cSkardel     optionUsage, /* usage procedure */
1041abb0f93cSkardel     translate_option_strings,   /* translation procedure */
1042abb0f93cSkardel     /*
1043abb0f93cSkardel      *  Indexes to special options
1044abb0f93cSkardel      */
1045abb0f93cSkardel     { INDEX_OPT_MORE_HELP, /* more-help option index */
1046abb0f93cSkardel       INDEX_OPT_SAVE_OPTS, /* save option index */
1047abb0f93cSkardel       NO_EQUIVALENT, /* '-#' option index */
1048abb0f93cSkardel       NO_EQUIVALENT /* index of default opt */
1049abb0f93cSkardel     },
10508585484eSchristos     23 /* full option count */, 18 /* user option count */,
1051abb0f93cSkardel     sntp_full_usage, sntp_short_usage,
1052f003fb54Skardel     NULL, NULL,
1053f003fb54Skardel     PKGDATADIR, sntp_packager_info
1054abb0f93cSkardel };
1055abb0f93cSkardel 
1056abb0f93cSkardel #if ENABLE_NLS
10578585484eSchristos /**
10588585484eSchristos  * This code is designed to translate translatable option text for the
10598585484eSchristos  * sntp program.  These translations happen upon entry
10608585484eSchristos  * to optionProcess().
10618585484eSchristos  */
1062abb0f93cSkardel #include <stdio.h>
1063abb0f93cSkardel #include <stdlib.h>
1064abb0f93cSkardel #include <string.h>
1065abb0f93cSkardel #include <unistd.h>
10668585484eSchristos #ifdef HAVE_DCGETTEXT
10678585484eSchristos # include <gettext.h>
10688585484eSchristos #endif
1069abb0f93cSkardel #include <autoopts/usage-txt.h>
1070abb0f93cSkardel 
1071abb0f93cSkardel static char * AO_gettext(char const * pz);
1072abb0f93cSkardel static void   coerce_it(void ** s);
1073abb0f93cSkardel 
10748585484eSchristos /**
10758585484eSchristos  * AutoGen specific wrapper function for gettext.  It relies on the macro _()
10768585484eSchristos  * to convert from English to the target language, then strdup-duplicates the
10778585484eSchristos  * result string.  It tries the "libopts" domain first, then whatever has been
10788585484eSchristos  * set via the \a textdomain(3) call.
10798585484eSchristos  *
10808585484eSchristos  * @param[in] pz the input text used as a lookup key.
10818585484eSchristos  * @returns the translated text (if there is one),
10828585484eSchristos  *   or the original text (if not).
10838585484eSchristos  */
1084abb0f93cSkardel static char *
1085abb0f93cSkardel AO_gettext(char const * pz)
1086abb0f93cSkardel {
10878585484eSchristos     char * res;
1088abb0f93cSkardel     if (pz == NULL)
1089abb0f93cSkardel         return NULL;
10908585484eSchristos #ifdef HAVE_DCGETTEXT
10918585484eSchristos     /*
10928585484eSchristos      * While processing the option_xlateable_txt data, try to use the
10938585484eSchristos      * "libopts" domain.  Once we switch to the option descriptor data,
10948585484eSchristos      * do *not* use that domain.
10958585484eSchristos      */
10968585484eSchristos     if (option_xlateable_txt.field_ct != 0) {
10978585484eSchristos         res = dgettext("libopts", pz);
10988585484eSchristos         if (res == pz)
10995d681e99Schristos             res = (char *)VOIDP(_(pz));
11008585484eSchristos     } else
11015d681e99Schristos         res = (char *)VOIDP(_(pz));
11028585484eSchristos #else
11035d681e99Schristos     res = (char *)VOIDP(_(pz));
11048585484eSchristos #endif
11058585484eSchristos     if (res == pz)
11068585484eSchristos         return res;
11078585484eSchristos     res = strdup(res);
11088585484eSchristos     if (res == NULL) {
1109abb0f93cSkardel         fputs(_("No memory for duping translated strings\n"), stderr);
1110f003fb54Skardel         exit(SNTP_EXIT_FAILURE);
1111abb0f93cSkardel     }
11128585484eSchristos     return res;
1113abb0f93cSkardel }
1114abb0f93cSkardel 
11158585484eSchristos /**
11168585484eSchristos  * All the pointers we use are marked "* const", but they are stored in
11178585484eSchristos  * writable memory.  Coerce the mutability and set the pointer.
11188585484eSchristos  */
1119f003fb54Skardel static void coerce_it(void ** s) { *s = AO_gettext(*s);
1120f003fb54Skardel }
1121abb0f93cSkardel 
11228585484eSchristos /**
11238585484eSchristos  * Translate all the translatable strings in the sntpOptions
11248585484eSchristos  * structure defined above.  This is done only once.
1125abb0f93cSkardel  */
1126abb0f93cSkardel static void
1127abb0f93cSkardel translate_option_strings(void)
1128abb0f93cSkardel {
11298585484eSchristos     tOptions * const opts = &sntpOptions;
1130f003fb54Skardel 
1131abb0f93cSkardel     /*
1132abb0f93cSkardel      *  Guard against re-translation.  It won't work.  The strings will have
1133abb0f93cSkardel      *  been changed by the first pass through this code.  One shot only.
1134abb0f93cSkardel      */
11358585484eSchristos     if (option_xlateable_txt.field_ct != 0) {
1136abb0f93cSkardel         /*
1137abb0f93cSkardel          *  Do the translations.  The first pointer follows the field count
1138abb0f93cSkardel          *  field.  The field count field is the size of a pointer.
1139abb0f93cSkardel          */
11405d681e99Schristos         char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
11418585484eSchristos         int     ix  = option_xlateable_txt.field_ct;
1142abb0f93cSkardel 
1143abb0f93cSkardel         do {
11448585484eSchristos             ppz++; /* skip over field_ct */
1145abb0f93cSkardel             *ppz = AO_gettext(*ppz);
1146abb0f93cSkardel         } while (--ix > 0);
11478585484eSchristos         /* prevent re-translation and disable "libopts" domain lookup */
11488585484eSchristos         option_xlateable_txt.field_ct = 0;
1149abb0f93cSkardel 
11505d681e99Schristos         coerce_it(VOIDP(&(opts->pzCopyright)));
11515d681e99Schristos         coerce_it(VOIDP(&(opts->pzCopyNotice)));
11525d681e99Schristos         coerce_it(VOIDP(&(opts->pzFullVersion)));
11535d681e99Schristos         coerce_it(VOIDP(&(opts->pzUsageTitle)));
11545d681e99Schristos         coerce_it(VOIDP(&(opts->pzExplain)));
11555d681e99Schristos         coerce_it(VOIDP(&(opts->pzDetail)));
11568585484eSchristos         {
11578585484eSchristos             tOptDesc * od = opts->pOptDesc;
11588585484eSchristos             for (ix = opts->optCt; ix > 0; ix--, od++)
11595d681e99Schristos                 coerce_it(VOIDP(&(od->pzText)));
1160abb0f93cSkardel         }
1161abb0f93cSkardel     }
11628585484eSchristos }
1163abb0f93cSkardel #endif /* ENABLE_NLS */
1164abb0f93cSkardel 
11658585484eSchristos #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
11668585484eSchristos /** I18N function strictly for xgettext.  Do not compile. */
11678585484eSchristos static void bogus_function(void) {
11688585484eSchristos   /* TRANSLATORS:
11698585484eSchristos 
11708585484eSchristos      The following dummy function was crated solely so that xgettext can
11718585484eSchristos      extract the correct strings.  These strings are actually referenced
11728585484eSchristos      by a field name in the sntpOptions structure noted in the
11738585484eSchristos      comments below.  The literal text is defined in sntp_opt_strs.
11748585484eSchristos 
11758585484eSchristos      NOTE: the strings below are segmented with respect to the source string
11768585484eSchristos      sntp_opt_strs.  The strings above are handed off for translation
11778585484eSchristos      at run time a paragraph at a time.  Consequently, they are presented here
11788585484eSchristos      for translation a paragraph at a time.
11798585484eSchristos 
11808585484eSchristos      ALSO: often the description for an option will reference another option
11818585484eSchristos      by name.  These are set off with apostrophe quotes (I hope).  Do not
11828585484eSchristos      translate option names.
11838585484eSchristos    */
11848585484eSchristos   /* referenced via sntpOptions.pzCopyright */
1185*eabc0478Schristos   puts(_("sntp 4.2.8p18\n\
1186*eabc0478Schristos Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n\
11878585484eSchristos This is free software. It is licensed for use, modification and\n\
11888585484eSchristos redistribution under the terms of the NTP License, copies of which\n\
11898585484eSchristos can be seen at:\n"));
11908585484eSchristos   puts(_("  <http://ntp.org/license>\n\
11918585484eSchristos   <http://opensource.org/licenses/ntp-license.php>\n"));
11928585484eSchristos 
11938585484eSchristos   /* referenced via sntpOptions.pzCopyNotice */
11948585484eSchristos   puts(_("Permission to use, copy, modify, and distribute this software and its\n\
11958585484eSchristos documentation for any purpose with or without fee is hereby granted,\n\
11968585484eSchristos provided that the above copyright notice appears in all copies and that\n\
11978585484eSchristos both the copyright notice and this permission notice appear in supporting\n\
11988585484eSchristos documentation, and that the name The University of Delaware not be used in\n\
11998585484eSchristos advertising or publicity pertaining to distribution of the software without\n\
12007476e6e4Schristos specific, written prior permission.  The University of Delaware and Network\n\
12017476e6e4Schristos Time Foundation makes no representations about the suitability this\n\
12027476e6e4Schristos software for any purpose.  It is provided \"as is\" without express or\n\
12037476e6e4Schristos implied warranty.\n"));
12048585484eSchristos 
12058585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12068585484eSchristos   puts(_("Force IPv4 DNS name resolution"));
12078585484eSchristos 
12088585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12098585484eSchristos   puts(_("Force IPv6 DNS name resolution"));
12108585484eSchristos 
12118585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12128585484eSchristos   puts(_("Enable authentication with the key auth-keynumber"));
12138585484eSchristos 
12148585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12158585484eSchristos   puts(_("Listen to the address specified for broadcast time sync"));
12168585484eSchristos 
12178585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12188585484eSchristos   puts(_("Concurrently query all IPs returned for host-name"));
12198585484eSchristos 
12208585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12218585484eSchristos   puts(_("Increase debug verbosity level"));
12228585484eSchristos 
12238585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12248585484eSchristos   puts(_("Set the debug verbosity level"));
12258585484eSchristos 
12268585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12278585484eSchristos   puts(_("The gap (in milliseconds) between time requests"));
12288585484eSchristos 
12298585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12308585484eSchristos   puts(_("KoD history filename"));
12318585484eSchristos 
12328585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12338585484eSchristos   puts(_("Look in this file for the key specified with -a"));
12348585484eSchristos 
12358585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12368585484eSchristos   puts(_("Log to specified logfile"));
12378585484eSchristos 
12388585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12398585484eSchristos   puts(_("Adjustments less than steplimit msec will be slewed"));
12408585484eSchristos 
12418585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12428585484eSchristos   puts(_("Send int as our NTP protocol version"));
12438585484eSchristos 
12448585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12458585484eSchristos   puts(_("Use the NTP Reserved Port (port 123)"));
12468585484eSchristos 
12478585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12488585484eSchristos   puts(_("OK to 'step' the time with settimeofday(2)"));
12498585484eSchristos 
12508585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12518585484eSchristos   puts(_("OK to 'slew' the time with adjtime(2)"));
12528585484eSchristos 
12538585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12548585484eSchristos   puts(_("The number of seconds to wait for responses"));
12558585484eSchristos 
12568585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12578585484eSchristos   puts(_("Wait for pending replies (if not setting the time)"));
12588585484eSchristos 
12598585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12608585484eSchristos   puts(_("display extended usage information and exit"));
12618585484eSchristos 
12628585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12638585484eSchristos   puts(_("extended usage information passed thru pager"));
12648585484eSchristos 
12658585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12668585484eSchristos   puts(_("output version information and exit"));
12678585484eSchristos 
12688585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12698585484eSchristos   puts(_("save the option state to a config file"));
12708585484eSchristos 
12718585484eSchristos   /* referenced via sntpOptions.pOptDesc->pzText */
12728585484eSchristos   puts(_("load options from a config file"));
12738585484eSchristos 
12748585484eSchristos   /* referenced via sntpOptions.pzUsageTitle */
1275*eabc0478Schristos   puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p18\n\
12768585484eSchristos Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
12778585484eSchristos \t\t[ hostname-or-IP ...]\n"));
12788585484eSchristos 
12798585484eSchristos   /* referenced via sntpOptions.pzExplain */
12808585484eSchristos   puts(_("\n"));
12818585484eSchristos 
12828585484eSchristos   /* referenced via sntpOptions.pzFullVersion */
1283*eabc0478Schristos   puts(_("sntp 4.2.8p18"));
12848585484eSchristos 
12858585484eSchristos   /* referenced via sntpOptions.pzFullUsage */
12868585484eSchristos   puts(_("<<<NOT-FOUND>>>"));
12878585484eSchristos 
12888585484eSchristos   /* referenced via sntpOptions.pzShortUsage */
12898585484eSchristos   puts(_("<<<NOT-FOUND>>>"));
12908585484eSchristos   /* LIBOPTS-MESSAGES: */
12918585484eSchristos #line 67 "../autoopts.c"
12928585484eSchristos   puts(_("allocation of %d bytes failed\n"));
1293*eabc0478Schristos #line 89 "../autoopts.c"
12948585484eSchristos   puts(_("allocation of %d bytes failed\n"));
1295*eabc0478Schristos #line 48 "../init.c"
12968585484eSchristos   puts(_("AutoOpts function called without option descriptor\n"));
1297*eabc0478Schristos #line 81 "../init.c"
12988585484eSchristos   puts(_("\tThis exceeds the compiled library version:  "));
1299*eabc0478Schristos #line 79 "../init.c"
13008585484eSchristos   puts(_("Automated Options Processing Error!\n"
13018585484eSchristos        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
1302*eabc0478Schristos #line 78 "../autoopts.c"
13038585484eSchristos   puts(_("realloc of %d bytes at 0x%p failed\n"));
1304*eabc0478Schristos #line 83 "../init.c"
13058585484eSchristos   puts(_("\tThis is less than the minimum library version:  "));
13068585484eSchristos #line 121 "../version.c"
13078585484eSchristos   puts(_("Automated Options version %s\n"
1308*eabc0478Schristos        "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
1309*eabc0478Schristos #line 49 "../makeshell.c"
13108585484eSchristos   puts(_("(AutoOpts bug):  %s.\n"));
13118585484eSchristos #line 90 "../reset.c"
13128585484eSchristos   puts(_("optionResetOpt() called, but reset-option not configured"));
1313*eabc0478Schristos #line 241 "../usage.c"
13148585484eSchristos   puts(_("could not locate the 'help' option"));
1315*eabc0478Schristos #line 330 "../autoopts.c"
13168585484eSchristos   puts(_("optionProcess() was called with invalid data"));
1317*eabc0478Schristos #line 697 "../usage.c"
13188585484eSchristos   puts(_("invalid argument type specified"));
1319*eabc0478Schristos #line 568 "../find.c"
13208585484eSchristos   puts(_("defaulted to option with optional arg"));
13218585484eSchristos #line 76 "../alias.c"
13228585484eSchristos   puts(_("aliasing option is out of range."));
1323*eabc0478Schristos #line 210 "../enum.c"
13248585484eSchristos   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
1325*eabc0478Schristos #line 78 "../find.c"
13268585484eSchristos   puts(_("  The following options match:\n"));
1327*eabc0478Schristos #line 263 "../find.c"
13288585484eSchristos   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
13298585484eSchristos #line 161 "../check.c"
13308585484eSchristos   puts(_("%s: Command line arguments required\n"));
13318585484eSchristos #line 43 "../alias.c"
13328585484eSchristos   puts(_("%d %s%s options allowed\n"));
1333*eabc0478Schristos #line 56 "../makeshell.c"
13348585484eSchristos   puts(_("%s error %d (%s) calling %s for '%s'\n"));
1335*eabc0478Schristos #line 268 "../makeshell.c"
13368585484eSchristos   puts(_("interprocess pipe"));
1337*eabc0478Schristos #line 171 "../version.c"
13388585484eSchristos   puts(_("error: version option argument '%c' invalid.  Use:\n"
13398585484eSchristos        "\t'v' - version only\n"
13408585484eSchristos        "\t'c' - version and copyright\n"
13418585484eSchristos        "\t'n' - version and full copyright notice\n"));
13428585484eSchristos #line 58 "../check.c"
13438585484eSchristos   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
1344*eabc0478Schristos #line 187 "../find.c"
13458585484eSchristos   puts(_("%s: The '%s' option has been disabled."));
1346*eabc0478Schristos #line 400 "../find.c"
13478585484eSchristos   puts(_("%s: The '%s' option has been disabled."));
13488585484eSchristos #line 38 "../alias.c"
13498585484eSchristos   puts(_("-equivalence"));
1350*eabc0478Schristos #line 439 "../find.c"
13518585484eSchristos   puts(_("%s: illegal option -- %c\n"));
13528585484eSchristos #line 110 "../reset.c"
13538585484eSchristos   puts(_("%s: illegal option -- %c\n"));
1354*eabc0478Schristos #line 241 "../find.c"
13558585484eSchristos   puts(_("%s: illegal option -- %s\n"));
1356*eabc0478Schristos #line 740 "../find.c"
13578585484eSchristos   puts(_("%s: illegal option -- %s\n"));
13588585484eSchristos #line 118 "../reset.c"
13598585484eSchristos   puts(_("%s: illegal option -- %s\n"));
1360*eabc0478Schristos #line 305 "../find.c"
13618585484eSchristos   puts(_("%s: unknown vendor extension option -- %s\n"));
1362*eabc0478Schristos #line 135 "../enum.c"
13638585484eSchristos   puts(_("  or an integer from %d through %d\n"));
1364*eabc0478Schristos #line 145 "../enum.c"
13658585484eSchristos   puts(_("  or an integer from %d through %d\n"));
1366*eabc0478Schristos #line 696 "../usage.c"
13678585484eSchristos   puts(_("%s error:  invalid option descriptor for %s\n"));
1368*eabc0478Schristos #line 1030 "../usage.c"
13698585484eSchristos   puts(_("%s error:  invalid option descriptor for %s\n"));
1370*eabc0478Schristos #line 355 "../find.c"
13718585484eSchristos   puts(_("%s: invalid option name: %s\n"));
1372*eabc0478Schristos #line 497 "../find.c"
13738585484eSchristos   puts(_("%s: The '%s' option requires an argument.\n"));
1374*eabc0478Schristos #line 150 "../autoopts.c"
13758585484eSchristos   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
13768585484eSchristos        "\t'%s' and '%s'."));
13778585484eSchristos #line 94 "../check.c"
13788585484eSchristos   puts(_("%s error:  The %s option is required\n"));
1379*eabc0478Schristos #line 602 "../find.c"
13808585484eSchristos   puts(_("%s: The '%s' option cannot have an argument.\n"));
13818585484eSchristos #line 151 "../check.c"
13828585484eSchristos   puts(_("%s: Command line arguments are not allowed.\n"));
1383*eabc0478Schristos #line 568 "../save.c"
13848585484eSchristos   puts(_("error %d (%s) creating %s\n"));
1385*eabc0478Schristos #line 210 "../enum.c"
13868585484eSchristos   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
13878585484eSchristos #line 93 "../reset.c"
13888585484eSchristos   puts(_("%s error: The '%s' option requires an argument.\n"));
1389*eabc0478Schristos #line 122 "../save.c"
13908585484eSchristos   puts(_("error %d (%s) stat-ing %s\n"));
1391*eabc0478Schristos #line 175 "../save.c"
13928585484eSchristos   puts(_("error %d (%s) stat-ing %s\n"));
13938585484eSchristos #line 143 "../restore.c"
13948585484eSchristos   puts(_("%s error: no saved option state\n"));
1395*eabc0478Schristos #line 225 "../autoopts.c"
13968585484eSchristos   puts(_("'%s' is not a command line option.\n"));
1397*eabc0478Schristos #line 113 "../time.c"
13988585484eSchristos   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
1399ea66d795Schristos #line 50 "../time.c"
14008585484eSchristos   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
14018585484eSchristos #line 92 "../check.c"
14028585484eSchristos   puts(_("%s error:  The %s option must appear %d times.\n"));
1403*eabc0478Schristos #line 165 "../numeric.c"
14048585484eSchristos   puts(_("%s error:  '%s' is not a recognizable number.\n"));
1405*eabc0478Schristos #line 176 "../enum.c"
14068585484eSchristos   puts(_("%s error:  %s exceeds %s keyword count\n"));
1407*eabc0478Schristos #line 279 "../usage.c"
14088585484eSchristos   puts(_("Try '%s %s' for more information.\n"));
14098585484eSchristos #line 45 "../alias.c"
14108585484eSchristos   puts(_("one %s%s option allowed\n"));
1411*eabc0478Schristos #line 170 "../makeshell.c"
14128585484eSchristos   puts(_("standard output"));
1413*eabc0478Schristos #line 905 "../makeshell.c"
14148585484eSchristos   puts(_("standard output"));
1415*eabc0478Schristos #line 223 "../usage.c"
14168585484eSchristos   puts(_("standard output"));
1417*eabc0478Schristos #line 364 "../usage.c"
14188585484eSchristos   puts(_("standard output"));
1419*eabc0478Schristos #line 574 "../usage.c"
14208585484eSchristos   puts(_("standard output"));
1421*eabc0478Schristos #line 178 "../version.c"
14228585484eSchristos   puts(_("standard output"));
1423*eabc0478Schristos #line 223 "../usage.c"
14248585484eSchristos   puts(_("standard error"));
1425*eabc0478Schristos #line 364 "../usage.c"
14268585484eSchristos   puts(_("standard error"));
1427*eabc0478Schristos #line 574 "../usage.c"
14288585484eSchristos   puts(_("standard error"));
1429*eabc0478Schristos #line 178 "../version.c"
14308585484eSchristos   puts(_("standard error"));
1431*eabc0478Schristos #line 170 "../makeshell.c"
14328585484eSchristos   puts(_("write"));
1433*eabc0478Schristos #line 905 "../makeshell.c"
14348585484eSchristos   puts(_("write"));
1435*eabc0478Schristos #line 222 "../usage.c"
14368585484eSchristos   puts(_("write"));
1437*eabc0478Schristos #line 363 "../usage.c"
14388585484eSchristos   puts(_("write"));
1439*eabc0478Schristos #line 573 "../usage.c"
14408585484eSchristos   puts(_("write"));
1441*eabc0478Schristos #line 177 "../version.c"
14428585484eSchristos   puts(_("write"));
14438585484eSchristos #line 60 "../numeric.c"
14448585484eSchristos   puts(_("%s error:  %s option value %ld is out of range.\n"));
14458585484eSchristos #line 44 "../check.c"
14468585484eSchristos   puts(_("%s error:  %s option requires the %s option\n"));
1447*eabc0478Schristos #line 121 "../save.c"
14488585484eSchristos   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1449*eabc0478Schristos #line 174 "../save.c"
14508585484eSchristos   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1451*eabc0478Schristos #line 193 "../save.c"
14528585484eSchristos   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1453*eabc0478Schristos #line 567 "../save.c"
14548585484eSchristos   puts(_("%s warning:  cannot save options - %s not regular file\n"));
14558585484eSchristos   /* END-LIBOPTS-MESSAGES */
14568585484eSchristos 
14578585484eSchristos   /* USAGE-TEXT: */
1458*eabc0478Schristos #line 822 "../usage.c"
14598585484eSchristos   puts(_("\t\t\t\t- an alternate for '%s'\n"));
1460*eabc0478Schristos #line 1097 "../usage.c"
14618585484eSchristos   puts(_("Version, usage and configuration options:"));
1462*eabc0478Schristos #line 873 "../usage.c"
14638585484eSchristos   puts(_("\t\t\t\t- default option for unnamed options\n"));
1464*eabc0478Schristos #line 786 "../usage.c"
14658585484eSchristos   puts(_("\t\t\t\t- disabled as '--%s'\n"));
1466*eabc0478Schristos #line 1066 "../usage.c"
14678585484eSchristos   puts(_(" --- %-14s %s\n"));
1468*eabc0478Schristos #line 1064 "../usage.c"
14698585484eSchristos   puts(_("This option has been disabled"));
1470*eabc0478Schristos #line 813 "../usage.c"
14718585484eSchristos   puts(_("\t\t\t\t- enabled by default\n"));
14728585484eSchristos #line 40 "../alias.c"
14738585484eSchristos   puts(_("%s error:  only "));
1474*eabc0478Schristos #line 1143 "../usage.c"
14758585484eSchristos   puts(_(" - examining environment variables named %s_*\n"));
14768585484eSchristos #line 168 "../file.c"
14778585484eSchristos   puts(_("\t\t\t\t- file must not pre-exist\n"));
14788585484eSchristos #line 172 "../file.c"
14798585484eSchristos   puts(_("\t\t\t\t- file must pre-exist\n"));
1480*eabc0478Schristos #line 329 "../usage.c"
14818585484eSchristos   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
14828585484eSchristos        "hyphen and the flag character.\n"));
1483*eabc0478Schristos #line 882 "../makeshell.c"
14848585484eSchristos   puts(_("\n"
14858585484eSchristos        "= = = = = = = =\n\n"
14868585484eSchristos        "This incarnation of genshell will produce\n"
14878585484eSchristos        "a shell script to parse the options for %s:\n\n"));
1488*eabc0478Schristos #line 142 "../enum.c"
14898585484eSchristos   puts(_("  or an integer mask with any of the lower %d bits set\n"));
1490*eabc0478Schristos #line 846 "../usage.c"
14918585484eSchristos   puts(_("\t\t\t\t- is a set membership option\n"));
1492*eabc0478Schristos #line 867 "../usage.c"
14938585484eSchristos   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
1494*eabc0478Schristos #line 331 "../usage.c"
14958585484eSchristos   puts(_("Options are specified by single or double hyphens and their name.\n"));
1496*eabc0478Schristos #line 853 "../usage.c"
14978585484eSchristos   puts(_("\t\t\t\t- may appear multiple times\n"));
1498*eabc0478Schristos #line 840 "../usage.c"
14998585484eSchristos   puts(_("\t\t\t\t- may not be preset\n"));
1500*eabc0478Schristos #line 1258 "../usage.c"
15018585484eSchristos   puts(_("   Arg Option-Name    Description\n"));
1502*eabc0478Schristos #line 1194 "../usage.c"
15038585484eSchristos   puts(_("  Flg Arg Option-Name    Description\n"));
1504*eabc0478Schristos #line 1252 "../usage.c"
15058585484eSchristos   puts(_("  Flg Arg Option-Name    Description\n"));
1506*eabc0478Schristos #line 1253 "../usage.c"
15078585484eSchristos   puts(_(" %3s %s"));
1508*eabc0478Schristos #line 1259 "../usage.c"
15098585484eSchristos   puts(_(" %3s %s"));
1510*eabc0478Schristos #line 336 "../usage.c"
15118585484eSchristos   puts(_("The '-#<number>' option may omit the hash char\n"));
1512*eabc0478Schristos #line 332 "../usage.c"
15138585484eSchristos   puts(_("All arguments are named options.\n"));
1514*eabc0478Schristos #line 920 "../usage.c"
15158585484eSchristos   puts(_(" - reading file %s"));
1516*eabc0478Schristos #line 358 "../usage.c"
15178585484eSchristos   puts(_("\n"
15188585484eSchristos        "Please send bug reports to:  <%s>\n"));
15198585484eSchristos #line 100 "../version.c"
15208585484eSchristos   puts(_("\n"
15218585484eSchristos        "Please send bug reports to:  <%s>\n"));
15228585484eSchristos #line 129 "../version.c"
15238585484eSchristos   puts(_("\n"
15248585484eSchristos        "Please send bug reports to:  <%s>\n"));
1525*eabc0478Schristos #line 852 "../usage.c"
15268585484eSchristos   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
1527*eabc0478Schristos #line 893 "../usage.c"
15288585484eSchristos   puts(_("\n"
15298585484eSchristos        "The following option preset mechanisms are supported:\n"));
1530*eabc0478Schristos #line 1141 "../usage.c"
15318585484eSchristos   puts(_("\n"
15328585484eSchristos        "The following option preset mechanisms are supported:\n"));
1533*eabc0478Schristos #line 631 "../usage.c"
15348585484eSchristos   puts(_("prohibits these options:\n"));
1535*eabc0478Schristos #line 626 "../usage.c"
15368585484eSchristos   puts(_("prohibits the option '%s'\n"));
15378585484eSchristos #line 81 "../numeric.c"
15388585484eSchristos   puts(_("%s%ld to %ld"));
15398585484eSchristos #line 79 "../numeric.c"
15408585484eSchristos   puts(_("%sgreater than or equal to %ld"));
15418585484eSchristos #line 75 "../numeric.c"
15428585484eSchristos   puts(_("%s%ld exactly"));
15438585484eSchristos #line 68 "../numeric.c"
15448585484eSchristos   puts(_("%sit must lie in one of the ranges:\n"));
15458585484eSchristos #line 68 "../numeric.c"
15468585484eSchristos   puts(_("%sit must be in the range:\n"));
15478585484eSchristos #line 88 "../numeric.c"
15488585484eSchristos   puts(_(", or\n"));
15498585484eSchristos #line 66 "../numeric.c"
15508585484eSchristos   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
15518585484eSchristos #line 77 "../numeric.c"
15528585484eSchristos   puts(_("%sless than or equal to %ld"));
1553*eabc0478Schristos #line 339 "../usage.c"
15548585484eSchristos   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
1555*eabc0478Schristos #line 601 "../usage.c"
15568585484eSchristos   puts(_("requires the option '%s'\n"));
1557*eabc0478Schristos #line 604 "../usage.c"
15588585484eSchristos   puts(_("requires these options:\n"));
1559*eabc0478Schristos #line 1270 "../usage.c"
15608585484eSchristos   puts(_("   Arg Option-Name   Req?  Description\n"));
1561*eabc0478Schristos #line 1264 "../usage.c"
15628585484eSchristos   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
1563*eabc0478Schristos #line 143 "../enum.c"
15648585484eSchristos   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
15658585484eSchristos        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
15668585484eSchristos        "will set them all.  Multiple entries may be passed as an option\n"
15678585484eSchristos        "argument list.\n"));
1568*eabc0478Schristos #line 859 "../usage.c"
15698585484eSchristos   puts(_("\t\t\t\t- may appear up to %d times\n"));
1570*eabc0478Schristos #line 52 "../enum.c"
15718585484eSchristos   puts(_("The valid \"%s\" option keywords are:\n"));
1572*eabc0478Schristos #line 1101 "../usage.c"
15738585484eSchristos   puts(_("The next option supports vendor supported extra options:"));
1574*eabc0478Schristos #line 722 "../usage.c"
15758585484eSchristos   puts(_("These additional options are:"));
15768585484eSchristos   /* END-USAGE-TEXT */
15778585484eSchristos }
15788585484eSchristos #endif /* uncompilable code */
1579abb0f93cSkardel #ifdef  __cplusplus
1580abb0f93cSkardel }
1581abb0f93cSkardel #endif
1582abb0f93cSkardel /* sntp-opts.c ends here */
1583