Documentation updates
[gnutls.git] / src / certtool-args.h
blob1a4273c1fc082b503af683daf08e47b037260e26
1 /* -*- buffer-read-only: t -*- vi: set ro:
2 *
3 * DO NOT EDIT THIS FILE (certtool-args.h)
4 *
5 * It has been AutoGen-ed October 9, 2012 at 08:27:12 PM by AutoGen 5.16
6 * From the definitions certtool-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 certtool 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 certtool 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 * certtool 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 * certtool 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 certtool 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_CERTTOOL_ARGS_H_GUARD
48 #define AUTOOPTS_CERTTOOL_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_INFILE = 2,
73 INDEX_OPT_OUTFILE = 3,
74 INDEX_OPT_GENERATE_SELF_SIGNED = 4,
75 INDEX_OPT_GENERATE_CERTIFICATE = 5,
76 INDEX_OPT_GENERATE_PROXY = 6,
77 INDEX_OPT_GENERATE_CRL = 7,
78 INDEX_OPT_UPDATE_CERTIFICATE = 8,
79 INDEX_OPT_GENERATE_PRIVKEY = 9,
80 INDEX_OPT_GENERATE_REQUEST = 10,
81 INDEX_OPT_VERIFY_CHAIN = 11,
82 INDEX_OPT_VERIFY = 12,
83 INDEX_OPT_VERIFY_CRL = 13,
84 INDEX_OPT_GENERATE_DH_PARAMS = 14,
85 INDEX_OPT_GET_DH_PARAMS = 15,
86 INDEX_OPT_DH_INFO = 16,
87 INDEX_OPT_LOAD_PRIVKEY = 17,
88 INDEX_OPT_LOAD_PUBKEY = 18,
89 INDEX_OPT_LOAD_REQUEST = 19,
90 INDEX_OPT_LOAD_CERTIFICATE = 20,
91 INDEX_OPT_LOAD_CA_PRIVKEY = 21,
92 INDEX_OPT_LOAD_CA_CERTIFICATE = 22,
93 INDEX_OPT_PASSWORD = 23,
94 INDEX_OPT_NULL_PASSWORD = 24,
95 INDEX_OPT_CERTIFICATE_INFO = 25,
96 INDEX_OPT_CERTIFICATE_PUBKEY = 26,
97 INDEX_OPT_PGP_CERTIFICATE_INFO = 27,
98 INDEX_OPT_PGP_RING_INFO = 28,
99 INDEX_OPT_CRL_INFO = 29,
100 INDEX_OPT_CRQ_INFO = 30,
101 INDEX_OPT_NO_CRQ_EXTENSIONS = 31,
102 INDEX_OPT_P12_INFO = 32,
103 INDEX_OPT_P7_INFO = 33,
104 INDEX_OPT_SMIME_TO_P7 = 34,
105 INDEX_OPT_KEY_INFO = 35,
106 INDEX_OPT_PGP_KEY_INFO = 36,
107 INDEX_OPT_PUBKEY_INFO = 37,
108 INDEX_OPT_V1 = 38,
109 INDEX_OPT_TO_P12 = 39,
110 INDEX_OPT_TO_P8 = 40,
111 INDEX_OPT_PKCS8 = 41,
112 INDEX_OPT_RSA = 42,
113 INDEX_OPT_DSA = 43,
114 INDEX_OPT_ECC = 44,
115 INDEX_OPT_HASH = 45,
116 INDEX_OPT_INDER = 46,
117 INDEX_OPT_INRAW = 47,
118 INDEX_OPT_OUTDER = 48,
119 INDEX_OPT_OUTRAW = 49,
120 INDEX_OPT_BITS = 50,
121 INDEX_OPT_SEC_PARAM = 51,
122 INDEX_OPT_DISABLE_QUICK_RANDOM = 52,
123 INDEX_OPT_TEMPLATE = 53,
124 INDEX_OPT_PKCS_CIPHER = 54,
125 INDEX_OPT_DANE_RR = 55,
126 INDEX_OPT_DANE_HOST = 56,
127 INDEX_OPT_DANE_PROTO = 57,
128 INDEX_OPT_DANE_PORT = 58,
129 INDEX_OPT_DANE_CA = 59,
130 INDEX_OPT_DANE_FULL_X509 = 60,
131 INDEX_OPT_DANE_LOCAL = 61,
132 INDEX_OPT_VERSION = 62,
133 INDEX_OPT_HELP = 63,
134 INDEX_OPT_MORE_HELP = 64
135 } teOptIndex;
137 #define OPTION_CT 65
138 #define CERTTOOL_VERSION "@VERSION@"
139 #define CERTTOOL_FULL_VERSION "certtool @VERSION@"
142 * Interface defines for all options. Replace "n" with the UPPER_CASED
143 * option name (as in the teOptIndex enumeration above).
144 * e.g. HAVE_OPT(DEBUG)
146 #define DESC(n) (certtoolOptions.pOptDesc[INDEX_OPT_## n])
147 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
148 #define OPT_ARG(n) (DESC(n).optArg.argString)
149 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
150 #define COUNT_OPT(n) (DESC(n).optOccCt)
151 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
152 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
153 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
154 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
155 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
156 #define CLEAR_OPT(n) STMTS( \
157 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
158 if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
159 DESC(n).fOptState |= OPTST_DISABLED; \
160 DESC(n).optCookie = NULL )
162 /* * * * * *
164 * Enumeration of certtool exit codes
166 typedef enum {
167 CERTTOOL_EXIT_SUCCESS = 0,
168 CERTTOOL_EXIT_FAILURE = 1,
169 CERTTOOL_EXIT_LIBOPTS_FAILURE = 70
170 } certtool_exit_code_t;
171 /* * * * * *
173 * Interface defines for specific options.
175 #define VALUE_OPT_DEBUG 'd'
177 #define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt)
178 #define VALUE_OPT_VERBOSE 'V'
179 #define VALUE_OPT_INFILE 2
180 #define VALUE_OPT_OUTFILE 3
181 #define VALUE_OPT_GENERATE_SELF_SIGNED 's'
182 #define VALUE_OPT_GENERATE_CERTIFICATE 'c'
183 #define VALUE_OPT_GENERATE_PROXY 6
184 #define VALUE_OPT_GENERATE_CRL 7
185 #define VALUE_OPT_UPDATE_CERTIFICATE 'u'
186 #define VALUE_OPT_GENERATE_PRIVKEY 'p'
187 #define VALUE_OPT_GENERATE_REQUEST 'q'
188 #define VALUE_OPT_VERIFY_CHAIN 'e'
189 #define VALUE_OPT_VERIFY 12
190 #define VALUE_OPT_VERIFY_CRL 13
191 #define VALUE_OPT_GENERATE_DH_PARAMS 14
192 #define VALUE_OPT_GET_DH_PARAMS 15
193 #define VALUE_OPT_DH_INFO 16
194 #define VALUE_OPT_LOAD_PRIVKEY 17
195 #define VALUE_OPT_LOAD_PUBKEY 18
196 #define VALUE_OPT_LOAD_REQUEST 19
197 #define VALUE_OPT_LOAD_CERTIFICATE 20
198 #define VALUE_OPT_LOAD_CA_PRIVKEY 21
199 #define VALUE_OPT_LOAD_CA_CERTIFICATE 22
200 #define VALUE_OPT_PASSWORD 23
201 #define VALUE_OPT_NULL_PASSWORD 24
202 #define VALUE_OPT_CERTIFICATE_INFO 'i'
203 #define VALUE_OPT_CERTIFICATE_PUBKEY 26
204 #define VALUE_OPT_PGP_CERTIFICATE_INFO 27
205 #define VALUE_OPT_PGP_RING_INFO 28
206 #define VALUE_OPT_CRL_INFO 'l'
207 #define VALUE_OPT_CRQ_INFO 30
208 #define VALUE_OPT_NO_CRQ_EXTENSIONS 31
209 #define VALUE_OPT_P12_INFO 32
210 #define VALUE_OPT_P7_INFO 129
211 #define VALUE_OPT_SMIME_TO_P7 130
212 #define VALUE_OPT_KEY_INFO 'k'
213 #define VALUE_OPT_PGP_KEY_INFO 132
214 #define VALUE_OPT_PUBKEY_INFO 133
215 #define VALUE_OPT_V1 134
216 #define VALUE_OPT_TO_P12 135
217 #define VALUE_OPT_TO_P8 136
218 #define VALUE_OPT_PKCS8 '8'
219 #define VALUE_OPT_RSA 138
220 #define VALUE_OPT_DSA 139
221 #define VALUE_OPT_ECC 140
222 #define VALUE_OPT_HASH 141
223 #define VALUE_OPT_INDER 142
224 #define VALUE_OPT_INRAW 143
225 #define VALUE_OPT_OUTDER 144
226 #define VALUE_OPT_OUTRAW 145
227 #define VALUE_OPT_BITS 146
229 #define OPT_VALUE_BITS (DESC(BITS).optArg.argInt)
230 #define VALUE_OPT_SEC_PARAM 147
231 #define VALUE_OPT_DISABLE_QUICK_RANDOM 148
232 #define VALUE_OPT_TEMPLATE 149
233 #define VALUE_OPT_PKCS_CIPHER 150
234 #define VALUE_OPT_DANE_RR 151
235 #define VALUE_OPT_DANE_HOST 152
236 #define VALUE_OPT_DANE_PROTO 153
237 #define VALUE_OPT_DANE_PORT 154
239 #define OPT_VALUE_DANE_PORT (DESC(DANE_PORT).optArg.argInt)
240 #define VALUE_OPT_DANE_CA 155
241 #define VALUE_OPT_DANE_FULL_X509 156
242 #define VALUE_OPT_DANE_LOCAL 157
243 #define VALUE_OPT_HELP 'h'
244 #define VALUE_OPT_MORE_HELP '!'
245 #define VALUE_OPT_VERSION 'v'
247 * Interface defines not associated with particular options
249 #define ERRSKIP_OPTERR STMTS(certtoolOptions.fOptSet &= ~OPTPROC_ERRSTOP)
250 #define ERRSTOP_OPTERR STMTS(certtoolOptions.fOptSet |= OPTPROC_ERRSTOP)
251 #define RESTART_OPT(n) STMTS( \
252 certtoolOptions.curOptIdx = (n); \
253 certtoolOptions.pzCurOpt = NULL)
254 #define START_OPT RESTART_OPT(1)
255 #define USAGE(c) (*certtoolOptions.pUsageProc)(&certtoolOptions, c)
256 /* extracted from opthead.tlib near line 484 */
258 #ifdef __cplusplus
259 extern "C" {
260 #endif
262 * global exported definitions
264 #include <gettext.h>
267 /* * * * * *
269 * Declare the certtool option descriptor.
271 extern tOptions certtoolOptions;
273 #if defined(ENABLE_NLS)
274 # ifndef _
275 # include <stdio.h>
276 static inline char* aoGetsText(char const* pz) {
277 if (pz == NULL) return NULL;
278 return (char*)gettext(pz);
280 # define _(s) aoGetsText(s)
281 # endif /* _() */
283 # define OPT_NO_XLAT_CFG_NAMES STMTS(certtoolOptions.fOptSet |= \
284 OPTPROC_NXLAT_OPT_CFG;)
285 # define OPT_NO_XLAT_OPT_NAMES STMTS(certtoolOptions.fOptSet |= \
286 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
288 # define OPT_XLAT_CFG_NAMES STMTS(certtoolOptions.fOptSet &= \
289 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
290 # define OPT_XLAT_OPT_NAMES STMTS(certtoolOptions.fOptSet &= \
291 ~OPTPROC_NXLAT_OPT;)
293 #else /* ENABLE_NLS */
294 # define OPT_NO_XLAT_CFG_NAMES
295 # define OPT_NO_XLAT_OPT_NAMES
297 # define OPT_XLAT_CFG_NAMES
298 # define OPT_XLAT_OPT_NAMES
300 # ifndef _
301 # define _(_s) _s
302 # endif
303 #endif /* ENABLE_NLS */
305 #ifdef __cplusplus
307 #endif
308 #endif /* AUTOOPTS_CERTTOOL_ARGS_H_GUARD */
309 /* certtool-args.h ends here */