xref: /freebsd/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
12b15cb3dSCy Schubert /*
22b15cb3dSCy Schubert  *  EDIT THIS FILE WITH CAUTION  (ntpsnmpd-opts.c)
32b15cb3dSCy Schubert  *
4*f5f40dd6SCy Schubert  *  It has been AutoGen-ed  May 25, 2024 at 12:04:35 AM by AutoGen 5.18.16
52b15cb3dSCy Schubert  *  From the definitions    ntpsnmpd-opts.def
62b15cb3dSCy Schubert  *  and the template file   options
72b15cb3dSCy Schubert  *
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 ntpsnmpd 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 ntpsnmpd 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.
372b15cb3dSCy Schubert  */
382b15cb3dSCy Schubert 
392b15cb3dSCy Schubert #ifndef __doxygen__
402b15cb3dSCy Schubert #define OPTION_CODE_COMPILE 1
412b15cb3dSCy Schubert #include "ntpsnmpd-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>
522b15cb3dSCy Schubert 
532b15cb3dSCy Schubert #ifdef  __cplusplus
542b15cb3dSCy Schubert extern "C" {
552b15cb3dSCy Schubert #endif
562b15cb3dSCy Schubert extern FILE * option_usage_fp;
572b15cb3dSCy Schubert #define zCopyright      (ntpsnmpd_opt_strs+0)
58f0574f5cSXin LI #define zLicenseDescrip (ntpsnmpd_opt_strs+345)
592b15cb3dSCy Schubert 
602b15cb3dSCy Schubert 
612b15cb3dSCy Schubert #ifndef NULL
622b15cb3dSCy Schubert #  define NULL 0
632b15cb3dSCy Schubert #endif
642b15cb3dSCy Schubert 
652b15cb3dSCy Schubert /**
662b15cb3dSCy Schubert  *  static const strings for ntpsnmpd options
672b15cb3dSCy Schubert  */
68a466cc55SCy Schubert static char const ntpsnmpd_opt_strs[1614] =
69*f5f40dd6SCy Schubert /*     0 */ "ntpsnmpd 4.2.8p18\n"
70*f5f40dd6SCy Schubert             "Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n"
712b15cb3dSCy Schubert             "This is free software. It is licensed for use, modification and\n"
722b15cb3dSCy Schubert             "redistribution under the terms of the NTP License, copies of which\n"
732b15cb3dSCy Schubert             "can be seen at:\n"
742b15cb3dSCy Schubert             "  <http://ntp.org/license>\n"
752b15cb3dSCy Schubert             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
76f0574f5cSXin LI /*   345 */ "Permission to use, copy, modify, and distribute this software and its\n"
772b15cb3dSCy Schubert             "documentation for any purpose with or without fee is hereby granted,\n"
782b15cb3dSCy Schubert             "provided that the above copyright notice appears in all copies and that\n"
792b15cb3dSCy Schubert             "both the copyright notice and this permission notice appear in supporting\n"
802b15cb3dSCy Schubert             "documentation, and that the name The University of Delaware not be used in\n"
812b15cb3dSCy Schubert             "advertising or publicity pertaining to distribution of the software without\n"
822b15cb3dSCy Schubert             "specific, written prior permission.  The University of Delaware and Network\n"
832b15cb3dSCy Schubert             "Time Foundation makes no representations about the suitability this\n"
842b15cb3dSCy Schubert             "software for any purpose.  It is provided \"as is\" without express or\n"
852b15cb3dSCy Schubert             "implied warranty.\n\0"
86f0574f5cSXin LI /*  1013 */ "Do not fork\0"
87f0574f5cSXin LI /*  1025 */ "NOFORK\0"
88f0574f5cSXin LI /*  1032 */ "nofork\0"
89f0574f5cSXin LI /*  1039 */ "Log to syslog()\0"
90f0574f5cSXin LI /*  1055 */ "SYSLOG\0"
91f0574f5cSXin LI /*  1062 */ "syslog\0"
92f0574f5cSXin LI /*  1069 */ "The socket address ntpsnmpd uses to connect to net-snmpd\0"
93f0574f5cSXin LI /*  1126 */ "AGENTXSOCKET\0"
94f0574f5cSXin LI /*  1139 */ "agentxsocket\0"
95f0574f5cSXin LI /*  1152 */ "unix:/var/agentx/master\0"
96f0574f5cSXin LI /*  1176 */ "display extended usage information and exit\0"
97f0574f5cSXin LI /*  1220 */ "help\0"
98f0574f5cSXin LI /*  1225 */ "extended usage information passed thru pager\0"
99f0574f5cSXin LI /*  1270 */ "more-help\0"
100f0574f5cSXin LI /*  1280 */ "output version information and exit\0"
101f0574f5cSXin LI /*  1316 */ "version\0"
102f0574f5cSXin LI /*  1324 */ "save the option state to a config file\0"
103f0574f5cSXin LI /*  1363 */ "save-opts\0"
104f0574f5cSXin LI /*  1373 */ "load options from a config file\0"
105f0574f5cSXin LI /*  1405 */ "LOAD_OPTS\0"
106f0574f5cSXin LI /*  1415 */ "no-load-opts\0"
107f0574f5cSXin LI /*  1428 */ "no\0"
108f0574f5cSXin LI /*  1431 */ "NTPSNMPD\0"
109*f5f40dd6SCy Schubert /*  1440 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p18\n"
1102b15cb3dSCy Schubert             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
111f0574f5cSXin LI /*  1544 */ "$HOME\0"
112f0574f5cSXin LI /*  1550 */ ".\0"
113f0574f5cSXin LI /*  1552 */ ".ntprc\0"
114a466cc55SCy Schubert /*  1559 */ "https://bugs.ntp.org, bugs@ntp.org\0"
115a466cc55SCy Schubert /*  1594 */ "\n\0"
116*f5f40dd6SCy Schubert /*  1596 */ "ntpsnmpd 4.2.8p18";
1172b15cb3dSCy Schubert 
1182b15cb3dSCy Schubert /**
1192b15cb3dSCy Schubert  *  nofork option description:
1202b15cb3dSCy Schubert  */
1212b15cb3dSCy Schubert /** Descriptive text for the nofork option */
122f0574f5cSXin LI #define NOFORK_DESC      (ntpsnmpd_opt_strs+1013)
1232b15cb3dSCy Schubert /** Upper-cased name for the nofork option */
124f0574f5cSXin LI #define NOFORK_NAME      (ntpsnmpd_opt_strs+1025)
1252b15cb3dSCy Schubert /** Name string for the nofork option */
126f0574f5cSXin LI #define NOFORK_name      (ntpsnmpd_opt_strs+1032)
1272b15cb3dSCy Schubert /** Compiled in flag settings for the nofork option */
1282b15cb3dSCy Schubert #define NOFORK_FLAGS     (OPTST_DISABLED)
1292b15cb3dSCy Schubert 
1302b15cb3dSCy Schubert /**
1312b15cb3dSCy Schubert  *  syslog option description:
1322b15cb3dSCy Schubert  */
1332b15cb3dSCy Schubert /** Descriptive text for the syslog option */
134f0574f5cSXin LI #define SYSLOG_DESC      (ntpsnmpd_opt_strs+1039)
1352b15cb3dSCy Schubert /** Upper-cased name for the syslog option */
136f0574f5cSXin LI #define SYSLOG_NAME      (ntpsnmpd_opt_strs+1055)
1372b15cb3dSCy Schubert /** Name string for the syslog option */
138f0574f5cSXin LI #define SYSLOG_name      (ntpsnmpd_opt_strs+1062)
1392b15cb3dSCy Schubert /** Compiled in flag settings for the syslog option */
1402b15cb3dSCy Schubert #define SYSLOG_FLAGS     (OPTST_DISABLED)
1412b15cb3dSCy Schubert 
1422b15cb3dSCy Schubert /**
1432b15cb3dSCy Schubert  *  agentXSocket option description:
1442b15cb3dSCy Schubert  */
1452b15cb3dSCy Schubert /** Descriptive text for the agentXSocket option */
146f0574f5cSXin LI #define AGENTXSOCKET_DESC      (ntpsnmpd_opt_strs+1069)
1472b15cb3dSCy Schubert /** Upper-cased name for the agentXSocket option */
148f0574f5cSXin LI #define AGENTXSOCKET_NAME      (ntpsnmpd_opt_strs+1126)
1492b15cb3dSCy Schubert /** Name string for the agentXSocket option */
150f0574f5cSXin LI #define AGENTXSOCKET_name      (ntpsnmpd_opt_strs+1139)
1512b15cb3dSCy Schubert /** The compiled in default value for the agentXSocket option argument */
152f0574f5cSXin LI #define AGENTXSOCKET_DFT_ARG   (ntpsnmpd_opt_strs+1152)
1532b15cb3dSCy Schubert /** Compiled in flag settings for the agentXSocket option */
1542b15cb3dSCy Schubert #define AGENTXSOCKET_FLAGS     (OPTST_DISABLED \
1552b15cb3dSCy Schubert         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
1562b15cb3dSCy Schubert 
1572b15cb3dSCy Schubert /*
1582b15cb3dSCy Schubert  *  Help/More_Help/Version option descriptions:
1592b15cb3dSCy Schubert  */
160f0574f5cSXin LI #define HELP_DESC       (ntpsnmpd_opt_strs+1176)
161f0574f5cSXin LI #define HELP_name       (ntpsnmpd_opt_strs+1220)
1622b15cb3dSCy Schubert #ifdef HAVE_WORKING_FORK
163f0574f5cSXin LI #define MORE_HELP_DESC  (ntpsnmpd_opt_strs+1225)
164f0574f5cSXin LI #define MORE_HELP_name  (ntpsnmpd_opt_strs+1270)
1652b15cb3dSCy Schubert #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
1662b15cb3dSCy Schubert #else
1672b15cb3dSCy Schubert #define MORE_HELP_DESC  HELP_DESC
1682b15cb3dSCy Schubert #define MORE_HELP_name  HELP_name
1692b15cb3dSCy Schubert #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
1702b15cb3dSCy Schubert #endif
1712b15cb3dSCy Schubert #ifdef NO_OPTIONAL_OPT_ARGS
1722b15cb3dSCy Schubert #  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
1732b15cb3dSCy Schubert #else
1742b15cb3dSCy Schubert #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
1752b15cb3dSCy Schubert                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
1762b15cb3dSCy Schubert #endif
177f0574f5cSXin LI #define VER_DESC        (ntpsnmpd_opt_strs+1280)
178f0574f5cSXin LI #define VER_name        (ntpsnmpd_opt_strs+1316)
179f0574f5cSXin LI #define SAVE_OPTS_DESC  (ntpsnmpd_opt_strs+1324)
180f0574f5cSXin LI #define SAVE_OPTS_name  (ntpsnmpd_opt_strs+1363)
181f0574f5cSXin LI #define LOAD_OPTS_DESC     (ntpsnmpd_opt_strs+1373)
182f0574f5cSXin LI #define LOAD_OPTS_NAME     (ntpsnmpd_opt_strs+1405)
183f0574f5cSXin LI #define NO_LOAD_OPTS_name  (ntpsnmpd_opt_strs+1415)
184f0574f5cSXin LI #define LOAD_OPTS_pfx      (ntpsnmpd_opt_strs+1428)
1852b15cb3dSCy Schubert #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
1862b15cb3dSCy Schubert /**
1872b15cb3dSCy Schubert  *  Declare option callback procedures
1882b15cb3dSCy Schubert  */
1892b15cb3dSCy Schubert extern tOptProc
1902b15cb3dSCy Schubert     ntpOptionPrintVersion, optionBooleanVal,      optionNestedVal,
1912b15cb3dSCy Schubert     optionNumericVal,      optionPagedUsage,      optionResetOpt,
1922b15cb3dSCy Schubert     optionStackArg,        optionTimeDate,        optionTimeVal,
1932b15cb3dSCy Schubert     optionUnstackArg,      optionVendorOption;
1942b15cb3dSCy Schubert static tOptProc
1952b15cb3dSCy Schubert     doUsageOpt;
1962b15cb3dSCy Schubert #define VER_PROC        ntpOptionPrintVersion
1972b15cb3dSCy Schubert 
1982b15cb3dSCy Schubert /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1992b15cb3dSCy Schubert /**
2002b15cb3dSCy Schubert  *  Define the ntpsnmpd Option Descriptions.
2012b15cb3dSCy Schubert  * This is an array of OPTION_CT entries, one for each
2022b15cb3dSCy Schubert  * option that the ntpsnmpd program responds to.
2032b15cb3dSCy Schubert  */
2042b15cb3dSCy Schubert static tOptDesc optDesc[OPTION_CT] = {
2052b15cb3dSCy Schubert   {  /* entry idx, value */ 0, VALUE_OPT_NOFORK,
2062b15cb3dSCy Schubert      /* equiv idx, value */ 0, VALUE_OPT_NOFORK,
2072b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
2082b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
2092b15cb3dSCy Schubert      /* opt state flags  */ NOFORK_FLAGS, 0,
2102b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --nofork */
2112b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
2122b15cb3dSCy Schubert      /* must/cannot opts */ NULL, NULL,
2132b15cb3dSCy Schubert      /* option proc      */ NULL,
2142b15cb3dSCy Schubert      /* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name,
2152b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
2162b15cb3dSCy Schubert 
2172b15cb3dSCy Schubert   {  /* entry idx, value */ 1, VALUE_OPT_SYSLOG,
2182b15cb3dSCy Schubert      /* equiv idx, value */ 1, VALUE_OPT_SYSLOG,
2192b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
2202b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
2212b15cb3dSCy Schubert      /* opt state flags  */ SYSLOG_FLAGS, 0,
2222b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --syslog */
2232b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
2242b15cb3dSCy Schubert      /* must/cannot opts */ NULL, NULL,
2252b15cb3dSCy Schubert      /* option proc      */ NULL,
2262b15cb3dSCy Schubert      /* desc, NAME, name */ SYSLOG_DESC, SYSLOG_NAME, SYSLOG_name,
2272b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
2282b15cb3dSCy Schubert 
2292b15cb3dSCy Schubert   {  /* entry idx, value */ 2, VALUE_OPT_AGENTXSOCKET,
2302b15cb3dSCy Schubert      /* equiv idx, value */ 2, VALUE_OPT_AGENTXSOCKET,
2312b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
2322b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
2332b15cb3dSCy Schubert      /* opt state flags  */ AGENTXSOCKET_FLAGS, 0,
2342b15cb3dSCy Schubert      /* last opt argumnt */ { AGENTXSOCKET_DFT_ARG },
2352b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
2362b15cb3dSCy Schubert      /* must/cannot opts */ NULL, NULL,
2372b15cb3dSCy Schubert      /* option proc      */ NULL,
2382b15cb3dSCy Schubert      /* desc, NAME, name */ AGENTXSOCKET_DESC, AGENTXSOCKET_NAME, AGENTXSOCKET_name,
2392b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
2402b15cb3dSCy Schubert 
2412b15cb3dSCy Schubert   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
2422b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_VERSION,
2432b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
2442b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
2452b15cb3dSCy Schubert      /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
2462b15cb3dSCy Schubert      /* last opt argumnt */ { NULL },
2472b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
2482b15cb3dSCy Schubert      /* must/cannot opts */ NULL, NULL,
2492b15cb3dSCy Schubert      /* option proc      */ VER_PROC,
2502b15cb3dSCy Schubert      /* desc, NAME, name */ VER_DESC, NULL, VER_name,
2512b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
2522b15cb3dSCy Schubert 
2532b15cb3dSCy Schubert 
2542b15cb3dSCy Schubert 
2552b15cb3dSCy Schubert   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
2562b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_HELP,
2572b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
2582b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
2592b15cb3dSCy Schubert      /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
2602b15cb3dSCy Schubert      /* last opt argumnt */ { NULL },
2612b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
2622b15cb3dSCy Schubert      /* must/cannot opts */ NULL, NULL,
2632b15cb3dSCy Schubert      /* option proc      */ doUsageOpt,
2642b15cb3dSCy Schubert      /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
2652b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
2662b15cb3dSCy Schubert 
2672b15cb3dSCy Schubert   {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
2682b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
2692b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
2702b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
2712b15cb3dSCy Schubert      /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
2722b15cb3dSCy Schubert      /* last opt argumnt */ { NULL },
2732b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
2742b15cb3dSCy Schubert      /* must/cannot opts */ NULL,  NULL,
2752b15cb3dSCy Schubert      /* option proc      */ optionPagedUsage,
2762b15cb3dSCy Schubert      /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
2772b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
2782b15cb3dSCy Schubert 
2792b15cb3dSCy Schubert   {  /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
2802b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
2812b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
2822b15cb3dSCy Schubert      /* min, max, act ct */ 0, 1, 0,
2832b15cb3dSCy Schubert      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
2842b15cb3dSCy Schubert                        | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
2852b15cb3dSCy Schubert      /* last opt argumnt */ { NULL },
2862b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
2872b15cb3dSCy Schubert      /* must/cannot opts */ NULL,  NULL,
2882b15cb3dSCy Schubert      /* option proc      */ NULL,
2892b15cb3dSCy Schubert      /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
2902b15cb3dSCy Schubert      /* disablement strs */ NULL, NULL },
2912b15cb3dSCy Schubert 
2922b15cb3dSCy Schubert   {  /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
2932b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
2942b15cb3dSCy Schubert      /* equivalenced to  */ NO_EQUIVALENT,
2952b15cb3dSCy Schubert      /* min, max, act ct */ 0, NOLIMIT, 0,
2962b15cb3dSCy Schubert      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
2972b15cb3dSCy Schubert 			  | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
2982b15cb3dSCy Schubert      /* last opt argumnt */ { NULL },
2992b15cb3dSCy Schubert      /* arg list/cookie  */ NULL,
3002b15cb3dSCy Schubert      /* must/cannot opts */ NULL, NULL,
3012b15cb3dSCy Schubert      /* option proc      */ optionLoadOpt,
3022b15cb3dSCy Schubert      /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
3032b15cb3dSCy Schubert      /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
3042b15cb3dSCy Schubert };
3052b15cb3dSCy Schubert 
3062b15cb3dSCy Schubert 
3072b15cb3dSCy Schubert /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
3082b15cb3dSCy Schubert /** Reference to the upper cased version of ntpsnmpd. */
309f0574f5cSXin LI #define zPROGNAME       (ntpsnmpd_opt_strs+1431)
3102b15cb3dSCy Schubert /** Reference to the title line for ntpsnmpd usage. */
311f0574f5cSXin LI #define zUsageTitle     (ntpsnmpd_opt_strs+1440)
3122b15cb3dSCy Schubert /** ntpsnmpd configuration file name. */
313f0574f5cSXin LI #define zRcName         (ntpsnmpd_opt_strs+1552)
3142b15cb3dSCy Schubert /** Directories to search for ntpsnmpd config files. */
3152b15cb3dSCy Schubert static char const * const apzHomeList[3] = {
316f0574f5cSXin LI     ntpsnmpd_opt_strs+1544,
317f0574f5cSXin LI     ntpsnmpd_opt_strs+1550,
3182b15cb3dSCy Schubert     NULL };
3192b15cb3dSCy Schubert /** The ntpsnmpd program bug email address. */
320f0574f5cSXin LI #define zBugsAddr       (ntpsnmpd_opt_strs+1559)
3212b15cb3dSCy Schubert /** Clarification/explanation of what ntpsnmpd does. */
322a466cc55SCy Schubert #define zExplain        (ntpsnmpd_opt_strs+1594)
3232b15cb3dSCy Schubert /** Extra detail explaining what ntpsnmpd does. */
3242b15cb3dSCy Schubert #define zDetail         (NULL)
3252b15cb3dSCy Schubert /** The full version string for ntpsnmpd. */
326a466cc55SCy Schubert #define zFullVersion    (ntpsnmpd_opt_strs+1596)
327a466cc55SCy Schubert /* extracted from optcode.tlib near line 342 */
3282b15cb3dSCy Schubert 
3292b15cb3dSCy Schubert #if defined(ENABLE_NLS)
3302b15cb3dSCy Schubert # define OPTPROC_BASE OPTPROC_TRANSLATE
3312b15cb3dSCy Schubert   static tOptionXlateProc translate_option_strings;
3322b15cb3dSCy Schubert #else
3332b15cb3dSCy Schubert # define OPTPROC_BASE OPTPROC_NONE
3342b15cb3dSCy Schubert # define translate_option_strings NULL
3352b15cb3dSCy Schubert #endif /* ENABLE_NLS */
3362b15cb3dSCy Schubert 
3372b15cb3dSCy Schubert #define ntpsnmpd_full_usage (NULL)
3382b15cb3dSCy Schubert #define ntpsnmpd_short_usage (NULL)
3392b15cb3dSCy Schubert 
3402b15cb3dSCy Schubert #endif /* not defined __doxygen__ */
3412b15cb3dSCy Schubert 
3422b15cb3dSCy Schubert /*
3432b15cb3dSCy Schubert  *  Create the static procedure(s) declared above.
3442b15cb3dSCy Schubert  */
3452b15cb3dSCy Schubert /**
3462b15cb3dSCy Schubert  * The callout function that invokes the optionUsage function.
3472b15cb3dSCy Schubert  *
3482b15cb3dSCy Schubert  * @param[in] opts the AutoOpts option description structure
3492b15cb3dSCy Schubert  * @param[in] od   the descriptor for the "help" (usage) option.
3502b15cb3dSCy Schubert  * @noreturn
3512b15cb3dSCy Schubert  */
3522b15cb3dSCy Schubert static void
3532b15cb3dSCy Schubert doUsageOpt(tOptions * opts, tOptDesc * od)
3542b15cb3dSCy Schubert {
3552b15cb3dSCy Schubert     int ex_code;
3562b15cb3dSCy Schubert     ex_code = NTPSNMPD_EXIT_SUCCESS;
3572b15cb3dSCy Schubert     optionUsage(&ntpsnmpdOptions, ex_code);
3582b15cb3dSCy Schubert     /* NOTREACHED */
359a466cc55SCy Schubert     exit(NTPSNMPD_EXIT_FAILURE);
3602b15cb3dSCy Schubert     (void)opts;
3612b15cb3dSCy Schubert     (void)od;
3622b15cb3dSCy Schubert }
363276da39aSCy Schubert /* extracted from optmain.tlib near line 1250 */
3642b15cb3dSCy Schubert 
3652b15cb3dSCy Schubert /**
3662b15cb3dSCy Schubert  * The directory containing the data associated with ntpsnmpd.
3672b15cb3dSCy Schubert  */
3682b15cb3dSCy Schubert #ifndef  PKGDATADIR
3692b15cb3dSCy Schubert # define PKGDATADIR ""
3702b15cb3dSCy Schubert #endif
3712b15cb3dSCy Schubert 
3722b15cb3dSCy Schubert /**
3732b15cb3dSCy Schubert  * Information about the person or institution that packaged ntpsnmpd
3742b15cb3dSCy Schubert  * for the current distribution.
3752b15cb3dSCy Schubert  */
3762b15cb3dSCy Schubert #ifndef  WITH_PACKAGER
3772b15cb3dSCy Schubert # define ntpsnmpd_packager_info NULL
3782b15cb3dSCy Schubert #else
3792b15cb3dSCy Schubert /** Packager information for ntpsnmpd. */
3802b15cb3dSCy Schubert static char const ntpsnmpd_packager_info[] =
3812b15cb3dSCy Schubert     "Packaged by " WITH_PACKAGER
3822b15cb3dSCy Schubert 
3832b15cb3dSCy Schubert # ifdef WITH_PACKAGER_VERSION
3842b15cb3dSCy Schubert         " ("WITH_PACKAGER_VERSION")"
3852b15cb3dSCy Schubert # endif
3862b15cb3dSCy Schubert 
3872b15cb3dSCy Schubert # ifdef WITH_PACKAGER_BUG_REPORTS
3882b15cb3dSCy Schubert     "\nReport ntpsnmpd bugs to " WITH_PACKAGER_BUG_REPORTS
3892b15cb3dSCy Schubert # endif
3902b15cb3dSCy Schubert     "\n";
3912b15cb3dSCy Schubert #endif
3922b15cb3dSCy Schubert #ifndef __doxygen__
3932b15cb3dSCy Schubert 
3942b15cb3dSCy Schubert #endif /* __doxygen__ */
3952b15cb3dSCy Schubert /**
3962b15cb3dSCy Schubert  * The option definitions for ntpsnmpd.  The one structure that
3972b15cb3dSCy Schubert  * binds them all.
3982b15cb3dSCy Schubert  */
3992b15cb3dSCy Schubert tOptions ntpsnmpdOptions = {
4002b15cb3dSCy Schubert     OPTIONS_STRUCT_VERSION,
4012b15cb3dSCy Schubert     0, NULL,                    /* original argc + argv    */
4022b15cb3dSCy Schubert     ( OPTPROC_BASE
4032b15cb3dSCy Schubert     + OPTPROC_ERRSTOP
4042b15cb3dSCy Schubert     + OPTPROC_SHORTOPT
4052b15cb3dSCy Schubert     + OPTPROC_LONGOPT
4062b15cb3dSCy Schubert     + OPTPROC_NO_REQ_OPT
4072b15cb3dSCy Schubert     + OPTPROC_ENVIRON
4082b15cb3dSCy Schubert     + OPTPROC_NO_ARGS
4092b15cb3dSCy Schubert     + OPTPROC_MISUSE ),
4102b15cb3dSCy Schubert     0, NULL,                    /* current option index, current option */
4112b15cb3dSCy Schubert     NULL,         NULL,         zPROGNAME,
4122b15cb3dSCy Schubert     zRcName,      zCopyright,   zLicenseDescrip,
4132b15cb3dSCy Schubert     zFullVersion, apzHomeList,  zUsageTitle,
4142b15cb3dSCy Schubert     zExplain,     zDetail,      optDesc,
4152b15cb3dSCy Schubert     zBugsAddr,                  /* address to send bugs to */
4162b15cb3dSCy Schubert     NULL, NULL,                 /* extensions/saved state  */
4172b15cb3dSCy Schubert     optionUsage, /* usage procedure */
4182b15cb3dSCy Schubert     translate_option_strings,   /* translation procedure */
4192b15cb3dSCy Schubert     /*
4202b15cb3dSCy Schubert      *  Indexes to special options
4212b15cb3dSCy Schubert      */
4222b15cb3dSCy Schubert     { INDEX_OPT_MORE_HELP, /* more-help option index */
4232b15cb3dSCy Schubert       INDEX_OPT_SAVE_OPTS, /* save option index */
4242b15cb3dSCy Schubert       NO_EQUIVALENT, /* '-#' option index */
4252b15cb3dSCy Schubert       NO_EQUIVALENT /* index of default opt */
4262b15cb3dSCy Schubert     },
4272b15cb3dSCy Schubert     8 /* full option count */, 3 /* user option count */,
4282b15cb3dSCy Schubert     ntpsnmpd_full_usage, ntpsnmpd_short_usage,
4292b15cb3dSCy Schubert     NULL, NULL,
4302b15cb3dSCy Schubert     PKGDATADIR, ntpsnmpd_packager_info
4312b15cb3dSCy Schubert };
4322b15cb3dSCy Schubert 
4332b15cb3dSCy Schubert #if ENABLE_NLS
4342b15cb3dSCy Schubert /**
4352b15cb3dSCy Schubert  * This code is designed to translate translatable option text for the
4362b15cb3dSCy Schubert  * ntpsnmpd program.  These translations happen upon entry
4372b15cb3dSCy Schubert  * to optionProcess().
4382b15cb3dSCy Schubert  */
4392b15cb3dSCy Schubert #include <stdio.h>
4402b15cb3dSCy Schubert #include <stdlib.h>
4412b15cb3dSCy Schubert #include <string.h>
4422b15cb3dSCy Schubert #include <unistd.h>
4432b15cb3dSCy Schubert #ifdef HAVE_DCGETTEXT
4442b15cb3dSCy Schubert # include <gettext.h>
4452b15cb3dSCy Schubert #endif
4462b15cb3dSCy Schubert #include <autoopts/usage-txt.h>
4472b15cb3dSCy Schubert 
4482b15cb3dSCy Schubert static char * AO_gettext(char const * pz);
4492b15cb3dSCy Schubert static void   coerce_it(void ** s);
4502b15cb3dSCy Schubert 
4512b15cb3dSCy Schubert /**
4522b15cb3dSCy Schubert  * AutoGen specific wrapper function for gettext.  It relies on the macro _()
4532b15cb3dSCy Schubert  * to convert from English to the target language, then strdup-duplicates the
4542b15cb3dSCy Schubert  * result string.  It tries the "libopts" domain first, then whatever has been
4552b15cb3dSCy Schubert  * set via the \a textdomain(3) call.
4562b15cb3dSCy Schubert  *
4572b15cb3dSCy Schubert  * @param[in] pz the input text used as a lookup key.
4582b15cb3dSCy Schubert  * @returns the translated text (if there is one),
4592b15cb3dSCy Schubert  *   or the original text (if not).
4602b15cb3dSCy Schubert  */
4612b15cb3dSCy Schubert static char *
4622b15cb3dSCy Schubert AO_gettext(char const * pz)
4632b15cb3dSCy Schubert {
4642b15cb3dSCy Schubert     char * res;
4652b15cb3dSCy Schubert     if (pz == NULL)
4662b15cb3dSCy Schubert         return NULL;
4672b15cb3dSCy Schubert #ifdef HAVE_DCGETTEXT
4682b15cb3dSCy Schubert     /*
4692b15cb3dSCy Schubert      * While processing the option_xlateable_txt data, try to use the
4702b15cb3dSCy Schubert      * "libopts" domain.  Once we switch to the option descriptor data,
4712b15cb3dSCy Schubert      * do *not* use that domain.
4722b15cb3dSCy Schubert      */
4732b15cb3dSCy Schubert     if (option_xlateable_txt.field_ct != 0) {
4742b15cb3dSCy Schubert         res = dgettext("libopts", pz);
4752b15cb3dSCy Schubert         if (res == pz)
476276da39aSCy Schubert             res = (char *)VOIDP(_(pz));
4772b15cb3dSCy Schubert     } else
478276da39aSCy Schubert         res = (char *)VOIDP(_(pz));
4792b15cb3dSCy Schubert #else
480276da39aSCy Schubert     res = (char *)VOIDP(_(pz));
4812b15cb3dSCy Schubert #endif
4822b15cb3dSCy Schubert     if (res == pz)
4832b15cb3dSCy Schubert         return res;
4842b15cb3dSCy Schubert     res = strdup(res);
4852b15cb3dSCy Schubert     if (res == NULL) {
4862b15cb3dSCy Schubert         fputs(_("No memory for duping translated strings\n"), stderr);
4872b15cb3dSCy Schubert         exit(NTPSNMPD_EXIT_FAILURE);
4882b15cb3dSCy Schubert     }
4892b15cb3dSCy Schubert     return res;
4902b15cb3dSCy Schubert }
4912b15cb3dSCy Schubert 
4922b15cb3dSCy Schubert /**
4932b15cb3dSCy Schubert  * All the pointers we use are marked "* const", but they are stored in
4942b15cb3dSCy Schubert  * writable memory.  Coerce the mutability and set the pointer.
4952b15cb3dSCy Schubert  */
4962b15cb3dSCy Schubert static void coerce_it(void ** s) { *s = AO_gettext(*s);
4972b15cb3dSCy Schubert }
4982b15cb3dSCy Schubert 
4992b15cb3dSCy Schubert /**
5002b15cb3dSCy Schubert  * Translate all the translatable strings in the ntpsnmpdOptions
5012b15cb3dSCy Schubert  * structure defined above.  This is done only once.
5022b15cb3dSCy Schubert  */
5032b15cb3dSCy Schubert static void
5042b15cb3dSCy Schubert translate_option_strings(void)
5052b15cb3dSCy Schubert {
5062b15cb3dSCy Schubert     tOptions * const opts = &ntpsnmpdOptions;
5072b15cb3dSCy Schubert 
5082b15cb3dSCy Schubert     /*
5092b15cb3dSCy Schubert      *  Guard against re-translation.  It won't work.  The strings will have
5102b15cb3dSCy Schubert      *  been changed by the first pass through this code.  One shot only.
5112b15cb3dSCy Schubert      */
5122b15cb3dSCy Schubert     if (option_xlateable_txt.field_ct != 0) {
5132b15cb3dSCy Schubert         /*
5142b15cb3dSCy Schubert          *  Do the translations.  The first pointer follows the field count
5152b15cb3dSCy Schubert          *  field.  The field count field is the size of a pointer.
5162b15cb3dSCy Schubert          */
517276da39aSCy Schubert         char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
5182b15cb3dSCy Schubert         int     ix  = option_xlateable_txt.field_ct;
5192b15cb3dSCy Schubert 
5202b15cb3dSCy Schubert         do {
5212b15cb3dSCy Schubert             ppz++; /* skip over field_ct */
5222b15cb3dSCy Schubert             *ppz = AO_gettext(*ppz);
5232b15cb3dSCy Schubert         } while (--ix > 0);
5242b15cb3dSCy Schubert         /* prevent re-translation and disable "libopts" domain lookup */
5252b15cb3dSCy Schubert         option_xlateable_txt.field_ct = 0;
5262b15cb3dSCy Schubert 
527276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzCopyright)));
528276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzCopyNotice)));
529276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzFullVersion)));
530276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzUsageTitle)));
531276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzExplain)));
532276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzDetail)));
5332b15cb3dSCy Schubert         {
5342b15cb3dSCy Schubert             tOptDesc * od = opts->pOptDesc;
5352b15cb3dSCy Schubert             for (ix = opts->optCt; ix > 0; ix--, od++)
536276da39aSCy Schubert                 coerce_it(VOIDP(&(od->pzText)));
5372b15cb3dSCy Schubert         }
5382b15cb3dSCy Schubert     }
5392b15cb3dSCy Schubert }
5402b15cb3dSCy Schubert #endif /* ENABLE_NLS */
5412b15cb3dSCy Schubert 
5422b15cb3dSCy Schubert #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
5432b15cb3dSCy Schubert /** I18N function strictly for xgettext.  Do not compile. */
5442b15cb3dSCy Schubert static void bogus_function(void) {
5452b15cb3dSCy Schubert   /* TRANSLATORS:
5462b15cb3dSCy Schubert 
5472b15cb3dSCy Schubert      The following dummy function was crated solely so that xgettext can
5482b15cb3dSCy Schubert      extract the correct strings.  These strings are actually referenced
5492b15cb3dSCy Schubert      by a field name in the ntpsnmpdOptions structure noted in the
5502b15cb3dSCy Schubert      comments below.  The literal text is defined in ntpsnmpd_opt_strs.
5512b15cb3dSCy Schubert 
5522b15cb3dSCy Schubert      NOTE: the strings below are segmented with respect to the source string
5532b15cb3dSCy Schubert      ntpsnmpd_opt_strs.  The strings above are handed off for translation
5542b15cb3dSCy Schubert      at run time a paragraph at a time.  Consequently, they are presented here
5552b15cb3dSCy Schubert      for translation a paragraph at a time.
5562b15cb3dSCy Schubert 
5572b15cb3dSCy Schubert      ALSO: often the description for an option will reference another option
5582b15cb3dSCy Schubert      by name.  These are set off with apostrophe quotes (I hope).  Do not
5592b15cb3dSCy Schubert      translate option names.
5602b15cb3dSCy Schubert    */
5612b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pzCopyright */
562*f5f40dd6SCy Schubert   puts(_("ntpsnmpd 4.2.8p18\n\
563*f5f40dd6SCy Schubert Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n\
5642b15cb3dSCy Schubert This is free software. It is licensed for use, modification and\n\
5652b15cb3dSCy Schubert redistribution under the terms of the NTP License, copies of which\n\
5662b15cb3dSCy Schubert can be seen at:\n"));
5672b15cb3dSCy Schubert   puts(_("  <http://ntp.org/license>\n\
5682b15cb3dSCy Schubert   <http://opensource.org/licenses/ntp-license.php>\n"));
5692b15cb3dSCy Schubert 
5702b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pzCopyNotice */
5712b15cb3dSCy Schubert   puts(_("Permission to use, copy, modify, and distribute this software and its\n\
5722b15cb3dSCy Schubert documentation for any purpose with or without fee is hereby granted,\n\
5732b15cb3dSCy Schubert provided that the above copyright notice appears in all copies and that\n\
5742b15cb3dSCy Schubert both the copyright notice and this permission notice appear in supporting\n\
5752b15cb3dSCy Schubert documentation, and that the name The University of Delaware not be used in\n\
5762b15cb3dSCy Schubert advertising or publicity pertaining to distribution of the software without\n\
5772b15cb3dSCy Schubert specific, written prior permission.  The University of Delaware and Network\n\
5782b15cb3dSCy Schubert Time Foundation makes no representations about the suitability this\n\
5792b15cb3dSCy Schubert software for any purpose.  It is provided \"as is\" without express or\n\
5802b15cb3dSCy Schubert implied warranty.\n"));
5812b15cb3dSCy Schubert 
5822b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
5832b15cb3dSCy Schubert   puts(_("Do not fork"));
5842b15cb3dSCy Schubert 
5852b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
5862b15cb3dSCy Schubert   puts(_("Log to syslog()"));
5872b15cb3dSCy Schubert 
5882b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
5892b15cb3dSCy Schubert   puts(_("The socket address ntpsnmpd uses to connect to net-snmpd"));
5902b15cb3dSCy Schubert 
5912b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
5922b15cb3dSCy Schubert   puts(_("display extended usage information and exit"));
5932b15cb3dSCy Schubert 
5942b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
5952b15cb3dSCy Schubert   puts(_("extended usage information passed thru pager"));
5962b15cb3dSCy Schubert 
5972b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
5982b15cb3dSCy Schubert   puts(_("output version information and exit"));
5992b15cb3dSCy Schubert 
6002b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
6012b15cb3dSCy Schubert   puts(_("save the option state to a config file"));
6022b15cb3dSCy Schubert 
6032b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
6042b15cb3dSCy Schubert   puts(_("load options from a config file"));
6052b15cb3dSCy Schubert 
6062b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pzUsageTitle */
607*f5f40dd6SCy Schubert   puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p18\n\
6082b15cb3dSCy Schubert Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
6092b15cb3dSCy Schubert 
6102b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pzExplain */
6112b15cb3dSCy Schubert   puts(_("\n"));
6122b15cb3dSCy Schubert 
6132b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pzFullVersion */
614*f5f40dd6SCy Schubert   puts(_("ntpsnmpd 4.2.8p18"));
6152b15cb3dSCy Schubert 
6162b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pzFullUsage */
6172b15cb3dSCy Schubert   puts(_("<<<NOT-FOUND>>>"));
6182b15cb3dSCy Schubert 
6192b15cb3dSCy Schubert   /* referenced via ntpsnmpdOptions.pzShortUsage */
6202b15cb3dSCy Schubert   puts(_("<<<NOT-FOUND>>>"));
6212b15cb3dSCy Schubert   /* LIBOPTS-MESSAGES: */
6222b15cb3dSCy Schubert #line 67 "../autoopts.c"
6232b15cb3dSCy Schubert   puts(_("allocation of %d bytes failed\n"));
624a466cc55SCy Schubert #line 89 "../autoopts.c"
6252b15cb3dSCy Schubert   puts(_("allocation of %d bytes failed\n"));
626a466cc55SCy Schubert #line 48 "../init.c"
6272b15cb3dSCy Schubert   puts(_("AutoOpts function called without option descriptor\n"));
628a466cc55SCy Schubert #line 81 "../init.c"
6292b15cb3dSCy Schubert   puts(_("\tThis exceeds the compiled library version:  "));
630a466cc55SCy Schubert #line 79 "../init.c"
6312b15cb3dSCy Schubert   puts(_("Automated Options Processing Error!\n"
6322b15cb3dSCy Schubert        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
633a466cc55SCy Schubert #line 78 "../autoopts.c"
6342b15cb3dSCy Schubert   puts(_("realloc of %d bytes at 0x%p failed\n"));
635a466cc55SCy Schubert #line 83 "../init.c"
6362b15cb3dSCy Schubert   puts(_("\tThis is less than the minimum library version:  "));
6372b15cb3dSCy Schubert #line 121 "../version.c"
6382b15cb3dSCy Schubert   puts(_("Automated Options version %s\n"
639a466cc55SCy Schubert        "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
640a466cc55SCy Schubert #line 49 "../makeshell.c"
6412b15cb3dSCy Schubert   puts(_("(AutoOpts bug):  %s.\n"));
6422b15cb3dSCy Schubert #line 90 "../reset.c"
6432b15cb3dSCy Schubert   puts(_("optionResetOpt() called, but reset-option not configured"));
644a466cc55SCy Schubert #line 241 "../usage.c"
6452b15cb3dSCy Schubert   puts(_("could not locate the 'help' option"));
646a466cc55SCy Schubert #line 330 "../autoopts.c"
6472b15cb3dSCy Schubert   puts(_("optionProcess() was called with invalid data"));
648a466cc55SCy Schubert #line 697 "../usage.c"
6492b15cb3dSCy Schubert   puts(_("invalid argument type specified"));
650a466cc55SCy Schubert #line 568 "../find.c"
6512b15cb3dSCy Schubert   puts(_("defaulted to option with optional arg"));
6522b15cb3dSCy Schubert #line 76 "../alias.c"
6532b15cb3dSCy Schubert   puts(_("aliasing option is out of range."));
654a466cc55SCy Schubert #line 210 "../enum.c"
6552b15cb3dSCy Schubert   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
656a466cc55SCy Schubert #line 78 "../find.c"
6572b15cb3dSCy Schubert   puts(_("  The following options match:\n"));
658a466cc55SCy Schubert #line 263 "../find.c"
6592b15cb3dSCy Schubert   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
6602b15cb3dSCy Schubert #line 161 "../check.c"
6612b15cb3dSCy Schubert   puts(_("%s: Command line arguments required\n"));
6622b15cb3dSCy Schubert #line 43 "../alias.c"
6632b15cb3dSCy Schubert   puts(_("%d %s%s options allowed\n"));
664a466cc55SCy Schubert #line 56 "../makeshell.c"
6652b15cb3dSCy Schubert   puts(_("%s error %d (%s) calling %s for '%s'\n"));
666a466cc55SCy Schubert #line 268 "../makeshell.c"
6672b15cb3dSCy Schubert   puts(_("interprocess pipe"));
668a466cc55SCy Schubert #line 171 "../version.c"
6692b15cb3dSCy Schubert   puts(_("error: version option argument '%c' invalid.  Use:\n"
6702b15cb3dSCy Schubert        "\t'v' - version only\n"
6712b15cb3dSCy Schubert        "\t'c' - version and copyright\n"
6722b15cb3dSCy Schubert        "\t'n' - version and full copyright notice\n"));
6732b15cb3dSCy Schubert #line 58 "../check.c"
6742b15cb3dSCy Schubert   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
675a466cc55SCy Schubert #line 187 "../find.c"
6762b15cb3dSCy Schubert   puts(_("%s: The '%s' option has been disabled."));
677a466cc55SCy Schubert #line 400 "../find.c"
6782b15cb3dSCy Schubert   puts(_("%s: The '%s' option has been disabled."));
6792b15cb3dSCy Schubert #line 38 "../alias.c"
6802b15cb3dSCy Schubert   puts(_("-equivalence"));
681a466cc55SCy Schubert #line 439 "../find.c"
6822b15cb3dSCy Schubert   puts(_("%s: illegal option -- %c\n"));
6832b15cb3dSCy Schubert #line 110 "../reset.c"
6842b15cb3dSCy Schubert   puts(_("%s: illegal option -- %c\n"));
685a466cc55SCy Schubert #line 241 "../find.c"
6862b15cb3dSCy Schubert   puts(_("%s: illegal option -- %s\n"));
687a466cc55SCy Schubert #line 740 "../find.c"
6882b15cb3dSCy Schubert   puts(_("%s: illegal option -- %s\n"));
6892b15cb3dSCy Schubert #line 118 "../reset.c"
6902b15cb3dSCy Schubert   puts(_("%s: illegal option -- %s\n"));
691a466cc55SCy Schubert #line 305 "../find.c"
6922b15cb3dSCy Schubert   puts(_("%s: unknown vendor extension option -- %s\n"));
693a466cc55SCy Schubert #line 135 "../enum.c"
6942b15cb3dSCy Schubert   puts(_("  or an integer from %d through %d\n"));
695a466cc55SCy Schubert #line 145 "../enum.c"
6962b15cb3dSCy Schubert   puts(_("  or an integer from %d through %d\n"));
697a466cc55SCy Schubert #line 696 "../usage.c"
6982b15cb3dSCy Schubert   puts(_("%s error:  invalid option descriptor for %s\n"));
699a466cc55SCy Schubert #line 1030 "../usage.c"
7002b15cb3dSCy Schubert   puts(_("%s error:  invalid option descriptor for %s\n"));
701a466cc55SCy Schubert #line 355 "../find.c"
7022b15cb3dSCy Schubert   puts(_("%s: invalid option name: %s\n"));
703a466cc55SCy Schubert #line 497 "../find.c"
7042b15cb3dSCy Schubert   puts(_("%s: The '%s' option requires an argument.\n"));
705a466cc55SCy Schubert #line 150 "../autoopts.c"
7062b15cb3dSCy Schubert   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
7072b15cb3dSCy Schubert        "\t'%s' and '%s'."));
7082b15cb3dSCy Schubert #line 94 "../check.c"
7092b15cb3dSCy Schubert   puts(_("%s error:  The %s option is required\n"));
710a466cc55SCy Schubert #line 602 "../find.c"
7112b15cb3dSCy Schubert   puts(_("%s: The '%s' option cannot have an argument.\n"));
7122b15cb3dSCy Schubert #line 151 "../check.c"
7132b15cb3dSCy Schubert   puts(_("%s: Command line arguments are not allowed.\n"));
714a466cc55SCy Schubert #line 568 "../save.c"
7152b15cb3dSCy Schubert   puts(_("error %d (%s) creating %s\n"));
716a466cc55SCy Schubert #line 210 "../enum.c"
7172b15cb3dSCy Schubert   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
7182b15cb3dSCy Schubert #line 93 "../reset.c"
7192b15cb3dSCy Schubert   puts(_("%s error: The '%s' option requires an argument.\n"));
720a466cc55SCy Schubert #line 122 "../save.c"
7212b15cb3dSCy Schubert   puts(_("error %d (%s) stat-ing %s\n"));
722a466cc55SCy Schubert #line 175 "../save.c"
7232b15cb3dSCy Schubert   puts(_("error %d (%s) stat-ing %s\n"));
7242b15cb3dSCy Schubert #line 143 "../restore.c"
7252b15cb3dSCy Schubert   puts(_("%s error: no saved option state\n"));
726a466cc55SCy Schubert #line 225 "../autoopts.c"
7272b15cb3dSCy Schubert   puts(_("'%s' is not a command line option.\n"));
728a466cc55SCy Schubert #line 113 "../time.c"
7292b15cb3dSCy Schubert   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
7302b15cb3dSCy Schubert #line 50 "../time.c"
7312b15cb3dSCy Schubert   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
7322b15cb3dSCy Schubert #line 92 "../check.c"
7332b15cb3dSCy Schubert   puts(_("%s error:  The %s option must appear %d times.\n"));
734a466cc55SCy Schubert #line 165 "../numeric.c"
7352b15cb3dSCy Schubert   puts(_("%s error:  '%s' is not a recognizable number.\n"));
736a466cc55SCy Schubert #line 176 "../enum.c"
7372b15cb3dSCy Schubert   puts(_("%s error:  %s exceeds %s keyword count\n"));
738a466cc55SCy Schubert #line 279 "../usage.c"
7392b15cb3dSCy Schubert   puts(_("Try '%s %s' for more information.\n"));
7402b15cb3dSCy Schubert #line 45 "../alias.c"
7412b15cb3dSCy Schubert   puts(_("one %s%s option allowed\n"));
742a466cc55SCy Schubert #line 170 "../makeshell.c"
7432b15cb3dSCy Schubert   puts(_("standard output"));
744a466cc55SCy Schubert #line 905 "../makeshell.c"
7452b15cb3dSCy Schubert   puts(_("standard output"));
746a466cc55SCy Schubert #line 223 "../usage.c"
7472b15cb3dSCy Schubert   puts(_("standard output"));
748a466cc55SCy Schubert #line 364 "../usage.c"
7492b15cb3dSCy Schubert   puts(_("standard output"));
750a466cc55SCy Schubert #line 574 "../usage.c"
7512b15cb3dSCy Schubert   puts(_("standard output"));
752a466cc55SCy Schubert #line 178 "../version.c"
7532b15cb3dSCy Schubert   puts(_("standard output"));
754a466cc55SCy Schubert #line 223 "../usage.c"
7552b15cb3dSCy Schubert   puts(_("standard error"));
756a466cc55SCy Schubert #line 364 "../usage.c"
7572b15cb3dSCy Schubert   puts(_("standard error"));
758a466cc55SCy Schubert #line 574 "../usage.c"
7592b15cb3dSCy Schubert   puts(_("standard error"));
760a466cc55SCy Schubert #line 178 "../version.c"
7612b15cb3dSCy Schubert   puts(_("standard error"));
762a466cc55SCy Schubert #line 170 "../makeshell.c"
7632b15cb3dSCy Schubert   puts(_("write"));
764a466cc55SCy Schubert #line 905 "../makeshell.c"
7652b15cb3dSCy Schubert   puts(_("write"));
766a466cc55SCy Schubert #line 222 "../usage.c"
7672b15cb3dSCy Schubert   puts(_("write"));
768a466cc55SCy Schubert #line 363 "../usage.c"
7692b15cb3dSCy Schubert   puts(_("write"));
770a466cc55SCy Schubert #line 573 "../usage.c"
7712b15cb3dSCy Schubert   puts(_("write"));
772a466cc55SCy Schubert #line 177 "../version.c"
7732b15cb3dSCy Schubert   puts(_("write"));
7742b15cb3dSCy Schubert #line 60 "../numeric.c"
7752b15cb3dSCy Schubert   puts(_("%s error:  %s option value %ld is out of range.\n"));
7762b15cb3dSCy Schubert #line 44 "../check.c"
7772b15cb3dSCy Schubert   puts(_("%s error:  %s option requires the %s option\n"));
778a466cc55SCy Schubert #line 121 "../save.c"
7792b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
780a466cc55SCy Schubert #line 174 "../save.c"
7812b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
782a466cc55SCy Schubert #line 193 "../save.c"
7832b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
784a466cc55SCy Schubert #line 567 "../save.c"
7852b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
7862b15cb3dSCy Schubert   /* END-LIBOPTS-MESSAGES */
7872b15cb3dSCy Schubert 
7882b15cb3dSCy Schubert   /* USAGE-TEXT: */
789a466cc55SCy Schubert #line 822 "../usage.c"
7902b15cb3dSCy Schubert   puts(_("\t\t\t\t- an alternate for '%s'\n"));
791a466cc55SCy Schubert #line 1097 "../usage.c"
7922b15cb3dSCy Schubert   puts(_("Version, usage and configuration options:"));
793a466cc55SCy Schubert #line 873 "../usage.c"
7942b15cb3dSCy Schubert   puts(_("\t\t\t\t- default option for unnamed options\n"));
795a466cc55SCy Schubert #line 786 "../usage.c"
7962b15cb3dSCy Schubert   puts(_("\t\t\t\t- disabled as '--%s'\n"));
797a466cc55SCy Schubert #line 1066 "../usage.c"
7982b15cb3dSCy Schubert   puts(_(" --- %-14s %s\n"));
799a466cc55SCy Schubert #line 1064 "../usage.c"
8002b15cb3dSCy Schubert   puts(_("This option has been disabled"));
801a466cc55SCy Schubert #line 813 "../usage.c"
8022b15cb3dSCy Schubert   puts(_("\t\t\t\t- enabled by default\n"));
8032b15cb3dSCy Schubert #line 40 "../alias.c"
8042b15cb3dSCy Schubert   puts(_("%s error:  only "));
805a466cc55SCy Schubert #line 1143 "../usage.c"
8062b15cb3dSCy Schubert   puts(_(" - examining environment variables named %s_*\n"));
8072b15cb3dSCy Schubert #line 168 "../file.c"
8082b15cb3dSCy Schubert   puts(_("\t\t\t\t- file must not pre-exist\n"));
8092b15cb3dSCy Schubert #line 172 "../file.c"
8102b15cb3dSCy Schubert   puts(_("\t\t\t\t- file must pre-exist\n"));
811a466cc55SCy Schubert #line 329 "../usage.c"
8122b15cb3dSCy Schubert   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
8132b15cb3dSCy Schubert        "hyphen and the flag character.\n"));
814a466cc55SCy Schubert #line 882 "../makeshell.c"
8152b15cb3dSCy Schubert   puts(_("\n"
8162b15cb3dSCy Schubert        "= = = = = = = =\n\n"
8172b15cb3dSCy Schubert        "This incarnation of genshell will produce\n"
8182b15cb3dSCy Schubert        "a shell script to parse the options for %s:\n\n"));
819a466cc55SCy Schubert #line 142 "../enum.c"
8202b15cb3dSCy Schubert   puts(_("  or an integer mask with any of the lower %d bits set\n"));
821a466cc55SCy Schubert #line 846 "../usage.c"
8222b15cb3dSCy Schubert   puts(_("\t\t\t\t- is a set membership option\n"));
823a466cc55SCy Schubert #line 867 "../usage.c"
8242b15cb3dSCy Schubert   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
825a466cc55SCy Schubert #line 331 "../usage.c"
8262b15cb3dSCy Schubert   puts(_("Options are specified by single or double hyphens and their name.\n"));
827a466cc55SCy Schubert #line 853 "../usage.c"
8282b15cb3dSCy Schubert   puts(_("\t\t\t\t- may appear multiple times\n"));
829a466cc55SCy Schubert #line 840 "../usage.c"
8302b15cb3dSCy Schubert   puts(_("\t\t\t\t- may not be preset\n"));
831a466cc55SCy Schubert #line 1258 "../usage.c"
8322b15cb3dSCy Schubert   puts(_("   Arg Option-Name    Description\n"));
833a466cc55SCy Schubert #line 1194 "../usage.c"
8342b15cb3dSCy Schubert   puts(_("  Flg Arg Option-Name    Description\n"));
835a466cc55SCy Schubert #line 1252 "../usage.c"
8362b15cb3dSCy Schubert   puts(_("  Flg Arg Option-Name    Description\n"));
837a466cc55SCy Schubert #line 1253 "../usage.c"
8382b15cb3dSCy Schubert   puts(_(" %3s %s"));
839a466cc55SCy Schubert #line 1259 "../usage.c"
8402b15cb3dSCy Schubert   puts(_(" %3s %s"));
841a466cc55SCy Schubert #line 336 "../usage.c"
8422b15cb3dSCy Schubert   puts(_("The '-#<number>' option may omit the hash char\n"));
843a466cc55SCy Schubert #line 332 "../usage.c"
8442b15cb3dSCy Schubert   puts(_("All arguments are named options.\n"));
845a466cc55SCy Schubert #line 920 "../usage.c"
8462b15cb3dSCy Schubert   puts(_(" - reading file %s"));
847a466cc55SCy Schubert #line 358 "../usage.c"
8482b15cb3dSCy Schubert   puts(_("\n"
8492b15cb3dSCy Schubert        "Please send bug reports to:  <%s>\n"));
8502b15cb3dSCy Schubert #line 100 "../version.c"
8512b15cb3dSCy Schubert   puts(_("\n"
8522b15cb3dSCy Schubert        "Please send bug reports to:  <%s>\n"));
8532b15cb3dSCy Schubert #line 129 "../version.c"
8542b15cb3dSCy Schubert   puts(_("\n"
8552b15cb3dSCy Schubert        "Please send bug reports to:  <%s>\n"));
856a466cc55SCy Schubert #line 852 "../usage.c"
8572b15cb3dSCy Schubert   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
858a466cc55SCy Schubert #line 893 "../usage.c"
8592b15cb3dSCy Schubert   puts(_("\n"
8602b15cb3dSCy Schubert        "The following option preset mechanisms are supported:\n"));
861a466cc55SCy Schubert #line 1141 "../usage.c"
8622b15cb3dSCy Schubert   puts(_("\n"
8632b15cb3dSCy Schubert        "The following option preset mechanisms are supported:\n"));
864a466cc55SCy Schubert #line 631 "../usage.c"
8652b15cb3dSCy Schubert   puts(_("prohibits these options:\n"));
866a466cc55SCy Schubert #line 626 "../usage.c"
8672b15cb3dSCy Schubert   puts(_("prohibits the option '%s'\n"));
8682b15cb3dSCy Schubert #line 81 "../numeric.c"
8692b15cb3dSCy Schubert   puts(_("%s%ld to %ld"));
8702b15cb3dSCy Schubert #line 79 "../numeric.c"
8712b15cb3dSCy Schubert   puts(_("%sgreater than or equal to %ld"));
8722b15cb3dSCy Schubert #line 75 "../numeric.c"
8732b15cb3dSCy Schubert   puts(_("%s%ld exactly"));
8742b15cb3dSCy Schubert #line 68 "../numeric.c"
8752b15cb3dSCy Schubert   puts(_("%sit must lie in one of the ranges:\n"));
8762b15cb3dSCy Schubert #line 68 "../numeric.c"
8772b15cb3dSCy Schubert   puts(_("%sit must be in the range:\n"));
8782b15cb3dSCy Schubert #line 88 "../numeric.c"
8792b15cb3dSCy Schubert   puts(_(", or\n"));
8802b15cb3dSCy Schubert #line 66 "../numeric.c"
8812b15cb3dSCy Schubert   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
8822b15cb3dSCy Schubert #line 77 "../numeric.c"
8832b15cb3dSCy Schubert   puts(_("%sless than or equal to %ld"));
884a466cc55SCy Schubert #line 339 "../usage.c"
8852b15cb3dSCy Schubert   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
886a466cc55SCy Schubert #line 601 "../usage.c"
8872b15cb3dSCy Schubert   puts(_("requires the option '%s'\n"));
888a466cc55SCy Schubert #line 604 "../usage.c"
8892b15cb3dSCy Schubert   puts(_("requires these options:\n"));
890a466cc55SCy Schubert #line 1270 "../usage.c"
8912b15cb3dSCy Schubert   puts(_("   Arg Option-Name   Req?  Description\n"));
892a466cc55SCy Schubert #line 1264 "../usage.c"
8932b15cb3dSCy Schubert   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
894a466cc55SCy Schubert #line 143 "../enum.c"
8952b15cb3dSCy Schubert   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
8962b15cb3dSCy Schubert        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
8972b15cb3dSCy Schubert        "will set them all.  Multiple entries may be passed as an option\n"
8982b15cb3dSCy Schubert        "argument list.\n"));
899a466cc55SCy Schubert #line 859 "../usage.c"
9002b15cb3dSCy Schubert   puts(_("\t\t\t\t- may appear up to %d times\n"));
901a466cc55SCy Schubert #line 52 "../enum.c"
9022b15cb3dSCy Schubert   puts(_("The valid \"%s\" option keywords are:\n"));
903a466cc55SCy Schubert #line 1101 "../usage.c"
9042b15cb3dSCy Schubert   puts(_("The next option supports vendor supported extra options:"));
905a466cc55SCy Schubert #line 722 "../usage.c"
9062b15cb3dSCy Schubert   puts(_("These additional options are:"));
9072b15cb3dSCy Schubert   /* END-USAGE-TEXT */
9082b15cb3dSCy Schubert }
9092b15cb3dSCy Schubert #endif /* uncompilable code */
9102b15cb3dSCy Schubert #ifdef  __cplusplus
9112b15cb3dSCy Schubert }
9122b15cb3dSCy Schubert #endif
9132b15cb3dSCy Schubert /* ntpsnmpd-opts.c ends here */
914