1 /* -*- buffer-read-only: t -*- vi: set ro:
3 * DO NOT EDIT THIS FILE (p11tool-args.h)
5 * It has been AutoGen-ed November 8, 2012 at 11:35:48 PM by AutoGen 5.16
6 * From the definitions p11tool-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 p11tool 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
19 * The p11tool 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 * p11tool 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 * p11tool 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 p11tool 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_P11TOOL_ARGS_H_GUARD
48 #define AUTOOPTS_P11TOOL_ARGS_H_GUARD 1
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
67 * Enumeration of each option:
71 INDEX_OPT_OUTFILE
= 1,
72 INDEX_OPT_LIST_TOKENS
= 2,
74 INDEX_OPT_LIST_MECHANISMS
= 4,
75 INDEX_OPT_LIST_ALL
= 5,
76 INDEX_OPT_LIST_ALL_CERTS
= 6,
77 INDEX_OPT_LIST_CERTS
= 7,
78 INDEX_OPT_LIST_ALL_PRIVKEYS
= 8,
79 INDEX_OPT_LIST_ALL_TRUSTED
= 9,
80 INDEX_OPT_INITIALIZE
= 10,
82 INDEX_OPT_DELETE
= 12,
83 INDEX_OPT_GENERATE_RSA
= 13,
84 INDEX_OPT_GENERATE_DSA
= 14,
85 INDEX_OPT_GENERATE_ECC
= 15,
87 INDEX_OPT_TRUSTED
= 17,
88 INDEX_OPT_PRIVATE
= 18,
90 INDEX_OPT_DETAILED_URL
= 20,
91 INDEX_OPT_SECRET_KEY
= 21,
92 INDEX_OPT_LOAD_PRIVKEY
= 22,
93 INDEX_OPT_LOAD_PUBKEY
= 23,
94 INDEX_OPT_LOAD_CERTIFICATE
= 24,
97 INDEX_OPT_SEC_PARAM
= 27,
100 INDEX_OPT_PROVIDER
= 30,
101 INDEX_OPT_VERSION
= 31,
103 INDEX_OPT_MORE_HELP
= 33
107 #define P11TOOL_VERSION "@VERSION@"
108 #define P11TOOL_FULL_VERSION "p11tool @VERSION@"
111 * Interface defines for all options. Replace "n" with the UPPER_CASED
112 * option name (as in the teOptIndex enumeration above).
113 * e.g. HAVE_OPT(DEBUG)
115 #define DESC(n) (p11toolOptions.pOptDesc[INDEX_OPT_## n])
116 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
117 #define OPT_ARG(n) (DESC(n).optArg.argString)
118 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
119 #define COUNT_OPT(n) (DESC(n).optOccCt)
120 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
121 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
122 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
123 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
124 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
125 #define CLEAR_OPT(n) STMTS( \
126 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
127 if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
128 DESC(n).fOptState |= OPTST_DISABLED; \
129 DESC(n).optCookie = NULL )
133 * Enumeration of p11tool exit codes
136 P11TOOL_EXIT_SUCCESS
= 0,
137 P11TOOL_EXIT_FAILURE
= 1,
138 P11TOOL_EXIT_LIBOPTS_FAILURE
= 70
139 } p11tool_exit_code_t
;
142 * Interface defines for specific options.
144 #define VALUE_OPT_DEBUG 'd'
146 #define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt)
147 #define VALUE_OPT_OUTFILE 1
148 #define VALUE_OPT_LIST_TOKENS 2
149 #define VALUE_OPT_EXPORT 3
150 #define VALUE_OPT_LIST_MECHANISMS 4
151 #define VALUE_OPT_LIST_ALL 5
152 #define VALUE_OPT_LIST_ALL_CERTS 6
153 #define VALUE_OPT_LIST_CERTS 7
154 #define VALUE_OPT_LIST_ALL_PRIVKEYS 8
155 #define VALUE_OPT_LIST_ALL_TRUSTED 9
156 #define VALUE_OPT_INITIALIZE 10
157 #define VALUE_OPT_WRITE 11
158 #define VALUE_OPT_DELETE 12
159 #define VALUE_OPT_GENERATE_RSA 13
160 #define VALUE_OPT_GENERATE_DSA 14
161 #define VALUE_OPT_GENERATE_ECC 15
162 #define VALUE_OPT_LABEL 16
163 #define VALUE_OPT_TRUSTED 17
164 #define VALUE_OPT_PRIVATE 18
165 #define VALUE_OPT_LOGIN 19
166 #define VALUE_OPT_DETAILED_URL 20
167 #define VALUE_OPT_SECRET_KEY 21
168 #define VALUE_OPT_LOAD_PRIVKEY 22
169 #define VALUE_OPT_LOAD_PUBKEY 23
170 #define VALUE_OPT_LOAD_CERTIFICATE 24
171 #define VALUE_OPT_PKCS8 '8'
172 #define VALUE_OPT_BITS 26
174 #define OPT_VALUE_BITS (DESC(BITS).optArg.argInt)
175 #define VALUE_OPT_SEC_PARAM 27
176 #define VALUE_OPT_INDER 28
177 #define VALUE_OPT_INRAW 29
178 #define VALUE_OPT_PROVIDER 30
179 #define VALUE_OPT_HELP 'h'
180 #define VALUE_OPT_MORE_HELP '!'
181 #define VALUE_OPT_VERSION 'v'
183 * Interface defines not associated with particular options
185 #define ERRSKIP_OPTERR STMTS(p11toolOptions.fOptSet &= ~OPTPROC_ERRSTOP)
186 #define ERRSTOP_OPTERR STMTS(p11toolOptions.fOptSet |= OPTPROC_ERRSTOP)
187 #define RESTART_OPT(n) STMTS( \
188 p11toolOptions.curOptIdx = (n); \
189 p11toolOptions.pzCurOpt = NULL)
190 #define START_OPT RESTART_OPT(1)
191 #define USAGE(c) (*p11toolOptions.pUsageProc)(&p11toolOptions, c)
192 /* extracted from opthead.tlib near line 484 */
198 * global exported definitions
205 * Declare the p11tool option descriptor.
207 extern tOptions p11toolOptions
;
209 #if defined(ENABLE_NLS)
212 static inline char* aoGetsText(char const* pz
) {
213 if (pz
== NULL
) return NULL
;
214 return (char*)gettext(pz
);
216 # define _(s) aoGetsText(s)
219 # define OPT_NO_XLAT_CFG_NAMES STMTS(p11toolOptions.fOptSet |= \
220 OPTPROC_NXLAT_OPT_CFG;)
221 # define OPT_NO_XLAT_OPT_NAMES STMTS(p11toolOptions.fOptSet |= \
222 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
224 # define OPT_XLAT_CFG_NAMES STMTS(p11toolOptions.fOptSet &= \
225 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
226 # define OPT_XLAT_OPT_NAMES STMTS(p11toolOptions.fOptSet &= \
229 #else /* ENABLE_NLS */
230 # define OPT_NO_XLAT_CFG_NAMES
231 # define OPT_NO_XLAT_OPT_NAMES
233 # define OPT_XLAT_CFG_NAMES
234 # define OPT_XLAT_OPT_NAMES
239 #endif /* ENABLE_NLS */
244 #endif /* AUTOOPTS_P11TOOL_ARGS_H_GUARD */
245 /* p11tool-args.h ends here */