1ea906c41SOllivier Robert /* 2ea906c41SOllivier Robert * EDIT THIS FILE WITH CAUTION (ntpdc-opts.c) 3ea906c41SOllivier Robert * 4*f0574f5cSXin LI * It has been AutoGen-ed March 21, 2017 at 10:44:44 AM by AutoGen 5.18.5 5ea906c41SOllivier Robert * From the definitions ntpdc-opts.def 6ea906c41SOllivier Robert * and the template file options 7ea906c41SOllivier Robert * 82b15cb3dSCy Schubert * Generated from AutoOpts 41:0:16 templates. 92b15cb3dSCy Schubert * 102b15cb3dSCy Schubert * AutoOpts is a copyrighted work. This source file is not encumbered 112b15cb3dSCy Schubert * by AutoOpts licensing, but is provided under the licensing terms chosen 122b15cb3dSCy Schubert * by the ntpdc author or copyright holder. AutoOpts is 132b15cb3dSCy Schubert * licensed under the terms of the LGPL. The redistributable library 142b15cb3dSCy Schubert * (``libopts'') is licensed under the terms of either the LGPL or, at the 152b15cb3dSCy Schubert * users discretion, the BSD license. See the AutoOpts and/or libopts sources 162b15cb3dSCy Schubert * for details. 172b15cb3dSCy Schubert * 182b15cb3dSCy Schubert * The ntpdc program is copyrighted and licensed 192b15cb3dSCy Schubert * under the following terms: 202b15cb3dSCy Schubert * 21*f0574f5cSXin LI * Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved. 222b15cb3dSCy Schubert * This is free software. It is licensed for use, modification and 232b15cb3dSCy Schubert * redistribution under the terms of the NTP License, copies of which 242b15cb3dSCy Schubert * can be seen at: 252b15cb3dSCy Schubert * <http://ntp.org/license> 262b15cb3dSCy Schubert * <http://opensource.org/licenses/ntp-license.php> 272b15cb3dSCy Schubert * 282b15cb3dSCy Schubert * Permission to use, copy, modify, and distribute this software and its 292b15cb3dSCy Schubert * documentation for any purpose with or without fee is hereby granted, 302b15cb3dSCy Schubert * provided that the above copyright notice appears in all copies and that 312b15cb3dSCy Schubert * both the copyright notice and this permission notice appear in 322b15cb3dSCy Schubert * supporting documentation, and that the name The University of Delaware not be used in 332b15cb3dSCy Schubert * advertising or publicity pertaining to distribution of the software 342b15cb3dSCy Schubert * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no 352b15cb3dSCy Schubert * representations about the suitability this software for any purpose. It 362b15cb3dSCy Schubert * is provided "as is" without express or implied warranty. 37ea906c41SOllivier Robert */ 38ea906c41SOllivier Robert 392b15cb3dSCy Schubert #ifndef __doxygen__ 40ea906c41SOllivier Robert #define OPTION_CODE_COMPILE 1 41ea906c41SOllivier Robert #include "ntpdc-opts.h" 422b15cb3dSCy Schubert #include <sys/types.h> 432b15cb3dSCy Schubert 442b15cb3dSCy Schubert #include <limits.h> 452b15cb3dSCy Schubert #include <stdio.h> 462b15cb3dSCy Schubert #include <stdlib.h> 47ea906c41SOllivier Robert 48ea906c41SOllivier Robert #ifdef __cplusplus 49ea906c41SOllivier Robert extern "C" { 50ea906c41SOllivier Robert #endif 512b15cb3dSCy Schubert extern FILE * option_usage_fp; 522b15cb3dSCy Schubert #define zCopyright (ntpdc_opt_strs+0) 53*f0574f5cSXin LI #define zLicenseDescrip (ntpdc_opt_strs+342) 54ea906c41SOllivier Robert 55ea906c41SOllivier Robert /* 56ea906c41SOllivier Robert * global included definitions 57ea906c41SOllivier Robert */ 58ea906c41SOllivier Robert #ifdef __windows 59ea906c41SOllivier Robert extern int atoi(const char*); 60ea906c41SOllivier Robert #else 61ea906c41SOllivier Robert # include <stdlib.h> 62ea906c41SOllivier Robert #endif 63ea906c41SOllivier Robert 64ea906c41SOllivier Robert #ifndef NULL 65ea906c41SOllivier Robert # define NULL 0 66ea906c41SOllivier Robert #endif 672b15cb3dSCy Schubert 682b15cb3dSCy Schubert /** 692b15cb3dSCy Schubert * static const strings for ntpdc options 70ea906c41SOllivier Robert */ 71*f0574f5cSXin LI static char const ntpdc_opt_strs[1914] = 72*f0574f5cSXin LI /* 0 */ "ntpdc 4.2.8p10\n" 73*f0574f5cSXin LI "Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n" 742b15cb3dSCy Schubert "This is free software. It is licensed for use, modification and\n" 752b15cb3dSCy Schubert "redistribution under the terms of the NTP License, copies of which\n" 762b15cb3dSCy Schubert "can be seen at:\n" 772b15cb3dSCy Schubert " <http://ntp.org/license>\n" 782b15cb3dSCy Schubert " <http://opensource.org/licenses/ntp-license.php>\n\0" 79*f0574f5cSXin LI /* 342 */ "Permission to use, copy, modify, and distribute this software and its\n" 802b15cb3dSCy Schubert "documentation for any purpose with or without fee is hereby granted,\n" 812b15cb3dSCy Schubert "provided that the above copyright notice appears in all copies and that\n" 822b15cb3dSCy Schubert "both the copyright notice and this permission notice appear in supporting\n" 832b15cb3dSCy Schubert "documentation, and that the name The University of Delaware not be used in\n" 842b15cb3dSCy Schubert "advertising or publicity pertaining to distribution of the software without\n" 852b15cb3dSCy Schubert "specific, written prior permission. The University of Delaware and Network\n" 862b15cb3dSCy Schubert "Time Foundation makes no representations about the suitability this\n" 872b15cb3dSCy Schubert "software for any purpose. It is provided \"as is\" without express or\n" 882b15cb3dSCy Schubert "implied warranty.\n\0" 89*f0574f5cSXin LI /* 1010 */ "Force IPv4 DNS name resolution\0" 90*f0574f5cSXin LI /* 1041 */ "IPV4\0" 91*f0574f5cSXin LI /* 1046 */ "ipv4\0" 92*f0574f5cSXin LI /* 1051 */ "Force IPv6 DNS name resolution\0" 93*f0574f5cSXin LI /* 1082 */ "IPV6\0" 94*f0574f5cSXin LI /* 1087 */ "ipv6\0" 95*f0574f5cSXin LI /* 1092 */ "run a command and exit\0" 96*f0574f5cSXin LI /* 1115 */ "COMMAND\0" 97*f0574f5cSXin LI /* 1123 */ "command\0" 98*f0574f5cSXin LI /* 1131 */ "Increase debug verbosity level\0" 99*f0574f5cSXin LI /* 1162 */ "DEBUG_LEVEL\0" 100*f0574f5cSXin LI /* 1174 */ "debug-level\0" 101*f0574f5cSXin LI /* 1186 */ "Set the debug verbosity level\0" 102*f0574f5cSXin LI /* 1216 */ "SET_DEBUG_LEVEL\0" 103*f0574f5cSXin LI /* 1232 */ "set-debug-level\0" 104*f0574f5cSXin LI /* 1248 */ "Force ntpq to operate in interactive mode\0" 105*f0574f5cSXin LI /* 1290 */ "INTERACTIVE\0" 106*f0574f5cSXin LI /* 1302 */ "interactive\0" 107*f0574f5cSXin LI /* 1314 */ "Print a list of the peers\0" 108*f0574f5cSXin LI /* 1340 */ "LISTPEERS\0" 109*f0574f5cSXin LI /* 1350 */ "listpeers\0" 110*f0574f5cSXin LI /* 1360 */ "numeric host addresses\0" 111*f0574f5cSXin LI /* 1383 */ "NUMERIC\0" 112*f0574f5cSXin LI /* 1391 */ "numeric\0" 113*f0574f5cSXin LI /* 1399 */ "PEERS\0" 114*f0574f5cSXin LI /* 1405 */ "peers\0" 115*f0574f5cSXin LI /* 1411 */ "Show a list of the peers\0" 116*f0574f5cSXin LI /* 1436 */ "SHOWPEERS\0" 117*f0574f5cSXin LI /* 1446 */ "showpeers\0" 118*f0574f5cSXin LI /* 1456 */ "display extended usage information and exit\0" 119*f0574f5cSXin LI /* 1500 */ "help\0" 120*f0574f5cSXin LI /* 1505 */ "extended usage information passed thru pager\0" 121*f0574f5cSXin LI /* 1550 */ "more-help\0" 122*f0574f5cSXin LI /* 1560 */ "output version information and exit\0" 123*f0574f5cSXin LI /* 1596 */ "version\0" 124*f0574f5cSXin LI /* 1604 */ "save the option state to a config file\0" 125*f0574f5cSXin LI /* 1643 */ "save-opts\0" 126*f0574f5cSXin LI /* 1653 */ "load options from a config file\0" 127*f0574f5cSXin LI /* 1685 */ "LOAD_OPTS\0" 128*f0574f5cSXin LI /* 1695 */ "no-load-opts\0" 129*f0574f5cSXin LI /* 1708 */ "no\0" 130*f0574f5cSXin LI /* 1711 */ "NTPDC\0" 131*f0574f5cSXin LI /* 1717 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p10\n" 1322b15cb3dSCy Schubert "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0" 133*f0574f5cSXin LI /* 1848 */ "$HOME\0" 134*f0574f5cSXin LI /* 1854 */ ".\0" 135*f0574f5cSXin LI /* 1856 */ ".ntprc\0" 136*f0574f5cSXin LI /* 1863 */ "http://bugs.ntp.org, bugs@ntp.org\0" 137*f0574f5cSXin LI /* 1897 */ "\n\0" 138*f0574f5cSXin LI /* 1899 */ "ntpdc 4.2.8p10"; 1392b15cb3dSCy Schubert 1402b15cb3dSCy Schubert /** 1412b15cb3dSCy Schubert * ipv4 option description with 1422b15cb3dSCy Schubert * "Must also have options" and "Incompatible options": 1432b15cb3dSCy Schubert */ 1442b15cb3dSCy Schubert /** Descriptive text for the ipv4 option */ 145*f0574f5cSXin LI #define IPV4_DESC (ntpdc_opt_strs+1010) 1462b15cb3dSCy Schubert /** Upper-cased name for the ipv4 option */ 147*f0574f5cSXin LI #define IPV4_NAME (ntpdc_opt_strs+1041) 1482b15cb3dSCy Schubert /** Name string for the ipv4 option */ 149*f0574f5cSXin LI #define IPV4_name (ntpdc_opt_strs+1046) 1502b15cb3dSCy Schubert /** Other options that appear in conjunction with the ipv4 option */ 1512b15cb3dSCy Schubert static int const aIpv4CantList[] = { 1522b15cb3dSCy Schubert INDEX_OPT_IPV6, NO_EQUIVALENT }; 1532b15cb3dSCy Schubert /** Compiled in flag settings for the ipv4 option */ 154ea906c41SOllivier Robert #define IPV4_FLAGS (OPTST_DISABLED) 155ea906c41SOllivier Robert 1562b15cb3dSCy Schubert /** 1572b15cb3dSCy Schubert * ipv6 option description with 1582b15cb3dSCy Schubert * "Must also have options" and "Incompatible options": 159ea906c41SOllivier Robert */ 1602b15cb3dSCy Schubert /** Descriptive text for the ipv6 option */ 161*f0574f5cSXin LI #define IPV6_DESC (ntpdc_opt_strs+1051) 1622b15cb3dSCy Schubert /** Upper-cased name for the ipv6 option */ 163*f0574f5cSXin LI #define IPV6_NAME (ntpdc_opt_strs+1082) 1642b15cb3dSCy Schubert /** Name string for the ipv6 option */ 165*f0574f5cSXin LI #define IPV6_name (ntpdc_opt_strs+1087) 1662b15cb3dSCy Schubert /** Other options that appear in conjunction with the ipv6 option */ 1672b15cb3dSCy Schubert static int const aIpv6CantList[] = { 1682b15cb3dSCy Schubert INDEX_OPT_IPV4, NO_EQUIVALENT }; 1692b15cb3dSCy Schubert /** Compiled in flag settings for the ipv6 option */ 170ea906c41SOllivier Robert #define IPV6_FLAGS (OPTST_DISABLED) 171ea906c41SOllivier Robert 1722b15cb3dSCy Schubert /** 1732b15cb3dSCy Schubert * command option description: 174ea906c41SOllivier Robert */ 1752b15cb3dSCy Schubert /** Descriptive text for the command option */ 176*f0574f5cSXin LI #define COMMAND_DESC (ntpdc_opt_strs+1092) 1772b15cb3dSCy Schubert /** Upper-cased name for the command option */ 178*f0574f5cSXin LI #define COMMAND_NAME (ntpdc_opt_strs+1115) 1792b15cb3dSCy Schubert /** Name string for the command option */ 180*f0574f5cSXin LI #define COMMAND_name (ntpdc_opt_strs+1123) 1812b15cb3dSCy Schubert /** Compiled in flag settings for the command option */ 182ea906c41SOllivier Robert #define COMMAND_FLAGS (OPTST_DISABLED | OPTST_STACKED \ 183ea906c41SOllivier Robert | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 184ea906c41SOllivier Robert 1852b15cb3dSCy Schubert /** 1862b15cb3dSCy Schubert * debug-level option description: 187ea906c41SOllivier Robert */ 1882b15cb3dSCy Schubert /** Descriptive text for the debug-level option */ 189*f0574f5cSXin LI #define DEBUG_LEVEL_DESC (ntpdc_opt_strs+1131) 1902b15cb3dSCy Schubert /** Upper-cased name for the debug-level option */ 191*f0574f5cSXin LI #define DEBUG_LEVEL_NAME (ntpdc_opt_strs+1162) 1922b15cb3dSCy Schubert /** Name string for the debug-level option */ 193*f0574f5cSXin LI #define DEBUG_LEVEL_name (ntpdc_opt_strs+1174) 1942b15cb3dSCy Schubert /** Compiled in flag settings for the debug-level option */ 1952b15cb3dSCy Schubert #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) 196ea906c41SOllivier Robert 1972b15cb3dSCy Schubert /** 1982b15cb3dSCy Schubert * set-debug-level option description: 199ea906c41SOllivier Robert */ 2002b15cb3dSCy Schubert /** Descriptive text for the set-debug-level option */ 201*f0574f5cSXin LI #define SET_DEBUG_LEVEL_DESC (ntpdc_opt_strs+1186) 2022b15cb3dSCy Schubert /** Upper-cased name for the set-debug-level option */ 203*f0574f5cSXin LI #define SET_DEBUG_LEVEL_NAME (ntpdc_opt_strs+1216) 2042b15cb3dSCy Schubert /** Name string for the set-debug-level option */ 205*f0574f5cSXin LI #define SET_DEBUG_LEVEL_name (ntpdc_opt_strs+1232) 2062b15cb3dSCy Schubert /** Compiled in flag settings for the set-debug-level option */ 2072b15cb3dSCy Schubert #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ 2082b15cb3dSCy Schubert | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 209ea906c41SOllivier Robert 2102b15cb3dSCy Schubert /** 2112b15cb3dSCy Schubert * interactive option description with 212ea906c41SOllivier Robert * "Must also have options" and "Incompatible options": 213ea906c41SOllivier Robert */ 2142b15cb3dSCy Schubert /** Descriptive text for the interactive option */ 215*f0574f5cSXin LI #define INTERACTIVE_DESC (ntpdc_opt_strs+1248) 2162b15cb3dSCy Schubert /** Upper-cased name for the interactive option */ 217*f0574f5cSXin LI #define INTERACTIVE_NAME (ntpdc_opt_strs+1290) 2182b15cb3dSCy Schubert /** Name string for the interactive option */ 219*f0574f5cSXin LI #define INTERACTIVE_name (ntpdc_opt_strs+1302) 2202b15cb3dSCy Schubert /** Other options that appear in conjunction with the interactive option */ 2212b15cb3dSCy Schubert static int const aInteractiveCantList[] = { 222ea906c41SOllivier Robert INDEX_OPT_COMMAND, 223ea906c41SOllivier Robert INDEX_OPT_LISTPEERS, 224ea906c41SOllivier Robert INDEX_OPT_PEERS, 225ea906c41SOllivier Robert INDEX_OPT_SHOWPEERS, NO_EQUIVALENT }; 2262b15cb3dSCy Schubert /** Compiled in flag settings for the interactive option */ 227ea906c41SOllivier Robert #define INTERACTIVE_FLAGS (OPTST_DISABLED) 228ea906c41SOllivier Robert 2292b15cb3dSCy Schubert /** 2302b15cb3dSCy Schubert * listpeers option description with 2312b15cb3dSCy Schubert * "Must also have options" and "Incompatible options": 232ea906c41SOllivier Robert */ 2332b15cb3dSCy Schubert /** Descriptive text for the listpeers option */ 234*f0574f5cSXin LI #define LISTPEERS_DESC (ntpdc_opt_strs+1314) 2352b15cb3dSCy Schubert /** Upper-cased name for the listpeers option */ 236*f0574f5cSXin LI #define LISTPEERS_NAME (ntpdc_opt_strs+1340) 2372b15cb3dSCy Schubert /** Name string for the listpeers option */ 238*f0574f5cSXin LI #define LISTPEERS_name (ntpdc_opt_strs+1350) 2392b15cb3dSCy Schubert /** Other options that appear in conjunction with the listpeers option */ 2402b15cb3dSCy Schubert static int const aListpeersCantList[] = { 2412b15cb3dSCy Schubert INDEX_OPT_COMMAND, NO_EQUIVALENT }; 2422b15cb3dSCy Schubert /** Compiled in flag settings for the listpeers option */ 2432b15cb3dSCy Schubert #define LISTPEERS_FLAGS (OPTST_DISABLED) 244ea906c41SOllivier Robert 2452b15cb3dSCy Schubert /** 2462b15cb3dSCy Schubert * numeric option description: 247ea906c41SOllivier Robert */ 2482b15cb3dSCy Schubert /** Descriptive text for the numeric option */ 249*f0574f5cSXin LI #define NUMERIC_DESC (ntpdc_opt_strs+1360) 2502b15cb3dSCy Schubert /** Upper-cased name for the numeric option */ 251*f0574f5cSXin LI #define NUMERIC_NAME (ntpdc_opt_strs+1383) 2522b15cb3dSCy Schubert /** Name string for the numeric option */ 253*f0574f5cSXin LI #define NUMERIC_name (ntpdc_opt_strs+1391) 2542b15cb3dSCy Schubert /** Compiled in flag settings for the numeric option */ 255ea906c41SOllivier Robert #define NUMERIC_FLAGS (OPTST_DISABLED) 256ea906c41SOllivier Robert 2572b15cb3dSCy Schubert /** 2582b15cb3dSCy Schubert * peers option description with 2592b15cb3dSCy Schubert * "Must also have options" and "Incompatible options": 2602b15cb3dSCy Schubert */ 2612b15cb3dSCy Schubert /** Descriptive text for the peers option */ 262*f0574f5cSXin LI #define PEERS_DESC (ntpdc_opt_strs+1314) 2632b15cb3dSCy Schubert /** Upper-cased name for the peers option */ 264*f0574f5cSXin LI #define PEERS_NAME (ntpdc_opt_strs+1399) 2652b15cb3dSCy Schubert /** Name string for the peers option */ 266*f0574f5cSXin LI #define PEERS_name (ntpdc_opt_strs+1405) 2672b15cb3dSCy Schubert /** Other options that appear in conjunction with the peers option */ 2682b15cb3dSCy Schubert static int const aPeersCantList[] = { 2692b15cb3dSCy Schubert INDEX_OPT_COMMAND, NO_EQUIVALENT }; 2702b15cb3dSCy Schubert /** Compiled in flag settings for the peers option */ 2712b15cb3dSCy Schubert #define PEERS_FLAGS (OPTST_DISABLED) 2722b15cb3dSCy Schubert 2732b15cb3dSCy Schubert /** 2742b15cb3dSCy Schubert * showpeers option description with 2752b15cb3dSCy Schubert * "Must also have options" and "Incompatible options": 2762b15cb3dSCy Schubert */ 2772b15cb3dSCy Schubert /** Descriptive text for the showpeers option */ 278*f0574f5cSXin LI #define SHOWPEERS_DESC (ntpdc_opt_strs+1411) 2792b15cb3dSCy Schubert /** Upper-cased name for the showpeers option */ 280*f0574f5cSXin LI #define SHOWPEERS_NAME (ntpdc_opt_strs+1436) 2812b15cb3dSCy Schubert /** Name string for the showpeers option */ 282*f0574f5cSXin LI #define SHOWPEERS_name (ntpdc_opt_strs+1446) 2832b15cb3dSCy Schubert /** Other options that appear in conjunction with the showpeers option */ 2842b15cb3dSCy Schubert static int const aShowpeersCantList[] = { 2852b15cb3dSCy Schubert INDEX_OPT_COMMAND, NO_EQUIVALENT }; 2862b15cb3dSCy Schubert /** Compiled in flag settings for the showpeers option */ 2872b15cb3dSCy Schubert #define SHOWPEERS_FLAGS (OPTST_DISABLED) 2882b15cb3dSCy Schubert 289ea906c41SOllivier Robert /* 290ea906c41SOllivier Robert * Help/More_Help/Version option descriptions: 291ea906c41SOllivier Robert */ 292*f0574f5cSXin LI #define HELP_DESC (ntpdc_opt_strs+1456) 293*f0574f5cSXin LI #define HELP_name (ntpdc_opt_strs+1500) 2942b15cb3dSCy Schubert #ifdef HAVE_WORKING_FORK 295*f0574f5cSXin LI #define MORE_HELP_DESC (ntpdc_opt_strs+1505) 296*f0574f5cSXin LI #define MORE_HELP_name (ntpdc_opt_strs+1550) 2972b15cb3dSCy Schubert #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) 2982b15cb3dSCy Schubert #else 2992b15cb3dSCy Schubert #define MORE_HELP_DESC HELP_DESC 3002b15cb3dSCy Schubert #define MORE_HELP_name HELP_name 3012b15cb3dSCy Schubert #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 3022b15cb3dSCy Schubert #endif 3032b15cb3dSCy Schubert #ifdef NO_OPTIONAL_OPT_ARGS 3042b15cb3dSCy Schubert # define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) 3052b15cb3dSCy Schubert #else 3062b15cb3dSCy Schubert # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ 3072b15cb3dSCy Schubert OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) 3082b15cb3dSCy Schubert #endif 309*f0574f5cSXin LI #define VER_DESC (ntpdc_opt_strs+1560) 310*f0574f5cSXin LI #define VER_name (ntpdc_opt_strs+1596) 311*f0574f5cSXin LI #define SAVE_OPTS_DESC (ntpdc_opt_strs+1604) 312*f0574f5cSXin LI #define SAVE_OPTS_name (ntpdc_opt_strs+1643) 313*f0574f5cSXin LI #define LOAD_OPTS_DESC (ntpdc_opt_strs+1653) 314*f0574f5cSXin LI #define LOAD_OPTS_NAME (ntpdc_opt_strs+1685) 315*f0574f5cSXin LI #define NO_LOAD_OPTS_name (ntpdc_opt_strs+1695) 316*f0574f5cSXin LI #define LOAD_OPTS_pfx (ntpdc_opt_strs+1708) 3172b15cb3dSCy Schubert #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) 3182b15cb3dSCy Schubert /** 319ea906c41SOllivier Robert * Declare option callback procedures 320ea906c41SOllivier Robert */ 321ea906c41SOllivier Robert extern tOptProc 3222b15cb3dSCy Schubert ntpOptionPrintVersion, optionBooleanVal, optionNestedVal, 3232b15cb3dSCy Schubert optionNumericVal, optionPagedUsage, optionResetOpt, 3242b15cb3dSCy Schubert optionStackArg, optionTimeDate, optionTimeVal, 3252b15cb3dSCy Schubert optionUnstackArg, optionVendorOption; 326ea906c41SOllivier Robert static tOptProc 3272b15cb3dSCy Schubert doOptDebug_Level, doUsageOpt; 3282b15cb3dSCy Schubert #define VER_PROC ntpOptionPrintVersion 329ea906c41SOllivier Robert 3302b15cb3dSCy Schubert /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 3312b15cb3dSCy Schubert /** 3322b15cb3dSCy Schubert * Define the ntpdc Option Descriptions. 3332b15cb3dSCy Schubert * This is an array of OPTION_CT entries, one for each 3342b15cb3dSCy Schubert * option that the ntpdc program responds to. 335ea906c41SOllivier Robert */ 336ea906c41SOllivier Robert static tOptDesc optDesc[OPTION_CT] = { 337ea906c41SOllivier Robert { /* entry idx, value */ 0, VALUE_OPT_IPV4, 3382b15cb3dSCy Schubert /* equiv idx, value */ 0, VALUE_OPT_IPV4, 339ea906c41SOllivier Robert /* equivalenced to */ NO_EQUIVALENT, 340ea906c41SOllivier Robert /* min, max, act ct */ 0, 1, 0, 341ea906c41SOllivier Robert /* opt state flags */ IPV4_FLAGS, 0, 3422b15cb3dSCy Schubert /* last opt argumnt */ { NULL }, /* --ipv4 */ 343ea906c41SOllivier Robert /* arg list/cookie */ NULL, 3442b15cb3dSCy Schubert /* must/cannot opts */ NULL, aIpv4CantList, 345ea906c41SOllivier Robert /* option proc */ NULL, 3462b15cb3dSCy Schubert /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name, 347ea906c41SOllivier Robert /* disablement strs */ NULL, NULL }, 348ea906c41SOllivier Robert 349ea906c41SOllivier Robert { /* entry idx, value */ 1, VALUE_OPT_IPV6, 3502b15cb3dSCy Schubert /* equiv idx, value */ 1, VALUE_OPT_IPV6, 3512b15cb3dSCy Schubert /* equivalenced to */ NO_EQUIVALENT, 352ea906c41SOllivier Robert /* min, max, act ct */ 0, 1, 0, 353ea906c41SOllivier Robert /* opt state flags */ IPV6_FLAGS, 0, 3542b15cb3dSCy Schubert /* last opt argumnt */ { NULL }, /* --ipv6 */ 355ea906c41SOllivier Robert /* arg list/cookie */ NULL, 3562b15cb3dSCy Schubert /* must/cannot opts */ NULL, aIpv6CantList, 357ea906c41SOllivier Robert /* option proc */ NULL, 3582b15cb3dSCy Schubert /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name, 359ea906c41SOllivier Robert /* disablement strs */ NULL, NULL }, 360ea906c41SOllivier Robert 361ea906c41SOllivier Robert { /* entry idx, value */ 2, VALUE_OPT_COMMAND, 362ea906c41SOllivier Robert /* equiv idx, value */ 2, VALUE_OPT_COMMAND, 363ea906c41SOllivier Robert /* equivalenced to */ NO_EQUIVALENT, 364ea906c41SOllivier Robert /* min, max, act ct */ 0, NOLIMIT, 0, 365ea906c41SOllivier Robert /* opt state flags */ COMMAND_FLAGS, 0, 3662b15cb3dSCy Schubert /* last opt argumnt */ { NULL }, /* --command */ 367ea906c41SOllivier Robert /* arg list/cookie */ NULL, 368ea906c41SOllivier Robert /* must/cannot opts */ NULL, NULL, 369ea906c41SOllivier Robert /* option proc */ optionStackArg, 3702b15cb3dSCy Schubert /* desc, NAME, name */ COMMAND_DESC, COMMAND_NAME, COMMAND_name, 371ea906c41SOllivier Robert /* disablement strs */ NULL, NULL }, 372ea906c41SOllivier Robert 3732b15cb3dSCy Schubert { /* entry idx, value */ 3, VALUE_OPT_DEBUG_LEVEL, 3742b15cb3dSCy Schubert /* equiv idx, value */ 3, VALUE_OPT_DEBUG_LEVEL, 375ea906c41SOllivier Robert /* equivalenced to */ NO_EQUIVALENT, 376ea906c41SOllivier Robert /* min, max, act ct */ 0, NOLIMIT, 0, 377ea906c41SOllivier Robert /* opt state flags */ DEBUG_LEVEL_FLAGS, 0, 3782b15cb3dSCy Schubert /* last opt argumnt */ { NULL }, /* --debug-level */ 379ea906c41SOllivier Robert /* arg list/cookie */ NULL, 380ea906c41SOllivier Robert /* must/cannot opts */ NULL, NULL, 3812b15cb3dSCy Schubert /* option proc */ doOptDebug_Level, 3822b15cb3dSCy Schubert /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name, 383ea906c41SOllivier Robert /* disablement strs */ NULL, NULL }, 384ea906c41SOllivier Robert 3852b15cb3dSCy Schubert { /* entry idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL, 3862b15cb3dSCy Schubert /* equiv idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL, 387ea906c41SOllivier Robert /* equivalenced to */ NO_EQUIVALENT, 388ea906c41SOllivier Robert /* min, max, act ct */ 0, NOLIMIT, 0, 389ea906c41SOllivier Robert /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0, 3902b15cb3dSCy Schubert /* last opt argumnt */ { NULL }, /* --set-debug-level */ 391ea906c41SOllivier Robert /* arg list/cookie */ NULL, 392ea906c41SOllivier Robert /* must/cannot opts */ NULL, NULL, 3932b15cb3dSCy Schubert /* option proc */ optionNumericVal, 3942b15cb3dSCy Schubert /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name, 395ea906c41SOllivier Robert /* disablement strs */ NULL, NULL }, 396ea906c41SOllivier Robert 3972b15cb3dSCy Schubert { /* entry idx, value */ 5, VALUE_OPT_INTERACTIVE, 3982b15cb3dSCy Schubert /* equiv idx, value */ 5, VALUE_OPT_INTERACTIVE, 3992b15cb3dSCy Schubert /* equivalenced to */ NO_EQUIVALENT, 4002b15cb3dSCy Schubert /* min, max, act ct */ 0, 1, 0, 4012b15cb3dSCy Schubert /* opt state flags */ INTERACTIVE_FLAGS, 0, 4022b15cb3dSCy Schubert /* last opt argumnt */ { NULL }, /* --interactive */ 4032b15cb3dSCy Schubert /* arg list/cookie */ NULL, 4042b15cb3dSCy Schubert /* must/cannot opts */ NULL, aInteractiveCantList, 4052b15cb3dSCy Schubert /* option proc */ NULL, 4062b15cb3dSCy Schubert /* desc, NAME, name */ INTERACTIVE_DESC, INTERACTIVE_NAME, INTERACTIVE_name, 4072b15cb3dSCy Schubert /* disablement strs */ NULL, NULL }, 4082b15cb3dSCy Schubert 4092b15cb3dSCy Schubert { /* entry idx, value */ 6, VALUE_OPT_LISTPEERS, 4102b15cb3dSCy Schubert /* equiv idx, value */ 6, VALUE_OPT_LISTPEERS, 4112b15cb3dSCy Schubert /* equivalenced to */ NO_EQUIVALENT, 4122b15cb3dSCy Schubert /* min, max, act ct */ 0, 1, 0, 4132b15cb3dSCy Schubert /* opt state flags */ LISTPEERS_FLAGS, 0, 4142b15cb3dSCy Schubert /* last opt argumnt */ { NULL }, /* --listpeers */ 4152b15cb3dSCy Schubert /* arg list/cookie */ NULL, 4162b15cb3dSCy Schubert /* must/cannot opts */ NULL, aListpeersCantList, 4172b15cb3dSCy Schubert /* option proc */ NULL, 4182b15cb3dSCy Schubert /* desc, NAME, name */ LISTPEERS_DESC, LISTPEERS_NAME, LISTPEERS_name, 4192b15cb3dSCy Schubert /* disablement strs */ NULL, NULL }, 4202b15cb3dSCy Schubert 4212b15cb3dSCy Schubert { /* entry idx, value */ 7, VALUE_OPT_NUMERIC, 4222b15cb3dSCy Schubert /* equiv idx, value */ 7, VALUE_OPT_NUMERIC, 423ea906c41SOllivier Robert /* equivalenced to */ NO_EQUIVALENT, 424ea906c41SOllivier Robert /* min, max, act ct */ 0, 1, 0, 425ea906c41SOllivier Robert /* opt state flags */ NUMERIC_FLAGS, 0, 4262b15cb3dSCy Schubert /* last opt argumnt */ { NULL }, /* --numeric */ 427ea906c41SOllivier Robert /* arg list/cookie */ NULL, 428ea906c41SOllivier Robert /* must/cannot opts */ NULL, NULL, 429ea906c41SOllivier Robert /* option proc */ NULL, 4302b15cb3dSCy Schubert /* desc, NAME, name */ NUMERIC_DESC, NUMERIC_NAME, NUMERIC_name, 431ea906c41SOllivier Robert /* disablement strs */ NULL, NULL }, 432ea906c41SOllivier Robert 4332b15cb3dSCy Schubert { /* entry idx, value */ 8, VALUE_OPT_PEERS, 4342b15cb3dSCy Schubert /* equiv idx, value */ 8, VALUE_OPT_PEERS, 435ea906c41SOllivier Robert /* equivalenced to */ NO_EQUIVALENT, 436ea906c41SOllivier Robert /* min, max, act ct */ 0, 1, 0, 4372b15cb3dSCy Schubert /* opt state flags */ PEERS_FLAGS, 0, 4382b15cb3dSCy Schubert /* last opt argumnt */ { NULL }, /* --peers */ 4392b15cb3dSCy Schubert /* arg list/cookie */ NULL, 4402b15cb3dSCy Schubert /* must/cannot opts */ NULL, aPeersCantList, 4412b15cb3dSCy Schubert /* option proc */ NULL, 4422b15cb3dSCy Schubert /* desc, NAME, name */ PEERS_DESC, PEERS_NAME, PEERS_name, 4432b15cb3dSCy Schubert /* disablement strs */ NULL, NULL }, 4442b15cb3dSCy Schubert 4452b15cb3dSCy Schubert { /* entry idx, value */ 9, VALUE_OPT_SHOWPEERS, 4462b15cb3dSCy Schubert /* equiv idx, value */ 9, VALUE_OPT_SHOWPEERS, 4472b15cb3dSCy Schubert /* equivalenced to */ NO_EQUIVALENT, 4482b15cb3dSCy Schubert /* min, max, act ct */ 0, 1, 0, 4492b15cb3dSCy Schubert /* opt state flags */ SHOWPEERS_FLAGS, 0, 4502b15cb3dSCy Schubert /* last opt argumnt */ { NULL }, /* --showpeers */ 4512b15cb3dSCy Schubert /* arg list/cookie */ NULL, 4522b15cb3dSCy Schubert /* must/cannot opts */ NULL, aShowpeersCantList, 4532b15cb3dSCy Schubert /* option proc */ NULL, 4542b15cb3dSCy Schubert /* desc, NAME, name */ SHOWPEERS_DESC, SHOWPEERS_NAME, SHOWPEERS_name, 4552b15cb3dSCy Schubert /* disablement strs */ NULL, NULL }, 4562b15cb3dSCy Schubert 4572b15cb3dSCy Schubert { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, 4582b15cb3dSCy Schubert /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, 4592b15cb3dSCy Schubert /* equivalenced to */ NO_EQUIVALENT, 4602b15cb3dSCy Schubert /* min, max, act ct */ 0, 1, 0, 4612b15cb3dSCy Schubert /* opt state flags */ VER_FLAGS, AOUSE_VERSION, 462ea906c41SOllivier Robert /* last opt argumnt */ { NULL }, 463ea906c41SOllivier Robert /* arg list/cookie */ NULL, 464ea906c41SOllivier Robert /* must/cannot opts */ NULL, NULL, 4652b15cb3dSCy Schubert /* option proc */ VER_PROC, 4662b15cb3dSCy Schubert /* desc, NAME, name */ VER_DESC, NULL, VER_name, 467ea906c41SOllivier Robert /* disablement strs */ NULL, NULL }, 468ea906c41SOllivier Robert 469ea906c41SOllivier Robert 470ea906c41SOllivier Robert 471ea906c41SOllivier Robert { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, 4722b15cb3dSCy Schubert /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, 473ea906c41SOllivier Robert /* equivalenced to */ NO_EQUIVALENT, 474ea906c41SOllivier Robert /* min, max, act ct */ 0, 1, 0, 4752b15cb3dSCy Schubert /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, 476ea906c41SOllivier Robert /* last opt argumnt */ { NULL }, 477ea906c41SOllivier Robert /* arg list/cookie */ NULL, 478ea906c41SOllivier Robert /* must/cannot opts */ NULL, NULL, 479ea906c41SOllivier Robert /* option proc */ doUsageOpt, 4802b15cb3dSCy Schubert /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, 481ea906c41SOllivier Robert /* disablement strs */ NULL, NULL }, 482ea906c41SOllivier Robert 483ea906c41SOllivier Robert { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, 4842b15cb3dSCy Schubert /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, 485ea906c41SOllivier Robert /* equivalenced to */ NO_EQUIVALENT, 486ea906c41SOllivier Robert /* min, max, act ct */ 0, 1, 0, 4872b15cb3dSCy Schubert /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, 488ea906c41SOllivier Robert /* last opt argumnt */ { NULL }, 489ea906c41SOllivier Robert /* arg list/cookie */ NULL, 490ea906c41SOllivier Robert /* must/cannot opts */ NULL, NULL, 491ea906c41SOllivier Robert /* option proc */ optionPagedUsage, 4922b15cb3dSCy Schubert /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, 493ea906c41SOllivier Robert /* disablement strs */ NULL, NULL }, 494ea906c41SOllivier Robert 495ea906c41SOllivier Robert { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, 4962b15cb3dSCy Schubert /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS, 497ea906c41SOllivier Robert /* equivalenced to */ NO_EQUIVALENT, 498ea906c41SOllivier Robert /* min, max, act ct */ 0, 1, 0, 499ea906c41SOllivier Robert /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) 5002b15cb3dSCy Schubert | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS, 501ea906c41SOllivier Robert /* last opt argumnt */ { NULL }, 502ea906c41SOllivier Robert /* arg list/cookie */ NULL, 503ea906c41SOllivier Robert /* must/cannot opts */ NULL, NULL, 504ea906c41SOllivier Robert /* option proc */ NULL, 5052b15cb3dSCy Schubert /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name, 506ea906c41SOllivier Robert /* disablement strs */ NULL, NULL }, 507ea906c41SOllivier Robert 508ea906c41SOllivier Robert { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, 5092b15cb3dSCy Schubert /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS, 510ea906c41SOllivier Robert /* equivalenced to */ NO_EQUIVALENT, 511ea906c41SOllivier Robert /* min, max, act ct */ 0, NOLIMIT, 0, 5122b15cb3dSCy Schubert /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) 5132b15cb3dSCy Schubert | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS, 514ea906c41SOllivier Robert /* last opt argumnt */ { NULL }, 515ea906c41SOllivier Robert /* arg list/cookie */ NULL, 516ea906c41SOllivier Robert /* must/cannot opts */ NULL, NULL, 517ea906c41SOllivier Robert /* option proc */ optionLoadOpt, 5182b15cb3dSCy Schubert /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name, 5192b15cb3dSCy Schubert /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx } 520ea906c41SOllivier Robert }; 521ea906c41SOllivier Robert 522ea906c41SOllivier Robert 5232b15cb3dSCy Schubert /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 5242b15cb3dSCy Schubert /** Reference to the upper cased version of ntpdc. */ 525*f0574f5cSXin LI #define zPROGNAME (ntpdc_opt_strs+1711) 5262b15cb3dSCy Schubert /** Reference to the title line for ntpdc usage. */ 527*f0574f5cSXin LI #define zUsageTitle (ntpdc_opt_strs+1717) 5282b15cb3dSCy Schubert /** ntpdc configuration file name. */ 529*f0574f5cSXin LI #define zRcName (ntpdc_opt_strs+1856) 5302b15cb3dSCy Schubert /** Directories to search for ntpdc config files. */ 5312b15cb3dSCy Schubert static char const * const apzHomeList[3] = { 532*f0574f5cSXin LI ntpdc_opt_strs+1848, 533*f0574f5cSXin LI ntpdc_opt_strs+1854, 5342b15cb3dSCy Schubert NULL }; 5352b15cb3dSCy Schubert /** The ntpdc program bug email address. */ 536*f0574f5cSXin LI #define zBugsAddr (ntpdc_opt_strs+1863) 5372b15cb3dSCy Schubert /** Clarification/explanation of what ntpdc does. */ 538*f0574f5cSXin LI #define zExplain (ntpdc_opt_strs+1897) 5392b15cb3dSCy Schubert /** Extra detail explaining what ntpdc does. */ 5402b15cb3dSCy Schubert #define zDetail (NULL) 5412b15cb3dSCy Schubert /** The full version string for ntpdc. */ 542*f0574f5cSXin LI #define zFullVersion (ntpdc_opt_strs+1899) 5432b15cb3dSCy Schubert /* extracted from optcode.tlib near line 364 */ 544ea906c41SOllivier Robert 545ea906c41SOllivier Robert #if defined(ENABLE_NLS) 546ea906c41SOllivier Robert # define OPTPROC_BASE OPTPROC_TRANSLATE 547ea906c41SOllivier Robert static tOptionXlateProc translate_option_strings; 548ea906c41SOllivier Robert #else 549ea906c41SOllivier Robert # define OPTPROC_BASE OPTPROC_NONE 550ea906c41SOllivier Robert # define translate_option_strings NULL 551ea906c41SOllivier Robert #endif /* ENABLE_NLS */ 552ea906c41SOllivier Robert 5532b15cb3dSCy Schubert #define ntpdc_full_usage (NULL) 5542b15cb3dSCy Schubert #define ntpdc_short_usage (NULL) 5552b15cb3dSCy Schubert 5562b15cb3dSCy Schubert #endif /* not defined __doxygen__ */ 5572b15cb3dSCy Schubert 5582b15cb3dSCy Schubert /* 5592b15cb3dSCy Schubert * Create the static procedure(s) declared above. 5602b15cb3dSCy Schubert */ 5612b15cb3dSCy Schubert /** 5622b15cb3dSCy Schubert * The callout function that invokes the optionUsage function. 5632b15cb3dSCy Schubert * 5642b15cb3dSCy Schubert * @param[in] opts the AutoOpts option description structure 5652b15cb3dSCy Schubert * @param[in] od the descriptor for the "help" (usage) option. 5662b15cb3dSCy Schubert * @noreturn 5672b15cb3dSCy Schubert */ 5682b15cb3dSCy Schubert static void 5692b15cb3dSCy Schubert doUsageOpt(tOptions * opts, tOptDesc * od) 5702b15cb3dSCy Schubert { 5712b15cb3dSCy Schubert int ex_code; 5722b15cb3dSCy Schubert ex_code = NTPDC_EXIT_SUCCESS; 5732b15cb3dSCy Schubert optionUsage(&ntpdcOptions, ex_code); 5742b15cb3dSCy Schubert /* NOTREACHED */ 5752b15cb3dSCy Schubert exit(1); 5762b15cb3dSCy Schubert (void)opts; 5772b15cb3dSCy Schubert (void)od; 5782b15cb3dSCy Schubert } 5792b15cb3dSCy Schubert 5802b15cb3dSCy Schubert /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 5812b15cb3dSCy Schubert /** 5822b15cb3dSCy Schubert * Code to handle the debug-level option. 5832b15cb3dSCy Schubert * 5842b15cb3dSCy Schubert * @param[in] pOptions the ntpdc options data structure 5852b15cb3dSCy Schubert * @param[in,out] pOptDesc the option descriptor for this option. 5862b15cb3dSCy Schubert */ 5872b15cb3dSCy Schubert static void 5882b15cb3dSCy Schubert doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc) 5892b15cb3dSCy Schubert { 5902b15cb3dSCy Schubert /* 5912b15cb3dSCy Schubert * Be sure the flag-code[0] handles special values for the options pointer 5922b15cb3dSCy Schubert * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit 5932b15cb3dSCy Schubert * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to 5942b15cb3dSCy Schubert * reset its state. 5952b15cb3dSCy Schubert */ 5962b15cb3dSCy Schubert /* extracted from debug-opt.def, line 15 */ 5972b15cb3dSCy Schubert OPT_VALUE_SET_DEBUG_LEVEL++; 5982b15cb3dSCy Schubert (void)pOptDesc; 5992b15cb3dSCy Schubert (void)pOptions; 6002b15cb3dSCy Schubert } 601276da39aSCy Schubert /* extracted from optmain.tlib near line 1250 */ 6022b15cb3dSCy Schubert 6032b15cb3dSCy Schubert /** 6042b15cb3dSCy Schubert * The directory containing the data associated with ntpdc. 6052b15cb3dSCy Schubert */ 6062b15cb3dSCy Schubert #ifndef PKGDATADIR 6072b15cb3dSCy Schubert # define PKGDATADIR "" 6082b15cb3dSCy Schubert #endif 6092b15cb3dSCy Schubert 6102b15cb3dSCy Schubert /** 6112b15cb3dSCy Schubert * Information about the person or institution that packaged ntpdc 6122b15cb3dSCy Schubert * for the current distribution. 6132b15cb3dSCy Schubert */ 6142b15cb3dSCy Schubert #ifndef WITH_PACKAGER 6152b15cb3dSCy Schubert # define ntpdc_packager_info NULL 6162b15cb3dSCy Schubert #else 6172b15cb3dSCy Schubert /** Packager information for ntpdc. */ 6182b15cb3dSCy Schubert static char const ntpdc_packager_info[] = 6192b15cb3dSCy Schubert "Packaged by " WITH_PACKAGER 6202b15cb3dSCy Schubert 6212b15cb3dSCy Schubert # ifdef WITH_PACKAGER_VERSION 6222b15cb3dSCy Schubert " ("WITH_PACKAGER_VERSION")" 6232b15cb3dSCy Schubert # endif 6242b15cb3dSCy Schubert 6252b15cb3dSCy Schubert # ifdef WITH_PACKAGER_BUG_REPORTS 6262b15cb3dSCy Schubert "\nReport ntpdc bugs to " WITH_PACKAGER_BUG_REPORTS 6272b15cb3dSCy Schubert # endif 6282b15cb3dSCy Schubert "\n"; 6292b15cb3dSCy Schubert #endif 6302b15cb3dSCy Schubert #ifndef __doxygen__ 6312b15cb3dSCy Schubert 6322b15cb3dSCy Schubert #endif /* __doxygen__ */ 6332b15cb3dSCy Schubert /** 6342b15cb3dSCy Schubert * The option definitions for ntpdc. The one structure that 6352b15cb3dSCy Schubert * binds them all. 6362b15cb3dSCy Schubert */ 637ea906c41SOllivier Robert tOptions ntpdcOptions = { 638ea906c41SOllivier Robert OPTIONS_STRUCT_VERSION, 639ea906c41SOllivier Robert 0, NULL, /* original argc + argv */ 640ea906c41SOllivier Robert ( OPTPROC_BASE 641ea906c41SOllivier Robert + OPTPROC_ERRSTOP 642ea906c41SOllivier Robert + OPTPROC_SHORTOPT 643ea906c41SOllivier Robert + OPTPROC_LONGOPT 644ea906c41SOllivier Robert + OPTPROC_NO_REQ_OPT 645ea906c41SOllivier Robert + OPTPROC_ENVIRON 6462b15cb3dSCy Schubert + OPTPROC_MISUSE ), 647ea906c41SOllivier Robert 0, NULL, /* current option index, current option */ 648ea906c41SOllivier Robert NULL, NULL, zPROGNAME, 6492b15cb3dSCy Schubert zRcName, zCopyright, zLicenseDescrip, 650ea906c41SOllivier Robert zFullVersion, apzHomeList, zUsageTitle, 651ea906c41SOllivier Robert zExplain, zDetail, optDesc, 652ea906c41SOllivier Robert zBugsAddr, /* address to send bugs to */ 653ea906c41SOllivier Robert NULL, NULL, /* extensions/saved state */ 654ea906c41SOllivier Robert optionUsage, /* usage procedure */ 655ea906c41SOllivier Robert translate_option_strings, /* translation procedure */ 656ea906c41SOllivier Robert /* 657ea906c41SOllivier Robert * Indexes to special options 658ea906c41SOllivier Robert */ 6592b15cb3dSCy Schubert { INDEX_OPT_MORE_HELP, /* more-help option index */ 6602b15cb3dSCy Schubert INDEX_OPT_SAVE_OPTS, /* save option index */ 6612b15cb3dSCy Schubert NO_EQUIVALENT, /* '-#' option index */ 662ea906c41SOllivier Robert NO_EQUIVALENT /* index of default opt */ 663ea906c41SOllivier Robert }, 6642b15cb3dSCy Schubert 15 /* full option count */, 10 /* user option count */, 6652b15cb3dSCy Schubert ntpdc_full_usage, ntpdc_short_usage, 6662b15cb3dSCy Schubert NULL, NULL, 6672b15cb3dSCy Schubert PKGDATADIR, ntpdc_packager_info 668ea906c41SOllivier Robert }; 669ea906c41SOllivier Robert 670ea906c41SOllivier Robert #if ENABLE_NLS 6712b15cb3dSCy Schubert /** 6722b15cb3dSCy Schubert * This code is designed to translate translatable option text for the 6732b15cb3dSCy Schubert * ntpdc program. These translations happen upon entry 6742b15cb3dSCy Schubert * to optionProcess(). 6752b15cb3dSCy Schubert */ 676ea906c41SOllivier Robert #include <stdio.h> 677ea906c41SOllivier Robert #include <stdlib.h> 678ea906c41SOllivier Robert #include <string.h> 679ea906c41SOllivier Robert #include <unistd.h> 6802b15cb3dSCy Schubert #ifdef HAVE_DCGETTEXT 6812b15cb3dSCy Schubert # include <gettext.h> 6822b15cb3dSCy Schubert #endif 683ea906c41SOllivier Robert #include <autoopts/usage-txt.h> 684ea906c41SOllivier Robert 685ea906c41SOllivier Robert static char * AO_gettext(char const * pz); 686ea906c41SOllivier Robert static void coerce_it(void ** s); 687ea906c41SOllivier Robert 6882b15cb3dSCy Schubert /** 6892b15cb3dSCy Schubert * AutoGen specific wrapper function for gettext. It relies on the macro _() 6902b15cb3dSCy Schubert * to convert from English to the target language, then strdup-duplicates the 6912b15cb3dSCy Schubert * result string. It tries the "libopts" domain first, then whatever has been 6922b15cb3dSCy Schubert * set via the \a textdomain(3) call. 6932b15cb3dSCy Schubert * 6942b15cb3dSCy Schubert * @param[in] pz the input text used as a lookup key. 6952b15cb3dSCy Schubert * @returns the translated text (if there is one), 6962b15cb3dSCy Schubert * or the original text (if not). 6972b15cb3dSCy Schubert */ 698ea906c41SOllivier Robert static char * 699ea906c41SOllivier Robert AO_gettext(char const * pz) 700ea906c41SOllivier Robert { 7012b15cb3dSCy Schubert char * res; 702ea906c41SOllivier Robert if (pz == NULL) 703ea906c41SOllivier Robert return NULL; 7042b15cb3dSCy Schubert #ifdef HAVE_DCGETTEXT 705ea906c41SOllivier Robert /* 7062b15cb3dSCy Schubert * While processing the option_xlateable_txt data, try to use the 7072b15cb3dSCy Schubert * "libopts" domain. Once we switch to the option descriptor data, 7082b15cb3dSCy Schubert * do *not* use that domain. 7092b15cb3dSCy Schubert */ 7102b15cb3dSCy Schubert if (option_xlateable_txt.field_ct != 0) { 7112b15cb3dSCy Schubert res = dgettext("libopts", pz); 7122b15cb3dSCy Schubert if (res == pz) 713276da39aSCy Schubert res = (char *)VOIDP(_(pz)); 7142b15cb3dSCy Schubert } else 715276da39aSCy Schubert res = (char *)VOIDP(_(pz)); 7162b15cb3dSCy Schubert #else 717276da39aSCy Schubert res = (char *)VOIDP(_(pz)); 7182b15cb3dSCy Schubert #endif 7192b15cb3dSCy Schubert if (res == pz) 7202b15cb3dSCy Schubert return res; 7212b15cb3dSCy Schubert res = strdup(res); 7222b15cb3dSCy Schubert if (res == NULL) { 7232b15cb3dSCy Schubert fputs(_("No memory for duping translated strings\n"), stderr); 7242b15cb3dSCy Schubert exit(NTPDC_EXIT_FAILURE); 7252b15cb3dSCy Schubert } 7262b15cb3dSCy Schubert return res; 7272b15cb3dSCy Schubert } 7282b15cb3dSCy Schubert 7292b15cb3dSCy Schubert /** 7302b15cb3dSCy Schubert * All the pointers we use are marked "* const", but they are stored in 7312b15cb3dSCy Schubert * writable memory. Coerce the mutability and set the pointer. 7322b15cb3dSCy Schubert */ 7332b15cb3dSCy Schubert static void coerce_it(void ** s) { *s = AO_gettext(*s); 7342b15cb3dSCy Schubert } 7352b15cb3dSCy Schubert 7362b15cb3dSCy Schubert /** 7372b15cb3dSCy Schubert * Translate all the translatable strings in the ntpdcOptions 7382b15cb3dSCy Schubert * structure defined above. This is done only once. 739ea906c41SOllivier Robert */ 740ea906c41SOllivier Robert static void 741ea906c41SOllivier Robert translate_option_strings(void) 742ea906c41SOllivier Robert { 7432b15cb3dSCy Schubert tOptions * const opts = &ntpdcOptions; 7442b15cb3dSCy Schubert 745ea906c41SOllivier Robert /* 746ea906c41SOllivier Robert * Guard against re-translation. It won't work. The strings will have 747ea906c41SOllivier Robert * been changed by the first pass through this code. One shot only. 748ea906c41SOllivier Robert */ 7492b15cb3dSCy Schubert if (option_xlateable_txt.field_ct != 0) { 750ea906c41SOllivier Robert /* 7512b15cb3dSCy Schubert * Do the translations. The first pointer follows the field count 7522b15cb3dSCy Schubert * field. The field count field is the size of a pointer. 753ea906c41SOllivier Robert */ 754276da39aSCy Schubert char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); 7552b15cb3dSCy Schubert int ix = option_xlateable_txt.field_ct; 756ea906c41SOllivier Robert 757ea906c41SOllivier Robert do { 7582b15cb3dSCy Schubert ppz++; /* skip over field_ct */ 759ea906c41SOllivier Robert *ppz = AO_gettext(*ppz); 760ea906c41SOllivier Robert } while (--ix > 0); 7612b15cb3dSCy Schubert /* prevent re-translation and disable "libopts" domain lookup */ 7622b15cb3dSCy Schubert option_xlateable_txt.field_ct = 0; 763ea906c41SOllivier Robert 764276da39aSCy Schubert coerce_it(VOIDP(&(opts->pzCopyright))); 765276da39aSCy Schubert coerce_it(VOIDP(&(opts->pzCopyNotice))); 766276da39aSCy Schubert coerce_it(VOIDP(&(opts->pzFullVersion))); 767276da39aSCy Schubert coerce_it(VOIDP(&(opts->pzUsageTitle))); 768276da39aSCy Schubert coerce_it(VOIDP(&(opts->pzExplain))); 769276da39aSCy Schubert coerce_it(VOIDP(&(opts->pzDetail))); 770ea906c41SOllivier Robert { 7712b15cb3dSCy Schubert tOptDesc * od = opts->pOptDesc; 7722b15cb3dSCy Schubert for (ix = opts->optCt; ix > 0; ix--, od++) 773276da39aSCy Schubert coerce_it(VOIDP(&(od->pzText))); 774ea906c41SOllivier Robert } 775ea906c41SOllivier Robert } 776ea906c41SOllivier Robert } 777ea906c41SOllivier Robert #endif /* ENABLE_NLS */ 778ea906c41SOllivier Robert 7792b15cb3dSCy Schubert #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT 7802b15cb3dSCy Schubert /** I18N function strictly for xgettext. Do not compile. */ 7812b15cb3dSCy Schubert static void bogus_function(void) { 7822b15cb3dSCy Schubert /* TRANSLATORS: 7832b15cb3dSCy Schubert 7842b15cb3dSCy Schubert The following dummy function was crated solely so that xgettext can 7852b15cb3dSCy Schubert extract the correct strings. These strings are actually referenced 7862b15cb3dSCy Schubert by a field name in the ntpdcOptions structure noted in the 7872b15cb3dSCy Schubert comments below. The literal text is defined in ntpdc_opt_strs. 7882b15cb3dSCy Schubert 7892b15cb3dSCy Schubert NOTE: the strings below are segmented with respect to the source string 7902b15cb3dSCy Schubert ntpdc_opt_strs. The strings above are handed off for translation 7912b15cb3dSCy Schubert at run time a paragraph at a time. Consequently, they are presented here 7922b15cb3dSCy Schubert for translation a paragraph at a time. 7932b15cb3dSCy Schubert 7942b15cb3dSCy Schubert ALSO: often the description for an option will reference another option 7952b15cb3dSCy Schubert by name. These are set off with apostrophe quotes (I hope). Do not 7962b15cb3dSCy Schubert translate option names. 7972b15cb3dSCy Schubert */ 7982b15cb3dSCy Schubert /* referenced via ntpdcOptions.pzCopyright */ 799*f0574f5cSXin LI puts(_("ntpdc 4.2.8p10\n\ 800*f0574f5cSXin LI Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n\ 8012b15cb3dSCy Schubert This is free software. It is licensed for use, modification and\n\ 8022b15cb3dSCy Schubert redistribution under the terms of the NTP License, copies of which\n\ 8032b15cb3dSCy Schubert can be seen at:\n")); 8042b15cb3dSCy Schubert puts(_(" <http://ntp.org/license>\n\ 8052b15cb3dSCy Schubert <http://opensource.org/licenses/ntp-license.php>\n")); 8062b15cb3dSCy Schubert 8072b15cb3dSCy Schubert /* referenced via ntpdcOptions.pzCopyNotice */ 8082b15cb3dSCy Schubert puts(_("Permission to use, copy, modify, and distribute this software and its\n\ 8092b15cb3dSCy Schubert documentation for any purpose with or without fee is hereby granted,\n\ 8102b15cb3dSCy Schubert provided that the above copyright notice appears in all copies and that\n\ 8112b15cb3dSCy Schubert both the copyright notice and this permission notice appear in supporting\n\ 8122b15cb3dSCy Schubert documentation, and that the name The University of Delaware not be used in\n\ 8132b15cb3dSCy Schubert advertising or publicity pertaining to distribution of the software without\n\ 8142b15cb3dSCy Schubert specific, written prior permission. The University of Delaware and Network\n\ 8152b15cb3dSCy Schubert Time Foundation makes no representations about the suitability this\n\ 8162b15cb3dSCy Schubert software for any purpose. It is provided \"as is\" without express or\n\ 8172b15cb3dSCy Schubert implied warranty.\n")); 8182b15cb3dSCy Schubert 8192b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8202b15cb3dSCy Schubert puts(_("Force IPv4 DNS name resolution")); 8212b15cb3dSCy Schubert 8222b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8232b15cb3dSCy Schubert puts(_("Force IPv6 DNS name resolution")); 8242b15cb3dSCy Schubert 8252b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8262b15cb3dSCy Schubert puts(_("run a command and exit")); 8272b15cb3dSCy Schubert 8282b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8292b15cb3dSCy Schubert puts(_("Increase debug verbosity level")); 8302b15cb3dSCy Schubert 8312b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8322b15cb3dSCy Schubert puts(_("Set the debug verbosity level")); 8332b15cb3dSCy Schubert 8342b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8352b15cb3dSCy Schubert puts(_("Force ntpq to operate in interactive mode")); 8362b15cb3dSCy Schubert 8372b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8382b15cb3dSCy Schubert puts(_("Print a list of the peers")); 8392b15cb3dSCy Schubert 8402b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8412b15cb3dSCy Schubert puts(_("numeric host addresses")); 8422b15cb3dSCy Schubert 8432b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8442b15cb3dSCy Schubert puts(_("Print a list of the peers")); 8452b15cb3dSCy Schubert 8462b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8472b15cb3dSCy Schubert puts(_("Show a list of the peers")); 8482b15cb3dSCy Schubert 8492b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8502b15cb3dSCy Schubert puts(_("display extended usage information and exit")); 8512b15cb3dSCy Schubert 8522b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8532b15cb3dSCy Schubert puts(_("extended usage information passed thru pager")); 8542b15cb3dSCy Schubert 8552b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8562b15cb3dSCy Schubert puts(_("output version information and exit")); 8572b15cb3dSCy Schubert 8582b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8592b15cb3dSCy Schubert puts(_("save the option state to a config file")); 8602b15cb3dSCy Schubert 8612b15cb3dSCy Schubert /* referenced via ntpdcOptions.pOptDesc->pzText */ 8622b15cb3dSCy Schubert puts(_("load options from a config file")); 8632b15cb3dSCy Schubert 8642b15cb3dSCy Schubert /* referenced via ntpdcOptions.pzUsageTitle */ 865*f0574f5cSXin LI puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p10\n\ 8662b15cb3dSCy Schubert Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n")); 8672b15cb3dSCy Schubert 8682b15cb3dSCy Schubert /* referenced via ntpdcOptions.pzExplain */ 8692b15cb3dSCy Schubert puts(_("\n")); 8702b15cb3dSCy Schubert 8712b15cb3dSCy Schubert /* referenced via ntpdcOptions.pzFullVersion */ 872*f0574f5cSXin LI puts(_("ntpdc 4.2.8p10")); 8732b15cb3dSCy Schubert 8742b15cb3dSCy Schubert /* referenced via ntpdcOptions.pzFullUsage */ 8752b15cb3dSCy Schubert puts(_("<<<NOT-FOUND>>>")); 8762b15cb3dSCy Schubert 8772b15cb3dSCy Schubert /* referenced via ntpdcOptions.pzShortUsage */ 8782b15cb3dSCy Schubert puts(_("<<<NOT-FOUND>>>")); 8792b15cb3dSCy Schubert /* LIBOPTS-MESSAGES: */ 8802b15cb3dSCy Schubert #line 67 "../autoopts.c" 8812b15cb3dSCy Schubert puts(_("allocation of %d bytes failed\n")); 8822b15cb3dSCy Schubert #line 93 "../autoopts.c" 8832b15cb3dSCy Schubert puts(_("allocation of %d bytes failed\n")); 8842b15cb3dSCy Schubert #line 53 "../init.c" 8852b15cb3dSCy Schubert puts(_("AutoOpts function called without option descriptor\n")); 8862b15cb3dSCy Schubert #line 86 "../init.c" 8872b15cb3dSCy Schubert puts(_("\tThis exceeds the compiled library version: ")); 8882b15cb3dSCy Schubert #line 84 "../init.c" 8892b15cb3dSCy Schubert puts(_("Automated Options Processing Error!\n" 8902b15cb3dSCy Schubert "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); 8912b15cb3dSCy Schubert #line 80 "../autoopts.c" 8922b15cb3dSCy Schubert puts(_("realloc of %d bytes at 0x%p failed\n")); 8932b15cb3dSCy Schubert #line 88 "../init.c" 8942b15cb3dSCy Schubert puts(_("\tThis is less than the minimum library version: ")); 8952b15cb3dSCy Schubert #line 121 "../version.c" 8962b15cb3dSCy Schubert puts(_("Automated Options version %s\n" 8972b15cb3dSCy Schubert "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); 898276da39aSCy Schubert #line 87 "../makeshell.c" 8992b15cb3dSCy Schubert puts(_("(AutoOpts bug): %s.\n")); 9002b15cb3dSCy Schubert #line 90 "../reset.c" 9012b15cb3dSCy Schubert puts(_("optionResetOpt() called, but reset-option not configured")); 9022b15cb3dSCy Schubert #line 292 "../usage.c" 9032b15cb3dSCy Schubert puts(_("could not locate the 'help' option")); 9042b15cb3dSCy Schubert #line 336 "../autoopts.c" 9052b15cb3dSCy Schubert puts(_("optionProcess() was called with invalid data")); 9062b15cb3dSCy Schubert #line 748 "../usage.c" 9072b15cb3dSCy Schubert puts(_("invalid argument type specified")); 9082b15cb3dSCy Schubert #line 598 "../find.c" 9092b15cb3dSCy Schubert puts(_("defaulted to option with optional arg")); 9102b15cb3dSCy Schubert #line 76 "../alias.c" 9112b15cb3dSCy Schubert puts(_("aliasing option is out of range.")); 9122b15cb3dSCy Schubert #line 234 "../enum.c" 9132b15cb3dSCy Schubert puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); 9142b15cb3dSCy Schubert #line 108 "../find.c" 9152b15cb3dSCy Schubert puts(_(" The following options match:\n")); 9162b15cb3dSCy Schubert #line 293 "../find.c" 9172b15cb3dSCy Schubert puts(_("%s: ambiguous option name: %s (matches %d options)\n")); 9182b15cb3dSCy Schubert #line 161 "../check.c" 9192b15cb3dSCy Schubert puts(_("%s: Command line arguments required\n")); 9202b15cb3dSCy Schubert #line 43 "../alias.c" 9212b15cb3dSCy Schubert puts(_("%d %s%s options allowed\n")); 922276da39aSCy Schubert #line 94 "../makeshell.c" 9232b15cb3dSCy Schubert puts(_("%s error %d (%s) calling %s for '%s'\n")); 924276da39aSCy Schubert #line 306 "../makeshell.c" 9252b15cb3dSCy Schubert puts(_("interprocess pipe")); 9262b15cb3dSCy Schubert #line 168 "../version.c" 9272b15cb3dSCy Schubert puts(_("error: version option argument '%c' invalid. Use:\n" 9282b15cb3dSCy Schubert "\t'v' - version only\n" 9292b15cb3dSCy Schubert "\t'c' - version and copyright\n" 9302b15cb3dSCy Schubert "\t'n' - version and full copyright notice\n")); 9312b15cb3dSCy Schubert #line 58 "../check.c" 9322b15cb3dSCy Schubert puts(_("%s error: the '%s' and '%s' options conflict\n")); 9332b15cb3dSCy Schubert #line 217 "../find.c" 9342b15cb3dSCy Schubert puts(_("%s: The '%s' option has been disabled.")); 9352b15cb3dSCy Schubert #line 430 "../find.c" 9362b15cb3dSCy Schubert puts(_("%s: The '%s' option has been disabled.")); 9372b15cb3dSCy Schubert #line 38 "../alias.c" 9382b15cb3dSCy Schubert puts(_("-equivalence")); 9392b15cb3dSCy Schubert #line 469 "../find.c" 9402b15cb3dSCy Schubert puts(_("%s: illegal option -- %c\n")); 9412b15cb3dSCy Schubert #line 110 "../reset.c" 9422b15cb3dSCy Schubert puts(_("%s: illegal option -- %c\n")); 9432b15cb3dSCy Schubert #line 271 "../find.c" 9442b15cb3dSCy Schubert puts(_("%s: illegal option -- %s\n")); 9452b15cb3dSCy Schubert #line 755 "../find.c" 9462b15cb3dSCy Schubert puts(_("%s: illegal option -- %s\n")); 9472b15cb3dSCy Schubert #line 118 "../reset.c" 9482b15cb3dSCy Schubert puts(_("%s: illegal option -- %s\n")); 9492b15cb3dSCy Schubert #line 335 "../find.c" 9502b15cb3dSCy Schubert puts(_("%s: unknown vendor extension option -- %s\n")); 9512b15cb3dSCy Schubert #line 159 "../enum.c" 9522b15cb3dSCy Schubert puts(_(" or an integer from %d through %d\n")); 9532b15cb3dSCy Schubert #line 169 "../enum.c" 9542b15cb3dSCy Schubert puts(_(" or an integer from %d through %d\n")); 9552b15cb3dSCy Schubert #line 747 "../usage.c" 9562b15cb3dSCy Schubert puts(_("%s error: invalid option descriptor for %s\n")); 9572b15cb3dSCy Schubert #line 1081 "../usage.c" 9582b15cb3dSCy Schubert puts(_("%s error: invalid option descriptor for %s\n")); 9592b15cb3dSCy Schubert #line 385 "../find.c" 9602b15cb3dSCy Schubert puts(_("%s: invalid option name: %s\n")); 9612b15cb3dSCy Schubert #line 527 "../find.c" 9622b15cb3dSCy Schubert puts(_("%s: The '%s' option requires an argument.\n")); 9632b15cb3dSCy Schubert #line 156 "../autoopts.c" 9642b15cb3dSCy Schubert puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" 9652b15cb3dSCy Schubert "\t'%s' and '%s'.")); 9662b15cb3dSCy Schubert #line 94 "../check.c" 9672b15cb3dSCy Schubert puts(_("%s error: The %s option is required\n")); 9682b15cb3dSCy Schubert #line 632 "../find.c" 9692b15cb3dSCy Schubert puts(_("%s: The '%s' option cannot have an argument.\n")); 9702b15cb3dSCy Schubert #line 151 "../check.c" 9712b15cb3dSCy Schubert puts(_("%s: Command line arguments are not allowed.\n")); 9722b15cb3dSCy Schubert #line 535 "../save.c" 9732b15cb3dSCy Schubert puts(_("error %d (%s) creating %s\n")); 9742b15cb3dSCy Schubert #line 234 "../enum.c" 9752b15cb3dSCy Schubert puts(_("%s error: '%s' does not match any %s keywords.\n")); 9762b15cb3dSCy Schubert #line 93 "../reset.c" 9772b15cb3dSCy Schubert puts(_("%s error: The '%s' option requires an argument.\n")); 9782b15cb3dSCy Schubert #line 184 "../save.c" 9792b15cb3dSCy Schubert puts(_("error %d (%s) stat-ing %s\n")); 9802b15cb3dSCy Schubert #line 238 "../save.c" 9812b15cb3dSCy Schubert puts(_("error %d (%s) stat-ing %s\n")); 9822b15cb3dSCy Schubert #line 143 "../restore.c" 9832b15cb3dSCy Schubert puts(_("%s error: no saved option state\n")); 9842b15cb3dSCy Schubert #line 231 "../autoopts.c" 9852b15cb3dSCy Schubert puts(_("'%s' is not a command line option.\n")); 9862b15cb3dSCy Schubert #line 111 "../time.c" 9872b15cb3dSCy Schubert puts(_("%s error: '%s' is not a recognizable date/time.\n")); 9882b15cb3dSCy Schubert #line 132 "../save.c" 9892b15cb3dSCy Schubert puts(_("'%s' not defined\n")); 9902b15cb3dSCy Schubert #line 50 "../time.c" 9912b15cb3dSCy Schubert puts(_("%s error: '%s' is not a recognizable time duration.\n")); 9922b15cb3dSCy Schubert #line 92 "../check.c" 9932b15cb3dSCy Schubert puts(_("%s error: The %s option must appear %d times.\n")); 9942b15cb3dSCy Schubert #line 164 "../numeric.c" 9952b15cb3dSCy Schubert puts(_("%s error: '%s' is not a recognizable number.\n")); 9962b15cb3dSCy Schubert #line 200 "../enum.c" 9972b15cb3dSCy Schubert puts(_("%s error: %s exceeds %s keyword count\n")); 9982b15cb3dSCy Schubert #line 330 "../usage.c" 9992b15cb3dSCy Schubert puts(_("Try '%s %s' for more information.\n")); 10002b15cb3dSCy Schubert #line 45 "../alias.c" 10012b15cb3dSCy Schubert puts(_("one %s%s option allowed\n")); 1002276da39aSCy Schubert #line 208 "../makeshell.c" 10032b15cb3dSCy Schubert puts(_("standard output")); 1004276da39aSCy Schubert #line 943 "../makeshell.c" 10052b15cb3dSCy Schubert puts(_("standard output")); 10062b15cb3dSCy Schubert #line 274 "../usage.c" 10072b15cb3dSCy Schubert puts(_("standard output")); 10082b15cb3dSCy Schubert #line 415 "../usage.c" 10092b15cb3dSCy Schubert puts(_("standard output")); 10102b15cb3dSCy Schubert #line 625 "../usage.c" 10112b15cb3dSCy Schubert puts(_("standard output")); 10122b15cb3dSCy Schubert #line 175 "../version.c" 10132b15cb3dSCy Schubert puts(_("standard output")); 10142b15cb3dSCy Schubert #line 274 "../usage.c" 10152b15cb3dSCy Schubert puts(_("standard error")); 10162b15cb3dSCy Schubert #line 415 "../usage.c" 10172b15cb3dSCy Schubert puts(_("standard error")); 10182b15cb3dSCy Schubert #line 625 "../usage.c" 10192b15cb3dSCy Schubert puts(_("standard error")); 10202b15cb3dSCy Schubert #line 175 "../version.c" 10212b15cb3dSCy Schubert puts(_("standard error")); 1022276da39aSCy Schubert #line 208 "../makeshell.c" 10232b15cb3dSCy Schubert puts(_("write")); 1024276da39aSCy Schubert #line 943 "../makeshell.c" 10252b15cb3dSCy Schubert puts(_("write")); 10262b15cb3dSCy Schubert #line 273 "../usage.c" 10272b15cb3dSCy Schubert puts(_("write")); 10282b15cb3dSCy Schubert #line 414 "../usage.c" 10292b15cb3dSCy Schubert puts(_("write")); 10302b15cb3dSCy Schubert #line 624 "../usage.c" 10312b15cb3dSCy Schubert puts(_("write")); 10322b15cb3dSCy Schubert #line 174 "../version.c" 10332b15cb3dSCy Schubert puts(_("write")); 10342b15cb3dSCy Schubert #line 60 "../numeric.c" 10352b15cb3dSCy Schubert puts(_("%s error: %s option value %ld is out of range.\n")); 10362b15cb3dSCy Schubert #line 44 "../check.c" 10372b15cb3dSCy Schubert puts(_("%s error: %s option requires the %s option\n")); 10382b15cb3dSCy Schubert #line 131 "../save.c" 10392b15cb3dSCy Schubert puts(_("%s warning: cannot save options - %s not regular file\n")); 10402b15cb3dSCy Schubert #line 183 "../save.c" 10412b15cb3dSCy Schubert puts(_("%s warning: cannot save options - %s not regular file\n")); 10422b15cb3dSCy Schubert #line 237 "../save.c" 10432b15cb3dSCy Schubert puts(_("%s warning: cannot save options - %s not regular file\n")); 10442b15cb3dSCy Schubert #line 256 "../save.c" 10452b15cb3dSCy Schubert puts(_("%s warning: cannot save options - %s not regular file\n")); 10462b15cb3dSCy Schubert #line 534 "../save.c" 10472b15cb3dSCy Schubert puts(_("%s warning: cannot save options - %s not regular file\n")); 10482b15cb3dSCy Schubert /* END-LIBOPTS-MESSAGES */ 10492b15cb3dSCy Schubert 10502b15cb3dSCy Schubert /* USAGE-TEXT: */ 10512b15cb3dSCy Schubert #line 873 "../usage.c" 10522b15cb3dSCy Schubert puts(_("\t\t\t\t- an alternate for '%s'\n")); 10532b15cb3dSCy Schubert #line 1148 "../usage.c" 10542b15cb3dSCy Schubert puts(_("Version, usage and configuration options:")); 10552b15cb3dSCy Schubert #line 924 "../usage.c" 10562b15cb3dSCy Schubert puts(_("\t\t\t\t- default option for unnamed options\n")); 10572b15cb3dSCy Schubert #line 837 "../usage.c" 10582b15cb3dSCy Schubert puts(_("\t\t\t\t- disabled as '--%s'\n")); 10592b15cb3dSCy Schubert #line 1117 "../usage.c" 10602b15cb3dSCy Schubert puts(_(" --- %-14s %s\n")); 10612b15cb3dSCy Schubert #line 1115 "../usage.c" 10622b15cb3dSCy Schubert puts(_("This option has been disabled")); 10632b15cb3dSCy Schubert #line 864 "../usage.c" 10642b15cb3dSCy Schubert puts(_("\t\t\t\t- enabled by default\n")); 10652b15cb3dSCy Schubert #line 40 "../alias.c" 10662b15cb3dSCy Schubert puts(_("%s error: only ")); 10672b15cb3dSCy Schubert #line 1194 "../usage.c" 10682b15cb3dSCy Schubert puts(_(" - examining environment variables named %s_*\n")); 10692b15cb3dSCy Schubert #line 168 "../file.c" 10702b15cb3dSCy Schubert puts(_("\t\t\t\t- file must not pre-exist\n")); 10712b15cb3dSCy Schubert #line 172 "../file.c" 10722b15cb3dSCy Schubert puts(_("\t\t\t\t- file must pre-exist\n")); 10732b15cb3dSCy Schubert #line 380 "../usage.c" 10742b15cb3dSCy Schubert puts(_("Options are specified by doubled hyphens and their name or by a single\n" 10752b15cb3dSCy Schubert "hyphen and the flag character.\n")); 1076276da39aSCy Schubert #line 921 "../makeshell.c" 10772b15cb3dSCy Schubert puts(_("\n" 10782b15cb3dSCy Schubert "= = = = = = = =\n\n" 10792b15cb3dSCy Schubert "This incarnation of genshell will produce\n" 10802b15cb3dSCy Schubert "a shell script to parse the options for %s:\n\n")); 10812b15cb3dSCy Schubert #line 166 "../enum.c" 10822b15cb3dSCy Schubert puts(_(" or an integer mask with any of the lower %d bits set\n")); 10832b15cb3dSCy Schubert #line 897 "../usage.c" 10842b15cb3dSCy Schubert puts(_("\t\t\t\t- is a set membership option\n")); 10852b15cb3dSCy Schubert #line 918 "../usage.c" 10862b15cb3dSCy Schubert puts(_("\t\t\t\t- must appear between %d and %d times\n")); 10872b15cb3dSCy Schubert #line 382 "../usage.c" 10882b15cb3dSCy Schubert puts(_("Options are specified by single or double hyphens and their name.\n")); 10892b15cb3dSCy Schubert #line 904 "../usage.c" 10902b15cb3dSCy Schubert puts(_("\t\t\t\t- may appear multiple times\n")); 10912b15cb3dSCy Schubert #line 891 "../usage.c" 10922b15cb3dSCy Schubert puts(_("\t\t\t\t- may not be preset\n")); 10932b15cb3dSCy Schubert #line 1309 "../usage.c" 10942b15cb3dSCy Schubert puts(_(" Arg Option-Name Description\n")); 10952b15cb3dSCy Schubert #line 1245 "../usage.c" 10962b15cb3dSCy Schubert puts(_(" Flg Arg Option-Name Description\n")); 10972b15cb3dSCy Schubert #line 1303 "../usage.c" 10982b15cb3dSCy Schubert puts(_(" Flg Arg Option-Name Description\n")); 10992b15cb3dSCy Schubert #line 1304 "../usage.c" 11002b15cb3dSCy Schubert puts(_(" %3s %s")); 11012b15cb3dSCy Schubert #line 1310 "../usage.c" 11022b15cb3dSCy Schubert puts(_(" %3s %s")); 11032b15cb3dSCy Schubert #line 387 "../usage.c" 11042b15cb3dSCy Schubert puts(_("The '-#<number>' option may omit the hash char\n")); 11052b15cb3dSCy Schubert #line 383 "../usage.c" 11062b15cb3dSCy Schubert puts(_("All arguments are named options.\n")); 11072b15cb3dSCy Schubert #line 971 "../usage.c" 11082b15cb3dSCy Schubert puts(_(" - reading file %s")); 11092b15cb3dSCy Schubert #line 409 "../usage.c" 11102b15cb3dSCy Schubert puts(_("\n" 11112b15cb3dSCy Schubert "Please send bug reports to: <%s>\n")); 11122b15cb3dSCy Schubert #line 100 "../version.c" 11132b15cb3dSCy Schubert puts(_("\n" 11142b15cb3dSCy Schubert "Please send bug reports to: <%s>\n")); 11152b15cb3dSCy Schubert #line 129 "../version.c" 11162b15cb3dSCy Schubert puts(_("\n" 11172b15cb3dSCy Schubert "Please send bug reports to: <%s>\n")); 11182b15cb3dSCy Schubert #line 903 "../usage.c" 11192b15cb3dSCy Schubert puts(_("\t\t\t\t- may NOT appear - preset only\n")); 11202b15cb3dSCy Schubert #line 944 "../usage.c" 11212b15cb3dSCy Schubert puts(_("\n" 11222b15cb3dSCy Schubert "The following option preset mechanisms are supported:\n")); 11232b15cb3dSCy Schubert #line 1192 "../usage.c" 11242b15cb3dSCy Schubert puts(_("\n" 11252b15cb3dSCy Schubert "The following option preset mechanisms are supported:\n")); 11262b15cb3dSCy Schubert #line 682 "../usage.c" 11272b15cb3dSCy Schubert puts(_("prohibits these options:\n")); 11282b15cb3dSCy Schubert #line 677 "../usage.c" 11292b15cb3dSCy Schubert puts(_("prohibits the option '%s'\n")); 11302b15cb3dSCy Schubert #line 81 "../numeric.c" 11312b15cb3dSCy Schubert puts(_("%s%ld to %ld")); 11322b15cb3dSCy Schubert #line 79 "../numeric.c" 11332b15cb3dSCy Schubert puts(_("%sgreater than or equal to %ld")); 11342b15cb3dSCy Schubert #line 75 "../numeric.c" 11352b15cb3dSCy Schubert puts(_("%s%ld exactly")); 11362b15cb3dSCy Schubert #line 68 "../numeric.c" 11372b15cb3dSCy Schubert puts(_("%sit must lie in one of the ranges:\n")); 11382b15cb3dSCy Schubert #line 68 "../numeric.c" 11392b15cb3dSCy Schubert puts(_("%sit must be in the range:\n")); 11402b15cb3dSCy Schubert #line 88 "../numeric.c" 11412b15cb3dSCy Schubert puts(_(", or\n")); 11422b15cb3dSCy Schubert #line 66 "../numeric.c" 11432b15cb3dSCy Schubert puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); 11442b15cb3dSCy Schubert #line 77 "../numeric.c" 11452b15cb3dSCy Schubert puts(_("%sless than or equal to %ld")); 11462b15cb3dSCy Schubert #line 390 "../usage.c" 11472b15cb3dSCy Schubert puts(_("Operands and options may be intermixed. They will be reordered.\n")); 11482b15cb3dSCy Schubert #line 652 "../usage.c" 11492b15cb3dSCy Schubert puts(_("requires the option '%s'\n")); 11502b15cb3dSCy Schubert #line 655 "../usage.c" 11512b15cb3dSCy Schubert puts(_("requires these options:\n")); 11522b15cb3dSCy Schubert #line 1321 "../usage.c" 11532b15cb3dSCy Schubert puts(_(" Arg Option-Name Req? Description\n")); 11542b15cb3dSCy Schubert #line 1315 "../usage.c" 11552b15cb3dSCy Schubert puts(_(" Flg Arg Option-Name Req? Description\n")); 11562b15cb3dSCy Schubert #line 167 "../enum.c" 11572b15cb3dSCy Schubert puts(_("or you may use a numeric representation. Preceding these with a '!'\n" 11582b15cb3dSCy Schubert "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" 11592b15cb3dSCy Schubert "will set them all. Multiple entries may be passed as an option\n" 11602b15cb3dSCy Schubert "argument list.\n")); 11612b15cb3dSCy Schubert #line 910 "../usage.c" 11622b15cb3dSCy Schubert puts(_("\t\t\t\t- may appear up to %d times\n")); 11632b15cb3dSCy Schubert #line 77 "../enum.c" 11642b15cb3dSCy Schubert puts(_("The valid \"%s\" option keywords are:\n")); 11652b15cb3dSCy Schubert #line 1152 "../usage.c" 11662b15cb3dSCy Schubert puts(_("The next option supports vendor supported extra options:")); 11672b15cb3dSCy Schubert #line 773 "../usage.c" 11682b15cb3dSCy Schubert puts(_("These additional options are:")); 11692b15cb3dSCy Schubert /* END-USAGE-TEXT */ 11702b15cb3dSCy Schubert } 11712b15cb3dSCy Schubert #endif /* uncompilable code */ 1172ea906c41SOllivier Robert #ifdef __cplusplus 1173ea906c41SOllivier Robert } 1174ea906c41SOllivier Robert #endif 1175ea906c41SOllivier Robert /* ntpdc-opts.c ends here */ 1176