corrected typo
[gnutls.git] / src / cli-args.h
blobf2ad811dfd2d80a64fe22caad5afe1c5ab025ed4
1 /* -*- buffer-read-only: t -*- vi: set ro:
2 *
3 * DO NOT EDIT THIS FILE (cli-args.h)
4 *
5 * It has been AutoGen-ed October 7, 2012 at 01:02:46 PM by AutoGen 5.16
6 * From the definitions cli-args.def
7 * and the template file options
9 * Generated from AutoOpts 36:4:11 templates.
11 * AutoOpts is a copyrighted work. This header file is not encumbered
12 * by AutoOpts licensing, but is provided under the licensing terms chosen
13 * by the gnutls-cli author or copyright holder. AutoOpts is
14 * licensed under the terms of the LGPL. The redistributable library
15 * (``libopts'') is licensed under the terms of either the LGPL or, at the
16 * users discretion, the BSD license. See the AutoOpts and/or libopts sources
17 * for details.
19 * The gnutls-cli program is copyrighted and licensed
20 * under the following terms:
22 * Copyright (C) 2000-2012 Free Software Foundation, all rights reserved.
23 * This is free software. It is licensed for use, modification and
24 * redistribution under the terms of the
25 * GNU General Public License, version 3 or later
26 * <http://gnu.org/licenses/gpl.html>
28 * gnutls-cli is free software: you can redistribute it and/or modify it
29 * under the terms of the GNU General Public License as published by the
30 * Free Software Foundation, either version 3 of the License, or
31 * (at your option) any later version.
33 * gnutls-cli is distributed in the hope that it will be useful, but
34 * WITHOUT ANY WARRANTY; without even the implied warranty of
35 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36 * See the GNU General Public License for more details.
38 * You should have received a copy of the GNU General Public License along
39 * with this program. If not, see <http://www.gnu.org/licenses/>.
42 * This file contains the programmatic interface to the Automated
43 * Options generated for the gnutls-cli program.
44 * These macros are documented in the AutoGen info file in the
45 * "AutoOpts" chapter. Please refer to that doc for usage help.
47 #ifndef AUTOOPTS_CLI_ARGS_H_GUARD
48 #define AUTOOPTS_CLI_ARGS_H_GUARD 1
49 #include "config.h"
50 #include <autoopts/options.h>
53 * Ensure that the library used for compiling this generated header is at
54 * least as new as the version current when the header template was released
55 * (not counting patch version increments). Also ensure that the oldest
56 * tolerable version is at least as old as what was current when the header
57 * template was released.
59 #define AO_TEMPLATE_VERSION 147460
60 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
61 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
62 # error option template version mismatches autoopts/options.h header
63 Choke Me.
64 #endif
67 * Enumeration of each option:
69 typedef enum {
70 INDEX_OPT_DEBUG = 0,
71 INDEX_OPT_VERBOSE = 1,
72 INDEX_OPT_TOFU = 2,
73 INDEX_OPT_DANE = 3,
74 INDEX_OPT_CA_VERIFICATION = 4,
75 INDEX_OPT_OCSP = 5,
76 INDEX_OPT_RESUME = 6,
77 INDEX_OPT_HEARTBEAT = 7,
78 INDEX_OPT_REHANDSHAKE = 8,
79 INDEX_OPT_NOTICKET = 9,
80 INDEX_OPT_OCSP_STATUS_REQUEST = 10,
81 INDEX_OPT_STARTTLS = 11,
82 INDEX_OPT_UDP = 12,
83 INDEX_OPT_MTU = 13,
84 INDEX_OPT_CRLF = 14,
85 INDEX_OPT_X509FMTDER = 15,
86 INDEX_OPT_FINGERPRINT = 16,
87 INDEX_OPT_DISABLE_EXTENSIONS = 17,
88 INDEX_OPT_PRINT_CERT = 18,
89 INDEX_OPT_RECORDSIZE = 19,
90 INDEX_OPT_DH_BITS = 20,
91 INDEX_OPT_PRIORITY = 21,
92 INDEX_OPT_X509CAFILE = 22,
93 INDEX_OPT_X509CRLFILE = 23,
94 INDEX_OPT_PGPKEYFILE = 24,
95 INDEX_OPT_PGPKEYRING = 25,
96 INDEX_OPT_PGPCERTFILE = 26,
97 INDEX_OPT_X509KEYFILE = 27,
98 INDEX_OPT_X509CERTFILE = 28,
99 INDEX_OPT_PGPSUBKEY = 29,
100 INDEX_OPT_SRPUSERNAME = 30,
101 INDEX_OPT_SRPPASSWD = 31,
102 INDEX_OPT_PSKUSERNAME = 32,
103 INDEX_OPT_PSKKEY = 33,
104 INDEX_OPT_PORT = 34,
105 INDEX_OPT_INSECURE = 35,
106 INDEX_OPT_BENCHMARK_CIPHERS = 36,
107 INDEX_OPT_BENCHMARK_SOFT_CIPHERS = 37,
108 INDEX_OPT_BENCHMARK_TLS_KX = 38,
109 INDEX_OPT_BENCHMARK_TLS_CIPHERS = 39,
110 INDEX_OPT_LIST = 40,
111 INDEX_OPT_VERSION = 41,
112 INDEX_OPT_HELP = 42,
113 INDEX_OPT_MORE_HELP = 43
114 } teOptIndex;
116 #define OPTION_CT 44
117 #define GNUTLS_CLI_VERSION "@VERSION@"
118 #define GNUTLS_CLI_FULL_VERSION "gnutls-cli @VERSION@"
121 * Interface defines for all options. Replace "n" with the UPPER_CASED
122 * option name (as in the teOptIndex enumeration above).
123 * e.g. HAVE_OPT(DEBUG)
125 #define DESC(n) (gnutls_cliOptions.pOptDesc[INDEX_OPT_## n])
126 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
127 #define OPT_ARG(n) (DESC(n).optArg.argString)
128 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
129 #define COUNT_OPT(n) (DESC(n).optOccCt)
130 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
131 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
132 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
133 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
134 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
135 #define CLEAR_OPT(n) STMTS( \
136 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
137 if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
138 DESC(n).fOptState |= OPTST_DISABLED; \
139 DESC(n).optCookie = NULL )
141 /* * * * * *
143 * Enumeration of gnutls-cli exit codes
145 typedef enum {
146 GNUTLS_CLI_EXIT_SUCCESS = 0,
147 GNUTLS_CLI_EXIT_FAILURE = 1,
148 GNUTLS_CLI_EXIT_LIBOPTS_FAILURE = 70
149 } gnutls_cli_exit_code_t;
150 /* * * * * *
152 * Interface defines for specific options.
154 #define VALUE_OPT_DEBUG 'd'
156 #define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt)
157 #define VALUE_OPT_VERBOSE 'V'
158 #define VALUE_OPT_TOFU 2
159 #define VALUE_OPT_DANE 3
160 #define VALUE_OPT_CA_VERIFICATION 4
161 #define VALUE_OPT_OCSP 5
162 #define VALUE_OPT_RESUME 'r'
163 #define VALUE_OPT_HEARTBEAT 'b'
164 #define VALUE_OPT_REHANDSHAKE 'e'
165 #define VALUE_OPT_NOTICKET 9
166 #define VALUE_OPT_OCSP_STATUS_REQUEST 10
167 #define VALUE_OPT_STARTTLS 's'
168 #define VALUE_OPT_UDP 'u'
169 #define VALUE_OPT_MTU 13
171 #define OPT_VALUE_MTU (DESC(MTU).optArg.argInt)
172 #define VALUE_OPT_CRLF 14
173 #define VALUE_OPT_X509FMTDER 15
174 #define VALUE_OPT_FINGERPRINT 'f'
175 #define VALUE_OPT_DISABLE_EXTENSIONS 17
176 #define VALUE_OPT_PRINT_CERT 18
177 #define VALUE_OPT_RECORDSIZE 19
179 #define OPT_VALUE_RECORDSIZE (DESC(RECORDSIZE).optArg.argInt)
180 #define VALUE_OPT_DH_BITS 20
182 #define OPT_VALUE_DH_BITS (DESC(DH_BITS).optArg.argInt)
183 #define VALUE_OPT_PRIORITY 21
184 #define VALUE_OPT_X509CAFILE 22
185 #define VALUE_OPT_X509CRLFILE 23
186 #define VALUE_OPT_PGPKEYFILE 24
187 #define VALUE_OPT_PGPKEYRING 25
188 #define VALUE_OPT_PGPCERTFILE 26
189 #define VALUE_OPT_X509KEYFILE 27
190 #define VALUE_OPT_X509CERTFILE 28
191 #define VALUE_OPT_PGPSUBKEY 29
192 #define VALUE_OPT_SRPUSERNAME 30
193 #define VALUE_OPT_SRPPASSWD 31
194 #define VALUE_OPT_PSKUSERNAME 32
195 #define VALUE_OPT_PSKKEY 129
196 #define VALUE_OPT_PORT 'p'
197 #define VALUE_OPT_INSECURE 131
198 #define VALUE_OPT_BENCHMARK_CIPHERS 132
199 #define VALUE_OPT_BENCHMARK_SOFT_CIPHERS 133
200 #define VALUE_OPT_BENCHMARK_TLS_KX 134
201 #define VALUE_OPT_BENCHMARK_TLS_CIPHERS 135
202 #define VALUE_OPT_LIST 'l'
203 #define VALUE_OPT_HELP 'h'
204 #define VALUE_OPT_MORE_HELP '!'
205 #define VALUE_OPT_VERSION 'v'
207 * Interface defines not associated with particular options
209 #define ERRSKIP_OPTERR STMTS(gnutls_cliOptions.fOptSet &= ~OPTPROC_ERRSTOP)
210 #define ERRSTOP_OPTERR STMTS(gnutls_cliOptions.fOptSet |= OPTPROC_ERRSTOP)
211 #define RESTART_OPT(n) STMTS( \
212 gnutls_cliOptions.curOptIdx = (n); \
213 gnutls_cliOptions.pzCurOpt = NULL)
214 #define START_OPT RESTART_OPT(1)
215 #define USAGE(c) (*gnutls_cliOptions.pUsageProc)(&gnutls_cliOptions, c)
216 /* extracted from opthead.tlib near line 484 */
218 #ifdef __cplusplus
219 extern "C" {
220 #endif
222 * global exported definitions
224 #include <gettext.h>
227 /* * * * * *
229 * Declare the gnutls-cli option descriptor.
231 extern tOptions gnutls_cliOptions;
233 #if defined(ENABLE_NLS)
234 # ifndef _
235 # include <stdio.h>
236 static inline char* aoGetsText(char const* pz) {
237 if (pz == NULL) return NULL;
238 return (char*)gettext(pz);
240 # define _(s) aoGetsText(s)
241 # endif /* _() */
243 # define OPT_NO_XLAT_CFG_NAMES STMTS(gnutls_cliOptions.fOptSet |= \
244 OPTPROC_NXLAT_OPT_CFG;)
245 # define OPT_NO_XLAT_OPT_NAMES STMTS(gnutls_cliOptions.fOptSet |= \
246 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
248 # define OPT_XLAT_CFG_NAMES STMTS(gnutls_cliOptions.fOptSet &= \
249 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
250 # define OPT_XLAT_OPT_NAMES STMTS(gnutls_cliOptions.fOptSet &= \
251 ~OPTPROC_NXLAT_OPT;)
253 #else /* ENABLE_NLS */
254 # define OPT_NO_XLAT_CFG_NAMES
255 # define OPT_NO_XLAT_OPT_NAMES
257 # define OPT_XLAT_CFG_NAMES
258 # define OPT_XLAT_OPT_NAMES
260 # ifndef _
261 # define _(_s) _s
262 # endif
263 #endif /* ENABLE_NLS */
265 #ifdef __cplusplus
267 #endif
268 #endif /* AUTOOPTS_CLI_ARGS_H_GUARD */
269 /* cli-args.h ends here */