benchmark time was increased.
[gnutls.git] / src / serv-args.h
blob9c4c86e6c1a6351c421bf4bbf3d1714f4b22ddb0
1 /* -*- buffer-read-only: t -*- vi: set ro:
2 *
3 * DO NOT EDIT THIS FILE (serv-args.h)
4 *
5 * It has been AutoGen-ed August 30, 2012 at 09:58:05 PM by AutoGen 5.16
6 * From the definitions serv-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-serv 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-serv 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-serv 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-serv 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-serv 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_SERV_ARGS_H_GUARD
48 #define AUTOOPTS_SERV_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_NOTICKET = 1,
72 INDEX_OPT_GENERATE = 2,
73 INDEX_OPT_QUIET = 3,
74 INDEX_OPT_NODB = 4,
75 INDEX_OPT_HTTP = 5,
76 INDEX_OPT_ECHO = 6,
77 INDEX_OPT_UDP = 7,
78 INDEX_OPT_MTU = 8,
79 INDEX_OPT_DISABLE_CLIENT_CERT = 9,
80 INDEX_OPT_REQUIRE_CLIENT_CERT = 10,
81 INDEX_OPT_HEARTBEAT = 11,
82 INDEX_OPT_X509FMTDER = 12,
83 INDEX_OPT_PRIORITY = 13,
84 INDEX_OPT_DHPARAMS = 14,
85 INDEX_OPT_X509CAFILE = 15,
86 INDEX_OPT_X509CRLFILE = 16,
87 INDEX_OPT_PGPKEYFILE = 17,
88 INDEX_OPT_PGPKEYRING = 18,
89 INDEX_OPT_PGPCERTFILE = 19,
90 INDEX_OPT_X509KEYFILE = 20,
91 INDEX_OPT_X509CERTFILE = 21,
92 INDEX_OPT_X509DSAKEYFILE = 22,
93 INDEX_OPT_X509DSACERTFILE = 23,
94 INDEX_OPT_X509ECCKEYFILE = 24,
95 INDEX_OPT_X509ECCCERTFILE = 25,
96 INDEX_OPT_PGPSUBKEY = 26,
97 INDEX_OPT_SRPPASSWD = 27,
98 INDEX_OPT_SRPPASSWDCONF = 28,
99 INDEX_OPT_PSKPASSWD = 29,
100 INDEX_OPT_PSKHINT = 30,
101 INDEX_OPT_PORT = 31,
102 INDEX_OPT_LIST = 32,
103 INDEX_OPT_VERSION = 33,
104 INDEX_OPT_HELP = 34,
105 INDEX_OPT_MORE_HELP = 35
106 } teOptIndex;
108 #define OPTION_CT 36
109 #define GNUTLS_SERV_VERSION "@VERSION@"
110 #define GNUTLS_SERV_FULL_VERSION "gnutls-serv @VERSION@"
113 * Interface defines for all options. Replace "n" with the UPPER_CASED
114 * option name (as in the teOptIndex enumeration above).
115 * e.g. HAVE_OPT(DEBUG)
117 #define DESC(n) (gnutls_servOptions.pOptDesc[INDEX_OPT_## n])
118 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
119 #define OPT_ARG(n) (DESC(n).optArg.argString)
120 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
121 #define COUNT_OPT(n) (DESC(n).optOccCt)
122 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
123 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
124 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
125 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
126 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
127 #define CLEAR_OPT(n) STMTS( \
128 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
129 if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
130 DESC(n).fOptState |= OPTST_DISABLED; \
131 DESC(n).optCookie = NULL )
133 /* * * * * *
135 * Enumeration of gnutls-serv exit codes
137 typedef enum {
138 GNUTLS_SERV_EXIT_SUCCESS = 0,
139 GNUTLS_SERV_EXIT_FAILURE = 1,
140 GNUTLS_SERV_EXIT_LIBOPTS_FAILURE = 70
141 } gnutls_serv_exit_code_t;
142 /* * * * * *
144 * Interface defines for specific options.
146 #define VALUE_OPT_DEBUG 'd'
148 #define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt)
149 #define VALUE_OPT_NOTICKET 1
150 #define VALUE_OPT_GENERATE 'g'
151 #define VALUE_OPT_QUIET 'q'
152 #define VALUE_OPT_NODB 4
153 #define VALUE_OPT_HTTP 5
154 #define VALUE_OPT_ECHO 6
155 #define VALUE_OPT_UDP 'u'
156 #define VALUE_OPT_MTU 8
158 #define OPT_VALUE_MTU (DESC(MTU).optArg.argInt)
159 #define VALUE_OPT_DISABLE_CLIENT_CERT 'a'
160 #define VALUE_OPT_REQUIRE_CLIENT_CERT 'r'
161 #define VALUE_OPT_HEARTBEAT 'b'
162 #define VALUE_OPT_X509FMTDER 12
163 #define VALUE_OPT_PRIORITY 13
164 #define VALUE_OPT_DHPARAMS 14
165 #define VALUE_OPT_X509CAFILE 15
166 #define VALUE_OPT_X509CRLFILE 16
167 #define VALUE_OPT_PGPKEYFILE 17
168 #define VALUE_OPT_PGPKEYRING 18
169 #define VALUE_OPT_PGPCERTFILE 19
170 #define VALUE_OPT_X509KEYFILE 20
171 #define VALUE_OPT_X509CERTFILE 21
172 #define VALUE_OPT_X509DSAKEYFILE 22
173 #define VALUE_OPT_X509DSACERTFILE 23
174 #define VALUE_OPT_X509ECCKEYFILE 24
175 #define VALUE_OPT_X509ECCCERTFILE 25
176 #define VALUE_OPT_PGPSUBKEY 26
177 #define VALUE_OPT_SRPPASSWD 27
178 #define VALUE_OPT_SRPPASSWDCONF 28
179 #define VALUE_OPT_PSKPASSWD 29
180 #define VALUE_OPT_PSKHINT 30
181 #define VALUE_OPT_PORT 'p'
183 #define OPT_VALUE_PORT (DESC(PORT).optArg.argInt)
184 #define VALUE_OPT_LIST 'l'
185 #define VALUE_OPT_HELP 'h'
186 #define VALUE_OPT_MORE_HELP '!'
187 #define VALUE_OPT_VERSION 'v'
189 * Interface defines not associated with particular options
191 #define ERRSKIP_OPTERR STMTS(gnutls_servOptions.fOptSet &= ~OPTPROC_ERRSTOP)
192 #define ERRSTOP_OPTERR STMTS(gnutls_servOptions.fOptSet |= OPTPROC_ERRSTOP)
193 #define RESTART_OPT(n) STMTS( \
194 gnutls_servOptions.curOptIdx = (n); \
195 gnutls_servOptions.pzCurOpt = NULL)
196 #define START_OPT RESTART_OPT(1)
197 #define USAGE(c) (*gnutls_servOptions.pUsageProc)(&gnutls_servOptions, c)
198 /* extracted from opthead.tlib near line 484 */
200 #ifdef __cplusplus
201 extern "C" {
202 #endif
204 * global exported definitions
206 #include <gettext.h>
209 /* * * * * *
211 * Declare the gnutls-serv option descriptor.
213 extern tOptions gnutls_servOptions;
215 #if defined(ENABLE_NLS)
216 # ifndef _
217 # include <stdio.h>
218 static inline char* aoGetsText(char const* pz) {
219 if (pz == NULL) return NULL;
220 return (char*)gettext(pz);
222 # define _(s) aoGetsText(s)
223 # endif /* _() */
225 # define OPT_NO_XLAT_CFG_NAMES STMTS(gnutls_servOptions.fOptSet |= \
226 OPTPROC_NXLAT_OPT_CFG;)
227 # define OPT_NO_XLAT_OPT_NAMES STMTS(gnutls_servOptions.fOptSet |= \
228 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
230 # define OPT_XLAT_CFG_NAMES STMTS(gnutls_servOptions.fOptSet &= \
231 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
232 # define OPT_XLAT_OPT_NAMES STMTS(gnutls_servOptions.fOptSet &= \
233 ~OPTPROC_NXLAT_OPT;)
235 #else /* ENABLE_NLS */
236 # define OPT_NO_XLAT_CFG_NAMES
237 # define OPT_NO_XLAT_OPT_NAMES
239 # define OPT_XLAT_CFG_NAMES
240 # define OPT_XLAT_OPT_NAMES
242 # ifndef _
243 # define _(_s) _s
244 # endif
245 #endif /* ENABLE_NLS */
247 #ifdef __cplusplus
249 #endif
250 #endif /* AUTOOPTS_SERV_ARGS_H_GUARD */
251 /* serv-args.h ends here */