xref: /freebsd/contrib/ntp/ntpdc/ntpdc-opts.c (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
1ea906c41SOllivier Robert /*
2ea906c41SOllivier Robert  *  EDIT THIS FILE WITH CAUTION  (ntpdc-opts.c)
3ea906c41SOllivier Robert  *
4*f5f40dd6SCy Schubert  *  It has been AutoGen-ed  May 25, 2024 at 12:04:11 AM by AutoGen 5.18.16
5ea906c41SOllivier Robert  *  From the definitions    ntpdc-opts.def
6ea906c41SOllivier Robert  *  and the template file   options
7ea906c41SOllivier Robert  *
8a466cc55SCy Schubert  * Generated from AutoOpts 42:1:17 templates.
92b15cb3dSCy Schubert  *
102b15cb3dSCy Schubert  *  AutoOpts is a copyrighted work.  This source file is not encumbered
112b15cb3dSCy Schubert  *  by AutoOpts licensing, but is provided under the licensing terms chosen
122b15cb3dSCy Schubert  *  by the ntpdc author or copyright holder.  AutoOpts is
132b15cb3dSCy Schubert  *  licensed under the terms of the LGPL.  The redistributable library
142b15cb3dSCy Schubert  *  (``libopts'') is licensed under the terms of either the LGPL or, at the
152b15cb3dSCy Schubert  *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
162b15cb3dSCy Schubert  *  for details.
172b15cb3dSCy Schubert  *
182b15cb3dSCy Schubert  * The ntpdc program is copyrighted and licensed
192b15cb3dSCy Schubert  * under the following terms:
202b15cb3dSCy Schubert  *
21*f5f40dd6SCy Schubert  *  Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.
222b15cb3dSCy Schubert  *  This is free software. It is licensed for use, modification and
232b15cb3dSCy Schubert  *  redistribution under the terms of the NTP License, copies of which
242b15cb3dSCy Schubert  *  can be seen at:
252b15cb3dSCy Schubert  *    <http://ntp.org/license>
262b15cb3dSCy Schubert  *    <http://opensource.org/licenses/ntp-license.php>
272b15cb3dSCy Schubert  *
282b15cb3dSCy Schubert  *  Permission to use, copy, modify, and distribute this software and its
292b15cb3dSCy Schubert  *  documentation for any purpose with or without fee is hereby granted,
302b15cb3dSCy Schubert  *  provided that the above copyright notice appears in all copies and that
312b15cb3dSCy Schubert  *  both the copyright notice and this permission notice appear in
322b15cb3dSCy Schubert  *  supporting documentation, and that the name The University of Delaware not be used in
332b15cb3dSCy Schubert  *  advertising or publicity pertaining to distribution of the software
342b15cb3dSCy Schubert  *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
352b15cb3dSCy Schubert  *  representations about the suitability this software for any purpose. It
362b15cb3dSCy Schubert  *  is provided "as is" without express or implied warranty.
37ea906c41SOllivier Robert  */
38ea906c41SOllivier Robert 
392b15cb3dSCy Schubert #ifndef __doxygen__
40ea906c41SOllivier Robert #define OPTION_CODE_COMPILE 1
41ea906c41SOllivier Robert #include "ntpdc-opts.h"
422b15cb3dSCy Schubert #include <sys/types.h>
43a466cc55SCy Schubert #include <sys/stat.h>
442b15cb3dSCy Schubert 
45a466cc55SCy Schubert #include <errno.h>
46a466cc55SCy Schubert #include <fcntl.h>
472b15cb3dSCy Schubert #include <limits.h>
482b15cb3dSCy Schubert #include <stdio.h>
492b15cb3dSCy Schubert #include <stdlib.h>
50a466cc55SCy Schubert #include <string.h>
51a466cc55SCy Schubert #include <unistd.h>
52ea906c41SOllivier Robert 
53ea906c41SOllivier Robert #ifdef  __cplusplus
54ea906c41SOllivier Robert extern "C" {
55ea906c41SOllivier Robert #endif
562b15cb3dSCy Schubert extern FILE * option_usage_fp;
572b15cb3dSCy Schubert #define zCopyright      (ntpdc_opt_strs+0)
58f0574f5cSXin LI #define zLicenseDescrip (ntpdc_opt_strs+342)
59ea906c41SOllivier Robert 
60ea906c41SOllivier Robert /*
61ea906c41SOllivier Robert  *  global included definitions
62ea906c41SOllivier Robert  */
63ea906c41SOllivier Robert #ifdef __windows
64ea906c41SOllivier Robert   extern int atoi(const char*);
65ea906c41SOllivier Robert #else
66ea906c41SOllivier Robert # include <stdlib.h>
67ea906c41SOllivier Robert #endif
68ea906c41SOllivier Robert 
69ea906c41SOllivier Robert #ifndef NULL
70ea906c41SOllivier Robert #  define NULL 0
71ea906c41SOllivier Robert #endif
722b15cb3dSCy Schubert 
732b15cb3dSCy Schubert /**
742b15cb3dSCy Schubert  *  static const strings for ntpdc options
75ea906c41SOllivier Robert  */
76a466cc55SCy Schubert static char const ntpdc_opt_strs[2005] =
77*f5f40dd6SCy Schubert /*     0 */ "ntpdc 4.2.8p18\n"
78*f5f40dd6SCy Schubert             "Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n"
792b15cb3dSCy Schubert             "This is free software. It is licensed for use, modification and\n"
802b15cb3dSCy Schubert             "redistribution under the terms of the NTP License, copies of which\n"
812b15cb3dSCy Schubert             "can be seen at:\n"
822b15cb3dSCy Schubert             "  <http://ntp.org/license>\n"
832b15cb3dSCy Schubert             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
84f0574f5cSXin LI /*   342 */ "Permission to use, copy, modify, and distribute this software and its\n"
852b15cb3dSCy Schubert             "documentation for any purpose with or without fee is hereby granted,\n"
862b15cb3dSCy Schubert             "provided that the above copyright notice appears in all copies and that\n"
872b15cb3dSCy Schubert             "both the copyright notice and this permission notice appear in supporting\n"
882b15cb3dSCy Schubert             "documentation, and that the name The University of Delaware not be used in\n"
892b15cb3dSCy Schubert             "advertising or publicity pertaining to distribution of the software without\n"
902b15cb3dSCy Schubert             "specific, written prior permission.  The University of Delaware and Network\n"
912b15cb3dSCy Schubert             "Time Foundation makes no representations about the suitability this\n"
922b15cb3dSCy Schubert             "software for any purpose.  It is provided \"as is\" without express or\n"
932b15cb3dSCy Schubert             "implied warranty.\n\0"
94f0574f5cSXin LI /*  1010 */ "Force IPv4 DNS name resolution\0"
95f0574f5cSXin LI /*  1041 */ "IPV4\0"
96f0574f5cSXin LI /*  1046 */ "ipv4\0"
97f0574f5cSXin LI /*  1051 */ "Force IPv6 DNS name resolution\0"
98f0574f5cSXin LI /*  1082 */ "IPV6\0"
99f0574f5cSXin LI /*  1087 */ "ipv6\0"
100f0574f5cSXin LI /*  1092 */ "run a command and exit\0"
101f0574f5cSXin LI /*  1115 */ "COMMAND\0"
102f0574f5cSXin LI /*  1123 */ "command\0"
103f0574f5cSXin LI /*  1131 */ "Increase debug verbosity level\0"
104f0574f5cSXin LI /*  1162 */ "DEBUG_LEVEL\0"
105f0574f5cSXin LI /*  1174 */ "debug-level\0"
106f0574f5cSXin LI /*  1186 */ "Set the debug verbosity level\0"
107f0574f5cSXin LI /*  1216 */ "SET_DEBUG_LEVEL\0"
108f0574f5cSXin LI /*  1232 */ "set-debug-level\0"
109f0574f5cSXin LI /*  1248 */ "Force ntpq to operate in interactive mode\0"
110f0574f5cSXin LI /*  1290 */ "INTERACTIVE\0"
111f0574f5cSXin LI /*  1302 */ "interactive\0"
112f0574f5cSXin LI /*  1314 */ "Print a list of the peers\0"
113f0574f5cSXin LI /*  1340 */ "LISTPEERS\0"
114f0574f5cSXin LI /*  1350 */ "listpeers\0"
115f0574f5cSXin LI /*  1360 */ "numeric host addresses\0"
116f0574f5cSXin LI /*  1383 */ "NUMERIC\0"
117f0574f5cSXin LI /*  1391 */ "numeric\0"
118f0574f5cSXin LI /*  1399 */ "PEERS\0"
119f0574f5cSXin LI /*  1405 */ "peers\0"
120f0574f5cSXin LI /*  1411 */ "Show a list of the peers\0"
121f0574f5cSXin LI /*  1436 */ "SHOWPEERS\0"
122f0574f5cSXin LI /*  1446 */ "showpeers\0"
123a466cc55SCy Schubert /*  1456 */ "Use unconnected UDP to communicate with ntpd (default on Windows)\0"
124a466cc55SCy Schubert /*  1522 */ "UNCONNECTED\0"
125a466cc55SCy Schubert /*  1534 */ "unconnected\0"
126a466cc55SCy Schubert /*  1546 */ "display extended usage information and exit\0"
127a466cc55SCy Schubert /*  1590 */ "help\0"
128a466cc55SCy Schubert /*  1595 */ "extended usage information passed thru pager\0"
129a466cc55SCy Schubert /*  1640 */ "more-help\0"
130a466cc55SCy Schubert /*  1650 */ "output version information and exit\0"
131a466cc55SCy Schubert /*  1686 */ "version\0"
132a466cc55SCy Schubert /*  1694 */ "save the option state to a config file\0"
133a466cc55SCy Schubert /*  1733 */ "save-opts\0"
134a466cc55SCy Schubert /*  1743 */ "load options from a config file\0"
135a466cc55SCy Schubert /*  1775 */ "LOAD_OPTS\0"
136a466cc55SCy Schubert /*  1785 */ "no-load-opts\0"
137a466cc55SCy Schubert /*  1798 */ "no\0"
138a466cc55SCy Schubert /*  1801 */ "NTPDC\0"
139*f5f40dd6SCy Schubert /*  1807 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p18\n"
1402b15cb3dSCy Schubert             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
141a466cc55SCy Schubert /*  1938 */ "$HOME\0"
142a466cc55SCy Schubert /*  1944 */ ".\0"
143a466cc55SCy Schubert /*  1946 */ ".ntprc\0"
144a466cc55SCy Schubert /*  1953 */ "https://bugs.ntp.org, bugs@ntp.org\0"
145a466cc55SCy Schubert /*  1988 */ "\n\0"
146*f5f40dd6SCy Schubert /*  1990 */ "ntpdc 4.2.8p18";
1472b15cb3dSCy Schubert 
1482b15cb3dSCy Schubert /**
1492b15cb3dSCy Schubert  *  ipv4 option description with
1502b15cb3dSCy Schubert  *  "Must also have options" and "Incompatible options":
1512b15cb3dSCy Schubert  */
1522b15cb3dSCy Schubert /** Descriptive text for the ipv4 option */
153f0574f5cSXin LI #define IPV4_DESC      (ntpdc_opt_strs+1010)
1542b15cb3dSCy Schubert /** Upper-cased name for the ipv4 option */
155f0574f5cSXin LI #define IPV4_NAME      (ntpdc_opt_strs+1041)
1562b15cb3dSCy Schubert /** Name string for the ipv4 option */
157f0574f5cSXin LI #define IPV4_name      (ntpdc_opt_strs+1046)
1582b15cb3dSCy Schubert /** Other options that appear in conjunction with the ipv4 option */
1592b15cb3dSCy Schubert static int const aIpv4CantList[] = {
1602b15cb3dSCy Schubert     INDEX_OPT_IPV6, NO_EQUIVALENT };
1612b15cb3dSCy Schubert /** Compiled in flag settings for the ipv4 option */
162ea906c41SOllivier Robert #define IPV4_FLAGS     (OPTST_DISABLED)
163ea906c41SOllivier Robert 
1642b15cb3dSCy Schubert /**
1652b15cb3dSCy Schubert  *  ipv6 option description with
1662b15cb3dSCy Schubert  *  "Must also have options" and "Incompatible options":
167ea906c41SOllivier Robert  */
1682b15cb3dSCy Schubert /** Descriptive text for the ipv6 option */
169f0574f5cSXin LI #define IPV6_DESC      (ntpdc_opt_strs+1051)
1702b15cb3dSCy Schubert /** Upper-cased name for the ipv6 option */
171f0574f5cSXin LI #define IPV6_NAME      (ntpdc_opt_strs+1082)
1722b15cb3dSCy Schubert /** Name string for the ipv6 option */
173f0574f5cSXin LI #define IPV6_name      (ntpdc_opt_strs+1087)
1742b15cb3dSCy Schubert /** Other options that appear in conjunction with the ipv6 option */
1752b15cb3dSCy Schubert static int const aIpv6CantList[] = {
1762b15cb3dSCy Schubert     INDEX_OPT_IPV4, NO_EQUIVALENT };
1772b15cb3dSCy Schubert /** Compiled in flag settings for the ipv6 option */
178ea906c41SOllivier Robert #define IPV6_FLAGS     (OPTST_DISABLED)
179ea906c41SOllivier Robert 
1802b15cb3dSCy Schubert /**
1812b15cb3dSCy Schubert  *  command option description:
182ea906c41SOllivier Robert  */
1832b15cb3dSCy Schubert /** Descriptive text for the command option */
184f0574f5cSXin LI #define COMMAND_DESC      (ntpdc_opt_strs+1092)
1852b15cb3dSCy Schubert /** Upper-cased name for the command option */
186f0574f5cSXin LI #define COMMAND_NAME      (ntpdc_opt_strs+1115)
1872b15cb3dSCy Schubert /** Name string for the command option */
188f0574f5cSXin LI #define COMMAND_name      (ntpdc_opt_strs+1123)
1892b15cb3dSCy Schubert /** Compiled in flag settings for the command option */
190ea906c41SOllivier Robert #define COMMAND_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
191ea906c41SOllivier Robert         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
192ea906c41SOllivier Robert 
1932b15cb3dSCy Schubert /**
1942b15cb3dSCy Schubert  *  debug-level option description:
195ea906c41SOllivier Robert  */
1962b15cb3dSCy Schubert /** Descriptive text for the debug-level option */
197f0574f5cSXin LI #define DEBUG_LEVEL_DESC      (ntpdc_opt_strs+1131)
1982b15cb3dSCy Schubert /** Upper-cased name for the debug-level option */
199f0574f5cSXin LI #define DEBUG_LEVEL_NAME      (ntpdc_opt_strs+1162)
2002b15cb3dSCy Schubert /** Name string for the debug-level option */
201f0574f5cSXin LI #define DEBUG_LEVEL_name      (ntpdc_opt_strs+1174)
2022b15cb3dSCy Schubert /** Compiled in flag settings for the debug-level option */
2032b15cb3dSCy Schubert #define DEBUG_LEVEL_FLAGS     (OPTST_DISABLED)
204ea906c41SOllivier Robert 
2052b15cb3dSCy Schubert /**
2062b15cb3dSCy Schubert  *  set-debug-level option description:
207ea906c41SOllivier Robert  */
2082b15cb3dSCy Schubert /** Descriptive text for the set-debug-level option */
209f0574f5cSXin LI #define SET_DEBUG_LEVEL_DESC      (ntpdc_opt_strs+1186)
2102b15cb3dSCy Schubert /** Upper-cased name for the set-debug-level option */
211f0574f5cSXin LI #define SET_DEBUG_LEVEL_NAME      (ntpdc_opt_strs+1216)
2122b15cb3dSCy Schubert /** Name string for the set-debug-level option */
213f0574f5cSXin LI #define SET_DEBUG_LEVEL_name      (ntpdc_opt_strs+1232)
2142b15cb3dSCy Schubert /** Compiled in flag settings for the set-debug-level option */
2152b15cb3dSCy Schubert #define SET_DEBUG_LEVEL_FLAGS     (OPTST_DISABLED \
2162b15cb3dSCy Schubert         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
217ea906c41SOllivier Robert 
2182b15cb3dSCy Schubert /**
2192b15cb3dSCy Schubert  *  interactive option description with
220ea906c41SOllivier Robert  *  "Must also have options" and "Incompatible options":
221ea906c41SOllivier Robert  */
2222b15cb3dSCy Schubert /** Descriptive text for the interactive option */
223f0574f5cSXin LI #define INTERACTIVE_DESC      (ntpdc_opt_strs+1248)
2242b15cb3dSCy Schubert /** Upper-cased name for the interactive option */
225f0574f5cSXin LI #define INTERACTIVE_NAME      (ntpdc_opt_strs+1290)
2262b15cb3dSCy Schubert /** Name string for the interactive option */
227f0574f5cSXin LI #define INTERACTIVE_name      (ntpdc_opt_strs+1302)
2282b15cb3dSCy Schubert /** Other options that appear in conjunction with the interactive option */
2292b15cb3dSCy Schubert static int const aInteractiveCantList[] = {
230ea906c41SOllivier Robert     INDEX_OPT_COMMAND,
231ea906c41SOllivier Robert     INDEX_OPT_LISTPEERS,
232ea906c41SOllivier Robert     INDEX_OPT_PEERS,
233ea906c41SOllivier Robert     INDEX_OPT_SHOWPEERS, NO_EQUIVALENT };
2342b15cb3dSCy Schubert /** Compiled in flag settings for the interactive option */
235ea906c41SOllivier Robert #define INTERACTIVE_FLAGS     (OPTST_DISABLED)
236ea906c41SOllivier Robert 
2372b15cb3dSCy Schubert /**
2382b15cb3dSCy Schubert  *  listpeers option description with
2392b15cb3dSCy Schubert  *  "Must also have options" and "Incompatible options":
240ea906c41SOllivier Robert  */
2412b15cb3dSCy Schubert /** Descriptive text for the listpeers option */
242f0574f5cSXin LI #define LISTPEERS_DESC      (ntpdc_opt_strs+1314)
2432b15cb3dSCy Schubert /** Upper-cased name for the listpeers option */
244f0574f5cSXin LI #define LISTPEERS_NAME      (ntpdc_opt_strs+1340)
2452b15cb3dSCy Schubert /** Name string for the listpeers option */
246f0574f5cSXin LI #define LISTPEERS_name      (ntpdc_opt_strs+1350)
2472b15cb3dSCy Schubert /** Other options that appear in conjunction with the listpeers option */
2482b15cb3dSCy Schubert static int const aListpeersCantList[] = {
2492b15cb3dSCy Schubert     INDEX_OPT_COMMAND, NO_EQUIVALENT };
2502b15cb3dSCy Schubert /** Compiled in flag settings for the listpeers option */
2512b15cb3dSCy Schubert #define LISTPEERS_FLAGS     (OPTST_DISABLED)
252ea906c41SOllivier Robert 
2532b15cb3dSCy Schubert /**
2542b15cb3dSCy Schubert  *  numeric option description:
255ea906c41SOllivier Robert  */
2562b15cb3dSCy Schubert /** Descriptive text for the numeric option */
257f0574f5cSXin LI #define NUMERIC_DESC      (ntpdc_opt_strs+1360)
2582b15cb3dSCy Schubert /** Upper-cased name for the numeric option */
259f0574f5cSXin LI #define NUMERIC_NAME      (ntpdc_opt_strs+1383)
2602b15cb3dSCy Schubert /** Name string for the numeric option */
261f0574f5cSXin LI #define NUMERIC_name      (ntpdc_opt_strs+1391)
2622b15cb3dSCy Schubert /** Compiled in flag settings for the numeric option */
263ea906c41SOllivier Robert #define NUMERIC_FLAGS     (OPTST_DISABLED)
264ea906c41SOllivier Robert 
2652b15cb3dSCy Schubert /**
2662b15cb3dSCy Schubert  *  peers option description with
2672b15cb3dSCy Schubert  *  "Must also have options" and "Incompatible options":
2682b15cb3dSCy Schubert  */
2692b15cb3dSCy Schubert /** Descriptive text for the peers option */
270f0574f5cSXin LI #define PEERS_DESC      (ntpdc_opt_strs+1314)
2712b15cb3dSCy Schubert /** Upper-cased name for the peers option */
272f0574f5cSXin LI #define PEERS_NAME      (ntpdc_opt_strs+1399)
2732b15cb3dSCy Schubert /** Name string for the peers option */
274f0574f5cSXin LI #define PEERS_name      (ntpdc_opt_strs+1405)
2752b15cb3dSCy Schubert /** Other options that appear in conjunction with the peers option */
2762b15cb3dSCy Schubert static int const aPeersCantList[] = {
2772b15cb3dSCy Schubert     INDEX_OPT_COMMAND, NO_EQUIVALENT };
2782b15cb3dSCy Schubert /** Compiled in flag settings for the peers option */
2792b15cb3dSCy Schubert #define PEERS_FLAGS     (OPTST_DISABLED)
2802b15cb3dSCy Schubert 
2812b15cb3dSCy Schubert /**
2822b15cb3dSCy Schubert  *  showpeers option description with
2832b15cb3dSCy Schubert  *  "Must also have options" and "Incompatible options":
2842b15cb3dSCy Schubert  */
2852b15cb3dSCy Schubert /** Descriptive text for the showpeers option */
286f0574f5cSXin LI #define SHOWPEERS_DESC      (ntpdc_opt_strs+1411)
2872b15cb3dSCy Schubert /** Upper-cased name for the showpeers option */
288f0574f5cSXin LI #define SHOWPEERS_NAME      (ntpdc_opt_strs+1436)
2892b15cb3dSCy Schubert /** Name string for the showpeers option */
290f0574f5cSXin LI #define SHOWPEERS_name      (ntpdc_opt_strs+1446)
2912b15cb3dSCy Schubert /** Other options that appear in conjunction with the showpeers option */
2922b15cb3dSCy Schubert static int const aShowpeersCantList[] = {
2932b15cb3dSCy Schubert     INDEX_OPT_COMMAND, NO_EQUIVALENT };
2942b15cb3dSCy Schubert /** Compiled in flag settings for the showpeers option */
2952b15cb3dSCy Schubert #define SHOWPEERS_FLAGS     (OPTST_DISABLED)
2962b15cb3dSCy Schubert 
297a466cc55SCy Schubert /**
298a466cc55SCy Schubert  *  unconnected option description:
299a466cc55SCy Schubert  */
300a466cc55SCy Schubert /** Descriptive text for the unconnected option */
301a466cc55SCy Schubert #define UNCONNECTED_DESC      (ntpdc_opt_strs+1456)
302a466cc55SCy Schubert /** Upper-cased name for the unconnected option */
303a466cc55SCy Schubert #define UNCONNECTED_NAME      (ntpdc_opt_strs+1522)
304a466cc55SCy Schubert /** Name string for the unconnected option */
305a466cc55SCy Schubert #define UNCONNECTED_name      (ntpdc_opt_strs+1534)
306a466cc55SCy Schubert /** Compiled in flag settings for the unconnected option */
307a466cc55SCy Schubert #define UNCONNECTED_FLAGS     (OPTST_DISABLED)
308a466cc55SCy Schubert 
309ea906c41SOllivier Robert /*
310ea906c41SOllivier Robert  *  Help/More_Help/Version option descriptions:
311ea906c41SOllivier Robert  */
312a466cc55SCy Schubert #define HELP_DESC       (ntpdc_opt_strs+1546)
313a466cc55SCy Schubert #define HELP_name       (ntpdc_opt_strs+1590)
3142b15cb3dSCy Schubert #ifdef HAVE_WORKING_FORK
315a466cc55SCy Schubert #define MORE_HELP_DESC  (ntpdc_opt_strs+1595)
316a466cc55SCy Schubert #define MORE_HELP_name  (ntpdc_opt_strs+1640)
3172b15cb3dSCy Schubert #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
3182b15cb3dSCy Schubert #else
3192b15cb3dSCy Schubert #define MORE_HELP_DESC  HELP_DESC
3202b15cb3dSCy Schubert #define MORE_HELP_name  HELP_name
3212b15cb3dSCy Schubert #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
3222b15cb3dSCy Schubert #endif
3232b15cb3dSCy Schubert #ifdef NO_OPTIONAL_OPT_ARGS
3242b15cb3dSCy Schubert #  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
3252b15cb3dSCy Schubert #else
3262b15cb3dSCy Schubert #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
3272b15cb3dSCy Schubert                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
3282b15cb3dSCy Schubert #endif
329a466cc55SCy Schubert #define VER_DESC        (ntpdc_opt_strs+1650)
330a466cc55SCy Schubert #define VER_name        (ntpdc_opt_strs+1686)
331a466cc55SCy Schubert #define SAVE_OPTS_DESC  (ntpdc_opt_strs+1694)
332a466cc55SCy Schubert #define SAVE_OPTS_name  (ntpdc_opt_strs+1733)
333a466cc55SCy Schubert #define LOAD_OPTS_DESC     (ntpdc_opt_strs+1743)
334a466cc55SCy Schubert #define LOAD_OPTS_NAME     (ntpdc_opt_strs+1775)
335a466cc55SCy Schubert #define NO_LOAD_OPTS_name  (ntpdc_opt_strs+1785)
336a466cc55SCy Schubert #define LOAD_OPTS_pfx      (ntpdc_opt_strs+1798)
3372b15cb3dSCy Schubert #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
3382b15cb3dSCy Schubert /**
339ea906c41SOllivier Robert  *  Declare option callback procedures
340ea906c41SOllivier Robert  */
341ea906c41SOllivier Robert extern tOptProc
3422b15cb3dSCy Schubert     ntpOptionPrintVersion, optionBooleanVal,      optionNestedVal,
3432b15cb3dSCy Schubert     optionNumericVal,      optionPagedUsage,      optionResetOpt,
3442b15cb3dSCy Schubert     optionStackArg,        optionTimeDate,        optionTimeVal,
3452b15cb3dSCy Schubert     optionUnstackArg,      optionVendorOption;
346ea906c41SOllivier Robert static tOptProc
3472b15cb3dSCy Schubert     doOptDebug_Level, doUsageOpt;
3482b15cb3dSCy Schubert #define VER_PROC        ntpOptionPrintVersion
349ea906c41SOllivier Robert 
3502b15cb3dSCy Schubert /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
3512b15cb3dSCy Schubert /**
3522b15cb3dSCy Schubert  *  Define the ntpdc Option Descriptions.
3532b15cb3dSCy Schubert  * This is an array of OPTION_CT entries, one for each
3542b15cb3dSCy Schubert  * option that the ntpdc program responds to.
355ea906c41SOllivier Robert  */
356ea906c41SOllivier Robert static tOptDesc optDesc[OPTION_CT] = {
357ea906c41SOllivier Robert   {  /* entry idx, value */ 0, VALUE_OPT_IPV4,
3582b15cb3dSCy Schubert      /* equiv idx, value */ 0, VALUE_OPT_IPV4,
359ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
360ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
361ea906c41SOllivier Robert      /* opt state flags  */ IPV4_FLAGS, 0,
3622b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --ipv4 */
363ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
3642b15cb3dSCy Schubert      /* must/cannot opts */ NULL, aIpv4CantList,
365ea906c41SOllivier Robert      /* option proc      */ NULL,
3662b15cb3dSCy Schubert      /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name,
367ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
368ea906c41SOllivier Robert 
369ea906c41SOllivier Robert   {  /* entry idx, value */ 1, VALUE_OPT_IPV6,
3702b15cb3dSCy Schubert      /* equiv idx, value */ 1, VALUE_OPT_IPV6,
3712b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
372ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
373ea906c41SOllivier Robert      /* opt state flags  */ IPV6_FLAGS, 0,
3742b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --ipv6 */
375ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
3762b15cb3dSCy Schubert      /* must/cannot opts */ NULL, aIpv6CantList,
377ea906c41SOllivier Robert      /* option proc      */ NULL,
3782b15cb3dSCy Schubert      /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name,
379ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
380ea906c41SOllivier Robert 
381ea906c41SOllivier Robert   {  /* entry idx, value */ 2, VALUE_OPT_COMMAND,
382ea906c41SOllivier Robert      /* equiv idx, value */ 2, VALUE_OPT_COMMAND,
383ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
384ea906c41SOllivier Robert      /* min, max, act ct */ 0, NOLIMIT, 0,
385ea906c41SOllivier Robert      /* opt state flags  */ COMMAND_FLAGS, 0,
3862b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --command */
387ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
388ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
389ea906c41SOllivier Robert      /* option proc      */ optionStackArg,
3902b15cb3dSCy Schubert      /* desc, NAME, name */ COMMAND_DESC, COMMAND_NAME, COMMAND_name,
391ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
392ea906c41SOllivier Robert 
3932b15cb3dSCy Schubert   {  /* entry idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
3942b15cb3dSCy Schubert      /* equiv idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
395ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
396ea906c41SOllivier Robert      /* min, max, act ct */ 0, NOLIMIT, 0,
397ea906c41SOllivier Robert      /* opt state flags  */ DEBUG_LEVEL_FLAGS, 0,
3982b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --debug-level */
399ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
400ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
4012b15cb3dSCy Schubert      /* option proc      */ doOptDebug_Level,
4022b15cb3dSCy Schubert      /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
403ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
404ea906c41SOllivier Robert 
4052b15cb3dSCy Schubert   {  /* entry idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
4062b15cb3dSCy Schubert      /* equiv idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
407ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
408ea906c41SOllivier Robert      /* min, max, act ct */ 0, NOLIMIT, 0,
409ea906c41SOllivier Robert      /* opt state flags  */ SET_DEBUG_LEVEL_FLAGS, 0,
4102b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --set-debug-level */
411ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
412ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
4132b15cb3dSCy Schubert      /* option proc      */ optionNumericVal,
4142b15cb3dSCy Schubert      /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
415ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
416ea906c41SOllivier Robert 
4172b15cb3dSCy Schubert   {  /* entry idx, value */ 5, VALUE_OPT_INTERACTIVE,
4182b15cb3dSCy Schubert      /* equiv idx, value */ 5, VALUE_OPT_INTERACTIVE,
4192b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
4202b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
4212b15cb3dSCy Schubert      /* opt state flags  */ INTERACTIVE_FLAGS, 0,
4222b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --interactive */
4232b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
4242b15cb3dSCy Schubert      /* must/cannot opts */ NULL, aInteractiveCantList,
4252b15cb3dSCy Schubert      /* option proc      */ NULL,
4262b15cb3dSCy Schubert      /* desc, NAME, name */ INTERACTIVE_DESC, INTERACTIVE_NAME, INTERACTIVE_name,
4272b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
4282b15cb3dSCy Schubert 
4292b15cb3dSCy Schubert   {  /* entry idx, value */ 6, VALUE_OPT_LISTPEERS,
4302b15cb3dSCy Schubert      /* equiv idx, value */ 6, VALUE_OPT_LISTPEERS,
4312b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
4322b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
4332b15cb3dSCy Schubert      /* opt state flags  */ LISTPEERS_FLAGS, 0,
4342b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --listpeers */
4352b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
4362b15cb3dSCy Schubert      /* must/cannot opts */ NULL, aListpeersCantList,
4372b15cb3dSCy Schubert      /* option proc      */ NULL,
4382b15cb3dSCy Schubert      /* desc, NAME, name */ LISTPEERS_DESC, LISTPEERS_NAME, LISTPEERS_name,
4392b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
4402b15cb3dSCy Schubert 
4412b15cb3dSCy Schubert   {  /* entry idx, value */ 7, VALUE_OPT_NUMERIC,
4422b15cb3dSCy Schubert      /* equiv idx, value */ 7, VALUE_OPT_NUMERIC,
443ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
444ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
445ea906c41SOllivier Robert      /* opt state flags  */ NUMERIC_FLAGS, 0,
4462b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --numeric */
447ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
448ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
449ea906c41SOllivier Robert      /* option proc      */ NULL,
4502b15cb3dSCy Schubert      /* desc, NAME, name */ NUMERIC_DESC, NUMERIC_NAME, NUMERIC_name,
451ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
452ea906c41SOllivier Robert 
4532b15cb3dSCy Schubert   {  /* entry idx, value */ 8, VALUE_OPT_PEERS,
4542b15cb3dSCy Schubert      /* equiv idx, value */ 8, VALUE_OPT_PEERS,
455ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
456ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
4572b15cb3dSCy Schubert      /* opt state flags  */ PEERS_FLAGS, 0,
4582b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --peers */
4592b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
4602b15cb3dSCy Schubert      /* must/cannot opts */ NULL, aPeersCantList,
4612b15cb3dSCy Schubert      /* option proc      */ NULL,
4622b15cb3dSCy Schubert      /* desc, NAME, name */ PEERS_DESC, PEERS_NAME, PEERS_name,
4632b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
4642b15cb3dSCy Schubert 
4652b15cb3dSCy Schubert   {  /* entry idx, value */ 9, VALUE_OPT_SHOWPEERS,
4662b15cb3dSCy Schubert      /* equiv idx, value */ 9, VALUE_OPT_SHOWPEERS,
4672b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
4682b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
4692b15cb3dSCy Schubert      /* opt state flags  */ SHOWPEERS_FLAGS, 0,
4702b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --showpeers */
4712b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
4722b15cb3dSCy Schubert      /* must/cannot opts */ NULL, aShowpeersCantList,
4732b15cb3dSCy Schubert      /* option proc      */ NULL,
4742b15cb3dSCy Schubert      /* desc, NAME, name */ SHOWPEERS_DESC, SHOWPEERS_NAME, SHOWPEERS_name,
4752b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
4762b15cb3dSCy Schubert 
477a466cc55SCy Schubert   {  /* entry idx, value */ 10, VALUE_OPT_UNCONNECTED,
478a466cc55SCy Schubert      /* equiv idx, value */ 10, VALUE_OPT_UNCONNECTED,
479a466cc55SCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
480a466cc55SCy Schubert      /* min, max, act ct */ 0, 1, 0,
481a466cc55SCy Schubert      /* opt state flags  */ UNCONNECTED_FLAGS, 0,
482a466cc55SCy Schubert      /* last opt argumnt */ { NULL }, /* --unconnected */
483a466cc55SCy Schubert      /* arg list/cookie  */ NULL,
484a466cc55SCy Schubert      /* must/cannot opts */ NULL, NULL,
485a466cc55SCy Schubert      /* option proc      */ NULL,
486a466cc55SCy Schubert      /* desc, NAME, name */ UNCONNECTED_DESC, UNCONNECTED_NAME, UNCONNECTED_name,
487a466cc55SCy Schubert      /* disablement strs */ NULL, NULL },
488a466cc55SCy Schubert 
4892b15cb3dSCy Schubert   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
4902b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_VERSION,
4912b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
4922b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
4932b15cb3dSCy Schubert      /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
494ea906c41SOllivier Robert      /* last opt argumnt */ { NULL },
495ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
496ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
4972b15cb3dSCy Schubert      /* option proc      */ VER_PROC,
4982b15cb3dSCy Schubert      /* desc, NAME, name */ VER_DESC, NULL, VER_name,
499ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
500ea906c41SOllivier Robert 
501ea906c41SOllivier Robert 
502ea906c41SOllivier Robert 
503ea906c41SOllivier Robert   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
5042b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_HELP,
505ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
506ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
5072b15cb3dSCy Schubert      /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
508ea906c41SOllivier Robert      /* last opt argumnt */ { NULL },
509ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
510ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
511ea906c41SOllivier Robert      /* option proc      */ doUsageOpt,
5122b15cb3dSCy Schubert      /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
513ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
514ea906c41SOllivier Robert 
515ea906c41SOllivier Robert   {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
5162b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
517ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
518ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
5192b15cb3dSCy Schubert      /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
520ea906c41SOllivier Robert      /* last opt argumnt */ { NULL },
521ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
522ea906c41SOllivier Robert      /* must/cannot opts */ NULL,  NULL,
523ea906c41SOllivier Robert      /* option proc      */ optionPagedUsage,
5242b15cb3dSCy Schubert      /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
525ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
526ea906c41SOllivier Robert 
527ea906c41SOllivier Robert   {  /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
5282b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
529ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
530ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
531ea906c41SOllivier Robert      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
5322b15cb3dSCy Schubert                        | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
533ea906c41SOllivier Robert      /* last opt argumnt */ { NULL },
534ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
535ea906c41SOllivier Robert      /* must/cannot opts */ NULL,  NULL,
536ea906c41SOllivier Robert      /* option proc      */ NULL,
5372b15cb3dSCy Schubert      /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
538ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
539ea906c41SOllivier Robert 
540ea906c41SOllivier Robert   {  /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
5412b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
542ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
543ea906c41SOllivier Robert      /* min, max, act ct */ 0, NOLIMIT, 0,
5442b15cb3dSCy Schubert      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
5452b15cb3dSCy Schubert 			  | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
546ea906c41SOllivier Robert      /* last opt argumnt */ { NULL },
547ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
548ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
549ea906c41SOllivier Robert      /* option proc      */ optionLoadOpt,
5502b15cb3dSCy Schubert      /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
5512b15cb3dSCy Schubert      /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
552ea906c41SOllivier Robert };
553ea906c41SOllivier Robert 
554ea906c41SOllivier Robert 
5552b15cb3dSCy Schubert /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
5562b15cb3dSCy Schubert /** Reference to the upper cased version of ntpdc. */
557a466cc55SCy Schubert #define zPROGNAME       (ntpdc_opt_strs+1801)
5582b15cb3dSCy Schubert /** Reference to the title line for ntpdc usage. */
559a466cc55SCy Schubert #define zUsageTitle     (ntpdc_opt_strs+1807)
5602b15cb3dSCy Schubert /** ntpdc configuration file name. */
561a466cc55SCy Schubert #define zRcName         (ntpdc_opt_strs+1946)
5622b15cb3dSCy Schubert /** Directories to search for ntpdc config files. */
5632b15cb3dSCy Schubert static char const * const apzHomeList[3] = {
564a466cc55SCy Schubert     ntpdc_opt_strs+1938,
565a466cc55SCy Schubert     ntpdc_opt_strs+1944,
5662b15cb3dSCy Schubert     NULL };
5672b15cb3dSCy Schubert /** The ntpdc program bug email address. */
568a466cc55SCy Schubert #define zBugsAddr       (ntpdc_opt_strs+1953)
5692b15cb3dSCy Schubert /** Clarification/explanation of what ntpdc does. */
570a466cc55SCy Schubert #define zExplain        (ntpdc_opt_strs+1988)
5712b15cb3dSCy Schubert /** Extra detail explaining what ntpdc does. */
5722b15cb3dSCy Schubert #define zDetail         (NULL)
5732b15cb3dSCy Schubert /** The full version string for ntpdc. */
574a466cc55SCy Schubert #define zFullVersion    (ntpdc_opt_strs+1990)
575a466cc55SCy Schubert /* extracted from optcode.tlib near line 342 */
576ea906c41SOllivier Robert 
577ea906c41SOllivier Robert #if defined(ENABLE_NLS)
578ea906c41SOllivier Robert # define OPTPROC_BASE OPTPROC_TRANSLATE
579ea906c41SOllivier Robert   static tOptionXlateProc translate_option_strings;
580ea906c41SOllivier Robert #else
581ea906c41SOllivier Robert # define OPTPROC_BASE OPTPROC_NONE
582ea906c41SOllivier Robert # define translate_option_strings NULL
583ea906c41SOllivier Robert #endif /* ENABLE_NLS */
584ea906c41SOllivier Robert 
5852b15cb3dSCy Schubert #define ntpdc_full_usage (NULL)
5862b15cb3dSCy Schubert #define ntpdc_short_usage (NULL)
5872b15cb3dSCy Schubert 
5882b15cb3dSCy Schubert #endif /* not defined __doxygen__ */
5892b15cb3dSCy Schubert 
5902b15cb3dSCy Schubert /*
5912b15cb3dSCy Schubert  *  Create the static procedure(s) declared above.
5922b15cb3dSCy Schubert  */
5932b15cb3dSCy Schubert /**
5942b15cb3dSCy Schubert  * The callout function that invokes the optionUsage function.
5952b15cb3dSCy Schubert  *
5962b15cb3dSCy Schubert  * @param[in] opts the AutoOpts option description structure
5972b15cb3dSCy Schubert  * @param[in] od   the descriptor for the "help" (usage) option.
5982b15cb3dSCy Schubert  * @noreturn
5992b15cb3dSCy Schubert  */
6002b15cb3dSCy Schubert static void
6012b15cb3dSCy Schubert doUsageOpt(tOptions * opts, tOptDesc * od)
6022b15cb3dSCy Schubert {
6032b15cb3dSCy Schubert     int ex_code;
6042b15cb3dSCy Schubert     ex_code = NTPDC_EXIT_SUCCESS;
6052b15cb3dSCy Schubert     optionUsage(&ntpdcOptions, ex_code);
6062b15cb3dSCy Schubert     /* NOTREACHED */
607a466cc55SCy Schubert     exit(NTPDC_EXIT_FAILURE);
6082b15cb3dSCy Schubert     (void)opts;
6092b15cb3dSCy Schubert     (void)od;
6102b15cb3dSCy Schubert }
6112b15cb3dSCy Schubert 
6122b15cb3dSCy Schubert /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
6132b15cb3dSCy Schubert /**
6142b15cb3dSCy Schubert  * Code to handle the debug-level option.
6152b15cb3dSCy Schubert  *
6162b15cb3dSCy Schubert  * @param[in] pOptions the ntpdc options data structure
6172b15cb3dSCy Schubert  * @param[in,out] pOptDesc the option descriptor for this option.
6182b15cb3dSCy Schubert  */
6192b15cb3dSCy Schubert static void
6202b15cb3dSCy Schubert doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
6212b15cb3dSCy Schubert {
6222b15cb3dSCy Schubert     /*
6232b15cb3dSCy Schubert      * Be sure the flag-code[0] handles special values for the options pointer
6242b15cb3dSCy Schubert      * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
6252b15cb3dSCy Schubert      * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
6262b15cb3dSCy Schubert      * reset its state.
6272b15cb3dSCy Schubert      */
6282b15cb3dSCy Schubert     /* extracted from debug-opt.def, line 15 */
6292b15cb3dSCy Schubert OPT_VALUE_SET_DEBUG_LEVEL++;
6302b15cb3dSCy Schubert     (void)pOptDesc;
6312b15cb3dSCy Schubert     (void)pOptions;
6322b15cb3dSCy Schubert }
633276da39aSCy Schubert /* extracted from optmain.tlib near line 1250 */
6342b15cb3dSCy Schubert 
6352b15cb3dSCy Schubert /**
6362b15cb3dSCy Schubert  * The directory containing the data associated with ntpdc.
6372b15cb3dSCy Schubert  */
6382b15cb3dSCy Schubert #ifndef  PKGDATADIR
6392b15cb3dSCy Schubert # define PKGDATADIR ""
6402b15cb3dSCy Schubert #endif
6412b15cb3dSCy Schubert 
6422b15cb3dSCy Schubert /**
6432b15cb3dSCy Schubert  * Information about the person or institution that packaged ntpdc
6442b15cb3dSCy Schubert  * for the current distribution.
6452b15cb3dSCy Schubert  */
6462b15cb3dSCy Schubert #ifndef  WITH_PACKAGER
6472b15cb3dSCy Schubert # define ntpdc_packager_info NULL
6482b15cb3dSCy Schubert #else
6492b15cb3dSCy Schubert /** Packager information for ntpdc. */
6502b15cb3dSCy Schubert static char const ntpdc_packager_info[] =
6512b15cb3dSCy Schubert     "Packaged by " WITH_PACKAGER
6522b15cb3dSCy Schubert 
6532b15cb3dSCy Schubert # ifdef WITH_PACKAGER_VERSION
6542b15cb3dSCy Schubert         " ("WITH_PACKAGER_VERSION")"
6552b15cb3dSCy Schubert # endif
6562b15cb3dSCy Schubert 
6572b15cb3dSCy Schubert # ifdef WITH_PACKAGER_BUG_REPORTS
6582b15cb3dSCy Schubert     "\nReport ntpdc bugs to " WITH_PACKAGER_BUG_REPORTS
6592b15cb3dSCy Schubert # endif
6602b15cb3dSCy Schubert     "\n";
6612b15cb3dSCy Schubert #endif
6622b15cb3dSCy Schubert #ifndef __doxygen__
6632b15cb3dSCy Schubert 
6642b15cb3dSCy Schubert #endif /* __doxygen__ */
6652b15cb3dSCy Schubert /**
6662b15cb3dSCy Schubert  * The option definitions for ntpdc.  The one structure that
6672b15cb3dSCy Schubert  * binds them all.
6682b15cb3dSCy Schubert  */
669ea906c41SOllivier Robert tOptions ntpdcOptions = {
670ea906c41SOllivier Robert     OPTIONS_STRUCT_VERSION,
671ea906c41SOllivier Robert     0, NULL,                    /* original argc + argv    */
672ea906c41SOllivier Robert     ( OPTPROC_BASE
673ea906c41SOllivier Robert     + OPTPROC_ERRSTOP
674ea906c41SOllivier Robert     + OPTPROC_SHORTOPT
675ea906c41SOllivier Robert     + OPTPROC_LONGOPT
676ea906c41SOllivier Robert     + OPTPROC_NO_REQ_OPT
677ea906c41SOllivier Robert     + OPTPROC_ENVIRON
6782b15cb3dSCy Schubert     + OPTPROC_MISUSE ),
679ea906c41SOllivier Robert     0, NULL,                    /* current option index, current option */
680ea906c41SOllivier Robert     NULL,         NULL,         zPROGNAME,
6812b15cb3dSCy Schubert     zRcName,      zCopyright,   zLicenseDescrip,
682ea906c41SOllivier Robert     zFullVersion, apzHomeList,  zUsageTitle,
683ea906c41SOllivier Robert     zExplain,     zDetail,      optDesc,
684ea906c41SOllivier Robert     zBugsAddr,                  /* address to send bugs to */
685ea906c41SOllivier Robert     NULL, NULL,                 /* extensions/saved state  */
686ea906c41SOllivier Robert     optionUsage, /* usage procedure */
687ea906c41SOllivier Robert     translate_option_strings,   /* translation procedure */
688ea906c41SOllivier Robert     /*
689ea906c41SOllivier Robert      *  Indexes to special options
690ea906c41SOllivier Robert      */
6912b15cb3dSCy Schubert     { INDEX_OPT_MORE_HELP, /* more-help option index */
6922b15cb3dSCy Schubert       INDEX_OPT_SAVE_OPTS, /* save option index */
6932b15cb3dSCy Schubert       NO_EQUIVALENT, /* '-#' option index */
694ea906c41SOllivier Robert       NO_EQUIVALENT /* index of default opt */
695ea906c41SOllivier Robert     },
696a466cc55SCy Schubert     16 /* full option count */, 11 /* user option count */,
6972b15cb3dSCy Schubert     ntpdc_full_usage, ntpdc_short_usage,
6982b15cb3dSCy Schubert     NULL, NULL,
6992b15cb3dSCy Schubert     PKGDATADIR, ntpdc_packager_info
700ea906c41SOllivier Robert };
701ea906c41SOllivier Robert 
702ea906c41SOllivier Robert #if ENABLE_NLS
7032b15cb3dSCy Schubert /**
7042b15cb3dSCy Schubert  * This code is designed to translate translatable option text for the
7052b15cb3dSCy Schubert  * ntpdc program.  These translations happen upon entry
7062b15cb3dSCy Schubert  * to optionProcess().
7072b15cb3dSCy Schubert  */
708ea906c41SOllivier Robert #include <stdio.h>
709ea906c41SOllivier Robert #include <stdlib.h>
710ea906c41SOllivier Robert #include <string.h>
711ea906c41SOllivier Robert #include <unistd.h>
7122b15cb3dSCy Schubert #ifdef HAVE_DCGETTEXT
7132b15cb3dSCy Schubert # include <gettext.h>
7142b15cb3dSCy Schubert #endif
715ea906c41SOllivier Robert #include <autoopts/usage-txt.h>
716ea906c41SOllivier Robert 
717ea906c41SOllivier Robert static char * AO_gettext(char const * pz);
718ea906c41SOllivier Robert static void   coerce_it(void ** s);
719ea906c41SOllivier Robert 
7202b15cb3dSCy Schubert /**
7212b15cb3dSCy Schubert  * AutoGen specific wrapper function for gettext.  It relies on the macro _()
7222b15cb3dSCy Schubert  * to convert from English to the target language, then strdup-duplicates the
7232b15cb3dSCy Schubert  * result string.  It tries the "libopts" domain first, then whatever has been
7242b15cb3dSCy Schubert  * set via the \a textdomain(3) call.
7252b15cb3dSCy Schubert  *
7262b15cb3dSCy Schubert  * @param[in] pz the input text used as a lookup key.
7272b15cb3dSCy Schubert  * @returns the translated text (if there is one),
7282b15cb3dSCy Schubert  *   or the original text (if not).
7292b15cb3dSCy Schubert  */
730ea906c41SOllivier Robert static char *
731ea906c41SOllivier Robert AO_gettext(char const * pz)
732ea906c41SOllivier Robert {
7332b15cb3dSCy Schubert     char * res;
734ea906c41SOllivier Robert     if (pz == NULL)
735ea906c41SOllivier Robert         return NULL;
7362b15cb3dSCy Schubert #ifdef HAVE_DCGETTEXT
737ea906c41SOllivier Robert     /*
7382b15cb3dSCy Schubert      * While processing the option_xlateable_txt data, try to use the
7392b15cb3dSCy Schubert      * "libopts" domain.  Once we switch to the option descriptor data,
7402b15cb3dSCy Schubert      * do *not* use that domain.
7412b15cb3dSCy Schubert      */
7422b15cb3dSCy Schubert     if (option_xlateable_txt.field_ct != 0) {
7432b15cb3dSCy Schubert         res = dgettext("libopts", pz);
7442b15cb3dSCy Schubert         if (res == pz)
745276da39aSCy Schubert             res = (char *)VOIDP(_(pz));
7462b15cb3dSCy Schubert     } else
747276da39aSCy Schubert         res = (char *)VOIDP(_(pz));
7482b15cb3dSCy Schubert #else
749276da39aSCy Schubert     res = (char *)VOIDP(_(pz));
7502b15cb3dSCy Schubert #endif
7512b15cb3dSCy Schubert     if (res == pz)
7522b15cb3dSCy Schubert         return res;
7532b15cb3dSCy Schubert     res = strdup(res);
7542b15cb3dSCy Schubert     if (res == NULL) {
7552b15cb3dSCy Schubert         fputs(_("No memory for duping translated strings\n"), stderr);
7562b15cb3dSCy Schubert         exit(NTPDC_EXIT_FAILURE);
7572b15cb3dSCy Schubert     }
7582b15cb3dSCy Schubert     return res;
7592b15cb3dSCy Schubert }
7602b15cb3dSCy Schubert 
7612b15cb3dSCy Schubert /**
7622b15cb3dSCy Schubert  * All the pointers we use are marked "* const", but they are stored in
7632b15cb3dSCy Schubert  * writable memory.  Coerce the mutability and set the pointer.
7642b15cb3dSCy Schubert  */
7652b15cb3dSCy Schubert static void coerce_it(void ** s) { *s = AO_gettext(*s);
7662b15cb3dSCy Schubert }
7672b15cb3dSCy Schubert 
7682b15cb3dSCy Schubert /**
7692b15cb3dSCy Schubert  * Translate all the translatable strings in the ntpdcOptions
7702b15cb3dSCy Schubert  * structure defined above.  This is done only once.
771ea906c41SOllivier Robert  */
772ea906c41SOllivier Robert static void
773ea906c41SOllivier Robert translate_option_strings(void)
774ea906c41SOllivier Robert {
7752b15cb3dSCy Schubert     tOptions * const opts = &ntpdcOptions;
7762b15cb3dSCy Schubert 
777ea906c41SOllivier Robert     /*
778ea906c41SOllivier Robert      *  Guard against re-translation.  It won't work.  The strings will have
779ea906c41SOllivier Robert      *  been changed by the first pass through this code.  One shot only.
780ea906c41SOllivier Robert      */
7812b15cb3dSCy Schubert     if (option_xlateable_txt.field_ct != 0) {
782ea906c41SOllivier Robert         /*
7832b15cb3dSCy Schubert          *  Do the translations.  The first pointer follows the field count
7842b15cb3dSCy Schubert          *  field.  The field count field is the size of a pointer.
785ea906c41SOllivier Robert          */
786276da39aSCy Schubert         char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
7872b15cb3dSCy Schubert         int     ix  = option_xlateable_txt.field_ct;
788ea906c41SOllivier Robert 
789ea906c41SOllivier Robert         do {
7902b15cb3dSCy Schubert             ppz++; /* skip over field_ct */
791ea906c41SOllivier Robert             *ppz = AO_gettext(*ppz);
792ea906c41SOllivier Robert         } while (--ix > 0);
7932b15cb3dSCy Schubert         /* prevent re-translation and disable "libopts" domain lookup */
7942b15cb3dSCy Schubert         option_xlateable_txt.field_ct = 0;
795ea906c41SOllivier Robert 
796276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzCopyright)));
797276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzCopyNotice)));
798276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzFullVersion)));
799276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzUsageTitle)));
800276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzExplain)));
801276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzDetail)));
802ea906c41SOllivier Robert         {
8032b15cb3dSCy Schubert             tOptDesc * od = opts->pOptDesc;
8042b15cb3dSCy Schubert             for (ix = opts->optCt; ix > 0; ix--, od++)
805276da39aSCy Schubert                 coerce_it(VOIDP(&(od->pzText)));
806ea906c41SOllivier Robert         }
807ea906c41SOllivier Robert     }
808ea906c41SOllivier Robert }
809ea906c41SOllivier Robert #endif /* ENABLE_NLS */
810ea906c41SOllivier Robert 
8112b15cb3dSCy Schubert #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
8122b15cb3dSCy Schubert /** I18N function strictly for xgettext.  Do not compile. */
8132b15cb3dSCy Schubert static void bogus_function(void) {
8142b15cb3dSCy Schubert   /* TRANSLATORS:
8152b15cb3dSCy Schubert 
8162b15cb3dSCy Schubert      The following dummy function was crated solely so that xgettext can
8172b15cb3dSCy Schubert      extract the correct strings.  These strings are actually referenced
8182b15cb3dSCy Schubert      by a field name in the ntpdcOptions structure noted in the
8192b15cb3dSCy Schubert      comments below.  The literal text is defined in ntpdc_opt_strs.
8202b15cb3dSCy Schubert 
8212b15cb3dSCy Schubert      NOTE: the strings below are segmented with respect to the source string
8222b15cb3dSCy Schubert      ntpdc_opt_strs.  The strings above are handed off for translation
8232b15cb3dSCy Schubert      at run time a paragraph at a time.  Consequently, they are presented here
8242b15cb3dSCy Schubert      for translation a paragraph at a time.
8252b15cb3dSCy Schubert 
8262b15cb3dSCy Schubert      ALSO: often the description for an option will reference another option
8272b15cb3dSCy Schubert      by name.  These are set off with apostrophe quotes (I hope).  Do not
8282b15cb3dSCy Schubert      translate option names.
8292b15cb3dSCy Schubert    */
8302b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pzCopyright */
831*f5f40dd6SCy Schubert   puts(_("ntpdc 4.2.8p18\n\
832*f5f40dd6SCy Schubert Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n\
8332b15cb3dSCy Schubert This is free software. It is licensed for use, modification and\n\
8342b15cb3dSCy Schubert redistribution under the terms of the NTP License, copies of which\n\
8352b15cb3dSCy Schubert can be seen at:\n"));
8362b15cb3dSCy Schubert   puts(_("  <http://ntp.org/license>\n\
8372b15cb3dSCy Schubert   <http://opensource.org/licenses/ntp-license.php>\n"));
8382b15cb3dSCy Schubert 
8392b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pzCopyNotice */
8402b15cb3dSCy Schubert   puts(_("Permission to use, copy, modify, and distribute this software and its\n\
8412b15cb3dSCy Schubert documentation for any purpose with or without fee is hereby granted,\n\
8422b15cb3dSCy Schubert provided that the above copyright notice appears in all copies and that\n\
8432b15cb3dSCy Schubert both the copyright notice and this permission notice appear in supporting\n\
8442b15cb3dSCy Schubert documentation, and that the name The University of Delaware not be used in\n\
8452b15cb3dSCy Schubert advertising or publicity pertaining to distribution of the software without\n\
8462b15cb3dSCy Schubert specific, written prior permission.  The University of Delaware and Network\n\
8472b15cb3dSCy Schubert Time Foundation makes no representations about the suitability this\n\
8482b15cb3dSCy Schubert software for any purpose.  It is provided \"as is\" without express or\n\
8492b15cb3dSCy Schubert implied warranty.\n"));
8502b15cb3dSCy Schubert 
8512b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8522b15cb3dSCy Schubert   puts(_("Force IPv4 DNS name resolution"));
8532b15cb3dSCy Schubert 
8542b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8552b15cb3dSCy Schubert   puts(_("Force IPv6 DNS name resolution"));
8562b15cb3dSCy Schubert 
8572b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8582b15cb3dSCy Schubert   puts(_("run a command and exit"));
8592b15cb3dSCy Schubert 
8602b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8612b15cb3dSCy Schubert   puts(_("Increase debug verbosity level"));
8622b15cb3dSCy Schubert 
8632b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8642b15cb3dSCy Schubert   puts(_("Set the debug verbosity level"));
8652b15cb3dSCy Schubert 
8662b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8672b15cb3dSCy Schubert   puts(_("Force ntpq to operate in interactive mode"));
8682b15cb3dSCy Schubert 
8692b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8702b15cb3dSCy Schubert   puts(_("Print a list of the peers"));
8712b15cb3dSCy Schubert 
8722b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8732b15cb3dSCy Schubert   puts(_("numeric host addresses"));
8742b15cb3dSCy Schubert 
8752b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8762b15cb3dSCy Schubert   puts(_("Print a list of the peers"));
8772b15cb3dSCy Schubert 
8782b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8792b15cb3dSCy Schubert   puts(_("Show a list of the peers"));
8802b15cb3dSCy Schubert 
8812b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
882a466cc55SCy Schubert   puts(_("Use unconnected UDP to communicate with ntpd (default on Windows)"));
883a466cc55SCy Schubert 
884a466cc55SCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8852b15cb3dSCy Schubert   puts(_("display extended usage information and exit"));
8862b15cb3dSCy Schubert 
8872b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8882b15cb3dSCy Schubert   puts(_("extended usage information passed thru pager"));
8892b15cb3dSCy Schubert 
8902b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8912b15cb3dSCy Schubert   puts(_("output version information and exit"));
8922b15cb3dSCy Schubert 
8932b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8942b15cb3dSCy Schubert   puts(_("save the option state to a config file"));
8952b15cb3dSCy Schubert 
8962b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pOptDesc->pzText */
8972b15cb3dSCy Schubert   puts(_("load options from a config file"));
8982b15cb3dSCy Schubert 
8992b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pzUsageTitle */
900*f5f40dd6SCy Schubert   puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p18\n\
9012b15cb3dSCy Schubert Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
9022b15cb3dSCy Schubert 
9032b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pzExplain */
9042b15cb3dSCy Schubert   puts(_("\n"));
9052b15cb3dSCy Schubert 
9062b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pzFullVersion */
907*f5f40dd6SCy Schubert   puts(_("ntpdc 4.2.8p18"));
9082b15cb3dSCy Schubert 
9092b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pzFullUsage */
9102b15cb3dSCy Schubert   puts(_("<<<NOT-FOUND>>>"));
9112b15cb3dSCy Schubert 
9122b15cb3dSCy Schubert   /* referenced via ntpdcOptions.pzShortUsage */
9132b15cb3dSCy Schubert   puts(_("<<<NOT-FOUND>>>"));
9142b15cb3dSCy Schubert   /* LIBOPTS-MESSAGES: */
9152b15cb3dSCy Schubert #line 67 "../autoopts.c"
9162b15cb3dSCy Schubert   puts(_("allocation of %d bytes failed\n"));
917a466cc55SCy Schubert #line 89 "../autoopts.c"
9182b15cb3dSCy Schubert   puts(_("allocation of %d bytes failed\n"));
919a466cc55SCy Schubert #line 48 "../init.c"
9202b15cb3dSCy Schubert   puts(_("AutoOpts function called without option descriptor\n"));
921a466cc55SCy Schubert #line 81 "../init.c"
9222b15cb3dSCy Schubert   puts(_("\tThis exceeds the compiled library version:  "));
923a466cc55SCy Schubert #line 79 "../init.c"
9242b15cb3dSCy Schubert   puts(_("Automated Options Processing Error!\n"
9252b15cb3dSCy Schubert        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
926a466cc55SCy Schubert #line 78 "../autoopts.c"
9272b15cb3dSCy Schubert   puts(_("realloc of %d bytes at 0x%p failed\n"));
928a466cc55SCy Schubert #line 83 "../init.c"
9292b15cb3dSCy Schubert   puts(_("\tThis is less than the minimum library version:  "));
9302b15cb3dSCy Schubert #line 121 "../version.c"
9312b15cb3dSCy Schubert   puts(_("Automated Options version %s\n"
932a466cc55SCy Schubert        "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
933a466cc55SCy Schubert #line 49 "../makeshell.c"
9342b15cb3dSCy Schubert   puts(_("(AutoOpts bug):  %s.\n"));
9352b15cb3dSCy Schubert #line 90 "../reset.c"
9362b15cb3dSCy Schubert   puts(_("optionResetOpt() called, but reset-option not configured"));
937a466cc55SCy Schubert #line 241 "../usage.c"
9382b15cb3dSCy Schubert   puts(_("could not locate the 'help' option"));
939a466cc55SCy Schubert #line 330 "../autoopts.c"
9402b15cb3dSCy Schubert   puts(_("optionProcess() was called with invalid data"));
941a466cc55SCy Schubert #line 697 "../usage.c"
9422b15cb3dSCy Schubert   puts(_("invalid argument type specified"));
943a466cc55SCy Schubert #line 568 "../find.c"
9442b15cb3dSCy Schubert   puts(_("defaulted to option with optional arg"));
9452b15cb3dSCy Schubert #line 76 "../alias.c"
9462b15cb3dSCy Schubert   puts(_("aliasing option is out of range."));
947a466cc55SCy Schubert #line 210 "../enum.c"
9482b15cb3dSCy Schubert   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
949a466cc55SCy Schubert #line 78 "../find.c"
9502b15cb3dSCy Schubert   puts(_("  The following options match:\n"));
951a466cc55SCy Schubert #line 263 "../find.c"
9522b15cb3dSCy Schubert   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
9532b15cb3dSCy Schubert #line 161 "../check.c"
9542b15cb3dSCy Schubert   puts(_("%s: Command line arguments required\n"));
9552b15cb3dSCy Schubert #line 43 "../alias.c"
9562b15cb3dSCy Schubert   puts(_("%d %s%s options allowed\n"));
957a466cc55SCy Schubert #line 56 "../makeshell.c"
9582b15cb3dSCy Schubert   puts(_("%s error %d (%s) calling %s for '%s'\n"));
959a466cc55SCy Schubert #line 268 "../makeshell.c"
9602b15cb3dSCy Schubert   puts(_("interprocess pipe"));
961a466cc55SCy Schubert #line 171 "../version.c"
9622b15cb3dSCy Schubert   puts(_("error: version option argument '%c' invalid.  Use:\n"
9632b15cb3dSCy Schubert        "\t'v' - version only\n"
9642b15cb3dSCy Schubert        "\t'c' - version and copyright\n"
9652b15cb3dSCy Schubert        "\t'n' - version and full copyright notice\n"));
9662b15cb3dSCy Schubert #line 58 "../check.c"
9672b15cb3dSCy Schubert   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
968a466cc55SCy Schubert #line 187 "../find.c"
9692b15cb3dSCy Schubert   puts(_("%s: The '%s' option has been disabled."));
970a466cc55SCy Schubert #line 400 "../find.c"
9712b15cb3dSCy Schubert   puts(_("%s: The '%s' option has been disabled."));
9722b15cb3dSCy Schubert #line 38 "../alias.c"
9732b15cb3dSCy Schubert   puts(_("-equivalence"));
974a466cc55SCy Schubert #line 439 "../find.c"
9752b15cb3dSCy Schubert   puts(_("%s: illegal option -- %c\n"));
9762b15cb3dSCy Schubert #line 110 "../reset.c"
9772b15cb3dSCy Schubert   puts(_("%s: illegal option -- %c\n"));
978a466cc55SCy Schubert #line 241 "../find.c"
9792b15cb3dSCy Schubert   puts(_("%s: illegal option -- %s\n"));
980a466cc55SCy Schubert #line 740 "../find.c"
9812b15cb3dSCy Schubert   puts(_("%s: illegal option -- %s\n"));
9822b15cb3dSCy Schubert #line 118 "../reset.c"
9832b15cb3dSCy Schubert   puts(_("%s: illegal option -- %s\n"));
984a466cc55SCy Schubert #line 305 "../find.c"
9852b15cb3dSCy Schubert   puts(_("%s: unknown vendor extension option -- %s\n"));
986a466cc55SCy Schubert #line 135 "../enum.c"
9872b15cb3dSCy Schubert   puts(_("  or an integer from %d through %d\n"));
988a466cc55SCy Schubert #line 145 "../enum.c"
9892b15cb3dSCy Schubert   puts(_("  or an integer from %d through %d\n"));
990a466cc55SCy Schubert #line 696 "../usage.c"
9912b15cb3dSCy Schubert   puts(_("%s error:  invalid option descriptor for %s\n"));
992a466cc55SCy Schubert #line 1030 "../usage.c"
9932b15cb3dSCy Schubert   puts(_("%s error:  invalid option descriptor for %s\n"));
994a466cc55SCy Schubert #line 355 "../find.c"
9952b15cb3dSCy Schubert   puts(_("%s: invalid option name: %s\n"));
996a466cc55SCy Schubert #line 497 "../find.c"
9972b15cb3dSCy Schubert   puts(_("%s: The '%s' option requires an argument.\n"));
998a466cc55SCy Schubert #line 150 "../autoopts.c"
9992b15cb3dSCy Schubert   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
10002b15cb3dSCy Schubert        "\t'%s' and '%s'."));
10012b15cb3dSCy Schubert #line 94 "../check.c"
10022b15cb3dSCy Schubert   puts(_("%s error:  The %s option is required\n"));
1003a466cc55SCy Schubert #line 602 "../find.c"
10042b15cb3dSCy Schubert   puts(_("%s: The '%s' option cannot have an argument.\n"));
10052b15cb3dSCy Schubert #line 151 "../check.c"
10062b15cb3dSCy Schubert   puts(_("%s: Command line arguments are not allowed.\n"));
1007a466cc55SCy Schubert #line 568 "../save.c"
10082b15cb3dSCy Schubert   puts(_("error %d (%s) creating %s\n"));
1009a466cc55SCy Schubert #line 210 "../enum.c"
10102b15cb3dSCy Schubert   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
10112b15cb3dSCy Schubert #line 93 "../reset.c"
10122b15cb3dSCy Schubert   puts(_("%s error: The '%s' option requires an argument.\n"));
1013a466cc55SCy Schubert #line 122 "../save.c"
10142b15cb3dSCy Schubert   puts(_("error %d (%s) stat-ing %s\n"));
1015a466cc55SCy Schubert #line 175 "../save.c"
10162b15cb3dSCy Schubert   puts(_("error %d (%s) stat-ing %s\n"));
10172b15cb3dSCy Schubert #line 143 "../restore.c"
10182b15cb3dSCy Schubert   puts(_("%s error: no saved option state\n"));
1019a466cc55SCy Schubert #line 225 "../autoopts.c"
10202b15cb3dSCy Schubert   puts(_("'%s' is not a command line option.\n"));
1021a466cc55SCy Schubert #line 113 "../time.c"
10222b15cb3dSCy Schubert   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
10232b15cb3dSCy Schubert #line 50 "../time.c"
10242b15cb3dSCy Schubert   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
10252b15cb3dSCy Schubert #line 92 "../check.c"
10262b15cb3dSCy Schubert   puts(_("%s error:  The %s option must appear %d times.\n"));
1027a466cc55SCy Schubert #line 165 "../numeric.c"
10282b15cb3dSCy Schubert   puts(_("%s error:  '%s' is not a recognizable number.\n"));
1029a466cc55SCy Schubert #line 176 "../enum.c"
10302b15cb3dSCy Schubert   puts(_("%s error:  %s exceeds %s keyword count\n"));
1031a466cc55SCy Schubert #line 279 "../usage.c"
10322b15cb3dSCy Schubert   puts(_("Try '%s %s' for more information.\n"));
10332b15cb3dSCy Schubert #line 45 "../alias.c"
10342b15cb3dSCy Schubert   puts(_("one %s%s option allowed\n"));
1035a466cc55SCy Schubert #line 170 "../makeshell.c"
10362b15cb3dSCy Schubert   puts(_("standard output"));
1037a466cc55SCy Schubert #line 905 "../makeshell.c"
10382b15cb3dSCy Schubert   puts(_("standard output"));
1039a466cc55SCy Schubert #line 223 "../usage.c"
10402b15cb3dSCy Schubert   puts(_("standard output"));
1041a466cc55SCy Schubert #line 364 "../usage.c"
10422b15cb3dSCy Schubert   puts(_("standard output"));
1043a466cc55SCy Schubert #line 574 "../usage.c"
10442b15cb3dSCy Schubert   puts(_("standard output"));
1045a466cc55SCy Schubert #line 178 "../version.c"
10462b15cb3dSCy Schubert   puts(_("standard output"));
1047a466cc55SCy Schubert #line 223 "../usage.c"
10482b15cb3dSCy Schubert   puts(_("standard error"));
1049a466cc55SCy Schubert #line 364 "../usage.c"
10502b15cb3dSCy Schubert   puts(_("standard error"));
1051a466cc55SCy Schubert #line 574 "../usage.c"
10522b15cb3dSCy Schubert   puts(_("standard error"));
1053a466cc55SCy Schubert #line 178 "../version.c"
10542b15cb3dSCy Schubert   puts(_("standard error"));
1055a466cc55SCy Schubert #line 170 "../makeshell.c"
10562b15cb3dSCy Schubert   puts(_("write"));
1057a466cc55SCy Schubert #line 905 "../makeshell.c"
10582b15cb3dSCy Schubert   puts(_("write"));
1059a466cc55SCy Schubert #line 222 "../usage.c"
10602b15cb3dSCy Schubert   puts(_("write"));
1061a466cc55SCy Schubert #line 363 "../usage.c"
10622b15cb3dSCy Schubert   puts(_("write"));
1063a466cc55SCy Schubert #line 573 "../usage.c"
10642b15cb3dSCy Schubert   puts(_("write"));
1065a466cc55SCy Schubert #line 177 "../version.c"
10662b15cb3dSCy Schubert   puts(_("write"));
10672b15cb3dSCy Schubert #line 60 "../numeric.c"
10682b15cb3dSCy Schubert   puts(_("%s error:  %s option value %ld is out of range.\n"));
10692b15cb3dSCy Schubert #line 44 "../check.c"
10702b15cb3dSCy Schubert   puts(_("%s error:  %s option requires the %s option\n"));
1071a466cc55SCy Schubert #line 121 "../save.c"
10722b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1073a466cc55SCy Schubert #line 174 "../save.c"
10742b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1075a466cc55SCy Schubert #line 193 "../save.c"
10762b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1077a466cc55SCy Schubert #line 567 "../save.c"
10782b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
10792b15cb3dSCy Schubert   /* END-LIBOPTS-MESSAGES */
10802b15cb3dSCy Schubert 
10812b15cb3dSCy Schubert   /* USAGE-TEXT: */
1082a466cc55SCy Schubert #line 822 "../usage.c"
10832b15cb3dSCy Schubert   puts(_("\t\t\t\t- an alternate for '%s'\n"));
1084a466cc55SCy Schubert #line 1097 "../usage.c"
10852b15cb3dSCy Schubert   puts(_("Version, usage and configuration options:"));
1086a466cc55SCy Schubert #line 873 "../usage.c"
10872b15cb3dSCy Schubert   puts(_("\t\t\t\t- default option for unnamed options\n"));
1088a466cc55SCy Schubert #line 786 "../usage.c"
10892b15cb3dSCy Schubert   puts(_("\t\t\t\t- disabled as '--%s'\n"));
1090a466cc55SCy Schubert #line 1066 "../usage.c"
10912b15cb3dSCy Schubert   puts(_(" --- %-14s %s\n"));
1092a466cc55SCy Schubert #line 1064 "../usage.c"
10932b15cb3dSCy Schubert   puts(_("This option has been disabled"));
1094a466cc55SCy Schubert #line 813 "../usage.c"
10952b15cb3dSCy Schubert   puts(_("\t\t\t\t- enabled by default\n"));
10962b15cb3dSCy Schubert #line 40 "../alias.c"
10972b15cb3dSCy Schubert   puts(_("%s error:  only "));
1098a466cc55SCy Schubert #line 1143 "../usage.c"
10992b15cb3dSCy Schubert   puts(_(" - examining environment variables named %s_*\n"));
11002b15cb3dSCy Schubert #line 168 "../file.c"
11012b15cb3dSCy Schubert   puts(_("\t\t\t\t- file must not pre-exist\n"));
11022b15cb3dSCy Schubert #line 172 "../file.c"
11032b15cb3dSCy Schubert   puts(_("\t\t\t\t- file must pre-exist\n"));
1104a466cc55SCy Schubert #line 329 "../usage.c"
11052b15cb3dSCy Schubert   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
11062b15cb3dSCy Schubert        "hyphen and the flag character.\n"));
1107a466cc55SCy Schubert #line 882 "../makeshell.c"
11082b15cb3dSCy Schubert   puts(_("\n"
11092b15cb3dSCy Schubert        "= = = = = = = =\n\n"
11102b15cb3dSCy Schubert        "This incarnation of genshell will produce\n"
11112b15cb3dSCy Schubert        "a shell script to parse the options for %s:\n\n"));
1112a466cc55SCy Schubert #line 142 "../enum.c"
11132b15cb3dSCy Schubert   puts(_("  or an integer mask with any of the lower %d bits set\n"));
1114a466cc55SCy Schubert #line 846 "../usage.c"
11152b15cb3dSCy Schubert   puts(_("\t\t\t\t- is a set membership option\n"));
1116a466cc55SCy Schubert #line 867 "../usage.c"
11172b15cb3dSCy Schubert   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
1118a466cc55SCy Schubert #line 331 "../usage.c"
11192b15cb3dSCy Schubert   puts(_("Options are specified by single or double hyphens and their name.\n"));
1120a466cc55SCy Schubert #line 853 "../usage.c"
11212b15cb3dSCy Schubert   puts(_("\t\t\t\t- may appear multiple times\n"));
1122a466cc55SCy Schubert #line 840 "../usage.c"
11232b15cb3dSCy Schubert   puts(_("\t\t\t\t- may not be preset\n"));
1124a466cc55SCy Schubert #line 1258 "../usage.c"
11252b15cb3dSCy Schubert   puts(_("   Arg Option-Name    Description\n"));
1126a466cc55SCy Schubert #line 1194 "../usage.c"
11272b15cb3dSCy Schubert   puts(_("  Flg Arg Option-Name    Description\n"));
1128a466cc55SCy Schubert #line 1252 "../usage.c"
11292b15cb3dSCy Schubert   puts(_("  Flg Arg Option-Name    Description\n"));
1130a466cc55SCy Schubert #line 1253 "../usage.c"
11312b15cb3dSCy Schubert   puts(_(" %3s %s"));
1132a466cc55SCy Schubert #line 1259 "../usage.c"
11332b15cb3dSCy Schubert   puts(_(" %3s %s"));
1134a466cc55SCy Schubert #line 336 "../usage.c"
11352b15cb3dSCy Schubert   puts(_("The '-#<number>' option may omit the hash char\n"));
1136a466cc55SCy Schubert #line 332 "../usage.c"
11372b15cb3dSCy Schubert   puts(_("All arguments are named options.\n"));
1138a466cc55SCy Schubert #line 920 "../usage.c"
11392b15cb3dSCy Schubert   puts(_(" - reading file %s"));
1140a466cc55SCy Schubert #line 358 "../usage.c"
11412b15cb3dSCy Schubert   puts(_("\n"
11422b15cb3dSCy Schubert        "Please send bug reports to:  <%s>\n"));
11432b15cb3dSCy Schubert #line 100 "../version.c"
11442b15cb3dSCy Schubert   puts(_("\n"
11452b15cb3dSCy Schubert        "Please send bug reports to:  <%s>\n"));
11462b15cb3dSCy Schubert #line 129 "../version.c"
11472b15cb3dSCy Schubert   puts(_("\n"
11482b15cb3dSCy Schubert        "Please send bug reports to:  <%s>\n"));
1149a466cc55SCy Schubert #line 852 "../usage.c"
11502b15cb3dSCy Schubert   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
1151a466cc55SCy Schubert #line 893 "../usage.c"
11522b15cb3dSCy Schubert   puts(_("\n"
11532b15cb3dSCy Schubert        "The following option preset mechanisms are supported:\n"));
1154a466cc55SCy Schubert #line 1141 "../usage.c"
11552b15cb3dSCy Schubert   puts(_("\n"
11562b15cb3dSCy Schubert        "The following option preset mechanisms are supported:\n"));
1157a466cc55SCy Schubert #line 631 "../usage.c"
11582b15cb3dSCy Schubert   puts(_("prohibits these options:\n"));
1159a466cc55SCy Schubert #line 626 "../usage.c"
11602b15cb3dSCy Schubert   puts(_("prohibits the option '%s'\n"));
11612b15cb3dSCy Schubert #line 81 "../numeric.c"
11622b15cb3dSCy Schubert   puts(_("%s%ld to %ld"));
11632b15cb3dSCy Schubert #line 79 "../numeric.c"
11642b15cb3dSCy Schubert   puts(_("%sgreater than or equal to %ld"));
11652b15cb3dSCy Schubert #line 75 "../numeric.c"
11662b15cb3dSCy Schubert   puts(_("%s%ld exactly"));
11672b15cb3dSCy Schubert #line 68 "../numeric.c"
11682b15cb3dSCy Schubert   puts(_("%sit must lie in one of the ranges:\n"));
11692b15cb3dSCy Schubert #line 68 "../numeric.c"
11702b15cb3dSCy Schubert   puts(_("%sit must be in the range:\n"));
11712b15cb3dSCy Schubert #line 88 "../numeric.c"
11722b15cb3dSCy Schubert   puts(_(", or\n"));
11732b15cb3dSCy Schubert #line 66 "../numeric.c"
11742b15cb3dSCy Schubert   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
11752b15cb3dSCy Schubert #line 77 "../numeric.c"
11762b15cb3dSCy Schubert   puts(_("%sless than or equal to %ld"));
1177a466cc55SCy Schubert #line 339 "../usage.c"
11782b15cb3dSCy Schubert   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
1179a466cc55SCy Schubert #line 601 "../usage.c"
11802b15cb3dSCy Schubert   puts(_("requires the option '%s'\n"));
1181a466cc55SCy Schubert #line 604 "../usage.c"
11822b15cb3dSCy Schubert   puts(_("requires these options:\n"));
1183a466cc55SCy Schubert #line 1270 "../usage.c"
11842b15cb3dSCy Schubert   puts(_("   Arg Option-Name   Req?  Description\n"));
1185a466cc55SCy Schubert #line 1264 "../usage.c"
11862b15cb3dSCy Schubert   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
1187a466cc55SCy Schubert #line 143 "../enum.c"
11882b15cb3dSCy Schubert   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
11892b15cb3dSCy Schubert        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
11902b15cb3dSCy Schubert        "will set them all.  Multiple entries may be passed as an option\n"
11912b15cb3dSCy Schubert        "argument list.\n"));
1192a466cc55SCy Schubert #line 859 "../usage.c"
11932b15cb3dSCy Schubert   puts(_("\t\t\t\t- may appear up to %d times\n"));
1194a466cc55SCy Schubert #line 52 "../enum.c"
11952b15cb3dSCy Schubert   puts(_("The valid \"%s\" option keywords are:\n"));
1196a466cc55SCy Schubert #line 1101 "../usage.c"
11972b15cb3dSCy Schubert   puts(_("The next option supports vendor supported extra options:"));
1198a466cc55SCy Schubert #line 722 "../usage.c"
11992b15cb3dSCy Schubert   puts(_("These additional options are:"));
12002b15cb3dSCy Schubert   /* END-USAGE-TEXT */
12012b15cb3dSCy Schubert }
12022b15cb3dSCy Schubert #endif /* uncompilable code */
1203ea906c41SOllivier Robert #ifdef  __cplusplus
1204ea906c41SOllivier Robert }
1205ea906c41SOllivier Robert #endif
1206ea906c41SOllivier Robert /* ntpdc-opts.c ends here */
1207