Home | History | Annotate | Line # | Download | only in ntpq
      1 /*	$NetBSD: ntpq-opts.c,v 1.15 2024/08/18 20:47:19 christos Exp $	*/
      2 
      3 /*
      4  *  EDIT THIS FILE WITH CAUTION  (ntpq-opts.c)
      5  *
      6  *  It has been AutoGen-ed  May 25, 2024 at 12:04:21 AM by AutoGen 5.18.16
      7  *  From the definitions    ntpq-opts.def
      8  *  and the template file   options
      9  *
     10  * Generated from AutoOpts 42:1:17 templates.
     11  *
     12  *  AutoOpts is a copyrighted work.  This source file is not encumbered
     13  *  by AutoOpts licensing, but is provided under the licensing terms chosen
     14  *  by the ntpq author or copyright holder.  AutoOpts is
     15  *  licensed under the terms of the LGPL.  The redistributable library
     16  *  (``libopts'') is licensed under the terms of either the LGPL or, at the
     17  *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
     18  *  for details.
     19  *
     20  * The ntpq program is copyrighted and licensed
     21  * under the following terms:
     22  *
     23  *  Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.
     24  *  This is free software. It is licensed for use, modification and
     25  *  redistribution under the terms of the NTP License, copies of which
     26  *  can be seen at:
     27  *    <http://ntp.org/license>
     28  *    <http://opensource.org/licenses/ntp-license.php>
     29  *
     30  *  Permission to use, copy, modify, and distribute this software and its
     31  *  documentation for any purpose with or without fee is hereby granted,
     32  *  provided that the above copyright notice appears in all copies and that
     33  *  both the copyright notice and this permission notice appear in
     34  *  supporting documentation, and that the name The University of Delaware not be used in
     35  *  advertising or publicity pertaining to distribution of the software
     36  *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
     37  *  representations about the suitability this software for any purpose. It
     38  *  is provided "as is" without express or implied warranty.
     39  */
     40 
     41 #ifndef __doxygen__
     42 #define OPTION_CODE_COMPILE 1
     43 #include "ntpq-opts.h"
     44 #include <sys/types.h>
     45 #include <sys/stat.h>
     46 
     47 #include <errno.h>
     48 #include <fcntl.h>
     49 #include <limits.h>
     50 #include <stdio.h>
     51 #include <stdlib.h>
     52 #include <string.h>
     53 #include <unistd.h>
     54 
     55 #ifdef  __cplusplus
     56 extern "C" {
     57 #endif
     58 extern FILE * option_usage_fp;
     59 #define zCopyright      (ntpq_opt_strs+0)
     60 #define zLicenseDescrip (ntpq_opt_strs+341)
     61 
     62 /*
     63  *  global included definitions
     64  */
     65 #ifdef __windows
     66   extern int atoi(const char*);
     67 #else
     68 # include <stdlib.h>
     69 #endif
     70 
     71 #ifndef NULL
     72 #  define NULL 0
     73 #endif
     74 
     75 /**
     76  *  static const strings for ntpq options
     77  */
     78 static char const ntpq_opt_strs[2068] =
     79 /*     0 */ "ntpq 4.2.8p18\n"
     80             "Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n"
     81             "This is free software. It is licensed for use, modification and\n"
     82             "redistribution under the terms of the NTP License, copies of which\n"
     83             "can be seen at:\n"
     84             "  <http://ntp.org/license>\n"
     85             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
     86 /*   341 */ "Permission to use, copy, modify, and distribute this software and its\n"
     87             "documentation for any purpose with or without fee is hereby granted,\n"
     88             "provided that the above copyright notice appears in all copies and that\n"
     89             "both the copyright notice and this permission notice appear in supporting\n"
     90             "documentation, and that the name The University of Delaware not be used in\n"
     91             "advertising or publicity pertaining to distribution of the software without\n"
     92             "specific, written prior permission.  The University of Delaware and Network\n"
     93             "Time Foundation makes no representations about the suitability this\n"
     94             "software for any purpose.  It is provided \"as is\" without express or\n"
     95             "implied warranty.\n\0"
     96 /*  1009 */ "Force IPv4 name resolution\0"
     97 /*  1036 */ "IPV4\0"
     98 /*  1041 */ "ipv4\0"
     99 /*  1046 */ "Force IPv6 name resolution\0"
    100 /*  1073 */ "IPV6\0"
    101 /*  1078 */ "ipv6\0"
    102 /*  1083 */ "run a command and exit\0"
    103 /*  1106 */ "COMMAND\0"
    104 /*  1114 */ "command\0"
    105 /*  1122 */ "Increase debug verbosity level\0"
    106 /*  1153 */ "DEBUG_LEVEL\0"
    107 /*  1165 */ "debug-level\0"
    108 /*  1177 */ "Set the debug verbosity level\0"
    109 /*  1207 */ "SET_DEBUG_LEVEL\0"
    110 /*  1223 */ "set-debug-level\0"
    111 /*  1239 */ "Force ntpq to operate in interactive mode\0"
    112 /*  1281 */ "INTERACTIVE\0"
    113 /*  1293 */ "interactive\0"
    114 /*  1305 */ "numeric host addresses\0"
    115 /*  1328 */ "NUMERIC\0"
    116 /*  1336 */ "numeric\0"
    117 /*  1344 */ "Always output status line with readvar\0"
    118 /*  1383 */ "OLD_RV\0"
    119 /*  1390 */ "old-rv\0"
    120 /*  1397 */ "Print a list of the peers\0"
    121 /*  1423 */ "PEERS\0"
    122 /*  1429 */ "peers\0"
    123 /*  1435 */ "Set default display type for S2+ refids\0"
    124 /*  1475 */ "REFID\0"
    125 /*  1481 */ "refid\0"
    126 /*  1487 */ "Use unconnected UDP to communicate with ntpd (default on Windows)\0"
    127 /*  1553 */ "UNCONNECTED\0"
    128 /*  1565 */ "unconnected\0"
    129 /*  1577 */ "Display the full 'remote' value\0"
    130 /*  1609 */ "WIDE\0"
    131 /*  1614 */ "wide\0"
    132 /*  1619 */ "display extended usage information and exit\0"
    133 /*  1663 */ "help\0"
    134 /*  1668 */ "extended usage information passed thru pager\0"
    135 /*  1713 */ "more-help\0"
    136 /*  1723 */ "output version information and exit\0"
    137 /*  1759 */ "version\0"
    138 /*  1767 */ "save the option state to a config file\0"
    139 /*  1806 */ "save-opts\0"
    140 /*  1816 */ "load options from a config file\0"
    141 /*  1848 */ "LOAD_OPTS\0"
    142 /*  1858 */ "no-load-opts\0"
    143 /*  1871 */ "no\0"
    144 /*  1874 */ "NTPQ\0"
    145 /*  1879 */ "ntpq - standard NTP query program - Ver. 4.2.8p18\n"
    146             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
    147 /*  1999 */ "$HOME\0"
    148 /*  2005 */ ".\0"
    149 /*  2007 */ ".ntprc\0"
    150 /*  2014 */ "https://bugs.ntp.org, bugs (at) ntp.org\0"
    151 /*  2049 */ "ntpq 4.2.8p18\0"
    152 /*  2063 */ "hash";
    153 
    154 /**
    155  *  ipv4 option description with
    156  *  "Must also have options" and "Incompatible options":
    157  */
    158 /** Descriptive text for the ipv4 option */
    159 #define IPV4_DESC      (ntpq_opt_strs+1009)
    160 /** Upper-cased name for the ipv4 option */
    161 #define IPV4_NAME      (ntpq_opt_strs+1036)
    162 /** Name string for the ipv4 option */
    163 #define IPV4_name      (ntpq_opt_strs+1041)
    164 /** Other options that appear in conjunction with the ipv4 option */
    165 static int const aIpv4CantList[] = {
    166     INDEX_OPT_IPV6, NO_EQUIVALENT };
    167 /** Compiled in flag settings for the ipv4 option */
    168 #define IPV4_FLAGS     (OPTST_DISABLED)
    169 
    170 /**
    171  *  ipv6 option description with
    172  *  "Must also have options" and "Incompatible options":
    173  */
    174 /** Descriptive text for the ipv6 option */
    175 #define IPV6_DESC      (ntpq_opt_strs+1046)
    176 /** Upper-cased name for the ipv6 option */
    177 #define IPV6_NAME      (ntpq_opt_strs+1073)
    178 /** Name string for the ipv6 option */
    179 #define IPV6_name      (ntpq_opt_strs+1078)
    180 /** Other options that appear in conjunction with the ipv6 option */
    181 static int const aIpv6CantList[] = {
    182     INDEX_OPT_IPV4, NO_EQUIVALENT };
    183 /** Compiled in flag settings for the ipv6 option */
    184 #define IPV6_FLAGS     (OPTST_DISABLED)
    185 
    186 /**
    187  *  command option description:
    188  */
    189 /** Descriptive text for the command option */
    190 #define COMMAND_DESC      (ntpq_opt_strs+1083)
    191 /** Upper-cased name for the command option */
    192 #define COMMAND_NAME      (ntpq_opt_strs+1106)
    193 /** Name string for the command option */
    194 #define COMMAND_name      (ntpq_opt_strs+1114)
    195 /** Compiled in flag settings for the command option */
    196 #define COMMAND_FLAGS     (OPTST_DISABLED \
    197         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
    198 
    199 /**
    200  *  debug-level option description:
    201  */
    202 /** Descriptive text for the debug-level option */
    203 #define DEBUG_LEVEL_DESC      (ntpq_opt_strs+1122)
    204 /** Upper-cased name for the debug-level option */
    205 #define DEBUG_LEVEL_NAME      (ntpq_opt_strs+1153)
    206 /** Name string for the debug-level option */
    207 #define DEBUG_LEVEL_name      (ntpq_opt_strs+1165)
    208 /** Compiled in flag settings for the debug-level option */
    209 #define DEBUG_LEVEL_FLAGS     (OPTST_DISABLED)
    210 
    211 /**
    212  *  set-debug-level option description:
    213  */
    214 /** Descriptive text for the set-debug-level option */
    215 #define SET_DEBUG_LEVEL_DESC      (ntpq_opt_strs+1177)
    216 /** Upper-cased name for the set-debug-level option */
    217 #define SET_DEBUG_LEVEL_NAME      (ntpq_opt_strs+1207)
    218 /** Name string for the set-debug-level option */
    219 #define SET_DEBUG_LEVEL_name      (ntpq_opt_strs+1223)
    220 /** Compiled in flag settings for the set-debug-level option */
    221 #define SET_DEBUG_LEVEL_FLAGS     (OPTST_DISABLED \
    222         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
    223 
    224 /**
    225  *  interactive option description with
    226  *  "Must also have options" and "Incompatible options":
    227  */
    228 /** Descriptive text for the interactive option */
    229 #define INTERACTIVE_DESC      (ntpq_opt_strs+1239)
    230 /** Upper-cased name for the interactive option */
    231 #define INTERACTIVE_NAME      (ntpq_opt_strs+1281)
    232 /** Name string for the interactive option */
    233 #define INTERACTIVE_name      (ntpq_opt_strs+1293)
    234 /** Other options that appear in conjunction with the interactive option */
    235 static int const aInteractiveCantList[] = {
    236     INDEX_OPT_COMMAND,
    237     INDEX_OPT_PEERS, NO_EQUIVALENT };
    238 /** Compiled in flag settings for the interactive option */
    239 #define INTERACTIVE_FLAGS     (OPTST_DISABLED)
    240 
    241 /**
    242  *  numeric option description:
    243  */
    244 /** Descriptive text for the numeric option */
    245 #define NUMERIC_DESC      (ntpq_opt_strs+1305)
    246 /** Upper-cased name for the numeric option */
    247 #define NUMERIC_NAME      (ntpq_opt_strs+1328)
    248 /** Name string for the numeric option */
    249 #define NUMERIC_name      (ntpq_opt_strs+1336)
    250 /** Compiled in flag settings for the numeric option */
    251 #define NUMERIC_FLAGS     (OPTST_DISABLED)
    252 
    253 /**
    254  *  old-rv option description:
    255  */
    256 /** Descriptive text for the old-rv option */
    257 #define OLD_RV_DESC      (ntpq_opt_strs+1344)
    258 /** Upper-cased name for the old-rv option */
    259 #define OLD_RV_NAME      (ntpq_opt_strs+1383)
    260 /** Name string for the old-rv option */
    261 #define OLD_RV_name      (ntpq_opt_strs+1390)
    262 /** Compiled in flag settings for the old-rv option */
    263 #define OLD_RV_FLAGS     (OPTST_DISABLED)
    264 
    265 /**
    266  *  peers option description with
    267  *  "Must also have options" and "Incompatible options":
    268  */
    269 /** Descriptive text for the peers option */
    270 #define PEERS_DESC      (ntpq_opt_strs+1397)
    271 /** Upper-cased name for the peers option */
    272 #define PEERS_NAME      (ntpq_opt_strs+1423)
    273 /** Name string for the peers option */
    274 #define PEERS_name      (ntpq_opt_strs+1429)
    275 /** Other options that appear in conjunction with the peers option */
    276 static int const aPeersCantList[] = {
    277     INDEX_OPT_INTERACTIVE, NO_EQUIVALENT };
    278 /** Compiled in flag settings for the peers option */
    279 #define PEERS_FLAGS     (OPTST_DISABLED)
    280 
    281 /**
    282  *  refid option description:
    283  */
    284 /** Descriptive text for the refid option */
    285 #define REFID_DESC      (ntpq_opt_strs+1435)
    286 /** Upper-cased name for the refid option */
    287 #define REFID_NAME      (ntpq_opt_strs+1475)
    288 /** Name string for the refid option */
    289 #define REFID_name      (ntpq_opt_strs+1481)
    290 /** The compiled in default value for the refid option argument */
    291 #define REFID_DFT_ARG   ((char const*)REFID_IPV4)
    292 /** Compiled in flag settings for the refid option */
    293 #define REFID_FLAGS     (OPTST_DISABLED \
    294         | OPTST_SET_ARGTYPE(OPARG_TYPE_ENUMERATION))
    295 
    296 /**
    297  *  unconnected option description:
    298  */
    299 /** Descriptive text for the unconnected option */
    300 #define UNCONNECTED_DESC      (ntpq_opt_strs+1487)
    301 /** Upper-cased name for the unconnected option */
    302 #define UNCONNECTED_NAME      (ntpq_opt_strs+1553)
    303 /** Name string for the unconnected option */
    304 #define UNCONNECTED_name      (ntpq_opt_strs+1565)
    305 /** Compiled in flag settings for the unconnected option */
    306 #define UNCONNECTED_FLAGS     (OPTST_DISABLED)
    307 
    308 /**
    309  *  wide option description:
    310  */
    311 /** Descriptive text for the wide option */
    312 #define WIDE_DESC      (ntpq_opt_strs+1577)
    313 /** Upper-cased name for the wide option */
    314 #define WIDE_NAME      (ntpq_opt_strs+1609)
    315 /** Name string for the wide option */
    316 #define WIDE_name      (ntpq_opt_strs+1614)
    317 /** Compiled in flag settings for the wide option */
    318 #define WIDE_FLAGS     (OPTST_DISABLED)
    319 
    320 /*
    321  *  Help/More_Help/Version option descriptions:
    322  */
    323 #define HELP_DESC       (ntpq_opt_strs+1619)
    324 #define HELP_name       (ntpq_opt_strs+1663)
    325 #ifdef HAVE_WORKING_FORK
    326 #define MORE_HELP_DESC  (ntpq_opt_strs+1668)
    327 #define MORE_HELP_name  (ntpq_opt_strs+1713)
    328 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
    329 #else
    330 #define MORE_HELP_DESC  HELP_DESC
    331 #define MORE_HELP_name  HELP_name
    332 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
    333 #endif
    334 #ifdef NO_OPTIONAL_OPT_ARGS
    335 #  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
    336 #else
    337 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
    338                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
    339 #endif
    340 #define VER_DESC        (ntpq_opt_strs+1723)
    341 #define VER_name        (ntpq_opt_strs+1759)
    342 #define SAVE_OPTS_DESC  (ntpq_opt_strs+1767)
    343 #define SAVE_OPTS_name  (ntpq_opt_strs+1806)
    344 #define LOAD_OPTS_DESC     (ntpq_opt_strs+1816)
    345 #define LOAD_OPTS_NAME     (ntpq_opt_strs+1848)
    346 #define NO_LOAD_OPTS_name  (ntpq_opt_strs+1858)
    347 #define LOAD_OPTS_pfx      (ntpq_opt_strs+1871)
    348 #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
    349 /**
    350  *  Declare option callback procedures
    351  */
    352 extern tOptProc
    353     ntpOptionPrintVersion,   ntpq_custom_opt_handler, optionBooleanVal,
    354     optionNestedVal,         optionNumericVal,        optionPagedUsage,
    355     optionResetOpt,          optionStackArg,          optionTimeDate,
    356     optionTimeVal,           optionUnstackArg,        optionVendorOption;
    357 static tOptProc
    358     doOptDebug_Level, doOptRefid, doUsageOpt;
    359 #define VER_PROC        ntpOptionPrintVersion
    360 
    361 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    362 /**
    363  *  Define the ntpq Option Descriptions.
    364  * This is an array of OPTION_CT entries, one for each
    365  * option that the ntpq program responds to.
    366  */
    367 static tOptDesc optDesc[OPTION_CT] = {
    368   {  /* entry idx, value */ 0, VALUE_OPT_IPV4,
    369      /* equiv idx, value */ 0, VALUE_OPT_IPV4,
    370      /* equivalenced to  */ NO_EQUIVALENT,
    371      /* min, max, act ct */ 0, 1, 0,
    372      /* opt state flags  */ IPV4_FLAGS, 0,
    373      /* last opt argumnt */ { NULL }, /* --ipv4 */
    374      /* arg list/cookie  */ NULL,
    375      /* must/cannot opts */ NULL, aIpv4CantList,
    376      /* option proc      */ NULL,
    377      /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name,
    378      /* disablement strs */ NULL, NULL },
    379 
    380   {  /* entry idx, value */ 1, VALUE_OPT_IPV6,
    381      /* equiv idx, value */ 1, VALUE_OPT_IPV6,
    382      /* equivalenced to  */ NO_EQUIVALENT,
    383      /* min, max, act ct */ 0, 1, 0,
    384      /* opt state flags  */ IPV6_FLAGS, 0,
    385      /* last opt argumnt */ { NULL }, /* --ipv6 */
    386      /* arg list/cookie  */ NULL,
    387      /* must/cannot opts */ NULL, aIpv6CantList,
    388      /* option proc      */ NULL,
    389      /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name,
    390      /* disablement strs */ NULL, NULL },
    391 
    392   {  /* entry idx, value */ 2, VALUE_OPT_COMMAND,
    393      /* equiv idx, value */ 2, VALUE_OPT_COMMAND,
    394      /* equivalenced to  */ NO_EQUIVALENT,
    395      /* min, max, act ct */ 0, NOLIMIT, 0,
    396      /* opt state flags  */ COMMAND_FLAGS, 0,
    397      /* last opt argumnt */ { NULL }, /* --command */
    398      /* arg list/cookie  */ NULL,
    399      /* must/cannot opts */ NULL, NULL,
    400      /* option proc      */ ntpq_custom_opt_handler,
    401      /* desc, NAME, name */ COMMAND_DESC, COMMAND_NAME, COMMAND_name,
    402      /* disablement strs */ NULL, NULL },
    403 
    404   {  /* entry idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
    405      /* equiv idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
    406      /* equivalenced to  */ NO_EQUIVALENT,
    407      /* min, max, act ct */ 0, NOLIMIT, 0,
    408      /* opt state flags  */ DEBUG_LEVEL_FLAGS, 0,
    409      /* last opt argumnt */ { NULL }, /* --debug-level */
    410      /* arg list/cookie  */ NULL,
    411      /* must/cannot opts */ NULL, NULL,
    412      /* option proc      */ doOptDebug_Level,
    413      /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
    414      /* disablement strs */ NULL, NULL },
    415 
    416   {  /* entry idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
    417      /* equiv idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
    418      /* equivalenced to  */ NO_EQUIVALENT,
    419      /* min, max, act ct */ 0, NOLIMIT, 0,
    420      /* opt state flags  */ SET_DEBUG_LEVEL_FLAGS, 0,
    421      /* last opt argumnt */ { NULL }, /* --set-debug-level */
    422      /* arg list/cookie  */ NULL,
    423      /* must/cannot opts */ NULL, NULL,
    424      /* option proc      */ optionNumericVal,
    425      /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
    426      /* disablement strs */ NULL, NULL },
    427 
    428   {  /* entry idx, value */ 5, VALUE_OPT_INTERACTIVE,
    429      /* equiv idx, value */ 5, VALUE_OPT_INTERACTIVE,
    430      /* equivalenced to  */ NO_EQUIVALENT,
    431      /* min, max, act ct */ 0, 1, 0,
    432      /* opt state flags  */ INTERACTIVE_FLAGS, 0,
    433      /* last opt argumnt */ { NULL }, /* --interactive */
    434      /* arg list/cookie  */ NULL,
    435      /* must/cannot opts */ NULL, aInteractiveCantList,
    436      /* option proc      */ NULL,
    437      /* desc, NAME, name */ INTERACTIVE_DESC, INTERACTIVE_NAME, INTERACTIVE_name,
    438      /* disablement strs */ NULL, NULL },
    439 
    440   {  /* entry idx, value */ 6, VALUE_OPT_NUMERIC,
    441      /* equiv idx, value */ 6, VALUE_OPT_NUMERIC,
    442      /* equivalenced to  */ NO_EQUIVALENT,
    443      /* min, max, act ct */ 0, 1, 0,
    444      /* opt state flags  */ NUMERIC_FLAGS, 0,
    445      /* last opt argumnt */ { NULL }, /* --numeric */
    446      /* arg list/cookie  */ NULL,
    447      /* must/cannot opts */ NULL, NULL,
    448      /* option proc      */ NULL,
    449      /* desc, NAME, name */ NUMERIC_DESC, NUMERIC_NAME, NUMERIC_name,
    450      /* disablement strs */ NULL, NULL },
    451 
    452   {  /* entry idx, value */ 7, VALUE_OPT_OLD_RV,
    453      /* equiv idx, value */ 7, VALUE_OPT_OLD_RV,
    454      /* equivalenced to  */ NO_EQUIVALENT,
    455      /* min, max, act ct */ 0, 1, 0,
    456      /* opt state flags  */ OLD_RV_FLAGS, 0,
    457      /* last opt argumnt */ { NULL }, /* --old-rv */
    458      /* arg list/cookie  */ NULL,
    459      /* must/cannot opts */ NULL, NULL,
    460      /* option proc      */ NULL,
    461      /* desc, NAME, name */ OLD_RV_DESC, OLD_RV_NAME, OLD_RV_name,
    462      /* disablement strs */ NULL, NULL },
    463 
    464   {  /* entry idx, value */ 8, VALUE_OPT_PEERS,
    465      /* equiv idx, value */ 8, VALUE_OPT_PEERS,
    466      /* equivalenced to  */ NO_EQUIVALENT,
    467      /* min, max, act ct */ 0, 1, 0,
    468      /* opt state flags  */ PEERS_FLAGS, 0,
    469      /* last opt argumnt */ { NULL }, /* --peers */
    470      /* arg list/cookie  */ NULL,
    471      /* must/cannot opts */ NULL, aPeersCantList,
    472      /* option proc      */ ntpq_custom_opt_handler,
    473      /* desc, NAME, name */ PEERS_DESC, PEERS_NAME, PEERS_name,
    474      /* disablement strs */ NULL, NULL },
    475 
    476   {  /* entry idx, value */ 9, VALUE_OPT_REFID,
    477      /* equiv idx, value */ 9, VALUE_OPT_REFID,
    478      /* equivalenced to  */ NO_EQUIVALENT,
    479      /* min, max, act ct */ 0, 1, 0,
    480      /* opt state flags  */ REFID_FLAGS, 0,
    481      /* last opt argumnt */ { REFID_DFT_ARG },
    482      /* arg list/cookie  */ NULL,
    483      /* must/cannot opts */ NULL, NULL,
    484      /* option proc      */ doOptRefid,
    485      /* desc, NAME, name */ REFID_DESC, REFID_NAME, REFID_name,
    486      /* disablement strs */ NULL, NULL },
    487 
    488   {  /* entry idx, value */ 10, VALUE_OPT_UNCONNECTED,
    489      /* equiv idx, value */ 10, VALUE_OPT_UNCONNECTED,
    490      /* equivalenced to  */ NO_EQUIVALENT,
    491      /* min, max, act ct */ 0, 1, 0,
    492      /* opt state flags  */ UNCONNECTED_FLAGS, 0,
    493      /* last opt argumnt */ { NULL }, /* --unconnected */
    494      /* arg list/cookie  */ NULL,
    495      /* must/cannot opts */ NULL, NULL,
    496      /* option proc      */ NULL,
    497      /* desc, NAME, name */ UNCONNECTED_DESC, UNCONNECTED_NAME, UNCONNECTED_name,
    498      /* disablement strs */ NULL, NULL },
    499 
    500   {  /* entry idx, value */ 11, VALUE_OPT_WIDE,
    501      /* equiv idx, value */ 11, VALUE_OPT_WIDE,
    502      /* equivalenced to  */ NO_EQUIVALENT,
    503      /* min, max, act ct */ 0, 1, 0,
    504      /* opt state flags  */ WIDE_FLAGS, 0,
    505      /* last opt argumnt */ { NULL }, /* --wide */
    506      /* arg list/cookie  */ NULL,
    507      /* must/cannot opts */ NULL, NULL,
    508      /* option proc      */ NULL,
    509      /* desc, NAME, name */ WIDE_DESC, WIDE_NAME, WIDE_name,
    510      /* disablement strs */ NULL, NULL },
    511 
    512   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
    513      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_VERSION,
    514      /* equivalenced to  */ NO_EQUIVALENT,
    515      /* min, max, act ct */ 0, 1, 0,
    516      /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
    517      /* last opt argumnt */ { NULL },
    518      /* arg list/cookie  */ NULL,
    519      /* must/cannot opts */ NULL, NULL,
    520      /* option proc      */ VER_PROC,
    521      /* desc, NAME, name */ VER_DESC, NULL, VER_name,
    522      /* disablement strs */ NULL, NULL },
    523 
    524 
    525 
    526   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
    527      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_HELP,
    528      /* equivalenced to  */ NO_EQUIVALENT,
    529      /* min, max, act ct */ 0, 1, 0,
    530      /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
    531      /* last opt argumnt */ { NULL },
    532      /* arg list/cookie  */ NULL,
    533      /* must/cannot opts */ NULL, NULL,
    534      /* option proc      */ doUsageOpt,
    535      /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
    536      /* disablement strs */ NULL, NULL },
    537 
    538   {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
    539      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
    540      /* equivalenced to  */ NO_EQUIVALENT,
    541      /* min, max, act ct */ 0, 1, 0,
    542      /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
    543      /* last opt argumnt */ { NULL },
    544      /* arg list/cookie  */ NULL,
    545      /* must/cannot opts */ NULL,  NULL,
    546      /* option proc      */ optionPagedUsage,
    547      /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
    548      /* disablement strs */ NULL, NULL },
    549 
    550   {  /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
    551      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
    552      /* equivalenced to  */ NO_EQUIVALENT,
    553      /* min, max, act ct */ 0, 1, 0,
    554      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
    555                        | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
    556      /* last opt argumnt */ { NULL },
    557      /* arg list/cookie  */ NULL,
    558      /* must/cannot opts */ NULL,  NULL,
    559      /* option proc      */ NULL,
    560      /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
    561      /* disablement strs */ NULL, NULL },
    562 
    563   {  /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
    564      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
    565      /* equivalenced to  */ NO_EQUIVALENT,
    566      /* min, max, act ct */ 0, NOLIMIT, 0,
    567      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
    568 			  | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
    569      /* last opt argumnt */ { NULL },
    570      /* arg list/cookie  */ NULL,
    571      /* must/cannot opts */ NULL, NULL,
    572      /* option proc      */ optionLoadOpt,
    573      /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
    574      /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
    575 };
    576 
    577 
    578 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    579 /** Reference to the upper cased version of ntpq. */
    580 #define zPROGNAME       (ntpq_opt_strs+1874)
    581 /** Reference to the title line for ntpq usage. */
    582 #define zUsageTitle     (ntpq_opt_strs+1879)
    583 /** ntpq configuration file name. */
    584 #define zRcName         (ntpq_opt_strs+2007)
    585 /** Directories to search for ntpq config files. */
    586 static char const * const apzHomeList[3] = {
    587     ntpq_opt_strs+1999,
    588     ntpq_opt_strs+2005,
    589     NULL };
    590 /** The ntpq program bug email address. */
    591 #define zBugsAddr       (ntpq_opt_strs+2014)
    592 /** Clarification/explanation of what ntpq does. */
    593 #define zExplain        (NULL)
    594 /** Extra detail explaining what ntpq does. */
    595 #define zDetail         (NULL)
    596 /** The full version string for ntpq. */
    597 #define zFullVersion    (ntpq_opt_strs+2049)
    598 /* extracted from optcode.tlib near line 342 */
    599 
    600 #if defined(ENABLE_NLS)
    601 # define OPTPROC_BASE OPTPROC_TRANSLATE
    602   static tOptionXlateProc translate_option_strings;
    603 #else
    604 # define OPTPROC_BASE OPTPROC_NONE
    605 # define translate_option_strings NULL
    606 #endif /* ENABLE_NLS */
    607 
    608 #define ntpq_full_usage (NULL)
    609 #define ntpq_short_usage (NULL)
    610 
    611 #endif /* not defined __doxygen__ */
    612 
    613 /*
    614  *  Create the static procedure(s) declared above.
    615  */
    616 /**
    617  * The callout function that invokes the optionUsage function.
    618  *
    619  * @param[in] opts the AutoOpts option description structure
    620  * @param[in] od   the descriptor for the "help" (usage) option.
    621  * @noreturn
    622  */
    623 static void
    624 doUsageOpt(tOptions * opts, tOptDesc * od)
    625 {
    626     int ex_code;
    627     ex_code = NTPQ_EXIT_SUCCESS;
    628     optionUsage(&ntpqOptions, ex_code);
    629     /* NOTREACHED */
    630     exit(NTPQ_EXIT_FAILURE);
    631     (void)opts;
    632     (void)od;
    633 }
    634 
    635 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    636 /**
    637  * Code to handle the debug-level option.
    638  *
    639  * @param[in] pOptions the ntpq options data structure
    640  * @param[in,out] pOptDesc the option descriptor for this option.
    641  */
    642 static void
    643 doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
    644 {
    645     /*
    646      * Be sure the flag-code[0] handles special values for the options pointer
    647      * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
    648      * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
    649      * reset its state.
    650      */
    651     /* extracted from debug-opt.def, line 15 */
    652 OPT_VALUE_SET_DEBUG_LEVEL++;
    653     (void)pOptDesc;
    654     (void)pOptions;
    655 }
    656 
    657 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    658 /**
    659  * Code to handle the refid option.
    660  * Set the default display format for S2+ refids.
    661  * @param[in] pOptions the ntpq options data structure
    662  * @param[in,out] pOptDesc the option descriptor for this option.
    663  */
    664 static void
    665 doOptRefid(tOptions* pOptions, tOptDesc* pOptDesc)
    666 {
    667 
    668 /* extracted from optmain.tlib near line 945 */
    669     static char const * const names[2] = {
    670         ntpq_opt_strs+2063, ntpq_opt_strs+1041 };
    671 
    672     if (pOptions <= OPTPROC_EMIT_LIMIT) {
    673         (void) optionEnumerationVal(pOptions, pOptDesc, names, 2);
    674         return; /* protect AutoOpts client code from internal callbacks */
    675     }
    676 
    677     pOptDesc->optArg.argEnum =
    678         optionEnumerationVal(pOptions, pOptDesc, names, 2);
    679 }
    680 /* extracted from optmain.tlib near line 1250 */
    681 
    682 /**
    683  * The directory containing the data associated with ntpq.
    684  */
    685 #ifndef  PKGDATADIR
    686 # define PKGDATADIR ""
    687 #endif
    688 
    689 /**
    690  * Information about the person or institution that packaged ntpq
    691  * for the current distribution.
    692  */
    693 #ifndef  WITH_PACKAGER
    694 # define ntpq_packager_info NULL
    695 #else
    696 /** Packager information for ntpq. */
    697 static char const ntpq_packager_info[] =
    698     "Packaged by " WITH_PACKAGER
    699 
    700 # ifdef WITH_PACKAGER_VERSION
    701         " ("WITH_PACKAGER_VERSION")"
    702 # endif
    703 
    704 # ifdef WITH_PACKAGER_BUG_REPORTS
    705     "\nReport ntpq bugs to " WITH_PACKAGER_BUG_REPORTS
    706 # endif
    707     "\n";
    708 #endif
    709 #ifndef __doxygen__
    710 
    711 #endif /* __doxygen__ */
    712 /**
    713  * The option definitions for ntpq.  The one structure that
    714  * binds them all.
    715  */
    716 tOptions ntpqOptions = {
    717     OPTIONS_STRUCT_VERSION,
    718     0, NULL,                    /* original argc + argv    */
    719     ( OPTPROC_BASE
    720     + OPTPROC_ERRSTOP
    721     + OPTPROC_SHORTOPT
    722     + OPTPROC_LONGOPT
    723     + OPTPROC_NO_REQ_OPT
    724     + OPTPROC_ENVIRON
    725     + OPTPROC_MISUSE ),
    726     0, NULL,                    /* current option index, current option */
    727     NULL,         NULL,         zPROGNAME,
    728     zRcName,      zCopyright,   zLicenseDescrip,
    729     zFullVersion, apzHomeList,  zUsageTitle,
    730     zExplain,     zDetail,      optDesc,
    731     zBugsAddr,                  /* address to send bugs to */
    732     NULL, NULL,                 /* extensions/saved state  */
    733     optionUsage, /* usage procedure */
    734     translate_option_strings,   /* translation procedure */
    735     /*
    736      *  Indexes to special options
    737      */
    738     { INDEX_OPT_MORE_HELP, /* more-help option index */
    739       INDEX_OPT_SAVE_OPTS, /* save option index */
    740       NO_EQUIVALENT, /* '-#' option index */
    741       NO_EQUIVALENT /* index of default opt */
    742     },
    743     17 /* full option count */, 12 /* user option count */,
    744     ntpq_full_usage, ntpq_short_usage,
    745     NULL, NULL,
    746     PKGDATADIR, ntpq_packager_info
    747 };
    748 
    749 #if ENABLE_NLS
    750 /**
    751  * This code is designed to translate translatable option text for the
    752  * ntpq program.  These translations happen upon entry
    753  * to optionProcess().
    754  */
    755 #include <stdio.h>
    756 #include <stdlib.h>
    757 #include <string.h>
    758 #include <unistd.h>
    759 #ifdef HAVE_DCGETTEXT
    760 # include <gettext.h>
    761 #endif
    762 #include <autoopts/usage-txt.h>
    763 
    764 static char * AO_gettext(char const * pz);
    765 static void   coerce_it(void ** s);
    766 
    767 /**
    768  * AutoGen specific wrapper function for gettext.  It relies on the macro _()
    769  * to convert from English to the target language, then strdup-duplicates the
    770  * result string.  It tries the "libopts" domain first, then whatever has been
    771  * set via the \a textdomain(3) call.
    772  *
    773  * @param[in] pz the input text used as a lookup key.
    774  * @returns the translated text (if there is one),
    775  *   or the original text (if not).
    776  */
    777 static char *
    778 AO_gettext(char const * pz)
    779 {
    780     char * res;
    781     if (pz == NULL)
    782         return NULL;
    783 #ifdef HAVE_DCGETTEXT
    784     /*
    785      * While processing the option_xlateable_txt data, try to use the
    786      * "libopts" domain.  Once we switch to the option descriptor data,
    787      * do *not* use that domain.
    788      */
    789     if (option_xlateable_txt.field_ct != 0) {
    790         res = dgettext("libopts", pz);
    791         if (res == pz)
    792             res = (char *)VOIDP(_(pz));
    793     } else
    794         res = (char *)VOIDP(_(pz));
    795 #else
    796     res = (char *)VOIDP(_(pz));
    797 #endif
    798     if (res == pz)
    799         return res;
    800     res = strdup(res);
    801     if (res == NULL) {
    802         fputs(_("No memory for duping translated strings\n"), stderr);
    803         exit(NTPQ_EXIT_FAILURE);
    804     }
    805     return res;
    806 }
    807 
    808 /**
    809  * All the pointers we use are marked "* const", but they are stored in
    810  * writable memory.  Coerce the mutability and set the pointer.
    811  */
    812 static void coerce_it(void ** s) { *s = AO_gettext(*s);
    813 }
    814 
    815 /**
    816  * Translate all the translatable strings in the ntpqOptions
    817  * structure defined above.  This is done only once.
    818  */
    819 static void
    820 translate_option_strings(void)
    821 {
    822     tOptions * const opts = &ntpqOptions;
    823 
    824     /*
    825      *  Guard against re-translation.  It won't work.  The strings will have
    826      *  been changed by the first pass through this code.  One shot only.
    827      */
    828     if (option_xlateable_txt.field_ct != 0) {
    829         /*
    830          *  Do the translations.  The first pointer follows the field count
    831          *  field.  The field count field is the size of a pointer.
    832          */
    833         char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
    834         int     ix  = option_xlateable_txt.field_ct;
    835 
    836         do {
    837             ppz++; /* skip over field_ct */
    838             *ppz = AO_gettext(*ppz);
    839         } while (--ix > 0);
    840         /* prevent re-translation and disable "libopts" domain lookup */
    841         option_xlateable_txt.field_ct = 0;
    842 
    843         coerce_it(VOIDP(&(opts->pzCopyright)));
    844         coerce_it(VOIDP(&(opts->pzCopyNotice)));
    845         coerce_it(VOIDP(&(opts->pzFullVersion)));
    846         coerce_it(VOIDP(&(opts->pzUsageTitle)));
    847         coerce_it(VOIDP(&(opts->pzExplain)));
    848         coerce_it(VOIDP(&(opts->pzDetail)));
    849         {
    850             tOptDesc * od = opts->pOptDesc;
    851             for (ix = opts->optCt; ix > 0; ix--, od++)
    852                 coerce_it(VOIDP(&(od->pzText)));
    853         }
    854     }
    855 }
    856 #endif /* ENABLE_NLS */
    857 
    858 #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
    859 /** I18N function strictly for xgettext.  Do not compile. */
    860 static void bogus_function(void) {
    861   /* TRANSLATORS:
    862 
    863      The following dummy function was crated solely so that xgettext can
    864      extract the correct strings.  These strings are actually referenced
    865      by a field name in the ntpqOptions structure noted in the
    866      comments below.  The literal text is defined in ntpq_opt_strs.
    867 
    868      NOTE: the strings below are segmented with respect to the source string
    869      ntpq_opt_strs.  The strings above are handed off for translation
    870      at run time a paragraph at a time.  Consequently, they are presented here
    871      for translation a paragraph at a time.
    872 
    873      ALSO: often the description for an option will reference another option
    874      by name.  These are set off with apostrophe quotes (I hope).  Do not
    875      translate option names.
    876    */
    877   /* referenced via ntpqOptions.pzCopyright */
    878   puts(_("ntpq 4.2.8p18\n\
    879 Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n\
    880 This is free software. It is licensed for use, modification and\n\
    881 redistribution under the terms of the NTP License, copies of which\n\
    882 can be seen at:\n"));
    883   puts(_("  <http://ntp.org/license>\n\
    884   <http://opensource.org/licenses/ntp-license.php>\n"));
    885 
    886   /* referenced via ntpqOptions.pzCopyNotice */
    887   puts(_("Permission to use, copy, modify, and distribute this software and its\n\
    888 documentation for any purpose with or without fee is hereby granted,\n\
    889 provided that the above copyright notice appears in all copies and that\n\
    890 both the copyright notice and this permission notice appear in supporting\n\
    891 documentation, and that the name The University of Delaware not be used in\n\
    892 advertising or publicity pertaining to distribution of the software without\n\
    893 specific, written prior permission.  The University of Delaware and Network\n\
    894 Time Foundation makes no representations about the suitability this\n\
    895 software for any purpose.  It is provided \"as is\" without express or\n\
    896 implied warranty.\n"));
    897 
    898   /* referenced via ntpqOptions.pOptDesc->pzText */
    899   puts(_("Force IPv4 name resolution"));
    900 
    901   /* referenced via ntpqOptions.pOptDesc->pzText */
    902   puts(_("Force IPv6 name resolution"));
    903 
    904   /* referenced via ntpqOptions.pOptDesc->pzText */
    905   puts(_("run a command and exit"));
    906 
    907   /* referenced via ntpqOptions.pOptDesc->pzText */
    908   puts(_("Increase debug verbosity level"));
    909 
    910   /* referenced via ntpqOptions.pOptDesc->pzText */
    911   puts(_("Set the debug verbosity level"));
    912 
    913   /* referenced via ntpqOptions.pOptDesc->pzText */
    914   puts(_("Force ntpq to operate in interactive mode"));
    915 
    916   /* referenced via ntpqOptions.pOptDesc->pzText */
    917   puts(_("numeric host addresses"));
    918 
    919   /* referenced via ntpqOptions.pOptDesc->pzText */
    920   puts(_("Always output status line with readvar"));
    921 
    922   /* referenced via ntpqOptions.pOptDesc->pzText */
    923   puts(_("Print a list of the peers"));
    924 
    925   /* referenced via ntpqOptions.pOptDesc->pzText */
    926   puts(_("Set default display type for S2+ refids"));
    927 
    928   /* referenced via ntpqOptions.pOptDesc->pzText */
    929   puts(_("Use unconnected UDP to communicate with ntpd (default on Windows)"));
    930 
    931   /* referenced via ntpqOptions.pOptDesc->pzText */
    932   puts(_("Display the full 'remote' value"));
    933 
    934   /* referenced via ntpqOptions.pOptDesc->pzText */
    935   puts(_("display extended usage information and exit"));
    936 
    937   /* referenced via ntpqOptions.pOptDesc->pzText */
    938   puts(_("extended usage information passed thru pager"));
    939 
    940   /* referenced via ntpqOptions.pOptDesc->pzText */
    941   puts(_("output version information and exit"));
    942 
    943   /* referenced via ntpqOptions.pOptDesc->pzText */
    944   puts(_("save the option state to a config file"));
    945 
    946   /* referenced via ntpqOptions.pOptDesc->pzText */
    947   puts(_("load options from a config file"));
    948 
    949   /* referenced via ntpqOptions.pzUsageTitle */
    950   puts(_("ntpq - standard NTP query program - Ver. 4.2.8p18\n\
    951 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
    952 
    953   /* referenced via ntpqOptions.pzFullVersion */
    954   puts(_("ntpq 4.2.8p18"));
    955 
    956   /* referenced via ntpqOptions.pzFullUsage */
    957   puts(_("<<<NOT-FOUND>>>"));
    958 
    959   /* referenced via ntpqOptions.pzShortUsage */
    960   puts(_("<<<NOT-FOUND>>>"));
    961   /* LIBOPTS-MESSAGES: */
    962 #line 67 "../autoopts.c"
    963   puts(_("allocation of %d bytes failed\n"));
    964 #line 89 "../autoopts.c"
    965   puts(_("allocation of %d bytes failed\n"));
    966 #line 48 "../init.c"
    967   puts(_("AutoOpts function called without option descriptor\n"));
    968 #line 81 "../init.c"
    969   puts(_("\tThis exceeds the compiled library version:  "));
    970 #line 79 "../init.c"
    971   puts(_("Automated Options Processing Error!\n"
    972        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
    973 #line 78 "../autoopts.c"
    974   puts(_("realloc of %d bytes at 0x%p failed\n"));
    975 #line 83 "../init.c"
    976   puts(_("\tThis is less than the minimum library version:  "));
    977 #line 121 "../version.c"
    978   puts(_("Automated Options version %s\n"
    979        "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
    980 #line 49 "../makeshell.c"
    981   puts(_("(AutoOpts bug):  %s.\n"));
    982 #line 90 "../reset.c"
    983   puts(_("optionResetOpt() called, but reset-option not configured"));
    984 #line 241 "../usage.c"
    985   puts(_("could not locate the 'help' option"));
    986 #line 330 "../autoopts.c"
    987   puts(_("optionProcess() was called with invalid data"));
    988 #line 697 "../usage.c"
    989   puts(_("invalid argument type specified"));
    990 #line 568 "../find.c"
    991   puts(_("defaulted to option with optional arg"));
    992 #line 76 "../alias.c"
    993   puts(_("aliasing option is out of range."));
    994 #line 210 "../enum.c"
    995   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
    996 #line 78 "../find.c"
    997   puts(_("  The following options match:\n"));
    998 #line 263 "../find.c"
    999   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
   1000 #line 161 "../check.c"
   1001   puts(_("%s: Command line arguments required\n"));
   1002 #line 43 "../alias.c"
   1003   puts(_("%d %s%s options allowed\n"));
   1004 #line 56 "../makeshell.c"
   1005   puts(_("%s error %d (%s) calling %s for '%s'\n"));
   1006 #line 268 "../makeshell.c"
   1007   puts(_("interprocess pipe"));
   1008 #line 171 "../version.c"
   1009   puts(_("error: version option argument '%c' invalid.  Use:\n"
   1010        "\t'v' - version only\n"
   1011        "\t'c' - version and copyright\n"
   1012        "\t'n' - version and full copyright notice\n"));
   1013 #line 58 "../check.c"
   1014   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
   1015 #line 187 "../find.c"
   1016   puts(_("%s: The '%s' option has been disabled."));
   1017 #line 400 "../find.c"
   1018   puts(_("%s: The '%s' option has been disabled."));
   1019 #line 38 "../alias.c"
   1020   puts(_("-equivalence"));
   1021 #line 439 "../find.c"
   1022   puts(_("%s: illegal option -- %c\n"));
   1023 #line 110 "../reset.c"
   1024   puts(_("%s: illegal option -- %c\n"));
   1025 #line 241 "../find.c"
   1026   puts(_("%s: illegal option -- %s\n"));
   1027 #line 740 "../find.c"
   1028   puts(_("%s: illegal option -- %s\n"));
   1029 #line 118 "../reset.c"
   1030   puts(_("%s: illegal option -- %s\n"));
   1031 #line 305 "../find.c"
   1032   puts(_("%s: unknown vendor extension option -- %s\n"));
   1033 #line 135 "../enum.c"
   1034   puts(_("  or an integer from %d through %d\n"));
   1035 #line 145 "../enum.c"
   1036   puts(_("  or an integer from %d through %d\n"));
   1037 #line 696 "../usage.c"
   1038   puts(_("%s error:  invalid option descriptor for %s\n"));
   1039 #line 1030 "../usage.c"
   1040   puts(_("%s error:  invalid option descriptor for %s\n"));
   1041 #line 355 "../find.c"
   1042   puts(_("%s: invalid option name: %s\n"));
   1043 #line 497 "../find.c"
   1044   puts(_("%s: The '%s' option requires an argument.\n"));
   1045 #line 150 "../autoopts.c"
   1046   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
   1047        "\t'%s' and '%s'."));
   1048 #line 94 "../check.c"
   1049   puts(_("%s error:  The %s option is required\n"));
   1050 #line 602 "../find.c"
   1051   puts(_("%s: The '%s' option cannot have an argument.\n"));
   1052 #line 151 "../check.c"
   1053   puts(_("%s: Command line arguments are not allowed.\n"));
   1054 #line 568 "../save.c"
   1055   puts(_("error %d (%s) creating %s\n"));
   1056 #line 210 "../enum.c"
   1057   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
   1058 #line 93 "../reset.c"
   1059   puts(_("%s error: The '%s' option requires an argument.\n"));
   1060 #line 122 "../save.c"
   1061   puts(_("error %d (%s) stat-ing %s\n"));
   1062 #line 175 "../save.c"
   1063   puts(_("error %d (%s) stat-ing %s\n"));
   1064 #line 143 "../restore.c"
   1065   puts(_("%s error: no saved option state\n"));
   1066 #line 225 "../autoopts.c"
   1067   puts(_("'%s' is not a command line option.\n"));
   1068 #line 113 "../time.c"
   1069   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
   1070 #line 50 "../time.c"
   1071   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
   1072 #line 92 "../check.c"
   1073   puts(_("%s error:  The %s option must appear %d times.\n"));
   1074 #line 165 "../numeric.c"
   1075   puts(_("%s error:  '%s' is not a recognizable number.\n"));
   1076 #line 176 "../enum.c"
   1077   puts(_("%s error:  %s exceeds %s keyword count\n"));
   1078 #line 279 "../usage.c"
   1079   puts(_("Try '%s %s' for more information.\n"));
   1080 #line 45 "../alias.c"
   1081   puts(_("one %s%s option allowed\n"));
   1082 #line 170 "../makeshell.c"
   1083   puts(_("standard output"));
   1084 #line 905 "../makeshell.c"
   1085   puts(_("standard output"));
   1086 #line 223 "../usage.c"
   1087   puts(_("standard output"));
   1088 #line 364 "../usage.c"
   1089   puts(_("standard output"));
   1090 #line 574 "../usage.c"
   1091   puts(_("standard output"));
   1092 #line 178 "../version.c"
   1093   puts(_("standard output"));
   1094 #line 223 "../usage.c"
   1095   puts(_("standard error"));
   1096 #line 364 "../usage.c"
   1097   puts(_("standard error"));
   1098 #line 574 "../usage.c"
   1099   puts(_("standard error"));
   1100 #line 178 "../version.c"
   1101   puts(_("standard error"));
   1102 #line 170 "../makeshell.c"
   1103   puts(_("write"));
   1104 #line 905 "../makeshell.c"
   1105   puts(_("write"));
   1106 #line 222 "../usage.c"
   1107   puts(_("write"));
   1108 #line 363 "../usage.c"
   1109   puts(_("write"));
   1110 #line 573 "../usage.c"
   1111   puts(_("write"));
   1112 #line 177 "../version.c"
   1113   puts(_("write"));
   1114 #line 60 "../numeric.c"
   1115   puts(_("%s error:  %s option value %ld is out of range.\n"));
   1116 #line 44 "../check.c"
   1117   puts(_("%s error:  %s option requires the %s option\n"));
   1118 #line 121 "../save.c"
   1119   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   1120 #line 174 "../save.c"
   1121   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   1122 #line 193 "../save.c"
   1123   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   1124 #line 567 "../save.c"
   1125   puts(_("%s warning:  cannot save options - %s not regular file\n"));
   1126   /* END-LIBOPTS-MESSAGES */
   1127 
   1128   /* USAGE-TEXT: */
   1129 #line 822 "../usage.c"
   1130   puts(_("\t\t\t\t- an alternate for '%s'\n"));
   1131 #line 1097 "../usage.c"
   1132   puts(_("Version, usage and configuration options:"));
   1133 #line 873 "../usage.c"
   1134   puts(_("\t\t\t\t- default option for unnamed options\n"));
   1135 #line 786 "../usage.c"
   1136   puts(_("\t\t\t\t- disabled as '--%s'\n"));
   1137 #line 1066 "../usage.c"
   1138   puts(_(" --- %-14s %s\n"));
   1139 #line 1064 "../usage.c"
   1140   puts(_("This option has been disabled"));
   1141 #line 813 "../usage.c"
   1142   puts(_("\t\t\t\t- enabled by default\n"));
   1143 #line 40 "../alias.c"
   1144   puts(_("%s error:  only "));
   1145 #line 1143 "../usage.c"
   1146   puts(_(" - examining environment variables named %s_*\n"));
   1147 #line 168 "../file.c"
   1148   puts(_("\t\t\t\t- file must not pre-exist\n"));
   1149 #line 172 "../file.c"
   1150   puts(_("\t\t\t\t- file must pre-exist\n"));
   1151 #line 329 "../usage.c"
   1152   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
   1153        "hyphen and the flag character.\n"));
   1154 #line 882 "../makeshell.c"
   1155   puts(_("\n"
   1156        "= = = = = = = =\n\n"
   1157        "This incarnation of genshell will produce\n"
   1158        "a shell script to parse the options for %s:\n\n"));
   1159 #line 142 "../enum.c"
   1160   puts(_("  or an integer mask with any of the lower %d bits set\n"));
   1161 #line 846 "../usage.c"
   1162   puts(_("\t\t\t\t- is a set membership option\n"));
   1163 #line 867 "../usage.c"
   1164   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
   1165 #line 331 "../usage.c"
   1166   puts(_("Options are specified by single or double hyphens and their name.\n"));
   1167 #line 853 "../usage.c"
   1168   puts(_("\t\t\t\t- may appear multiple times\n"));
   1169 #line 840 "../usage.c"
   1170   puts(_("\t\t\t\t- may not be preset\n"));
   1171 #line 1258 "../usage.c"
   1172   puts(_("   Arg Option-Name    Description\n"));
   1173 #line 1194 "../usage.c"
   1174   puts(_("  Flg Arg Option-Name    Description\n"));
   1175 #line 1252 "../usage.c"
   1176   puts(_("  Flg Arg Option-Name    Description\n"));
   1177 #line 1253 "../usage.c"
   1178   puts(_(" %3s %s"));
   1179 #line 1259 "../usage.c"
   1180   puts(_(" %3s %s"));
   1181 #line 336 "../usage.c"
   1182   puts(_("The '-#<number>' option may omit the hash char\n"));
   1183 #line 332 "../usage.c"
   1184   puts(_("All arguments are named options.\n"));
   1185 #line 920 "../usage.c"
   1186   puts(_(" - reading file %s"));
   1187 #line 358 "../usage.c"
   1188   puts(_("\n"
   1189        "Please send bug reports to:  <%s>\n"));
   1190 #line 100 "../version.c"
   1191   puts(_("\n"
   1192        "Please send bug reports to:  <%s>\n"));
   1193 #line 129 "../version.c"
   1194   puts(_("\n"
   1195        "Please send bug reports to:  <%s>\n"));
   1196 #line 852 "../usage.c"
   1197   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
   1198 #line 893 "../usage.c"
   1199   puts(_("\n"
   1200        "The following option preset mechanisms are supported:\n"));
   1201 #line 1141 "../usage.c"
   1202   puts(_("\n"
   1203        "The following option preset mechanisms are supported:\n"));
   1204 #line 631 "../usage.c"
   1205   puts(_("prohibits these options:\n"));
   1206 #line 626 "../usage.c"
   1207   puts(_("prohibits the option '%s'\n"));
   1208 #line 81 "../numeric.c"
   1209   puts(_("%s%ld to %ld"));
   1210 #line 79 "../numeric.c"
   1211   puts(_("%sgreater than or equal to %ld"));
   1212 #line 75 "../numeric.c"
   1213   puts(_("%s%ld exactly"));
   1214 #line 68 "../numeric.c"
   1215   puts(_("%sit must lie in one of the ranges:\n"));
   1216 #line 68 "../numeric.c"
   1217   puts(_("%sit must be in the range:\n"));
   1218 #line 88 "../numeric.c"
   1219   puts(_(", or\n"));
   1220 #line 66 "../numeric.c"
   1221   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
   1222 #line 77 "../numeric.c"
   1223   puts(_("%sless than or equal to %ld"));
   1224 #line 339 "../usage.c"
   1225   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
   1226 #line 601 "../usage.c"
   1227   puts(_("requires the option '%s'\n"));
   1228 #line 604 "../usage.c"
   1229   puts(_("requires these options:\n"));
   1230 #line 1270 "../usage.c"
   1231   puts(_("   Arg Option-Name   Req?  Description\n"));
   1232 #line 1264 "../usage.c"
   1233   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
   1234 #line 143 "../enum.c"
   1235   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
   1236        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
   1237        "will set them all.  Multiple entries may be passed as an option\n"
   1238        "argument list.\n"));
   1239 #line 859 "../usage.c"
   1240   puts(_("\t\t\t\t- may appear up to %d times\n"));
   1241 #line 52 "../enum.c"
   1242   puts(_("The valid \"%s\" option keywords are:\n"));
   1243 #line 1101 "../usage.c"
   1244   puts(_("The next option supports vendor supported extra options:"));
   1245 #line 722 "../usage.c"
   1246   puts(_("These additional options are:"));
   1247   /* END-USAGE-TEXT */
   1248 }
   1249 #endif /* uncompilable code */
   1250 #ifdef  __cplusplus
   1251 }
   1252 #endif
   1253 /* ntpq-opts.c ends here */
   1254