xref: /freebsd/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c (revision 2008043f386721d58158e37e0d7e50df8095942d)
1 /*
2  *  EDIT THIS FILE WITH CAUTION  (ntpsnmpd-opts.c)
3  *
4  *  It has been AutoGen-ed  June  6, 2023 at 04:38:17 AM by AutoGen 5.18.16
5  *  From the definitions    ntpsnmpd-opts.def
6  *  and the template file   options
7  *
8  * Generated from AutoOpts 42:1:17 templates.
9  *
10  *  AutoOpts is a copyrighted work.  This source file is not encumbered
11  *  by AutoOpts licensing, but is provided under the licensing terms chosen
12  *  by the ntpsnmpd author or copyright holder.  AutoOpts is
13  *  licensed under the terms of the LGPL.  The redistributable library
14  *  (``libopts'') is licensed under the terms of either the LGPL or, at the
15  *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
16  *  for details.
17  *
18  * The ntpsnmpd program is copyrighted and licensed
19  * under the following terms:
20  *
21  *  Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.
22  *  This is free software. It is licensed for use, modification and
23  *  redistribution under the terms of the NTP License, copies of which
24  *  can be seen at:
25  *    <http://ntp.org/license>
26  *    <http://opensource.org/licenses/ntp-license.php>
27  *
28  *  Permission to use, copy, modify, and distribute this software and its
29  *  documentation for any purpose with or without fee is hereby granted,
30  *  provided that the above copyright notice appears in all copies and that
31  *  both the copyright notice and this permission notice appear in
32  *  supporting documentation, and that the name The University of Delaware not be used in
33  *  advertising or publicity pertaining to distribution of the software
34  *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
35  *  representations about the suitability this software for any purpose. It
36  *  is provided "as is" without express or implied warranty.
37  */
38 
39 #ifndef __doxygen__
40 #define OPTION_CODE_COMPILE 1
41 #include "ntpsnmpd-opts.h"
42 #include <sys/types.h>
43 #include <sys/stat.h>
44 
45 #include <errno.h>
46 #include <fcntl.h>
47 #include <limits.h>
48 #include <stdio.h>
49 #include <stdlib.h>
50 #include <string.h>
51 #include <unistd.h>
52 
53 #ifdef  __cplusplus
54 extern "C" {
55 #endif
56 extern FILE * option_usage_fp;
57 #define zCopyright      (ntpsnmpd_opt_strs+0)
58 #define zLicenseDescrip (ntpsnmpd_opt_strs+345)
59 
60 
61 #ifndef NULL
62 #  define NULL 0
63 #endif
64 
65 /**
66  *  static const strings for ntpsnmpd options
67  */
68 static char const ntpsnmpd_opt_strs[1614] =
69 /*     0 */ "ntpsnmpd 4.2.8p17\n"
70             "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n"
71             "This is free software. It is licensed for use, modification and\n"
72             "redistribution under the terms of the NTP License, copies of which\n"
73             "can be seen at:\n"
74             "  <http://ntp.org/license>\n"
75             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
76 /*   345 */ "Permission to use, copy, modify, and distribute this software and its\n"
77             "documentation for any purpose with or without fee is hereby granted,\n"
78             "provided that the above copyright notice appears in all copies and that\n"
79             "both the copyright notice and this permission notice appear in supporting\n"
80             "documentation, and that the name The University of Delaware not be used in\n"
81             "advertising or publicity pertaining to distribution of the software without\n"
82             "specific, written prior permission.  The University of Delaware and Network\n"
83             "Time Foundation makes no representations about the suitability this\n"
84             "software for any purpose.  It is provided \"as is\" without express or\n"
85             "implied warranty.\n\0"
86 /*  1013 */ "Do not fork\0"
87 /*  1025 */ "NOFORK\0"
88 /*  1032 */ "nofork\0"
89 /*  1039 */ "Log to syslog()\0"
90 /*  1055 */ "SYSLOG\0"
91 /*  1062 */ "syslog\0"
92 /*  1069 */ "The socket address ntpsnmpd uses to connect to net-snmpd\0"
93 /*  1126 */ "AGENTXSOCKET\0"
94 /*  1139 */ "agentxsocket\0"
95 /*  1152 */ "unix:/var/agentx/master\0"
96 /*  1176 */ "display extended usage information and exit\0"
97 /*  1220 */ "help\0"
98 /*  1225 */ "extended usage information passed thru pager\0"
99 /*  1270 */ "more-help\0"
100 /*  1280 */ "output version information and exit\0"
101 /*  1316 */ "version\0"
102 /*  1324 */ "save the option state to a config file\0"
103 /*  1363 */ "save-opts\0"
104 /*  1373 */ "load options from a config file\0"
105 /*  1405 */ "LOAD_OPTS\0"
106 /*  1415 */ "no-load-opts\0"
107 /*  1428 */ "no\0"
108 /*  1431 */ "NTPSNMPD\0"
109 /*  1440 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p17\n"
110             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
111 /*  1544 */ "$HOME\0"
112 /*  1550 */ ".\0"
113 /*  1552 */ ".ntprc\0"
114 /*  1559 */ "https://bugs.ntp.org, bugs@ntp.org\0"
115 /*  1594 */ "\n\0"
116 /*  1596 */ "ntpsnmpd 4.2.8p17";
117 
118 /**
119  *  nofork option description:
120  */
121 /** Descriptive text for the nofork option */
122 #define NOFORK_DESC      (ntpsnmpd_opt_strs+1013)
123 /** Upper-cased name for the nofork option */
124 #define NOFORK_NAME      (ntpsnmpd_opt_strs+1025)
125 /** Name string for the nofork option */
126 #define NOFORK_name      (ntpsnmpd_opt_strs+1032)
127 /** Compiled in flag settings for the nofork option */
128 #define NOFORK_FLAGS     (OPTST_DISABLED)
129 
130 /**
131  *  syslog option description:
132  */
133 /** Descriptive text for the syslog option */
134 #define SYSLOG_DESC      (ntpsnmpd_opt_strs+1039)
135 /** Upper-cased name for the syslog option */
136 #define SYSLOG_NAME      (ntpsnmpd_opt_strs+1055)
137 /** Name string for the syslog option */
138 #define SYSLOG_name      (ntpsnmpd_opt_strs+1062)
139 /** Compiled in flag settings for the syslog option */
140 #define SYSLOG_FLAGS     (OPTST_DISABLED)
141 
142 /**
143  *  agentXSocket option description:
144  */
145 /** Descriptive text for the agentXSocket option */
146 #define AGENTXSOCKET_DESC      (ntpsnmpd_opt_strs+1069)
147 /** Upper-cased name for the agentXSocket option */
148 #define AGENTXSOCKET_NAME      (ntpsnmpd_opt_strs+1126)
149 /** Name string for the agentXSocket option */
150 #define AGENTXSOCKET_name      (ntpsnmpd_opt_strs+1139)
151 /** The compiled in default value for the agentXSocket option argument */
152 #define AGENTXSOCKET_DFT_ARG   (ntpsnmpd_opt_strs+1152)
153 /** Compiled in flag settings for the agentXSocket option */
154 #define AGENTXSOCKET_FLAGS     (OPTST_DISABLED \
155         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
156 
157 /*
158  *  Help/More_Help/Version option descriptions:
159  */
160 #define HELP_DESC       (ntpsnmpd_opt_strs+1176)
161 #define HELP_name       (ntpsnmpd_opt_strs+1220)
162 #ifdef HAVE_WORKING_FORK
163 #define MORE_HELP_DESC  (ntpsnmpd_opt_strs+1225)
164 #define MORE_HELP_name  (ntpsnmpd_opt_strs+1270)
165 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
166 #else
167 #define MORE_HELP_DESC  HELP_DESC
168 #define MORE_HELP_name  HELP_name
169 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
170 #endif
171 #ifdef NO_OPTIONAL_OPT_ARGS
172 #  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
173 #else
174 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
175                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
176 #endif
177 #define VER_DESC        (ntpsnmpd_opt_strs+1280)
178 #define VER_name        (ntpsnmpd_opt_strs+1316)
179 #define SAVE_OPTS_DESC  (ntpsnmpd_opt_strs+1324)
180 #define SAVE_OPTS_name  (ntpsnmpd_opt_strs+1363)
181 #define LOAD_OPTS_DESC     (ntpsnmpd_opt_strs+1373)
182 #define LOAD_OPTS_NAME     (ntpsnmpd_opt_strs+1405)
183 #define NO_LOAD_OPTS_name  (ntpsnmpd_opt_strs+1415)
184 #define LOAD_OPTS_pfx      (ntpsnmpd_opt_strs+1428)
185 #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
186 /**
187  *  Declare option callback procedures
188  */
189 extern tOptProc
190     ntpOptionPrintVersion, optionBooleanVal,      optionNestedVal,
191     optionNumericVal,      optionPagedUsage,      optionResetOpt,
192     optionStackArg,        optionTimeDate,        optionTimeVal,
193     optionUnstackArg,      optionVendorOption;
194 static tOptProc
195     doUsageOpt;
196 #define VER_PROC        ntpOptionPrintVersion
197 
198 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
199 /**
200  *  Define the ntpsnmpd Option Descriptions.
201  * This is an array of OPTION_CT entries, one for each
202  * option that the ntpsnmpd program responds to.
203  */
204 static tOptDesc optDesc[OPTION_CT] = {
205   {  /* entry idx, value */ 0, VALUE_OPT_NOFORK,
206      /* equiv idx, value */ 0, VALUE_OPT_NOFORK,
207      /* equivalenced to  */ NO_EQUIVALENT,
208      /* min, max, act ct */ 0, 1, 0,
209      /* opt state flags  */ NOFORK_FLAGS, 0,
210      /* last opt argumnt */ { NULL }, /* --nofork */
211      /* arg list/cookie  */ NULL,
212      /* must/cannot opts */ NULL, NULL,
213      /* option proc      */ NULL,
214      /* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name,
215      /* disablement strs */ NULL, NULL },
216 
217   {  /* entry idx, value */ 1, VALUE_OPT_SYSLOG,
218      /* equiv idx, value */ 1, VALUE_OPT_SYSLOG,
219      /* equivalenced to  */ NO_EQUIVALENT,
220      /* min, max, act ct */ 0, 1, 0,
221      /* opt state flags  */ SYSLOG_FLAGS, 0,
222      /* last opt argumnt */ { NULL }, /* --syslog */
223      /* arg list/cookie  */ NULL,
224      /* must/cannot opts */ NULL, NULL,
225      /* option proc      */ NULL,
226      /* desc, NAME, name */ SYSLOG_DESC, SYSLOG_NAME, SYSLOG_name,
227      /* disablement strs */ NULL, NULL },
228 
229   {  /* entry idx, value */ 2, VALUE_OPT_AGENTXSOCKET,
230      /* equiv idx, value */ 2, VALUE_OPT_AGENTXSOCKET,
231      /* equivalenced to  */ NO_EQUIVALENT,
232      /* min, max, act ct */ 0, 1, 0,
233      /* opt state flags  */ AGENTXSOCKET_FLAGS, 0,
234      /* last opt argumnt */ { AGENTXSOCKET_DFT_ARG },
235      /* arg list/cookie  */ NULL,
236      /* must/cannot opts */ NULL, NULL,
237      /* option proc      */ NULL,
238      /* desc, NAME, name */ AGENTXSOCKET_DESC, AGENTXSOCKET_NAME, AGENTXSOCKET_name,
239      /* disablement strs */ NULL, NULL },
240 
241   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
242      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_VERSION,
243      /* equivalenced to  */ NO_EQUIVALENT,
244      /* min, max, act ct */ 0, 1, 0,
245      /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
246      /* last opt argumnt */ { NULL },
247      /* arg list/cookie  */ NULL,
248      /* must/cannot opts */ NULL, NULL,
249      /* option proc      */ VER_PROC,
250      /* desc, NAME, name */ VER_DESC, NULL, VER_name,
251      /* disablement strs */ NULL, NULL },
252 
253 
254 
255   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
256      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_HELP,
257      /* equivalenced to  */ NO_EQUIVALENT,
258      /* min, max, act ct */ 0, 1, 0,
259      /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
260      /* last opt argumnt */ { NULL },
261      /* arg list/cookie  */ NULL,
262      /* must/cannot opts */ NULL, NULL,
263      /* option proc      */ doUsageOpt,
264      /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
265      /* disablement strs */ NULL, NULL },
266 
267   {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
268      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
269      /* equivalenced to  */ NO_EQUIVALENT,
270      /* min, max, act ct */ 0, 1, 0,
271      /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
272      /* last opt argumnt */ { NULL },
273      /* arg list/cookie  */ NULL,
274      /* must/cannot opts */ NULL,  NULL,
275      /* option proc      */ optionPagedUsage,
276      /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
277      /* disablement strs */ NULL, NULL },
278 
279   {  /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
280      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
281      /* equivalenced to  */ NO_EQUIVALENT,
282      /* min, max, act ct */ 0, 1, 0,
283      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
284                        | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
285      /* last opt argumnt */ { NULL },
286      /* arg list/cookie  */ NULL,
287      /* must/cannot opts */ NULL,  NULL,
288      /* option proc      */ NULL,
289      /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
290      /* disablement strs */ NULL, NULL },
291 
292   {  /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
293      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
294      /* equivalenced to  */ NO_EQUIVALENT,
295      /* min, max, act ct */ 0, NOLIMIT, 0,
296      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
297 			  | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
298      /* last opt argumnt */ { NULL },
299      /* arg list/cookie  */ NULL,
300      /* must/cannot opts */ NULL, NULL,
301      /* option proc      */ optionLoadOpt,
302      /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
303      /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
304 };
305 
306 
307 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
308 /** Reference to the upper cased version of ntpsnmpd. */
309 #define zPROGNAME       (ntpsnmpd_opt_strs+1431)
310 /** Reference to the title line for ntpsnmpd usage. */
311 #define zUsageTitle     (ntpsnmpd_opt_strs+1440)
312 /** ntpsnmpd configuration file name. */
313 #define zRcName         (ntpsnmpd_opt_strs+1552)
314 /** Directories to search for ntpsnmpd config files. */
315 static char const * const apzHomeList[3] = {
316     ntpsnmpd_opt_strs+1544,
317     ntpsnmpd_opt_strs+1550,
318     NULL };
319 /** The ntpsnmpd program bug email address. */
320 #define zBugsAddr       (ntpsnmpd_opt_strs+1559)
321 /** Clarification/explanation of what ntpsnmpd does. */
322 #define zExplain        (ntpsnmpd_opt_strs+1594)
323 /** Extra detail explaining what ntpsnmpd does. */
324 #define zDetail         (NULL)
325 /** The full version string for ntpsnmpd. */
326 #define zFullVersion    (ntpsnmpd_opt_strs+1596)
327 /* extracted from optcode.tlib near line 342 */
328 
329 #if defined(ENABLE_NLS)
330 # define OPTPROC_BASE OPTPROC_TRANSLATE
331   static tOptionXlateProc translate_option_strings;
332 #else
333 # define OPTPROC_BASE OPTPROC_NONE
334 # define translate_option_strings NULL
335 #endif /* ENABLE_NLS */
336 
337 #define ntpsnmpd_full_usage (NULL)
338 #define ntpsnmpd_short_usage (NULL)
339 
340 #endif /* not defined __doxygen__ */
341 
342 /*
343  *  Create the static procedure(s) declared above.
344  */
345 /**
346  * The callout function that invokes the optionUsage function.
347  *
348  * @param[in] opts the AutoOpts option description structure
349  * @param[in] od   the descriptor for the "help" (usage) option.
350  * @noreturn
351  */
352 static void
353 doUsageOpt(tOptions * opts, tOptDesc * od)
354 {
355     int ex_code;
356     ex_code = NTPSNMPD_EXIT_SUCCESS;
357     optionUsage(&ntpsnmpdOptions, ex_code);
358     /* NOTREACHED */
359     exit(NTPSNMPD_EXIT_FAILURE);
360     (void)opts;
361     (void)od;
362 }
363 /* extracted from optmain.tlib near line 1250 */
364 
365 /**
366  * The directory containing the data associated with ntpsnmpd.
367  */
368 #ifndef  PKGDATADIR
369 # define PKGDATADIR ""
370 #endif
371 
372 /**
373  * Information about the person or institution that packaged ntpsnmpd
374  * for the current distribution.
375  */
376 #ifndef  WITH_PACKAGER
377 # define ntpsnmpd_packager_info NULL
378 #else
379 /** Packager information for ntpsnmpd. */
380 static char const ntpsnmpd_packager_info[] =
381     "Packaged by " WITH_PACKAGER
382 
383 # ifdef WITH_PACKAGER_VERSION
384         " ("WITH_PACKAGER_VERSION")"
385 # endif
386 
387 # ifdef WITH_PACKAGER_BUG_REPORTS
388     "\nReport ntpsnmpd bugs to " WITH_PACKAGER_BUG_REPORTS
389 # endif
390     "\n";
391 #endif
392 #ifndef __doxygen__
393 
394 #endif /* __doxygen__ */
395 /**
396  * The option definitions for ntpsnmpd.  The one structure that
397  * binds them all.
398  */
399 tOptions ntpsnmpdOptions = {
400     OPTIONS_STRUCT_VERSION,
401     0, NULL,                    /* original argc + argv    */
402     ( OPTPROC_BASE
403     + OPTPROC_ERRSTOP
404     + OPTPROC_SHORTOPT
405     + OPTPROC_LONGOPT
406     + OPTPROC_NO_REQ_OPT
407     + OPTPROC_ENVIRON
408     + OPTPROC_NO_ARGS
409     + OPTPROC_MISUSE ),
410     0, NULL,                    /* current option index, current option */
411     NULL,         NULL,         zPROGNAME,
412     zRcName,      zCopyright,   zLicenseDescrip,
413     zFullVersion, apzHomeList,  zUsageTitle,
414     zExplain,     zDetail,      optDesc,
415     zBugsAddr,                  /* address to send bugs to */
416     NULL, NULL,                 /* extensions/saved state  */
417     optionUsage, /* usage procedure */
418     translate_option_strings,   /* translation procedure */
419     /*
420      *  Indexes to special options
421      */
422     { INDEX_OPT_MORE_HELP, /* more-help option index */
423       INDEX_OPT_SAVE_OPTS, /* save option index */
424       NO_EQUIVALENT, /* '-#' option index */
425       NO_EQUIVALENT /* index of default opt */
426     },
427     8 /* full option count */, 3 /* user option count */,
428     ntpsnmpd_full_usage, ntpsnmpd_short_usage,
429     NULL, NULL,
430     PKGDATADIR, ntpsnmpd_packager_info
431 };
432 
433 #if ENABLE_NLS
434 /**
435  * This code is designed to translate translatable option text for the
436  * ntpsnmpd program.  These translations happen upon entry
437  * to optionProcess().
438  */
439 #include <stdio.h>
440 #include <stdlib.h>
441 #include <string.h>
442 #include <unistd.h>
443 #ifdef HAVE_DCGETTEXT
444 # include <gettext.h>
445 #endif
446 #include <autoopts/usage-txt.h>
447 
448 static char * AO_gettext(char const * pz);
449 static void   coerce_it(void ** s);
450 
451 /**
452  * AutoGen specific wrapper function for gettext.  It relies on the macro _()
453  * to convert from English to the target language, then strdup-duplicates the
454  * result string.  It tries the "libopts" domain first, then whatever has been
455  * set via the \a textdomain(3) call.
456  *
457  * @param[in] pz the input text used as a lookup key.
458  * @returns the translated text (if there is one),
459  *   or the original text (if not).
460  */
461 static char *
462 AO_gettext(char const * pz)
463 {
464     char * res;
465     if (pz == NULL)
466         return NULL;
467 #ifdef HAVE_DCGETTEXT
468     /*
469      * While processing the option_xlateable_txt data, try to use the
470      * "libopts" domain.  Once we switch to the option descriptor data,
471      * do *not* use that domain.
472      */
473     if (option_xlateable_txt.field_ct != 0) {
474         res = dgettext("libopts", pz);
475         if (res == pz)
476             res = (char *)VOIDP(_(pz));
477     } else
478         res = (char *)VOIDP(_(pz));
479 #else
480     res = (char *)VOIDP(_(pz));
481 #endif
482     if (res == pz)
483         return res;
484     res = strdup(res);
485     if (res == NULL) {
486         fputs(_("No memory for duping translated strings\n"), stderr);
487         exit(NTPSNMPD_EXIT_FAILURE);
488     }
489     return res;
490 }
491 
492 /**
493  * All the pointers we use are marked "* const", but they are stored in
494  * writable memory.  Coerce the mutability and set the pointer.
495  */
496 static void coerce_it(void ** s) { *s = AO_gettext(*s);
497 }
498 
499 /**
500  * Translate all the translatable strings in the ntpsnmpdOptions
501  * structure defined above.  This is done only once.
502  */
503 static void
504 translate_option_strings(void)
505 {
506     tOptions * const opts = &ntpsnmpdOptions;
507 
508     /*
509      *  Guard against re-translation.  It won't work.  The strings will have
510      *  been changed by the first pass through this code.  One shot only.
511      */
512     if (option_xlateable_txt.field_ct != 0) {
513         /*
514          *  Do the translations.  The first pointer follows the field count
515          *  field.  The field count field is the size of a pointer.
516          */
517         char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
518         int     ix  = option_xlateable_txt.field_ct;
519 
520         do {
521             ppz++; /* skip over field_ct */
522             *ppz = AO_gettext(*ppz);
523         } while (--ix > 0);
524         /* prevent re-translation and disable "libopts" domain lookup */
525         option_xlateable_txt.field_ct = 0;
526 
527         coerce_it(VOIDP(&(opts->pzCopyright)));
528         coerce_it(VOIDP(&(opts->pzCopyNotice)));
529         coerce_it(VOIDP(&(opts->pzFullVersion)));
530         coerce_it(VOIDP(&(opts->pzUsageTitle)));
531         coerce_it(VOIDP(&(opts->pzExplain)));
532         coerce_it(VOIDP(&(opts->pzDetail)));
533         {
534             tOptDesc * od = opts->pOptDesc;
535             for (ix = opts->optCt; ix > 0; ix--, od++)
536                 coerce_it(VOIDP(&(od->pzText)));
537         }
538     }
539 }
540 #endif /* ENABLE_NLS */
541 
542 #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
543 /** I18N function strictly for xgettext.  Do not compile. */
544 static void bogus_function(void) {
545   /* TRANSLATORS:
546 
547      The following dummy function was crated solely so that xgettext can
548      extract the correct strings.  These strings are actually referenced
549      by a field name in the ntpsnmpdOptions structure noted in the
550      comments below.  The literal text is defined in ntpsnmpd_opt_strs.
551 
552      NOTE: the strings below are segmented with respect to the source string
553      ntpsnmpd_opt_strs.  The strings above are handed off for translation
554      at run time a paragraph at a time.  Consequently, they are presented here
555      for translation a paragraph at a time.
556 
557      ALSO: often the description for an option will reference another option
558      by name.  These are set off with apostrophe quotes (I hope).  Do not
559      translate option names.
560    */
561   /* referenced via ntpsnmpdOptions.pzCopyright */
562   puts(_("ntpsnmpd 4.2.8p17\n\
563 Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\
564 This is free software. It is licensed for use, modification and\n\
565 redistribution under the terms of the NTP License, copies of which\n\
566 can be seen at:\n"));
567   puts(_("  <http://ntp.org/license>\n\
568   <http://opensource.org/licenses/ntp-license.php>\n"));
569 
570   /* referenced via ntpsnmpdOptions.pzCopyNotice */
571   puts(_("Permission to use, copy, modify, and distribute this software and its\n\
572 documentation for any purpose with or without fee is hereby granted,\n\
573 provided that the above copyright notice appears in all copies and that\n\
574 both the copyright notice and this permission notice appear in supporting\n\
575 documentation, and that the name The University of Delaware not be used in\n\
576 advertising or publicity pertaining to distribution of the software without\n\
577 specific, written prior permission.  The University of Delaware and Network\n\
578 Time Foundation makes no representations about the suitability this\n\
579 software for any purpose.  It is provided \"as is\" without express or\n\
580 implied warranty.\n"));
581 
582   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
583   puts(_("Do not fork"));
584 
585   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
586   puts(_("Log to syslog()"));
587 
588   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
589   puts(_("The socket address ntpsnmpd uses to connect to net-snmpd"));
590 
591   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
592   puts(_("display extended usage information and exit"));
593 
594   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
595   puts(_("extended usage information passed thru pager"));
596 
597   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
598   puts(_("output version information and exit"));
599 
600   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
601   puts(_("save the option state to a config file"));
602 
603   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
604   puts(_("load options from a config file"));
605 
606   /* referenced via ntpsnmpdOptions.pzUsageTitle */
607   puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p17\n\
608 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
609 
610   /* referenced via ntpsnmpdOptions.pzExplain */
611   puts(_("\n"));
612 
613   /* referenced via ntpsnmpdOptions.pzFullVersion */
614   puts(_("ntpsnmpd 4.2.8p17"));
615 
616   /* referenced via ntpsnmpdOptions.pzFullUsage */
617   puts(_("<<<NOT-FOUND>>>"));
618 
619   /* referenced via ntpsnmpdOptions.pzShortUsage */
620   puts(_("<<<NOT-FOUND>>>"));
621   /* LIBOPTS-MESSAGES: */
622 #line 67 "../autoopts.c"
623   puts(_("allocation of %d bytes failed\n"));
624 #line 89 "../autoopts.c"
625   puts(_("allocation of %d bytes failed\n"));
626 #line 48 "../init.c"
627   puts(_("AutoOpts function called without option descriptor\n"));
628 #line 81 "../init.c"
629   puts(_("\tThis exceeds the compiled library version:  "));
630 #line 79 "../init.c"
631   puts(_("Automated Options Processing Error!\n"
632        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
633 #line 78 "../autoopts.c"
634   puts(_("realloc of %d bytes at 0x%p failed\n"));
635 #line 83 "../init.c"
636   puts(_("\tThis is less than the minimum library version:  "));
637 #line 121 "../version.c"
638   puts(_("Automated Options version %s\n"
639        "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
640 #line 49 "../makeshell.c"
641   puts(_("(AutoOpts bug):  %s.\n"));
642 #line 90 "../reset.c"
643   puts(_("optionResetOpt() called, but reset-option not configured"));
644 #line 241 "../usage.c"
645   puts(_("could not locate the 'help' option"));
646 #line 330 "../autoopts.c"
647   puts(_("optionProcess() was called with invalid data"));
648 #line 697 "../usage.c"
649   puts(_("invalid argument type specified"));
650 #line 568 "../find.c"
651   puts(_("defaulted to option with optional arg"));
652 #line 76 "../alias.c"
653   puts(_("aliasing option is out of range."));
654 #line 210 "../enum.c"
655   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
656 #line 78 "../find.c"
657   puts(_("  The following options match:\n"));
658 #line 263 "../find.c"
659   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
660 #line 161 "../check.c"
661   puts(_("%s: Command line arguments required\n"));
662 #line 43 "../alias.c"
663   puts(_("%d %s%s options allowed\n"));
664 #line 56 "../makeshell.c"
665   puts(_("%s error %d (%s) calling %s for '%s'\n"));
666 #line 268 "../makeshell.c"
667   puts(_("interprocess pipe"));
668 #line 171 "../version.c"
669   puts(_("error: version option argument '%c' invalid.  Use:\n"
670        "\t'v' - version only\n"
671        "\t'c' - version and copyright\n"
672        "\t'n' - version and full copyright notice\n"));
673 #line 58 "../check.c"
674   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
675 #line 187 "../find.c"
676   puts(_("%s: The '%s' option has been disabled."));
677 #line 400 "../find.c"
678   puts(_("%s: The '%s' option has been disabled."));
679 #line 38 "../alias.c"
680   puts(_("-equivalence"));
681 #line 439 "../find.c"
682   puts(_("%s: illegal option -- %c\n"));
683 #line 110 "../reset.c"
684   puts(_("%s: illegal option -- %c\n"));
685 #line 241 "../find.c"
686   puts(_("%s: illegal option -- %s\n"));
687 #line 740 "../find.c"
688   puts(_("%s: illegal option -- %s\n"));
689 #line 118 "../reset.c"
690   puts(_("%s: illegal option -- %s\n"));
691 #line 305 "../find.c"
692   puts(_("%s: unknown vendor extension option -- %s\n"));
693 #line 135 "../enum.c"
694   puts(_("  or an integer from %d through %d\n"));
695 #line 145 "../enum.c"
696   puts(_("  or an integer from %d through %d\n"));
697 #line 696 "../usage.c"
698   puts(_("%s error:  invalid option descriptor for %s\n"));
699 #line 1030 "../usage.c"
700   puts(_("%s error:  invalid option descriptor for %s\n"));
701 #line 355 "../find.c"
702   puts(_("%s: invalid option name: %s\n"));
703 #line 497 "../find.c"
704   puts(_("%s: The '%s' option requires an argument.\n"));
705 #line 150 "../autoopts.c"
706   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
707        "\t'%s' and '%s'."));
708 #line 94 "../check.c"
709   puts(_("%s error:  The %s option is required\n"));
710 #line 602 "../find.c"
711   puts(_("%s: The '%s' option cannot have an argument.\n"));
712 #line 151 "../check.c"
713   puts(_("%s: Command line arguments are not allowed.\n"));
714 #line 568 "../save.c"
715   puts(_("error %d (%s) creating %s\n"));
716 #line 210 "../enum.c"
717   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
718 #line 93 "../reset.c"
719   puts(_("%s error: The '%s' option requires an argument.\n"));
720 #line 122 "../save.c"
721   puts(_("error %d (%s) stat-ing %s\n"));
722 #line 175 "../save.c"
723   puts(_("error %d (%s) stat-ing %s\n"));
724 #line 143 "../restore.c"
725   puts(_("%s error: no saved option state\n"));
726 #line 225 "../autoopts.c"
727   puts(_("'%s' is not a command line option.\n"));
728 #line 113 "../time.c"
729   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
730 #line 50 "../time.c"
731   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
732 #line 92 "../check.c"
733   puts(_("%s error:  The %s option must appear %d times.\n"));
734 #line 165 "../numeric.c"
735   puts(_("%s error:  '%s' is not a recognizable number.\n"));
736 #line 176 "../enum.c"
737   puts(_("%s error:  %s exceeds %s keyword count\n"));
738 #line 279 "../usage.c"
739   puts(_("Try '%s %s' for more information.\n"));
740 #line 45 "../alias.c"
741   puts(_("one %s%s option allowed\n"));
742 #line 170 "../makeshell.c"
743   puts(_("standard output"));
744 #line 905 "../makeshell.c"
745   puts(_("standard output"));
746 #line 223 "../usage.c"
747   puts(_("standard output"));
748 #line 364 "../usage.c"
749   puts(_("standard output"));
750 #line 574 "../usage.c"
751   puts(_("standard output"));
752 #line 178 "../version.c"
753   puts(_("standard output"));
754 #line 223 "../usage.c"
755   puts(_("standard error"));
756 #line 364 "../usage.c"
757   puts(_("standard error"));
758 #line 574 "../usage.c"
759   puts(_("standard error"));
760 #line 178 "../version.c"
761   puts(_("standard error"));
762 #line 170 "../makeshell.c"
763   puts(_("write"));
764 #line 905 "../makeshell.c"
765   puts(_("write"));
766 #line 222 "../usage.c"
767   puts(_("write"));
768 #line 363 "../usage.c"
769   puts(_("write"));
770 #line 573 "../usage.c"
771   puts(_("write"));
772 #line 177 "../version.c"
773   puts(_("write"));
774 #line 60 "../numeric.c"
775   puts(_("%s error:  %s option value %ld is out of range.\n"));
776 #line 44 "../check.c"
777   puts(_("%s error:  %s option requires the %s option\n"));
778 #line 121 "../save.c"
779   puts(_("%s warning:  cannot save options - %s not regular file\n"));
780 #line 174 "../save.c"
781   puts(_("%s warning:  cannot save options - %s not regular file\n"));
782 #line 193 "../save.c"
783   puts(_("%s warning:  cannot save options - %s not regular file\n"));
784 #line 567 "../save.c"
785   puts(_("%s warning:  cannot save options - %s not regular file\n"));
786   /* END-LIBOPTS-MESSAGES */
787 
788   /* USAGE-TEXT: */
789 #line 822 "../usage.c"
790   puts(_("\t\t\t\t- an alternate for '%s'\n"));
791 #line 1097 "../usage.c"
792   puts(_("Version, usage and configuration options:"));
793 #line 873 "../usage.c"
794   puts(_("\t\t\t\t- default option for unnamed options\n"));
795 #line 786 "../usage.c"
796   puts(_("\t\t\t\t- disabled as '--%s'\n"));
797 #line 1066 "../usage.c"
798   puts(_(" --- %-14s %s\n"));
799 #line 1064 "../usage.c"
800   puts(_("This option has been disabled"));
801 #line 813 "../usage.c"
802   puts(_("\t\t\t\t- enabled by default\n"));
803 #line 40 "../alias.c"
804   puts(_("%s error:  only "));
805 #line 1143 "../usage.c"
806   puts(_(" - examining environment variables named %s_*\n"));
807 #line 168 "../file.c"
808   puts(_("\t\t\t\t- file must not pre-exist\n"));
809 #line 172 "../file.c"
810   puts(_("\t\t\t\t- file must pre-exist\n"));
811 #line 329 "../usage.c"
812   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
813        "hyphen and the flag character.\n"));
814 #line 882 "../makeshell.c"
815   puts(_("\n"
816        "= = = = = = = =\n\n"
817        "This incarnation of genshell will produce\n"
818        "a shell script to parse the options for %s:\n\n"));
819 #line 142 "../enum.c"
820   puts(_("  or an integer mask with any of the lower %d bits set\n"));
821 #line 846 "../usage.c"
822   puts(_("\t\t\t\t- is a set membership option\n"));
823 #line 867 "../usage.c"
824   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
825 #line 331 "../usage.c"
826   puts(_("Options are specified by single or double hyphens and their name.\n"));
827 #line 853 "../usage.c"
828   puts(_("\t\t\t\t- may appear multiple times\n"));
829 #line 840 "../usage.c"
830   puts(_("\t\t\t\t- may not be preset\n"));
831 #line 1258 "../usage.c"
832   puts(_("   Arg Option-Name    Description\n"));
833 #line 1194 "../usage.c"
834   puts(_("  Flg Arg Option-Name    Description\n"));
835 #line 1252 "../usage.c"
836   puts(_("  Flg Arg Option-Name    Description\n"));
837 #line 1253 "../usage.c"
838   puts(_(" %3s %s"));
839 #line 1259 "../usage.c"
840   puts(_(" %3s %s"));
841 #line 336 "../usage.c"
842   puts(_("The '-#<number>' option may omit the hash char\n"));
843 #line 332 "../usage.c"
844   puts(_("All arguments are named options.\n"));
845 #line 920 "../usage.c"
846   puts(_(" - reading file %s"));
847 #line 358 "../usage.c"
848   puts(_("\n"
849        "Please send bug reports to:  <%s>\n"));
850 #line 100 "../version.c"
851   puts(_("\n"
852        "Please send bug reports to:  <%s>\n"));
853 #line 129 "../version.c"
854   puts(_("\n"
855        "Please send bug reports to:  <%s>\n"));
856 #line 852 "../usage.c"
857   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
858 #line 893 "../usage.c"
859   puts(_("\n"
860        "The following option preset mechanisms are supported:\n"));
861 #line 1141 "../usage.c"
862   puts(_("\n"
863        "The following option preset mechanisms are supported:\n"));
864 #line 631 "../usage.c"
865   puts(_("prohibits these options:\n"));
866 #line 626 "../usage.c"
867   puts(_("prohibits the option '%s'\n"));
868 #line 81 "../numeric.c"
869   puts(_("%s%ld to %ld"));
870 #line 79 "../numeric.c"
871   puts(_("%sgreater than or equal to %ld"));
872 #line 75 "../numeric.c"
873   puts(_("%s%ld exactly"));
874 #line 68 "../numeric.c"
875   puts(_("%sit must lie in one of the ranges:\n"));
876 #line 68 "../numeric.c"
877   puts(_("%sit must be in the range:\n"));
878 #line 88 "../numeric.c"
879   puts(_(", or\n"));
880 #line 66 "../numeric.c"
881   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
882 #line 77 "../numeric.c"
883   puts(_("%sless than or equal to %ld"));
884 #line 339 "../usage.c"
885   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
886 #line 601 "../usage.c"
887   puts(_("requires the option '%s'\n"));
888 #line 604 "../usage.c"
889   puts(_("requires these options:\n"));
890 #line 1270 "../usage.c"
891   puts(_("   Arg Option-Name   Req?  Description\n"));
892 #line 1264 "../usage.c"
893   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
894 #line 143 "../enum.c"
895   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
896        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
897        "will set them all.  Multiple entries may be passed as an option\n"
898        "argument list.\n"));
899 #line 859 "../usage.c"
900   puts(_("\t\t\t\t- may appear up to %d times\n"));
901 #line 52 "../enum.c"
902   puts(_("The valid \"%s\" option keywords are:\n"));
903 #line 1101 "../usage.c"
904   puts(_("The next option supports vendor supported extra options:"));
905 #line 722 "../usage.c"
906   puts(_("These additional options are:"));
907   /* END-USAGE-TEXT */
908 }
909 #endif /* uncompilable code */
910 #ifdef  __cplusplus
911 }
912 #endif
913 /* ntpsnmpd-opts.c ends here */
914