summaryrefslogtreecommitdiff
path: root/src/cli-args.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-01-23 21:05:18 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-01-23 21:05:18 +0100
commitb9fe619275c7c6058caf430b1320e0e370430367 (patch)
tree2c0ac61d1579f61c25e8acf47a9fe3f696231bcc /src/cli-args.c
parent4968dd090ecf9c88a105a2c805cf97638bcca75d (diff)
downloadgnutls-b9fe619275c7c6058caf430b1320e0e370430367.tar.gz
Updated ranges patch.
Diffstat (limited to 'src/cli-args.c')
-rw-r--r--src/cli-args.c188
1 files changed, 109 insertions, 79 deletions
diff --git a/src/cli-args.c b/src/cli-args.c
index 85eb132840..e2906456ed 100644
--- a/src/cli-args.c
+++ b/src/cli-args.c
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (cli-args.c)
*
- * It has been AutoGen-ed January 22, 2013 at 05:25:25 PM by AutoGen 5.15
+ * It has been AutoGen-ed January 23, 2013 at 09:03:04 PM by AutoGen 5.16
* From the definitions cli-args.def
* and the template file options
*
- * Generated from AutoOpts 36:3:11 templates.
+ * Generated from AutoOpts 36:4:11 templates.
*
* AutoOpts is a copyrighted work. This source file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -39,6 +39,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef __doxygen__
#define OPTION_CODE_COMPILE 1
#include "cli-args.h"
#include <sys/types.h>
@@ -58,7 +59,6 @@ extern FILE * option_usage_fp;
#define zCopyright (gnutls_cli_opt_strs+0)
#define zLicenseDescrip (gnutls_cli_opt_strs+281)
-extern tUsageProc optionUsage;
#ifndef NULL
# define NULL 0
@@ -67,7 +67,7 @@ extern tUsageProc optionUsage;
/*
* gnutls-cli option static const strings
*/
-static char const gnutls_cli_opt_strs[3868] =
+static char const gnutls_cli_opt_strs[3854] =
/* 0 */ "gnutls-cli @VERSION@\n"
"Copyright (C) 2000-2012 Free Software Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
@@ -196,41 +196,41 @@ static char const gnutls_cli_opt_strs[3868] =
/* 2762 */ "Don't abort program if server certificate can't be validated\0"
/* 2823 */ "INSECURE\0"
/* 2832 */ "insecure\0"
-/* 2841 */ "When possible, use length-hiding padding to prevent traffic analysis\0"
-/* 2910 */ "RANGES\0"
-/* 2917 */ "ranges\0"
-/* 2924 */ "Benchmark individual ciphers\0"
-/* 2953 */ "BENCHMARK_CIPHERS\0"
-/* 2971 */ "benchmark-ciphers\0"
-/* 2989 */ "Benchmark individual software ciphers (no hw acceleration)\0"
-/* 3048 */ "BENCHMARK_SOFT_CIPHERS\0"
-/* 3071 */ "benchmark-soft-ciphers\0"
-/* 3094 */ "Benchmark TLS key exchange methods\0"
-/* 3129 */ "BENCHMARK_TLS_KX\0"
-/* 3146 */ "benchmark-tls-kx\0"
-/* 3163 */ "Benchmark TLS ciphers\0"
-/* 3185 */ "BENCHMARK_TLS_CIPHERS\0"
-/* 3207 */ "benchmark-tls-ciphers\0"
-/* 3229 */ "Print a list of the supported algorithms and modes\0"
-/* 3280 */ "LIST\0"
-/* 3285 */ "list\0"
-/* 3290 */ "Display extended usage information and exit\0"
-/* 3334 */ "help\0"
-/* 3339 */ "Extended usage information passed thru pager\0"
-/* 3384 */ "more-help\0"
-/* 3394 */ "Output version information and exit\0"
-/* 3430 */ "version\0"
-/* 3438 */ "GNUTLS_CLI\0"
-/* 3449 */ "gnutls-cli - GnuTLS client - Ver. @VERSION@\n"
+/* 2841 */ "Use length-hiding padding to prevent traffic analysis\0"
+/* 2895 */ "RANGES\0"
+/* 2902 */ "ranges\0"
+/* 2909 */ "Benchmark individual ciphers\0"
+/* 2938 */ "BENCHMARK_CIPHERS\0"
+/* 2956 */ "benchmark-ciphers\0"
+/* 2974 */ "Benchmark individual software ciphers (no hw acceleration)\0"
+/* 3033 */ "BENCHMARK_SOFT_CIPHERS\0"
+/* 3056 */ "benchmark-soft-ciphers\0"
+/* 3079 */ "Benchmark TLS key exchange methods\0"
+/* 3114 */ "BENCHMARK_TLS_KX\0"
+/* 3131 */ "benchmark-tls-kx\0"
+/* 3148 */ "Benchmark TLS ciphers\0"
+/* 3170 */ "BENCHMARK_TLS_CIPHERS\0"
+/* 3192 */ "benchmark-tls-ciphers\0"
+/* 3214 */ "Print a list of the supported algorithms and modes\0"
+/* 3265 */ "LIST\0"
+/* 3270 */ "list\0"
+/* 3275 */ "Display extended usage information and exit\0"
+/* 3319 */ "help\0"
+/* 3324 */ "Extended usage information passed thru pager\0"
+/* 3369 */ "more-help\0"
+/* 3379 */ "Output version information and exit\0"
+/* 3415 */ "version\0"
+/* 3423 */ "GNUTLS_CLI\0"
+/* 3434 */ "gnutls-cli - GnuTLS client - Ver. @VERSION@\n"
"USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostname]\n\0"
-/* 3562 */ "bug-gnutls@gnu.org\0"
-/* 3581 */ "\n\n\0"
-/* 3584 */ "\n"
- "Simple client program to set up a TLS connection to some other computer.\n"
- "It sets up a TLS connection and forwards data from the standard input to\n"
- "the secured socket and vice versa.\n\0"
-/* 3767 */ "gnutls-cli @VERSION@\0"
-/* 3788 */ "Usage: gnutls-cli [options] hostname\n"
+/* 3547 */ "bug-gnutls@gnu.org\0"
+/* 3566 */ "\n\n\0"
+/* 3569 */ "\n"
+ "Simple client program to set up a TLS connection to some other computer. It\n"
+ "sets up a TLS connection and forwards data from the standard input to the\n"
+ "secured socket and vice versa.\n\0"
+/* 3753 */ "gnutls-cli @VERSION@\0"
+/* 3774 */ "Usage: gnutls-cli [options] hostname\n"
"gnutls-cli --help for usage instructions.\n";
/*
@@ -562,58 +562,58 @@ static char const gnutls_cli_opt_strs[3868] =
* ranges option description:
*/
#define RANGES_DESC (gnutls_cli_opt_strs+2841)
-#define RANGES_NAME (gnutls_cli_opt_strs+2910)
-#define RANGES_name (gnutls_cli_opt_strs+2917)
+#define RANGES_NAME (gnutls_cli_opt_strs+2895)
+#define RANGES_name (gnutls_cli_opt_strs+2902)
#define RANGES_FLAGS (OPTST_DISABLED)
/*
* benchmark-ciphers option description:
*/
-#define BENCHMARK_CIPHERS_DESC (gnutls_cli_opt_strs+2924)
-#define BENCHMARK_CIPHERS_NAME (gnutls_cli_opt_strs+2953)
-#define BENCHMARK_CIPHERS_name (gnutls_cli_opt_strs+2971)
+#define BENCHMARK_CIPHERS_DESC (gnutls_cli_opt_strs+2909)
+#define BENCHMARK_CIPHERS_NAME (gnutls_cli_opt_strs+2938)
+#define BENCHMARK_CIPHERS_name (gnutls_cli_opt_strs+2956)
#define BENCHMARK_CIPHERS_FLAGS (OPTST_DISABLED)
/*
* benchmark-soft-ciphers option description:
*/
-#define BENCHMARK_SOFT_CIPHERS_DESC (gnutls_cli_opt_strs+2989)
-#define BENCHMARK_SOFT_CIPHERS_NAME (gnutls_cli_opt_strs+3048)
-#define BENCHMARK_SOFT_CIPHERS_name (gnutls_cli_opt_strs+3071)
+#define BENCHMARK_SOFT_CIPHERS_DESC (gnutls_cli_opt_strs+2974)
+#define BENCHMARK_SOFT_CIPHERS_NAME (gnutls_cli_opt_strs+3033)
+#define BENCHMARK_SOFT_CIPHERS_name (gnutls_cli_opt_strs+3056)
#define BENCHMARK_SOFT_CIPHERS_FLAGS (OPTST_DISABLED)
/*
* benchmark-tls-kx option description:
*/
-#define BENCHMARK_TLS_KX_DESC (gnutls_cli_opt_strs+3094)
-#define BENCHMARK_TLS_KX_NAME (gnutls_cli_opt_strs+3129)
-#define BENCHMARK_TLS_KX_name (gnutls_cli_opt_strs+3146)
+#define BENCHMARK_TLS_KX_DESC (gnutls_cli_opt_strs+3079)
+#define BENCHMARK_TLS_KX_NAME (gnutls_cli_opt_strs+3114)
+#define BENCHMARK_TLS_KX_name (gnutls_cli_opt_strs+3131)
#define BENCHMARK_TLS_KX_FLAGS (OPTST_DISABLED)
/*
* benchmark-tls-ciphers option description:
*/
-#define BENCHMARK_TLS_CIPHERS_DESC (gnutls_cli_opt_strs+3163)
-#define BENCHMARK_TLS_CIPHERS_NAME (gnutls_cli_opt_strs+3185)
-#define BENCHMARK_TLS_CIPHERS_name (gnutls_cli_opt_strs+3207)
+#define BENCHMARK_TLS_CIPHERS_DESC (gnutls_cli_opt_strs+3148)
+#define BENCHMARK_TLS_CIPHERS_NAME (gnutls_cli_opt_strs+3170)
+#define BENCHMARK_TLS_CIPHERS_name (gnutls_cli_opt_strs+3192)
#define BENCHMARK_TLS_CIPHERS_FLAGS (OPTST_DISABLED)
/*
* list option description:
*/
-#define LIST_DESC (gnutls_cli_opt_strs+3229)
-#define LIST_NAME (gnutls_cli_opt_strs+3280)
-#define LIST_name (gnutls_cli_opt_strs+3285)
+#define LIST_DESC (gnutls_cli_opt_strs+3214)
+#define LIST_NAME (gnutls_cli_opt_strs+3265)
+#define LIST_name (gnutls_cli_opt_strs+3270)
#define LIST_FLAGS (OPTST_DISABLED)
/*
* Help/More_Help/Version option descriptions:
*/
-#define HELP_DESC (gnutls_cli_opt_strs+3290)
-#define HELP_name (gnutls_cli_opt_strs+3334)
+#define HELP_DESC (gnutls_cli_opt_strs+3275)
+#define HELP_name (gnutls_cli_opt_strs+3319)
#ifdef HAVE_WORKING_FORK
-#define MORE_HELP_DESC (gnutls_cli_opt_strs+3339)
-#define MORE_HELP_name (gnutls_cli_opt_strs+3384)
+#define MORE_HELP_DESC (gnutls_cli_opt_strs+3324)
+#define MORE_HELP_name (gnutls_cli_opt_strs+3369)
#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
#else
#define MORE_HELP_DESC NULL
@@ -626,8 +626,8 @@ static char const gnutls_cli_opt_strs[3868] =
# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
#endif
-#define VER_DESC (gnutls_cli_opt_strs+3394)
-#define VER_name (gnutls_cli_opt_strs+3430)
+#define VER_DESC (gnutls_cli_opt_strs+3379)
+#define VER_name (gnutls_cli_opt_strs+3415)
/*
* Declare option callback procedures
*/
@@ -641,9 +641,11 @@ static tOptProc
doOptPgpkeyring, doOptRecordsize, doOptX509crlfile, doUsageOpt;
#define VER_PROC optionPrintVersion
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * Define the Gnutls_Cli Option Descriptions.
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Define the gnutls-cli Option Descriptions.
+ * This is an array of OPTION_CT entries, one for each
+ * option that the gnutls-cli program responds to.
*/
static tOptDesc optDesc[OPTION_CT] = {
{ /* entry idx, value */ 0, VALUE_OPT_DEBUG,
@@ -1204,17 +1206,17 @@ static tOptDesc optDesc[OPTION_CT] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Define the Gnutls_Cli Option Environment
+ * Define the gnutls-cli Option Environment
*/
-#define zPROGNAME (gnutls_cli_opt_strs+3438)
-#define zUsageTitle (gnutls_cli_opt_strs+3449)
+#define zPROGNAME (gnutls_cli_opt_strs+3423)
+#define zUsageTitle (gnutls_cli_opt_strs+3434)
#define zRcName NULL
#define apzHomeList NULL
-#define zBugsAddr (gnutls_cli_opt_strs+3562)
-#define zExplain (gnutls_cli_opt_strs+3581)
-#define zDetail (gnutls_cli_opt_strs+3584)
-#define zFullVersion (gnutls_cli_opt_strs+3767)
-/* extracted from optcode.tlib near line 349 */
+#define zBugsAddr (gnutls_cli_opt_strs+3547)
+#define zExplain (gnutls_cli_opt_strs+3566)
+#define zDetail (gnutls_cli_opt_strs+3569)
+#define zFullVersion (gnutls_cli_opt_strs+3753)
+/* extracted from optcode.tlib near line 350 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT
@@ -1227,22 +1229,27 @@ static tOptDesc optDesc[OPTION_CT] = {
#define gnutls_cli_full_usage (NULL)
-#define gnutls_cli_short_usage (gnutls_cli_opt_strs+3788)
+#define gnutls_cli_short_usage (gnutls_cli_opt_strs+3774)
+
+#endif /* not defined __doxygen__ */
/*
* Create the static procedure(s) declared above.
*/
/**
- * The callout function that invokes the USAGE() macro.
+ * The callout function that invokes the optionUsage function.
*
* @param pOptions the AutoOpts option description structure
* @param pOptDesc the descriptor for the "help" (usage) option.
+ * @noreturn
*/
static void
doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
{
+ optionUsage(&gnutls_cliOptions, GNUTLS_CLI_EXIT_SUCCESS);
+ /* NOTREACHED */
+ (void)pOptDesc;
(void)pOptions;
- USAGE(GNUTLS_CLI_EXIT_SUCCESS);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -1436,12 +1443,19 @@ doOptPgpcertfile(tOptions* pOptions, tOptDesc* pOptDesc)
optionFileCheck(pOptions, pOptDesc, type, mode);
}
-/* extracted from optmain.tlib near line 1093 */
+/* extracted from optmain.tlib near line 1113 */
+/**
+ * The directory containing the data associated with gnutls-cli.
+ */
#ifndef PKGDATADIR
# define PKGDATADIR ""
#endif
+/**
+ * Information about the person or institution that packaged gnutls-cli
+ * for the current distribution.
+ */
#ifndef WITH_PACKAGER
# define gnutls_cli_packager_info NULL
#else
@@ -1457,7 +1471,13 @@ static char const gnutls_cli_packager_info[] =
# endif
"\n";
#endif
+#ifndef __doxygen__
+#endif /* __doxygen__ */
+/**
+ * The option definitions for gnutls-cli. The one structure that
+ * binds them all.
+ */
tOptions gnutls_cliOptions = {
OPTIONS_STRUCT_VERSION,
0, NULL, /* original argc + argv */
@@ -1503,7 +1523,16 @@ tOptions gnutls_cliOptions = {
static char* AO_gettext(char const* pz);
static void coerce_it(void** s);
-static char*
+/**
+ * AutoGen specific wrapper function for gettext.
+ * It relies on the macro _() to convert from English to the target
+ * language, then strdup-duplicates the result string.
+ *
+ * @param[in] pz the input text used as a lookup key.
+ * @returns the translated text (if there is one),
+ * or the original text (if not).
+ */
+static char *
AO_gettext(char const* pz)
{
char* pzRes;
@@ -1523,8 +1552,9 @@ AO_gettext(char const* pz)
static void coerce_it(void** s) { *s = AO_gettext(*s);
}
-/*
- * This invokes the translation code (e.g. gettext(3)).
+/**
+ * Translate all the translatable strings in the gnutls_cliOptions
+ * structure defined above. This is done only once.
*/
static void
translate_option_strings(void)