Fix CVE-2017-6891 in minitasn1 code
[platform/upstream/gnutls.git] / src / p11tool-args.c.bak
1 /*   -*- buffer-read-only: t -*- vi: set ro:
2  *
3  *  DO NOT EDIT THIS FILE   (p11tool-args.c)
4  *
5  *  It has been AutoGen-ed
6  *  From the definitions    p11tool-args.def
7  *  and the template file   options
8  *
9  * Generated from AutoOpts 41:1:16 templates.
10  *
11  *  AutoOpts is a copyrighted work.  This source 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
17  *  for details.
18  *
19  * The p11tool program is copyrighted and licensed
20  * under the following terms:
21  *
22  *  Copyright (C) 2000-2017 Free Software Foundation, and others, all rights reserved.
23  *  This is free software. It is licensed for use, modification and
24  *  redistribution under the terms of the GNU General Public License,
25  *  version 3 or later <http://gnu.org/licenses/gpl.html>
26  *
27  *  p11tool is free software: you can redistribute it and/or modify it
28  *  under the terms of the GNU General Public License as published by the
29  *  Free Software Foundation, either version 3 of the License, or
30  *  (at your option) any later version.
31  *
32  *  p11tool is distributed in the hope that it will be useful, but
33  *  WITHOUT ANY WARRANTY; without even the implied warranty of
34  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
35  *  See the GNU General Public License for more details.
36  *
37  *  You should have received a copy of the GNU General Public License along
38  *  with this program.  If not, see <http://www.gnu.org/licenses/>.
39  */
40
41 #ifndef __doxygen__
42 #define OPTION_CODE_COMPILE 1
43 #include "p11tool-args.h"
44 #include <sys/types.h>
45
46 #include <limits.h>
47 #include <stdio.h>
48 #include <stdlib.h>
49 #include <errno.h>
50
51 #ifdef  __cplusplus
52 extern "C" {
53 #endif
54 extern FILE * option_usage_fp;
55 #define zCopyright      (p11tool_opt_strs+0)
56 #define zLicenseDescrip (p11tool_opt_strs+283)
57
58
59 #ifndef NULL
60 #  define NULL 0
61 #endif
62
63 /**
64  *  static const strings for p11tool options
65  */
66 static char const p11tool_opt_strs[4869] =
67 /*     0 */ "p11tool 3.3.27\n"
68             "Copyright (C) 2000-2017 Free Software Foundation, and others, all rights reserved.\n"
69             "This is free software. It is licensed for use, modification and\n"
70             "redistribution under the terms of the GNU General Public License,\n"
71             "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0"
72 /*   283 */ "p11tool is free software: you can redistribute it and/or modify it under\n"
73             "the terms of the GNU General Public License as published by the Free\n"
74             "Software Foundation, either version 3 of the License, or (at your option)\n"
75             "any later version.\n\n"
76             "p11tool is distributed in the hope that it will be useful, but WITHOUT ANY\n"
77             "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n"
78             "FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\n"
79             "details.\n\n"
80             "You should have received a copy of the GNU General Public License along\n"
81             "with this program.  If not, see <http://www.gnu.org/licenses/>.\n\0"
82 /*   886 */ "Enable debugging\0"
83 /*   903 */ "DEBUG\0"
84 /*   909 */ "debug\0"
85 /*   915 */ "Output file\0"
86 /*   927 */ "OUTFILE\0"
87 /*   935 */ "outfile\0"
88 /*   943 */ "List all available tokens\0"
89 /*   969 */ "LIST_TOKENS\0"
90 /*   981 */ "list-tokens\0"
91 /*   993 */ "Export the object specified by the URL\0"
92 /*  1032 */ "EXPORT\0"
93 /*  1039 */ "export\0"
94 /*  1046 */ "Export the certificate specified by the URL and its chain of trust\0"
95 /*  1113 */ "EXPORT_CHAIN\0"
96 /*  1126 */ "export-chain\0"
97 /*  1139 */ "List all available mechanisms in a token\0"
98 /*  1180 */ "LIST_MECHANISMS\0"
99 /*  1196 */ "list-mechanisms\0"
100 /*  1212 */ "List information on an available object in a token\0"
101 /*  1263 */ "INFO\0"
102 /*  1268 */ "info\0"
103 /*  1273 */ "List all available objects in a token\0"
104 /*  1311 */ "LIST_ALL\0"
105 /*  1320 */ "list-all\0"
106 /*  1329 */ "List all available certificates in a token\0"
107 /*  1372 */ "LIST_ALL_CERTS\0"
108 /*  1387 */ "list-all-certs\0"
109 /*  1402 */ "List all certificates that have an associated private key\0"
110 /*  1460 */ "LIST_CERTS\0"
111 /*  1471 */ "list-certs\0"
112 /*  1482 */ "List all available private keys in a token\0"
113 /*  1525 */ "LIST_ALL_PRIVKEYS\0"
114 /*  1543 */ "list-all-privkeys\0"
115 /*  1561 */ "an alias for the 'list-all-privkeys' option\0"
116 /*  1605 */ "list-privkeys\0"
117 /*  1619 */ "list-keys\0"
118 /*  1629 */ "List all available certificates marked as trusted\0"
119 /*  1679 */ "LIST_ALL_TRUSTED\0"
120 /*  1696 */ "list-all-trusted\0"
121 /*  1713 */ "Writes the loaded objects to a PKCS #11 token\0"
122 /*  1759 */ "WRITE\0"
123 /*  1765 */ "write\0"
124 /*  1771 */ "Deletes the objects matching the PKCS #11 URL\0"
125 /*  1817 */ "DELETE\0"
126 /*  1824 */ "delete\0"
127 /*  1831 */ "Generate random data\0"
128 /*  1852 */ "GENERATE_RANDOM\0"
129 /*  1868 */ "generate-random\0"
130 /*  1884 */ "Generate an RSA private-public key pair\0"
131 /*  1924 */ "GENERATE_RSA\0"
132 /*  1937 */ "generate-rsa\0"
133 /*  1950 */ "Generate a DSA private-public key pair\0"
134 /*  1989 */ "GENERATE_DSA\0"
135 /*  2002 */ "generate-dsa\0"
136 /*  2015 */ "Generate an ECDSA private-public key pair\0"
137 /*  2057 */ "GENERATE_ECC\0"
138 /*  2070 */ "generate-ecc\0"
139 /*  2083 */ "Export the public key for a private key\0"
140 /*  2123 */ "EXPORT_PUBKEY\0"
141 /*  2137 */ "export-pubkey\0"
142 /*  2151 */ "Set the CKA_ID (in hex) for the specified by the URL object\0"
143 /*  2211 */ "SET_ID\0"
144 /*  2218 */ "set-id\0"
145 /*  2225 */ "Set the CKA_LABEL for the specified by the URL object\0"
146 /*  2279 */ "SET_LABEL\0"
147 /*  2289 */ "set-label\0"
148 /*  2299 */ "Sets a label for the write operation\0"
149 /*  2336 */ "LABEL\0"
150 /*  2342 */ "label\0"
151 /*  2348 */ "Sets an ID for the write operation\0"
152 /*  2383 */ "ID\0"
153 /*  2386 */ "id\0"
154 /*  2389 */ "Marks the generated key to be a wrapping key\0"
155 /*  2434 */ "MARK_WRAP\0"
156 /*  2444 */ "no-mark-wrap\0"
157 /*  2457 */ "no\0"
158 /*  2460 */ "Marks the object to be written as trusted\0"
159 /*  2502 */ "MARK_TRUSTED\0"
160 /*  2515 */ "no-mark-trusted\0"
161 /*  2531 */ "Marks the object to be written as a CA\0"
162 /*  2570 */ "MARK_CA\0"
163 /*  2578 */ "no-mark-ca\0"
164 /*  2589 */ "Marks the object to be written as private\0"
165 /*  2631 */ "MARK_PRIVATE\0"
166 /*  2644 */ "no-mark-private\0"
167 /*  2660 */ "an alias for the 'mark-trusted' option\0"
168 /*  2699 */ "trusted\0"
169 /*  2707 */ "an alias for the 'mark-ca' option\0"
170 /*  2741 */ "ca\0"
171 /*  2744 */ "an alias for the 'mark-private' option\0"
172 /*  2783 */ "private\0"
173 /*  2791 */ "Force (user) login to token\0"
174 /*  2819 */ "LOGIN\0"
175 /*  2825 */ "no-login\0"
176 /*  2834 */ "Force security officer login to token\0"
177 /*  2872 */ "SO_LOGIN\0"
178 /*  2881 */ "no-so-login\0"
179 /*  2893 */ "an alias for the 'so-login' option\0"
180 /*  2928 */ "admin-login\0"
181 /*  2940 */ "Print detailed URLs\0"
182 /*  2960 */ "DETAILED_URL\0"
183 /*  2973 */ "no-detailed-url\0"
184 /*  2989 */ "Provide a hex encoded secret key\0"
185 /*  3022 */ "SECRET_KEY\0"
186 /*  3033 */ "secret-key\0"
187 /*  3044 */ "Private key file to use\0"
188 /*  3068 */ "LOAD_PRIVKEY\0"
189 /*  3081 */ "load-privkey\0"
190 /*  3094 */ "Public key file to use\0"
191 /*  3117 */ "LOAD_PUBKEY\0"
192 /*  3129 */ "load-pubkey\0"
193 /*  3141 */ "Certificate file to use\0"
194 /*  3165 */ "LOAD_CERTIFICATE\0"
195 /*  3182 */ "load-certificate\0"
196 /*  3199 */ "Use PKCS #8 format for private keys\0"
197 /*  3235 */ "PKCS8\0"
198 /*  3241 */ "pkcs8\0"
199 /*  3247 */ "Specify the number of bits for key generate\0"
200 /*  3291 */ "BITS\0"
201 /*  3296 */ "bits\0"
202 /*  3301 */ "Specify the curve used for EC key generation\0"
203 /*  3346 */ "CURVE\0"
204 /*  3352 */ "curve\0"
205 /*  3358 */ "Specify the security level\0"
206 /*  3385 */ "SEC_PARAM\0"
207 /*  3395 */ "sec-param\0"
208 /*  3405 */ "Use DER/RAW format for input\0"
209 /*  3434 */ "INDER\0"
210 /*  3440 */ "no-inder\0"
211 /*  3449 */ "an alias for the 'inder' option\0"
212 /*  3481 */ "inraw\0"
213 /*  3487 */ "Use DER format for output certificates, private keys, and DH parameters\0"
214 /*  3559 */ "OUTDER\0"
215 /*  3566 */ "no-outder\0"
216 /*  3576 */ "an alias for the 'outder' option\0"
217 /*  3609 */ "outraw\0"
218 /*  3616 */ "Initializes a PKCS #11 token\0"
219 /*  3645 */ "INITIALIZE\0"
220 /*  3656 */ "initialize\0"
221 /*  3667 */ "Specify the PIN to use on token initialization\0"
222 /*  3714 */ "SET_PIN\0"
223 /*  3722 */ "set-pin\0"
224 /*  3730 */ "Specify the Security Officer's PIN to use on token initialization\0"
225 /*  3796 */ "SET_SO_PIN\0"
226 /*  3807 */ "set-so-pin\0"
227 /*  3818 */ "Specify the PKCS #11 provider library\0"
228 /*  3856 */ "PROVIDER\0"
229 /*  3865 */ "provider\0"
230 /*  3874 */ "Disable all interaction with the tool.  All parameters need to be\n"
231             "specified on command line.\0"
232 /*  3967 */ "BATCH\0"
233 /*  3973 */ "batch\0"
234 /*  3979 */ "display extended usage information and exit\0"
235 /*  4023 */ "help\0"
236 /*  4028 */ "extended usage information passed thru pager\0"
237 /*  4073 */ "more-help\0"
238 /*  4083 */ "output version information and exit\0"
239 /*  4119 */ "version\0"
240 /*  4127 */ "P11TOOL\0"
241 /*  4135 */ "p11tool - GnuTLS PKCS #11 tool\n"
242             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [url]\n\0"
243 /*  4230 */ "bugs@gnutls.org\0"
244 /*  4246 */ "\n\0"
245 /*  4248 */ "Program that allows operations on PKCS #11 smart cards and security\n"
246             "modules.\n\n"
247             "To use PKCS #11 tokens with GnuTLS the p11-kit configuration files need to\n"
248             "be setup.  That is create a .module file in /etc/pkcs11/modules with the\n"
249             "contents 'module: /path/to/pkcs11.so'.  Alternatively the configuration\n"
250             "file /etc/gnutls/pkcs11.conf has to exist and contain a number of lines of\n"
251             "the form 'load=/usr/lib/opensc-pkcs11.so'.\n\n"
252             "You can provide the PIN to be used for the PKCS #11 operations with the\n"
253             "environment variables GNUTLS_PIN and GNUTLS_SO_PIN.\n\0"
254 /*  4790 */ "p11tool 3.3.27\0"
255 /*  4805 */ "p11tool [options] [url]\n"
256             "p11tool --help for usage instructions.\n";
257
258 /**
259  *  debug option description:
260  */
261 /** Descriptive text for the debug option */
262 #define DEBUG_DESC      (p11tool_opt_strs+886)
263 /** Upper-cased name for the debug option */
264 #define DEBUG_NAME      (p11tool_opt_strs+903)
265 /** Name string for the debug option */
266 #define DEBUG_name      (p11tool_opt_strs+909)
267 /** Compiled in flag settings for the debug option */
268 #define DEBUG_FLAGS     (OPTST_DISABLED \
269         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
270
271 /**
272  *  outfile option description:
273  */
274 /** Descriptive text for the outfile option */
275 #define OUTFILE_DESC      (p11tool_opt_strs+915)
276 /** Upper-cased name for the outfile option */
277 #define OUTFILE_NAME      (p11tool_opt_strs+927)
278 /** Name string for the outfile option */
279 #define OUTFILE_name      (p11tool_opt_strs+935)
280 /** Compiled in flag settings for the outfile option */
281 #define OUTFILE_FLAGS     (OPTST_DISABLED \
282         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
283
284 /**
285  *  list-tokens option description:
286  */
287 /** Descriptive text for the list-tokens option */
288 #define LIST_TOKENS_DESC      (p11tool_opt_strs+943)
289 /** Upper-cased name for the list-tokens option */
290 #define LIST_TOKENS_NAME      (p11tool_opt_strs+969)
291 /** Name string for the list-tokens option */
292 #define LIST_TOKENS_name      (p11tool_opt_strs+981)
293 /** Compiled in flag settings for the list-tokens option */
294 #define LIST_TOKENS_FLAGS     (OPTST_DISABLED)
295
296 /**
297  *  export option description:
298  */
299 /** Descriptive text for the export option */
300 #define EXPORT_DESC      (p11tool_opt_strs+993)
301 /** Upper-cased name for the export option */
302 #define EXPORT_NAME      (p11tool_opt_strs+1032)
303 /** Name string for the export option */
304 #define EXPORT_name      (p11tool_opt_strs+1039)
305 /** Compiled in flag settings for the export option */
306 #define EXPORT_FLAGS     (OPTST_DISABLED)
307
308 /**
309  *  export-chain option description:
310  */
311 /** Descriptive text for the export-chain option */
312 #define EXPORT_CHAIN_DESC      (p11tool_opt_strs+1046)
313 /** Upper-cased name for the export-chain option */
314 #define EXPORT_CHAIN_NAME      (p11tool_opt_strs+1113)
315 /** Name string for the export-chain option */
316 #define EXPORT_CHAIN_name      (p11tool_opt_strs+1126)
317 /** Compiled in flag settings for the export-chain option */
318 #define EXPORT_CHAIN_FLAGS     (OPTST_DISABLED)
319
320 /**
321  *  list-mechanisms option description:
322  */
323 /** Descriptive text for the list-mechanisms option */
324 #define LIST_MECHANISMS_DESC      (p11tool_opt_strs+1139)
325 /** Upper-cased name for the list-mechanisms option */
326 #define LIST_MECHANISMS_NAME      (p11tool_opt_strs+1180)
327 /** Name string for the list-mechanisms option */
328 #define LIST_MECHANISMS_name      (p11tool_opt_strs+1196)
329 /** Compiled in flag settings for the list-mechanisms option */
330 #define LIST_MECHANISMS_FLAGS     (OPTST_DISABLED)
331
332 /**
333  *  info option description:
334  */
335 /** Descriptive text for the info option */
336 #define INFO_DESC      (p11tool_opt_strs+1212)
337 /** Upper-cased name for the info option */
338 #define INFO_NAME      (p11tool_opt_strs+1263)
339 /** Name string for the info option */
340 #define INFO_name      (p11tool_opt_strs+1268)
341 /** Compiled in flag settings for the info option */
342 #define INFO_FLAGS     (OPTST_DISABLED)
343
344 /**
345  *  list-all option description:
346  */
347 /** Descriptive text for the list-all option */
348 #define LIST_ALL_DESC      (p11tool_opt_strs+1273)
349 /** Upper-cased name for the list-all option */
350 #define LIST_ALL_NAME      (p11tool_opt_strs+1311)
351 /** Name string for the list-all option */
352 #define LIST_ALL_name      (p11tool_opt_strs+1320)
353 /** Compiled in flag settings for the list-all option */
354 #define LIST_ALL_FLAGS     (OPTST_DISABLED)
355
356 /**
357  *  list-all-certs option description:
358  */
359 /** Descriptive text for the list-all-certs option */
360 #define LIST_ALL_CERTS_DESC      (p11tool_opt_strs+1329)
361 /** Upper-cased name for the list-all-certs option */
362 #define LIST_ALL_CERTS_NAME      (p11tool_opt_strs+1372)
363 /** Name string for the list-all-certs option */
364 #define LIST_ALL_CERTS_name      (p11tool_opt_strs+1387)
365 /** Compiled in flag settings for the list-all-certs option */
366 #define LIST_ALL_CERTS_FLAGS     (OPTST_DISABLED)
367
368 /**
369  *  list-certs option description:
370  */
371 /** Descriptive text for the list-certs option */
372 #define LIST_CERTS_DESC      (p11tool_opt_strs+1402)
373 /** Upper-cased name for the list-certs option */
374 #define LIST_CERTS_NAME      (p11tool_opt_strs+1460)
375 /** Name string for the list-certs option */
376 #define LIST_CERTS_name      (p11tool_opt_strs+1471)
377 /** Compiled in flag settings for the list-certs option */
378 #define LIST_CERTS_FLAGS     (OPTST_DISABLED)
379
380 /**
381  *  list-all-privkeys option description:
382  */
383 /** Descriptive text for the list-all-privkeys option */
384 #define LIST_ALL_PRIVKEYS_DESC      (p11tool_opt_strs+1482)
385 /** Upper-cased name for the list-all-privkeys option */
386 #define LIST_ALL_PRIVKEYS_NAME      (p11tool_opt_strs+1525)
387 /** Name string for the list-all-privkeys option */
388 #define LIST_ALL_PRIVKEYS_name      (p11tool_opt_strs+1543)
389 /** Compiled in flag settings for the list-all-privkeys option */
390 #define LIST_ALL_PRIVKEYS_FLAGS     (OPTST_DISABLED)
391
392 /**
393  *  list-privkeys option description:
394  */
395 /** Descriptive text for the list-privkeys option */
396 #define LIST_PRIVKEYS_DESC    (p11tool_opt_strs+1561)
397 #define LIST_PRIVKEYS_NAME    NULL
398 /** Unmodified name string for the list-privkeys option */
399 #define LIST_PRIVKEYS_name    (p11tool_opt_strs+1605)
400 /** Compiled in flag settings for the list-privkeys option */
401 #define LIST_PRIVKEYS_FLAGS     (LIST_ALL_PRIVKEYS_FLAGS | OPTST_ALIAS)
402
403 /**
404  *  list-keys option description:
405  */
406 /** Descriptive text for the list-keys option */
407 #define LIST_KEYS_DESC    (p11tool_opt_strs+1561)
408 #define LIST_KEYS_NAME    NULL
409 /** Unmodified name string for the list-keys option */
410 #define LIST_KEYS_name    (p11tool_opt_strs+1619)
411 /** Compiled in flag settings for the list-keys option */
412 #define LIST_KEYS_FLAGS     (LIST_ALL_PRIVKEYS_FLAGS | OPTST_ALIAS)
413
414 /**
415  *  list-all-trusted option description:
416  */
417 /** Descriptive text for the list-all-trusted option */
418 #define LIST_ALL_TRUSTED_DESC      (p11tool_opt_strs+1629)
419 /** Upper-cased name for the list-all-trusted option */
420 #define LIST_ALL_TRUSTED_NAME      (p11tool_opt_strs+1679)
421 /** Name string for the list-all-trusted option */
422 #define LIST_ALL_TRUSTED_name      (p11tool_opt_strs+1696)
423 /** Compiled in flag settings for the list-all-trusted option */
424 #define LIST_ALL_TRUSTED_FLAGS     (OPTST_DISABLED)
425
426 /**
427  *  write option description:
428  */
429 /** Descriptive text for the write option */
430 #define WRITE_DESC      (p11tool_opt_strs+1713)
431 /** Upper-cased name for the write option */
432 #define WRITE_NAME      (p11tool_opt_strs+1759)
433 /** Name string for the write option */
434 #define WRITE_name      (p11tool_opt_strs+1765)
435 /** Compiled in flag settings for the write option */
436 #define WRITE_FLAGS     (OPTST_DISABLED)
437
438 /**
439  *  delete option description:
440  */
441 /** Descriptive text for the delete option */
442 #define DELETE_DESC      (p11tool_opt_strs+1771)
443 /** Upper-cased name for the delete option */
444 #define DELETE_NAME      (p11tool_opt_strs+1817)
445 /** Name string for the delete option */
446 #define DELETE_name      (p11tool_opt_strs+1824)
447 /** Compiled in flag settings for the delete option */
448 #define DELETE_FLAGS     (OPTST_DISABLED)
449
450 /**
451  *  generate-random option description:
452  */
453 /** Descriptive text for the generate-random option */
454 #define GENERATE_RANDOM_DESC      (p11tool_opt_strs+1831)
455 /** Upper-cased name for the generate-random option */
456 #define GENERATE_RANDOM_NAME      (p11tool_opt_strs+1852)
457 /** Name string for the generate-random option */
458 #define GENERATE_RANDOM_name      (p11tool_opt_strs+1868)
459 /** Compiled in flag settings for the generate-random option */
460 #define GENERATE_RANDOM_FLAGS     (OPTST_DISABLED \
461         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
462
463 /**
464  *  generate-rsa option description:
465  */
466 /** Descriptive text for the generate-rsa option */
467 #define GENERATE_RSA_DESC      (p11tool_opt_strs+1884)
468 /** Upper-cased name for the generate-rsa option */
469 #define GENERATE_RSA_NAME      (p11tool_opt_strs+1924)
470 /** Name string for the generate-rsa option */
471 #define GENERATE_RSA_name      (p11tool_opt_strs+1937)
472 /** Compiled in flag settings for the generate-rsa option */
473 #define GENERATE_RSA_FLAGS     (OPTST_DISABLED)
474
475 /**
476  *  generate-dsa option description:
477  */
478 /** Descriptive text for the generate-dsa option */
479 #define GENERATE_DSA_DESC      (p11tool_opt_strs+1950)
480 /** Upper-cased name for the generate-dsa option */
481 #define GENERATE_DSA_NAME      (p11tool_opt_strs+1989)
482 /** Name string for the generate-dsa option */
483 #define GENERATE_DSA_name      (p11tool_opt_strs+2002)
484 /** Compiled in flag settings for the generate-dsa option */
485 #define GENERATE_DSA_FLAGS     (OPTST_DISABLED)
486
487 /**
488  *  generate-ecc option description:
489  */
490 /** Descriptive text for the generate-ecc option */
491 #define GENERATE_ECC_DESC      (p11tool_opt_strs+2015)
492 /** Upper-cased name for the generate-ecc option */
493 #define GENERATE_ECC_NAME      (p11tool_opt_strs+2057)
494 /** Name string for the generate-ecc option */
495 #define GENERATE_ECC_name      (p11tool_opt_strs+2070)
496 /** Compiled in flag settings for the generate-ecc option */
497 #define GENERATE_ECC_FLAGS     (OPTST_DISABLED)
498
499 /**
500  *  export-pubkey option description:
501  */
502 /** Descriptive text for the export-pubkey option */
503 #define EXPORT_PUBKEY_DESC      (p11tool_opt_strs+2083)
504 /** Upper-cased name for the export-pubkey option */
505 #define EXPORT_PUBKEY_NAME      (p11tool_opt_strs+2123)
506 /** Name string for the export-pubkey option */
507 #define EXPORT_PUBKEY_name      (p11tool_opt_strs+2137)
508 /** Compiled in flag settings for the export-pubkey option */
509 #define EXPORT_PUBKEY_FLAGS     (OPTST_DISABLED)
510
511 /**
512  *  set-id option description:
513  */
514 /** Descriptive text for the set-id option */
515 #define SET_ID_DESC      (p11tool_opt_strs+2151)
516 /** Upper-cased name for the set-id option */
517 #define SET_ID_NAME      (p11tool_opt_strs+2211)
518 /** Name string for the set-id option */
519 #define SET_ID_name      (p11tool_opt_strs+2218)
520 /** Compiled in flag settings for the set-id option */
521 #define SET_ID_FLAGS     (OPTST_DISABLED \
522         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
523
524 /**
525  *  set-label option description:
526  */
527 /** Descriptive text for the set-label option */
528 #define SET_LABEL_DESC      (p11tool_opt_strs+2225)
529 /** Upper-cased name for the set-label option */
530 #define SET_LABEL_NAME      (p11tool_opt_strs+2279)
531 /** Name string for the set-label option */
532 #define SET_LABEL_name      (p11tool_opt_strs+2289)
533 /** Compiled in flag settings for the set-label option */
534 #define SET_LABEL_FLAGS     (OPTST_DISABLED \
535         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
536
537 /**
538  *  label option description:
539  */
540 /** Descriptive text for the label option */
541 #define LABEL_DESC      (p11tool_opt_strs+2299)
542 /** Upper-cased name for the label option */
543 #define LABEL_NAME      (p11tool_opt_strs+2336)
544 /** Name string for the label option */
545 #define LABEL_name      (p11tool_opt_strs+2342)
546 /** Compiled in flag settings for the label option */
547 #define LABEL_FLAGS     (OPTST_DISABLED \
548         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
549
550 /**
551  *  id option description:
552  */
553 /** Descriptive text for the id option */
554 #define ID_DESC      (p11tool_opt_strs+2348)
555 /** Upper-cased name for the id option */
556 #define ID_NAME      (p11tool_opt_strs+2383)
557 /** Name string for the id option */
558 #define ID_name      (p11tool_opt_strs+2386)
559 /** Compiled in flag settings for the id option */
560 #define ID_FLAGS     (OPTST_DISABLED \
561         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
562
563 /**
564  *  mark-wrap option description:
565  */
566 /** Descriptive text for the mark-wrap option */
567 #define MARK_WRAP_DESC      (p11tool_opt_strs+2389)
568 /** Upper-cased name for the mark-wrap option */
569 #define MARK_WRAP_NAME      (p11tool_opt_strs+2434)
570 /** disablement name for the mark-wrap option */
571 #define NOT_MARK_WRAP_name  (p11tool_opt_strs+2444)
572 /** disablement prefix for the mark-wrap option */
573 #define NOT_MARK_WRAP_PFX   (p11tool_opt_strs+2457)
574 /** Name string for the mark-wrap option */
575 #define MARK_WRAP_name      (NOT_MARK_WRAP_name + 3)
576 /** Compiled in flag settings for the mark-wrap option */
577 #define MARK_WRAP_FLAGS     (OPTST_DISABLED)
578
579 /**
580  *  mark-trusted option description:
581  */
582 /** Descriptive text for the mark-trusted option */
583 #define MARK_TRUSTED_DESC      (p11tool_opt_strs+2460)
584 /** Upper-cased name for the mark-trusted option */
585 #define MARK_TRUSTED_NAME      (p11tool_opt_strs+2502)
586 /** disablement name for the mark-trusted option */
587 #define NOT_MARK_TRUSTED_name  (p11tool_opt_strs+2515)
588 /** disablement prefix for the mark-trusted option */
589 #define NOT_MARK_TRUSTED_PFX   (p11tool_opt_strs+2457)
590 /** Name string for the mark-trusted option */
591 #define MARK_TRUSTED_name      (NOT_MARK_TRUSTED_name + 3)
592 /** Compiled in flag settings for the mark-trusted option */
593 #define MARK_TRUSTED_FLAGS     (OPTST_DISABLED)
594
595 /**
596  *  mark-ca option description:
597  */
598 /** Descriptive text for the mark-ca option */
599 #define MARK_CA_DESC      (p11tool_opt_strs+2531)
600 /** Upper-cased name for the mark-ca option */
601 #define MARK_CA_NAME      (p11tool_opt_strs+2570)
602 /** disablement name for the mark-ca option */
603 #define NOT_MARK_CA_name  (p11tool_opt_strs+2578)
604 /** disablement prefix for the mark-ca option */
605 #define NOT_MARK_CA_PFX   (p11tool_opt_strs+2457)
606 /** Name string for the mark-ca option */
607 #define MARK_CA_name      (NOT_MARK_CA_name + 3)
608 /** Compiled in flag settings for the mark-ca option */
609 #define MARK_CA_FLAGS     (OPTST_DISABLED)
610
611 /**
612  *  mark-private option description:
613  */
614 /** Descriptive text for the mark-private option */
615 #define MARK_PRIVATE_DESC      (p11tool_opt_strs+2589)
616 /** Upper-cased name for the mark-private option */
617 #define MARK_PRIVATE_NAME      (p11tool_opt_strs+2631)
618 /** disablement name for the mark-private option */
619 #define NOT_MARK_PRIVATE_name  (p11tool_opt_strs+2644)
620 /** disablement prefix for the mark-private option */
621 #define NOT_MARK_PRIVATE_PFX   (p11tool_opt_strs+2457)
622 /** Name string for the mark-private option */
623 #define MARK_PRIVATE_name      (NOT_MARK_PRIVATE_name + 3)
624 /** Compiled in flag settings for the mark-private option */
625 #define MARK_PRIVATE_FLAGS     (OPTST_INITENABLED)
626
627 /**
628  *  trusted option description:
629  */
630 /** Descriptive text for the trusted option */
631 #define TRUSTED_DESC    (p11tool_opt_strs+2660)
632 #define TRUSTED_NAME    NULL
633 /** Unmodified name string for the trusted option */
634 #define TRUSTED_name    (p11tool_opt_strs+2699)
635 /** Compiled in flag settings for the trusted option */
636 #define TRUSTED_FLAGS     (MARK_TRUSTED_FLAGS | OPTST_ALIAS)
637
638 /**
639  *  ca option description:
640  */
641 /** Descriptive text for the ca option */
642 #define CA_DESC    (p11tool_opt_strs+2707)
643 #define CA_NAME    NULL
644 /** Unmodified name string for the ca option */
645 #define CA_name    (p11tool_opt_strs+2741)
646 /** Compiled in flag settings for the ca option */
647 #define CA_FLAGS     (MARK_CA_FLAGS | OPTST_ALIAS)
648
649 /**
650  *  private option description:
651  */
652 /** Descriptive text for the private option */
653 #define PRIVATE_DESC    (p11tool_opt_strs+2744)
654 #define PRIVATE_NAME    NULL
655 /** Unmodified name string for the private option */
656 #define PRIVATE_name    (p11tool_opt_strs+2783)
657 /** Compiled in flag settings for the private option */
658 #define PRIVATE_FLAGS     (MARK_PRIVATE_FLAGS | OPTST_ALIAS)
659
660 /**
661  *  login option description:
662  */
663 /** Descriptive text for the login option */
664 #define LOGIN_DESC      (p11tool_opt_strs+2791)
665 /** Upper-cased name for the login option */
666 #define LOGIN_NAME      (p11tool_opt_strs+2819)
667 /** disablement name for the login option */
668 #define NOT_LOGIN_name  (p11tool_opt_strs+2825)
669 /** disablement prefix for the login option */
670 #define NOT_LOGIN_PFX   (p11tool_opt_strs+2457)
671 /** Name string for the login option */
672 #define LOGIN_name      (NOT_LOGIN_name + 3)
673 /** Compiled in flag settings for the login option */
674 #define LOGIN_FLAGS     (OPTST_DISABLED)
675
676 /**
677  *  so-login option description:
678  */
679 /** Descriptive text for the so-login option */
680 #define SO_LOGIN_DESC      (p11tool_opt_strs+2834)
681 /** Upper-cased name for the so-login option */
682 #define SO_LOGIN_NAME      (p11tool_opt_strs+2872)
683 /** disablement name for the so-login option */
684 #define NOT_SO_LOGIN_name  (p11tool_opt_strs+2881)
685 /** disablement prefix for the so-login option */
686 #define NOT_SO_LOGIN_PFX   (p11tool_opt_strs+2457)
687 /** Name string for the so-login option */
688 #define SO_LOGIN_name      (NOT_SO_LOGIN_name + 3)
689 /** Compiled in flag settings for the so-login option */
690 #define SO_LOGIN_FLAGS     (OPTST_DISABLED)
691
692 /**
693  *  admin-login option description:
694  */
695 /** Descriptive text for the admin-login option */
696 #define ADMIN_LOGIN_DESC    (p11tool_opt_strs+2893)
697 #define ADMIN_LOGIN_NAME    NULL
698 /** Unmodified name string for the admin-login option */
699 #define ADMIN_LOGIN_name    (p11tool_opt_strs+2928)
700 /** Compiled in flag settings for the admin-login option */
701 #define ADMIN_LOGIN_FLAGS     (SO_LOGIN_FLAGS | OPTST_ALIAS)
702
703 /**
704  *  detailed-url option description:
705  */
706 /** Descriptive text for the detailed-url option */
707 #define DETAILED_URL_DESC      (p11tool_opt_strs+2940)
708 /** Upper-cased name for the detailed-url option */
709 #define DETAILED_URL_NAME      (p11tool_opt_strs+2960)
710 /** disablement name for the detailed-url option */
711 #define NOT_DETAILED_URL_name  (p11tool_opt_strs+2973)
712 /** disablement prefix for the detailed-url option */
713 #define NOT_DETAILED_URL_PFX   (p11tool_opt_strs+2457)
714 /** Name string for the detailed-url option */
715 #define DETAILED_URL_name      (NOT_DETAILED_URL_name + 3)
716 /** Compiled in flag settings for the detailed-url option */
717 #define DETAILED_URL_FLAGS     (OPTST_DISABLED)
718
719 /**
720  *  secret-key option description:
721  */
722 /** Descriptive text for the secret-key option */
723 #define SECRET_KEY_DESC      (p11tool_opt_strs+2989)
724 /** Upper-cased name for the secret-key option */
725 #define SECRET_KEY_NAME      (p11tool_opt_strs+3022)
726 /** Name string for the secret-key option */
727 #define SECRET_KEY_name      (p11tool_opt_strs+3033)
728 /** Compiled in flag settings for the secret-key option */
729 #define SECRET_KEY_FLAGS     (OPTST_DISABLED \
730         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
731
732 /**
733  *  load-privkey option description:
734  */
735 /** Descriptive text for the load-privkey option */
736 #define LOAD_PRIVKEY_DESC      (p11tool_opt_strs+3044)
737 /** Upper-cased name for the load-privkey option */
738 #define LOAD_PRIVKEY_NAME      (p11tool_opt_strs+3068)
739 /** Name string for the load-privkey option */
740 #define LOAD_PRIVKEY_name      (p11tool_opt_strs+3081)
741 /** Compiled in flag settings for the load-privkey option */
742 #define LOAD_PRIVKEY_FLAGS     (OPTST_DISABLED \
743         | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
744
745 /**
746  *  load-pubkey option description:
747  */
748 /** Descriptive text for the load-pubkey option */
749 #define LOAD_PUBKEY_DESC      (p11tool_opt_strs+3094)
750 /** Upper-cased name for the load-pubkey option */
751 #define LOAD_PUBKEY_NAME      (p11tool_opt_strs+3117)
752 /** Name string for the load-pubkey option */
753 #define LOAD_PUBKEY_name      (p11tool_opt_strs+3129)
754 /** Compiled in flag settings for the load-pubkey option */
755 #define LOAD_PUBKEY_FLAGS     (OPTST_DISABLED \
756         | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
757
758 /**
759  *  load-certificate option description:
760  */
761 /** Descriptive text for the load-certificate option */
762 #define LOAD_CERTIFICATE_DESC      (p11tool_opt_strs+3141)
763 /** Upper-cased name for the load-certificate option */
764 #define LOAD_CERTIFICATE_NAME      (p11tool_opt_strs+3165)
765 /** Name string for the load-certificate option */
766 #define LOAD_CERTIFICATE_name      (p11tool_opt_strs+3182)
767 /** Compiled in flag settings for the load-certificate option */
768 #define LOAD_CERTIFICATE_FLAGS     (OPTST_DISABLED \
769         | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
770
771 /**
772  *  pkcs8 option description:
773  */
774 /** Descriptive text for the pkcs8 option */
775 #define PKCS8_DESC      (p11tool_opt_strs+3199)
776 /** Upper-cased name for the pkcs8 option */
777 #define PKCS8_NAME      (p11tool_opt_strs+3235)
778 /** Name string for the pkcs8 option */
779 #define PKCS8_name      (p11tool_opt_strs+3241)
780 /** Compiled in flag settings for the pkcs8 option */
781 #define PKCS8_FLAGS     (OPTST_DISABLED)
782
783 /**
784  *  bits option description:
785  */
786 /** Descriptive text for the bits option */
787 #define BITS_DESC      (p11tool_opt_strs+3247)
788 /** Upper-cased name for the bits option */
789 #define BITS_NAME      (p11tool_opt_strs+3291)
790 /** Name string for the bits option */
791 #define BITS_name      (p11tool_opt_strs+3296)
792 /** Compiled in flag settings for the bits option */
793 #define BITS_FLAGS     (OPTST_DISABLED \
794         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
795
796 /**
797  *  curve option description:
798  */
799 /** Descriptive text for the curve option */
800 #define CURVE_DESC      (p11tool_opt_strs+3301)
801 /** Upper-cased name for the curve option */
802 #define CURVE_NAME      (p11tool_opt_strs+3346)
803 /** Name string for the curve option */
804 #define CURVE_name      (p11tool_opt_strs+3352)
805 /** Compiled in flag settings for the curve option */
806 #define CURVE_FLAGS     (OPTST_DISABLED \
807         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
808
809 /**
810  *  sec-param option description:
811  */
812 /** Descriptive text for the sec-param option */
813 #define SEC_PARAM_DESC      (p11tool_opt_strs+3358)
814 /** Upper-cased name for the sec-param option */
815 #define SEC_PARAM_NAME      (p11tool_opt_strs+3385)
816 /** Name string for the sec-param option */
817 #define SEC_PARAM_name      (p11tool_opt_strs+3395)
818 /** Compiled in flag settings for the sec-param option */
819 #define SEC_PARAM_FLAGS     (OPTST_DISABLED \
820         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
821
822 /**
823  *  inder option description:
824  */
825 /** Descriptive text for the inder option */
826 #define INDER_DESC      (p11tool_opt_strs+3405)
827 /** Upper-cased name for the inder option */
828 #define INDER_NAME      (p11tool_opt_strs+3434)
829 /** disablement name for the inder option */
830 #define NOT_INDER_name  (p11tool_opt_strs+3440)
831 /** disablement prefix for the inder option */
832 #define NOT_INDER_PFX   (p11tool_opt_strs+2457)
833 /** Name string for the inder option */
834 #define INDER_name      (NOT_INDER_name + 3)
835 /** Compiled in flag settings for the inder option */
836 #define INDER_FLAGS     (OPTST_DISABLED)
837
838 /**
839  *  inraw option description:
840  */
841 /** Descriptive text for the inraw option */
842 #define INRAW_DESC    (p11tool_opt_strs+3449)
843 #define INRAW_NAME    NULL
844 /** Unmodified name string for the inraw option */
845 #define INRAW_name    (p11tool_opt_strs+3481)
846 /** Compiled in flag settings for the inraw option */
847 #define INRAW_FLAGS     (INDER_FLAGS | OPTST_ALIAS)
848
849 /**
850  *  outder option description:
851  */
852 /** Descriptive text for the outder option */
853 #define OUTDER_DESC      (p11tool_opt_strs+3487)
854 /** Upper-cased name for the outder option */
855 #define OUTDER_NAME      (p11tool_opt_strs+3559)
856 /** disablement name for the outder option */
857 #define NOT_OUTDER_name  (p11tool_opt_strs+3566)
858 /** disablement prefix for the outder option */
859 #define NOT_OUTDER_PFX   (p11tool_opt_strs+2457)
860 /** Name string for the outder option */
861 #define OUTDER_name      (NOT_OUTDER_name + 3)
862 /** Compiled in flag settings for the outder option */
863 #define OUTDER_FLAGS     (OPTST_DISABLED)
864
865 /**
866  *  outraw option description:
867  */
868 /** Descriptive text for the outraw option */
869 #define OUTRAW_DESC    (p11tool_opt_strs+3576)
870 #define OUTRAW_NAME    NULL
871 /** Unmodified name string for the outraw option */
872 #define OUTRAW_name    (p11tool_opt_strs+3609)
873 /** Compiled in flag settings for the outraw option */
874 #define OUTRAW_FLAGS     (OUTDER_FLAGS | OPTST_ALIAS)
875
876 /**
877  *  initialize option description:
878  */
879 /** Descriptive text for the initialize option */
880 #define INITIALIZE_DESC      (p11tool_opt_strs+3616)
881 /** Upper-cased name for the initialize option */
882 #define INITIALIZE_NAME      (p11tool_opt_strs+3645)
883 /** Name string for the initialize option */
884 #define INITIALIZE_name      (p11tool_opt_strs+3656)
885 /** Compiled in flag settings for the initialize option */
886 #define INITIALIZE_FLAGS     (OPTST_DISABLED)
887
888 /**
889  *  set-pin option description:
890  */
891 /** Descriptive text for the set-pin option */
892 #define SET_PIN_DESC      (p11tool_opt_strs+3667)
893 /** Upper-cased name for the set-pin option */
894 #define SET_PIN_NAME      (p11tool_opt_strs+3714)
895 /** Name string for the set-pin option */
896 #define SET_PIN_name      (p11tool_opt_strs+3722)
897 /** Compiled in flag settings for the set-pin option */
898 #define SET_PIN_FLAGS     (OPTST_DISABLED \
899         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
900
901 /**
902  *  set-so-pin option description:
903  */
904 /** Descriptive text for the set-so-pin option */
905 #define SET_SO_PIN_DESC      (p11tool_opt_strs+3730)
906 /** Upper-cased name for the set-so-pin option */
907 #define SET_SO_PIN_NAME      (p11tool_opt_strs+3796)
908 /** Name string for the set-so-pin option */
909 #define SET_SO_PIN_name      (p11tool_opt_strs+3807)
910 /** Compiled in flag settings for the set-so-pin option */
911 #define SET_SO_PIN_FLAGS     (OPTST_DISABLED \
912         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
913
914 /**
915  *  provider option description:
916  */
917 /** Descriptive text for the provider option */
918 #define PROVIDER_DESC      (p11tool_opt_strs+3818)
919 /** Upper-cased name for the provider option */
920 #define PROVIDER_NAME      (p11tool_opt_strs+3856)
921 /** Name string for the provider option */
922 #define PROVIDER_name      (p11tool_opt_strs+3865)
923 /** Compiled in flag settings for the provider option */
924 #define PROVIDER_FLAGS     (OPTST_DISABLED \
925         | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
926
927 /**
928  *  batch option description:
929  */
930 /** Descriptive text for the batch option */
931 #define BATCH_DESC      (p11tool_opt_strs+3874)
932 /** Upper-cased name for the batch option */
933 #define BATCH_NAME      (p11tool_opt_strs+3967)
934 /** Name string for the batch option */
935 #define BATCH_name      (p11tool_opt_strs+3973)
936 /** Compiled in flag settings for the batch option */
937 #define BATCH_FLAGS     (OPTST_DISABLED)
938
939 /*
940  *  Help/More_Help/Version option descriptions:
941  */
942 #define HELP_DESC       (p11tool_opt_strs+3979)
943 #define HELP_name       (p11tool_opt_strs+4023)
944 #ifdef HAVE_WORKING_FORK
945 #define MORE_HELP_DESC  (p11tool_opt_strs+4028)
946 #define MORE_HELP_name  (p11tool_opt_strs+4073)
947 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
948 #else
949 #define MORE_HELP_DESC  HELP_DESC
950 #define MORE_HELP_name  HELP_name
951 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
952 #endif
953 #ifdef NO_OPTIONAL_OPT_ARGS
954 #  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
955 #else
956 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
957                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
958 #endif
959 #define VER_DESC        (p11tool_opt_strs+4083)
960 #define VER_name        (p11tool_opt_strs+4119)
961 /**
962  *  Declare option callback procedures
963  */
964 extern tOptProc
965     optionBooleanVal,   optionNestedVal,    optionNumericVal,
966     optionPagedUsage,   optionPrintVersion, optionResetOpt,
967     optionStackArg,     optionTimeDate,     optionTimeVal,
968     optionUnstackArg,   optionVendorOption;
969 static tOptProc
970     doOptAdmin_Login,      doOptCa,               doOptDebug,
971     doOptInraw,            doOptList_Keys,        doOptList_Privkeys,
972     doOptLoad_Certificate, doOptLoad_Privkey,     doOptLoad_Pubkey,
973     doOptOutraw,           doOptPrivate,          doOptProvider,
974     doOptTrusted,          doUsageOpt;
975 #define VER_PROC        optionPrintVersion
976
977 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
978 /**
979  *  Define the p11tool Option Descriptions.
980  * This is an array of OPTION_CT entries, one for each
981  * option that the p11tool program responds to.
982  */
983 static tOptDesc optDesc[OPTION_CT] = {
984   {  /* entry idx, value */ 0, VALUE_OPT_DEBUG,
985      /* equiv idx, value */ 0, VALUE_OPT_DEBUG,
986      /* equivalenced to  */ NO_EQUIVALENT,
987      /* min, max, act ct */ 0, 1, 0,
988      /* opt state flags  */ DEBUG_FLAGS, 0,
989      /* last opt argumnt */ { NULL }, /* --debug */
990      /* arg list/cookie  */ NULL,
991      /* must/cannot opts */ NULL, NULL,
992      /* option proc      */ doOptDebug,
993      /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name,
994      /* disablement strs */ NULL, NULL },
995
996   {  /* entry idx, value */ 1, VALUE_OPT_OUTFILE,
997      /* equiv idx, value */ 1, VALUE_OPT_OUTFILE,
998      /* equivalenced to  */ NO_EQUIVALENT,
999      /* min, max, act ct */ 0, 1, 0,
1000      /* opt state flags  */ OUTFILE_FLAGS, 0,
1001      /* last opt argumnt */ { NULL }, /* --outfile */
1002      /* arg list/cookie  */ NULL,
1003      /* must/cannot opts */ NULL, NULL,
1004      /* option proc      */ NULL,
1005      /* desc, NAME, name */ OUTFILE_DESC, OUTFILE_NAME, OUTFILE_name,
1006      /* disablement strs */ NULL, NULL },
1007
1008   {  /* entry idx, value */ 2, VALUE_OPT_LIST_TOKENS,
1009      /* equiv idx, value */ 2, VALUE_OPT_LIST_TOKENS,
1010      /* equivalenced to  */ NO_EQUIVALENT,
1011      /* min, max, act ct */ 0, 1, 0,
1012      /* opt state flags  */ LIST_TOKENS_FLAGS, 0,
1013      /* last opt argumnt */ { NULL }, /* --list-tokens */
1014      /* arg list/cookie  */ NULL,
1015      /* must/cannot opts */ NULL, NULL,
1016      /* option proc      */ NULL,
1017      /* desc, NAME, name */ LIST_TOKENS_DESC, LIST_TOKENS_NAME, LIST_TOKENS_name,
1018      /* disablement strs */ NULL, NULL },
1019
1020   {  /* entry idx, value */ 3, VALUE_OPT_EXPORT,
1021      /* equiv idx, value */ 3, VALUE_OPT_EXPORT,
1022      /* equivalenced to  */ NO_EQUIVALENT,
1023      /* min, max, act ct */ 0, 1, 0,
1024      /* opt state flags  */ EXPORT_FLAGS, 0,
1025      /* last opt argumnt */ { NULL }, /* --export */
1026      /* arg list/cookie  */ NULL,
1027      /* must/cannot opts */ NULL, NULL,
1028      /* option proc      */ NULL,
1029      /* desc, NAME, name */ EXPORT_DESC, EXPORT_NAME, EXPORT_name,
1030      /* disablement strs */ NULL, NULL },
1031
1032   {  /* entry idx, value */ 4, VALUE_OPT_EXPORT_CHAIN,
1033      /* equiv idx, value */ 4, VALUE_OPT_EXPORT_CHAIN,
1034      /* equivalenced to  */ NO_EQUIVALENT,
1035      /* min, max, act ct */ 0, 1, 0,
1036      /* opt state flags  */ EXPORT_CHAIN_FLAGS, 0,
1037      /* last opt argumnt */ { NULL }, /* --export-chain */
1038      /* arg list/cookie  */ NULL,
1039      /* must/cannot opts */ NULL, NULL,
1040      /* option proc      */ NULL,
1041      /* desc, NAME, name */ EXPORT_CHAIN_DESC, EXPORT_CHAIN_NAME, EXPORT_CHAIN_name,
1042      /* disablement strs */ NULL, NULL },
1043
1044   {  /* entry idx, value */ 5, VALUE_OPT_LIST_MECHANISMS,
1045      /* equiv idx, value */ 5, VALUE_OPT_LIST_MECHANISMS,
1046      /* equivalenced to  */ NO_EQUIVALENT,
1047      /* min, max, act ct */ 0, 1, 0,
1048      /* opt state flags  */ LIST_MECHANISMS_FLAGS, 0,
1049      /* last opt argumnt */ { NULL }, /* --list-mechanisms */
1050      /* arg list/cookie  */ NULL,
1051      /* must/cannot opts */ NULL, NULL,
1052      /* option proc      */ NULL,
1053      /* desc, NAME, name */ LIST_MECHANISMS_DESC, LIST_MECHANISMS_NAME, LIST_MECHANISMS_name,
1054      /* disablement strs */ NULL, NULL },
1055
1056   {  /* entry idx, value */ 6, VALUE_OPT_INFO,
1057      /* equiv idx, value */ 6, VALUE_OPT_INFO,
1058      /* equivalenced to  */ NO_EQUIVALENT,
1059      /* min, max, act ct */ 0, 1, 0,
1060      /* opt state flags  */ INFO_FLAGS, 0,
1061      /* last opt argumnt */ { NULL }, /* --info */
1062      /* arg list/cookie  */ NULL,
1063      /* must/cannot opts */ NULL, NULL,
1064      /* option proc      */ NULL,
1065      /* desc, NAME, name */ INFO_DESC, INFO_NAME, INFO_name,
1066      /* disablement strs */ NULL, NULL },
1067
1068   {  /* entry idx, value */ 7, VALUE_OPT_LIST_ALL,
1069      /* equiv idx, value */ 7, VALUE_OPT_LIST_ALL,
1070      /* equivalenced to  */ NO_EQUIVALENT,
1071      /* min, max, act ct */ 0, 1, 0,
1072      /* opt state flags  */ LIST_ALL_FLAGS, 0,
1073      /* last opt argumnt */ { NULL }, /* --list-all */
1074      /* arg list/cookie  */ NULL,
1075      /* must/cannot opts */ NULL, NULL,
1076      /* option proc      */ NULL,
1077      /* desc, NAME, name */ LIST_ALL_DESC, LIST_ALL_NAME, LIST_ALL_name,
1078      /* disablement strs */ NULL, NULL },
1079
1080   {  /* entry idx, value */ 8, VALUE_OPT_LIST_ALL_CERTS,
1081      /* equiv idx, value */ 8, VALUE_OPT_LIST_ALL_CERTS,
1082      /* equivalenced to  */ NO_EQUIVALENT,
1083      /* min, max, act ct */ 0, 1, 0,
1084      /* opt state flags  */ LIST_ALL_CERTS_FLAGS, 0,
1085      /* last opt argumnt */ { NULL }, /* --list-all-certs */
1086      /* arg list/cookie  */ NULL,
1087      /* must/cannot opts */ NULL, NULL,
1088      /* option proc      */ NULL,
1089      /* desc, NAME, name */ LIST_ALL_CERTS_DESC, LIST_ALL_CERTS_NAME, LIST_ALL_CERTS_name,
1090      /* disablement strs */ NULL, NULL },
1091
1092   {  /* entry idx, value */ 9, VALUE_OPT_LIST_CERTS,
1093      /* equiv idx, value */ 9, VALUE_OPT_LIST_CERTS,
1094      /* equivalenced to  */ NO_EQUIVALENT,
1095      /* min, max, act ct */ 0, 1, 0,
1096      /* opt state flags  */ LIST_CERTS_FLAGS, 0,
1097      /* last opt argumnt */ { NULL }, /* --list-certs */
1098      /* arg list/cookie  */ NULL,
1099      /* must/cannot opts */ NULL, NULL,
1100      /* option proc      */ NULL,
1101      /* desc, NAME, name */ LIST_CERTS_DESC, LIST_CERTS_NAME, LIST_CERTS_name,
1102      /* disablement strs */ NULL, NULL },
1103
1104   {  /* entry idx, value */ 10, VALUE_OPT_LIST_ALL_PRIVKEYS,
1105      /* equiv idx, value */ 10, VALUE_OPT_LIST_ALL_PRIVKEYS,
1106      /* equivalenced to  */ NO_EQUIVALENT,
1107      /* min, max, act ct */ 0, 1, 0,
1108      /* opt state flags  */ LIST_ALL_PRIVKEYS_FLAGS, 0,
1109      /* last opt argumnt */ { NULL }, /* --list-all-privkeys */
1110      /* arg list/cookie  */ NULL,
1111      /* must/cannot opts */ NULL, NULL,
1112      /* option proc      */ NULL,
1113      /* desc, NAME, name */ LIST_ALL_PRIVKEYS_DESC, LIST_ALL_PRIVKEYS_NAME, LIST_ALL_PRIVKEYS_name,
1114      /* disablement strs */ NULL, NULL },
1115
1116   {  /* entry idx, value */ 11, VALUE_OPT_LIST_PRIVKEYS,
1117      /* equiv idx, value */ 11, VALUE_OPT_LIST_PRIVKEYS,
1118      /* equivalenced to  */ NO_EQUIVALENT,
1119      /* min, max, act ct */ 0, 1, 0,
1120      /* opt state flags  */ LIST_PRIVKEYS_FLAGS, 0,
1121      /* last opt argumnt */ { NULL }, /* --list-privkeys */
1122      /* arg list/cookie  */ NULL,
1123      /* must/cannot opts */ NULL, NULL,
1124      /* option proc      */ doOptList_Privkeys,
1125      /* desc, NAME, name */ LIST_PRIVKEYS_DESC, LIST_PRIVKEYS_NAME, LIST_PRIVKEYS_name,
1126      /* disablement strs */ 0, 0 },
1127
1128   {  /* entry idx, value */ 12, VALUE_OPT_LIST_KEYS,
1129      /* equiv idx, value */ 12, VALUE_OPT_LIST_KEYS,
1130      /* equivalenced to  */ NO_EQUIVALENT,
1131      /* min, max, act ct */ 0, 1, 0,
1132      /* opt state flags  */ LIST_KEYS_FLAGS, 0,
1133      /* last opt argumnt */ { NULL }, /* --list-keys */
1134      /* arg list/cookie  */ NULL,
1135      /* must/cannot opts */ NULL, NULL,
1136      /* option proc      */ doOptList_Keys,
1137      /* desc, NAME, name */ LIST_KEYS_DESC, LIST_KEYS_NAME, LIST_KEYS_name,
1138      /* disablement strs */ 0, 0 },
1139
1140   {  /* entry idx, value */ 13, VALUE_OPT_LIST_ALL_TRUSTED,
1141      /* equiv idx, value */ 13, VALUE_OPT_LIST_ALL_TRUSTED,
1142      /* equivalenced to  */ NO_EQUIVALENT,
1143      /* min, max, act ct */ 0, 1, 0,
1144      /* opt state flags  */ LIST_ALL_TRUSTED_FLAGS, 0,
1145      /* last opt argumnt */ { NULL }, /* --list-all-trusted */
1146      /* arg list/cookie  */ NULL,
1147      /* must/cannot opts */ NULL, NULL,
1148      /* option proc      */ NULL,
1149      /* desc, NAME, name */ LIST_ALL_TRUSTED_DESC, LIST_ALL_TRUSTED_NAME, LIST_ALL_TRUSTED_name,
1150      /* disablement strs */ NULL, NULL },
1151
1152   {  /* entry idx, value */ 14, VALUE_OPT_WRITE,
1153      /* equiv idx, value */ 14, VALUE_OPT_WRITE,
1154      /* equivalenced to  */ NO_EQUIVALENT,
1155      /* min, max, act ct */ 0, 1, 0,
1156      /* opt state flags  */ WRITE_FLAGS, 0,
1157      /* last opt argumnt */ { NULL }, /* --write */
1158      /* arg list/cookie  */ NULL,
1159      /* must/cannot opts */ NULL, NULL,
1160      /* option proc      */ NULL,
1161      /* desc, NAME, name */ WRITE_DESC, WRITE_NAME, WRITE_name,
1162      /* disablement strs */ NULL, NULL },
1163
1164   {  /* entry idx, value */ 15, VALUE_OPT_DELETE,
1165      /* equiv idx, value */ 15, VALUE_OPT_DELETE,
1166      /* equivalenced to  */ NO_EQUIVALENT,
1167      /* min, max, act ct */ 0, 1, 0,
1168      /* opt state flags  */ DELETE_FLAGS, 0,
1169      /* last opt argumnt */ { NULL }, /* --delete */
1170      /* arg list/cookie  */ NULL,
1171      /* must/cannot opts */ NULL, NULL,
1172      /* option proc      */ NULL,
1173      /* desc, NAME, name */ DELETE_DESC, DELETE_NAME, DELETE_name,
1174      /* disablement strs */ NULL, NULL },
1175
1176   {  /* entry idx, value */ 16, VALUE_OPT_GENERATE_RANDOM,
1177      /* equiv idx, value */ 16, VALUE_OPT_GENERATE_RANDOM,
1178      /* equivalenced to  */ NO_EQUIVALENT,
1179      /* min, max, act ct */ 0, 1, 0,
1180      /* opt state flags  */ GENERATE_RANDOM_FLAGS, 0,
1181      /* last opt argumnt */ { NULL }, /* --generate-random */
1182      /* arg list/cookie  */ NULL,
1183      /* must/cannot opts */ NULL, NULL,
1184      /* option proc      */ optionNumericVal,
1185      /* desc, NAME, name */ GENERATE_RANDOM_DESC, GENERATE_RANDOM_NAME, GENERATE_RANDOM_name,
1186      /* disablement strs */ NULL, NULL },
1187
1188   {  /* entry idx, value */ 17, VALUE_OPT_GENERATE_RSA,
1189      /* equiv idx, value */ 17, VALUE_OPT_GENERATE_RSA,
1190      /* equivalenced to  */ NO_EQUIVALENT,
1191      /* min, max, act ct */ 0, 1, 0,
1192      /* opt state flags  */ GENERATE_RSA_FLAGS, 0,
1193      /* last opt argumnt */ { NULL }, /* --generate-rsa */
1194      /* arg list/cookie  */ NULL,
1195      /* must/cannot opts */ NULL, NULL,
1196      /* option proc      */ NULL,
1197      /* desc, NAME, name */ GENERATE_RSA_DESC, GENERATE_RSA_NAME, GENERATE_RSA_name,
1198      /* disablement strs */ NULL, NULL },
1199
1200   {  /* entry idx, value */ 18, VALUE_OPT_GENERATE_DSA,
1201      /* equiv idx, value */ 18, VALUE_OPT_GENERATE_DSA,
1202      /* equivalenced to  */ NO_EQUIVALENT,
1203      /* min, max, act ct */ 0, 1, 0,
1204      /* opt state flags  */ GENERATE_DSA_FLAGS, 0,
1205      /* last opt argumnt */ { NULL }, /* --generate-dsa */
1206      /* arg list/cookie  */ NULL,
1207      /* must/cannot opts */ NULL, NULL,
1208      /* option proc      */ NULL,
1209      /* desc, NAME, name */ GENERATE_DSA_DESC, GENERATE_DSA_NAME, GENERATE_DSA_name,
1210      /* disablement strs */ NULL, NULL },
1211
1212   {  /* entry idx, value */ 19, VALUE_OPT_GENERATE_ECC,
1213      /* equiv idx, value */ 19, VALUE_OPT_GENERATE_ECC,
1214      /* equivalenced to  */ NO_EQUIVALENT,
1215      /* min, max, act ct */ 0, 1, 0,
1216      /* opt state flags  */ GENERATE_ECC_FLAGS, 0,
1217      /* last opt argumnt */ { NULL }, /* --generate-ecc */
1218      /* arg list/cookie  */ NULL,
1219      /* must/cannot opts */ NULL, NULL,
1220      /* option proc      */ NULL,
1221      /* desc, NAME, name */ GENERATE_ECC_DESC, GENERATE_ECC_NAME, GENERATE_ECC_name,
1222      /* disablement strs */ NULL, NULL },
1223
1224   {  /* entry idx, value */ 20, VALUE_OPT_EXPORT_PUBKEY,
1225      /* equiv idx, value */ 20, VALUE_OPT_EXPORT_PUBKEY,
1226      /* equivalenced to  */ NO_EQUIVALENT,
1227      /* min, max, act ct */ 0, 1, 0,
1228      /* opt state flags  */ EXPORT_PUBKEY_FLAGS, 0,
1229      /* last opt argumnt */ { NULL }, /* --export-pubkey */
1230      /* arg list/cookie  */ NULL,
1231      /* must/cannot opts */ NULL, NULL,
1232      /* option proc      */ NULL,
1233      /* desc, NAME, name */ EXPORT_PUBKEY_DESC, EXPORT_PUBKEY_NAME, EXPORT_PUBKEY_name,
1234      /* disablement strs */ NULL, NULL },
1235
1236   {  /* entry idx, value */ 21, VALUE_OPT_SET_ID,
1237      /* equiv idx, value */ 21, VALUE_OPT_SET_ID,
1238      /* equivalenced to  */ NO_EQUIVALENT,
1239      /* min, max, act ct */ 0, 1, 0,
1240      /* opt state flags  */ SET_ID_FLAGS, 0,
1241      /* last opt argumnt */ { NULL }, /* --set-id */
1242      /* arg list/cookie  */ NULL,
1243      /* must/cannot opts */ NULL, NULL,
1244      /* option proc      */ NULL,
1245      /* desc, NAME, name */ SET_ID_DESC, SET_ID_NAME, SET_ID_name,
1246      /* disablement strs */ NULL, NULL },
1247
1248   {  /* entry idx, value */ 22, VALUE_OPT_SET_LABEL,
1249      /* equiv idx, value */ 22, VALUE_OPT_SET_LABEL,
1250      /* equivalenced to  */ NO_EQUIVALENT,
1251      /* min, max, act ct */ 0, 1, 0,
1252      /* opt state flags  */ SET_LABEL_FLAGS, 0,
1253      /* last opt argumnt */ { NULL }, /* --set-label */
1254      /* arg list/cookie  */ NULL,
1255      /* must/cannot opts */ NULL, NULL,
1256      /* option proc      */ NULL,
1257      /* desc, NAME, name */ SET_LABEL_DESC, SET_LABEL_NAME, SET_LABEL_name,
1258      /* disablement strs */ NULL, NULL },
1259
1260   {  /* entry idx, value */ 23, VALUE_OPT_LABEL,
1261      /* equiv idx, value */ 23, VALUE_OPT_LABEL,
1262      /* equivalenced to  */ NO_EQUIVALENT,
1263      /* min, max, act ct */ 0, 1, 0,
1264      /* opt state flags  */ LABEL_FLAGS, 0,
1265      /* last opt argumnt */ { NULL }, /* --label */
1266      /* arg list/cookie  */ NULL,
1267      /* must/cannot opts */ NULL, NULL,
1268      /* option proc      */ NULL,
1269      /* desc, NAME, name */ LABEL_DESC, LABEL_NAME, LABEL_name,
1270      /* disablement strs */ NULL, NULL },
1271
1272   {  /* entry idx, value */ 24, VALUE_OPT_ID,
1273      /* equiv idx, value */ 24, VALUE_OPT_ID,
1274      /* equivalenced to  */ NO_EQUIVALENT,
1275      /* min, max, act ct */ 0, 1, 0,
1276      /* opt state flags  */ ID_FLAGS, 0,
1277      /* last opt argumnt */ { NULL }, /* --id */
1278      /* arg list/cookie  */ NULL,
1279      /* must/cannot opts */ NULL, NULL,
1280      /* option proc      */ NULL,
1281      /* desc, NAME, name */ ID_DESC, ID_NAME, ID_name,
1282      /* disablement strs */ NULL, NULL },
1283
1284   {  /* entry idx, value */ 25, VALUE_OPT_MARK_WRAP,
1285      /* equiv idx, value */ 25, VALUE_OPT_MARK_WRAP,
1286      /* equivalenced to  */ NO_EQUIVALENT,
1287      /* min, max, act ct */ 0, 1, 0,
1288      /* opt state flags  */ MARK_WRAP_FLAGS, 0,
1289      /* last opt argumnt */ { NULL }, /* --mark-wrap */
1290      /* arg list/cookie  */ NULL,
1291      /* must/cannot opts */ NULL, NULL,
1292      /* option proc      */ NULL,
1293      /* desc, NAME, name */ MARK_WRAP_DESC, MARK_WRAP_NAME, MARK_WRAP_name,
1294      /* disablement strs */ NOT_MARK_WRAP_name, NOT_MARK_WRAP_PFX },
1295
1296   {  /* entry idx, value */ 26, VALUE_OPT_MARK_TRUSTED,
1297      /* equiv idx, value */ 26, VALUE_OPT_MARK_TRUSTED,
1298      /* equivalenced to  */ NO_EQUIVALENT,
1299      /* min, max, act ct */ 0, 1, 0,
1300      /* opt state flags  */ MARK_TRUSTED_FLAGS, 0,
1301      /* last opt argumnt */ { NULL }, /* --mark-trusted */
1302      /* arg list/cookie  */ NULL,
1303      /* must/cannot opts */ NULL, NULL,
1304      /* option proc      */ NULL,
1305      /* desc, NAME, name */ MARK_TRUSTED_DESC, MARK_TRUSTED_NAME, MARK_TRUSTED_name,
1306      /* disablement strs */ NOT_MARK_TRUSTED_name, NOT_MARK_TRUSTED_PFX },
1307
1308   {  /* entry idx, value */ 27, VALUE_OPT_MARK_CA,
1309      /* equiv idx, value */ 27, VALUE_OPT_MARK_CA,
1310      /* equivalenced to  */ NO_EQUIVALENT,
1311      /* min, max, act ct */ 0, 1, 0,
1312      /* opt state flags  */ MARK_CA_FLAGS, 0,
1313      /* last opt argumnt */ { NULL }, /* --mark-ca */
1314      /* arg list/cookie  */ NULL,
1315      /* must/cannot opts */ NULL, NULL,
1316      /* option proc      */ NULL,
1317      /* desc, NAME, name */ MARK_CA_DESC, MARK_CA_NAME, MARK_CA_name,
1318      /* disablement strs */ NOT_MARK_CA_name, NOT_MARK_CA_PFX },
1319
1320   {  /* entry idx, value */ 28, VALUE_OPT_MARK_PRIVATE,
1321      /* equiv idx, value */ 28, VALUE_OPT_MARK_PRIVATE,
1322      /* equivalenced to  */ NO_EQUIVALENT,
1323      /* min, max, act ct */ 0, 1, 0,
1324      /* opt state flags  */ MARK_PRIVATE_FLAGS, 0,
1325      /* last opt argumnt */ { NULL }, /* --mark-private */
1326      /* arg list/cookie  */ NULL,
1327      /* must/cannot opts */ NULL, NULL,
1328      /* option proc      */ NULL,
1329      /* desc, NAME, name */ MARK_PRIVATE_DESC, MARK_PRIVATE_NAME, MARK_PRIVATE_name,
1330      /* disablement strs */ NOT_MARK_PRIVATE_name, NOT_MARK_PRIVATE_PFX },
1331
1332   {  /* entry idx, value */ 29, VALUE_OPT_TRUSTED,
1333      /* equiv idx, value */ 29, VALUE_OPT_TRUSTED,
1334      /* equivalenced to  */ NO_EQUIVALENT,
1335      /* min, max, act ct */ 0, 1, 0,
1336      /* opt state flags  */ TRUSTED_FLAGS, 0,
1337      /* last opt argumnt */ { NULL }, /* --trusted */
1338      /* arg list/cookie  */ NULL,
1339      /* must/cannot opts */ NULL, NULL,
1340      /* option proc      */ doOptTrusted,
1341      /* desc, NAME, name */ TRUSTED_DESC, TRUSTED_NAME, TRUSTED_name,
1342      /* disablement strs */ 0, 0 },
1343
1344   {  /* entry idx, value */ 30, VALUE_OPT_CA,
1345      /* equiv idx, value */ 30, VALUE_OPT_CA,
1346      /* equivalenced to  */ NO_EQUIVALENT,
1347      /* min, max, act ct */ 0, 1, 0,
1348      /* opt state flags  */ CA_FLAGS, 0,
1349      /* last opt argumnt */ { NULL }, /* --ca */
1350      /* arg list/cookie  */ NULL,
1351      /* must/cannot opts */ NULL, NULL,
1352      /* option proc      */ doOptCa,
1353      /* desc, NAME, name */ CA_DESC, CA_NAME, CA_name,
1354      /* disablement strs */ 0, 0 },
1355
1356   {  /* entry idx, value */ 31, VALUE_OPT_PRIVATE,
1357      /* equiv idx, value */ 31, VALUE_OPT_PRIVATE,
1358      /* equivalenced to  */ NO_EQUIVALENT,
1359      /* min, max, act ct */ 0, 1, 0,
1360      /* opt state flags  */ PRIVATE_FLAGS, 0,
1361      /* last opt argumnt */ { NULL }, /* --private */
1362      /* arg list/cookie  */ NULL,
1363      /* must/cannot opts */ NULL, NULL,
1364      /* option proc      */ doOptPrivate,
1365      /* desc, NAME, name */ PRIVATE_DESC, PRIVATE_NAME, PRIVATE_name,
1366      /* disablement strs */ 0, 0 },
1367
1368   {  /* entry idx, value */ 32, VALUE_OPT_LOGIN,
1369      /* equiv idx, value */ 32, VALUE_OPT_LOGIN,
1370      /* equivalenced to  */ NO_EQUIVALENT,
1371      /* min, max, act ct */ 0, 1, 0,
1372      /* opt state flags  */ LOGIN_FLAGS, 0,
1373      /* last opt argumnt */ { NULL }, /* --login */
1374      /* arg list/cookie  */ NULL,
1375      /* must/cannot opts */ NULL, NULL,
1376      /* option proc      */ NULL,
1377      /* desc, NAME, name */ LOGIN_DESC, LOGIN_NAME, LOGIN_name,
1378      /* disablement strs */ NOT_LOGIN_name, NOT_LOGIN_PFX },
1379
1380   {  /* entry idx, value */ 33, VALUE_OPT_SO_LOGIN,
1381      /* equiv idx, value */ 33, VALUE_OPT_SO_LOGIN,
1382      /* equivalenced to  */ NO_EQUIVALENT,
1383      /* min, max, act ct */ 0, 1, 0,
1384      /* opt state flags  */ SO_LOGIN_FLAGS, 0,
1385      /* last opt argumnt */ { NULL }, /* --so-login */
1386      /* arg list/cookie  */ NULL,
1387      /* must/cannot opts */ NULL, NULL,
1388      /* option proc      */ NULL,
1389      /* desc, NAME, name */ SO_LOGIN_DESC, SO_LOGIN_NAME, SO_LOGIN_name,
1390      /* disablement strs */ NOT_SO_LOGIN_name, NOT_SO_LOGIN_PFX },
1391
1392   {  /* entry idx, value */ 34, VALUE_OPT_ADMIN_LOGIN,
1393      /* equiv idx, value */ 34, VALUE_OPT_ADMIN_LOGIN,
1394      /* equivalenced to  */ NO_EQUIVALENT,
1395      /* min, max, act ct */ 0, 1, 0,
1396      /* opt state flags  */ ADMIN_LOGIN_FLAGS, 0,
1397      /* last opt argumnt */ { NULL }, /* --admin-login */
1398      /* arg list/cookie  */ NULL,
1399      /* must/cannot opts */ NULL, NULL,
1400      /* option proc      */ doOptAdmin_Login,
1401      /* desc, NAME, name */ ADMIN_LOGIN_DESC, ADMIN_LOGIN_NAME, ADMIN_LOGIN_name,
1402      /* disablement strs */ 0, 0 },
1403
1404   {  /* entry idx, value */ 35, VALUE_OPT_DETAILED_URL,
1405      /* equiv idx, value */ 35, VALUE_OPT_DETAILED_URL,
1406      /* equivalenced to  */ NO_EQUIVALENT,
1407      /* min, max, act ct */ 0, 1, 0,
1408      /* opt state flags  */ DETAILED_URL_FLAGS, 0,
1409      /* last opt argumnt */ { NULL }, /* --detailed-url */
1410      /* arg list/cookie  */ NULL,
1411      /* must/cannot opts */ NULL, NULL,
1412      /* option proc      */ NULL,
1413      /* desc, NAME, name */ DETAILED_URL_DESC, DETAILED_URL_NAME, DETAILED_URL_name,
1414      /* disablement strs */ NOT_DETAILED_URL_name, NOT_DETAILED_URL_PFX },
1415
1416   {  /* entry idx, value */ 36, VALUE_OPT_SECRET_KEY,
1417      /* equiv idx, value */ 36, VALUE_OPT_SECRET_KEY,
1418      /* equivalenced to  */ NO_EQUIVALENT,
1419      /* min, max, act ct */ 0, 1, 0,
1420      /* opt state flags  */ SECRET_KEY_FLAGS, 0,
1421      /* last opt argumnt */ { NULL }, /* --secret-key */
1422      /* arg list/cookie  */ NULL,
1423      /* must/cannot opts */ NULL, NULL,
1424      /* option proc      */ NULL,
1425      /* desc, NAME, name */ SECRET_KEY_DESC, SECRET_KEY_NAME, SECRET_KEY_name,
1426      /* disablement strs */ NULL, NULL },
1427
1428   {  /* entry idx, value */ 37, VALUE_OPT_LOAD_PRIVKEY,
1429      /* equiv idx, value */ 37, VALUE_OPT_LOAD_PRIVKEY,
1430      /* equivalenced to  */ NO_EQUIVALENT,
1431      /* min, max, act ct */ 0, 1, 0,
1432      /* opt state flags  */ LOAD_PRIVKEY_FLAGS, 0,
1433      /* last opt argumnt */ { NULL }, /* --load-privkey */
1434      /* arg list/cookie  */ NULL,
1435      /* must/cannot opts */ NULL, NULL,
1436      /* option proc      */ doOptLoad_Privkey,
1437      /* desc, NAME, name */ LOAD_PRIVKEY_DESC, LOAD_PRIVKEY_NAME, LOAD_PRIVKEY_name,
1438      /* disablement strs */ NULL, NULL },
1439
1440   {  /* entry idx, value */ 38, VALUE_OPT_LOAD_PUBKEY,
1441      /* equiv idx, value */ 38, VALUE_OPT_LOAD_PUBKEY,
1442      /* equivalenced to  */ NO_EQUIVALENT,
1443      /* min, max, act ct */ 0, 1, 0,
1444      /* opt state flags  */ LOAD_PUBKEY_FLAGS, 0,
1445      /* last opt argumnt */ { NULL }, /* --load-pubkey */
1446      /* arg list/cookie  */ NULL,
1447      /* must/cannot opts */ NULL, NULL,
1448      /* option proc      */ doOptLoad_Pubkey,
1449      /* desc, NAME, name */ LOAD_PUBKEY_DESC, LOAD_PUBKEY_NAME, LOAD_PUBKEY_name,
1450      /* disablement strs */ NULL, NULL },
1451
1452   {  /* entry idx, value */ 39, VALUE_OPT_LOAD_CERTIFICATE,
1453      /* equiv idx, value */ 39, VALUE_OPT_LOAD_CERTIFICATE,
1454      /* equivalenced to  */ NO_EQUIVALENT,
1455      /* min, max, act ct */ 0, 1, 0,
1456      /* opt state flags  */ LOAD_CERTIFICATE_FLAGS, 0,
1457      /* last opt argumnt */ { NULL }, /* --load-certificate */
1458      /* arg list/cookie  */ NULL,
1459      /* must/cannot opts */ NULL, NULL,
1460      /* option proc      */ doOptLoad_Certificate,
1461      /* desc, NAME, name */ LOAD_CERTIFICATE_DESC, LOAD_CERTIFICATE_NAME, LOAD_CERTIFICATE_name,
1462      /* disablement strs */ NULL, NULL },
1463
1464   {  /* entry idx, value */ 40, VALUE_OPT_PKCS8,
1465      /* equiv idx, value */ 40, VALUE_OPT_PKCS8,
1466      /* equivalenced to  */ NO_EQUIVALENT,
1467      /* min, max, act ct */ 0, 1, 0,
1468      /* opt state flags  */ PKCS8_FLAGS, 0,
1469      /* last opt argumnt */ { NULL }, /* --pkcs8 */
1470      /* arg list/cookie  */ NULL,
1471      /* must/cannot opts */ NULL, NULL,
1472      /* option proc      */ NULL,
1473      /* desc, NAME, name */ PKCS8_DESC, PKCS8_NAME, PKCS8_name,
1474      /* disablement strs */ NULL, NULL },
1475
1476   {  /* entry idx, value */ 41, VALUE_OPT_BITS,
1477      /* equiv idx, value */ 41, VALUE_OPT_BITS,
1478      /* equivalenced to  */ NO_EQUIVALENT,
1479      /* min, max, act ct */ 0, 1, 0,
1480      /* opt state flags  */ BITS_FLAGS, 0,
1481      /* last opt argumnt */ { NULL }, /* --bits */
1482      /* arg list/cookie  */ NULL,
1483      /* must/cannot opts */ NULL, NULL,
1484      /* option proc      */ optionNumericVal,
1485      /* desc, NAME, name */ BITS_DESC, BITS_NAME, BITS_name,
1486      /* disablement strs */ NULL, NULL },
1487
1488   {  /* entry idx, value */ 42, VALUE_OPT_CURVE,
1489      /* equiv idx, value */ 42, VALUE_OPT_CURVE,
1490      /* equivalenced to  */ NO_EQUIVALENT,
1491      /* min, max, act ct */ 0, 1, 0,
1492      /* opt state flags  */ CURVE_FLAGS, 0,
1493      /* last opt argumnt */ { NULL }, /* --curve */
1494      /* arg list/cookie  */ NULL,
1495      /* must/cannot opts */ NULL, NULL,
1496      /* option proc      */ NULL,
1497      /* desc, NAME, name */ CURVE_DESC, CURVE_NAME, CURVE_name,
1498      /* disablement strs */ NULL, NULL },
1499
1500   {  /* entry idx, value */ 43, VALUE_OPT_SEC_PARAM,
1501      /* equiv idx, value */ 43, VALUE_OPT_SEC_PARAM,
1502      /* equivalenced to  */ NO_EQUIVALENT,
1503      /* min, max, act ct */ 0, 1, 0,
1504      /* opt state flags  */ SEC_PARAM_FLAGS, 0,
1505      /* last opt argumnt */ { NULL }, /* --sec-param */
1506      /* arg list/cookie  */ NULL,
1507      /* must/cannot opts */ NULL, NULL,
1508      /* option proc      */ NULL,
1509      /* desc, NAME, name */ SEC_PARAM_DESC, SEC_PARAM_NAME, SEC_PARAM_name,
1510      /* disablement strs */ NULL, NULL },
1511
1512   {  /* entry idx, value */ 44, VALUE_OPT_INDER,
1513      /* equiv idx, value */ 44, VALUE_OPT_INDER,
1514      /* equivalenced to  */ NO_EQUIVALENT,
1515      /* min, max, act ct */ 0, 1, 0,
1516      /* opt state flags  */ INDER_FLAGS, 0,
1517      /* last opt argumnt */ { NULL }, /* --inder */
1518      /* arg list/cookie  */ NULL,
1519      /* must/cannot opts */ NULL, NULL,
1520      /* option proc      */ NULL,
1521      /* desc, NAME, name */ INDER_DESC, INDER_NAME, INDER_name,
1522      /* disablement strs */ NOT_INDER_name, NOT_INDER_PFX },
1523
1524   {  /* entry idx, value */ 45, VALUE_OPT_INRAW,
1525      /* equiv idx, value */ 45, VALUE_OPT_INRAW,
1526      /* equivalenced to  */ NO_EQUIVALENT,
1527      /* min, max, act ct */ 0, 1, 0,
1528      /* opt state flags  */ INRAW_FLAGS, 0,
1529      /* last opt argumnt */ { NULL }, /* --inraw */
1530      /* arg list/cookie  */ NULL,
1531      /* must/cannot opts */ NULL, NULL,
1532      /* option proc      */ doOptInraw,
1533      /* desc, NAME, name */ INRAW_DESC, INRAW_NAME, INRAW_name,
1534      /* disablement strs */ 0, 0 },
1535
1536   {  /* entry idx, value */ 46, VALUE_OPT_OUTDER,
1537      /* equiv idx, value */ 46, VALUE_OPT_OUTDER,
1538      /* equivalenced to  */ NO_EQUIVALENT,
1539      /* min, max, act ct */ 0, 1, 0,
1540      /* opt state flags  */ OUTDER_FLAGS, 0,
1541      /* last opt argumnt */ { NULL }, /* --outder */
1542      /* arg list/cookie  */ NULL,
1543      /* must/cannot opts */ NULL, NULL,
1544      /* option proc      */ NULL,
1545      /* desc, NAME, name */ OUTDER_DESC, OUTDER_NAME, OUTDER_name,
1546      /* disablement strs */ NOT_OUTDER_name, NOT_OUTDER_PFX },
1547
1548   {  /* entry idx, value */ 47, VALUE_OPT_OUTRAW,
1549      /* equiv idx, value */ 47, VALUE_OPT_OUTRAW,
1550      /* equivalenced to  */ NO_EQUIVALENT,
1551      /* min, max, act ct */ 0, 1, 0,
1552      /* opt state flags  */ OUTRAW_FLAGS, 0,
1553      /* last opt argumnt */ { NULL }, /* --outraw */
1554      /* arg list/cookie  */ NULL,
1555      /* must/cannot opts */ NULL, NULL,
1556      /* option proc      */ doOptOutraw,
1557      /* desc, NAME, name */ OUTRAW_DESC, OUTRAW_NAME, OUTRAW_name,
1558      /* disablement strs */ 0, 0 },
1559
1560   {  /* entry idx, value */ 48, VALUE_OPT_INITIALIZE,
1561      /* equiv idx, value */ 48, VALUE_OPT_INITIALIZE,
1562      /* equivalenced to  */ NO_EQUIVALENT,
1563      /* min, max, act ct */ 0, 1, 0,
1564      /* opt state flags  */ INITIALIZE_FLAGS, 0,
1565      /* last opt argumnt */ { NULL }, /* --initialize */
1566      /* arg list/cookie  */ NULL,
1567      /* must/cannot opts */ NULL, NULL,
1568      /* option proc      */ NULL,
1569      /* desc, NAME, name */ INITIALIZE_DESC, INITIALIZE_NAME, INITIALIZE_name,
1570      /* disablement strs */ NULL, NULL },
1571
1572   {  /* entry idx, value */ 49, VALUE_OPT_SET_PIN,
1573      /* equiv idx, value */ 49, VALUE_OPT_SET_PIN,
1574      /* equivalenced to  */ NO_EQUIVALENT,
1575      /* min, max, act ct */ 0, 1, 0,
1576      /* opt state flags  */ SET_PIN_FLAGS, 0,
1577      /* last opt argumnt */ { NULL }, /* --set-pin */
1578      /* arg list/cookie  */ NULL,
1579      /* must/cannot opts */ NULL, NULL,
1580      /* option proc      */ NULL,
1581      /* desc, NAME, name */ SET_PIN_DESC, SET_PIN_NAME, SET_PIN_name,
1582      /* disablement strs */ NULL, NULL },
1583
1584   {  /* entry idx, value */ 50, VALUE_OPT_SET_SO_PIN,
1585      /* equiv idx, value */ 50, VALUE_OPT_SET_SO_PIN,
1586      /* equivalenced to  */ NO_EQUIVALENT,
1587      /* min, max, act ct */ 0, 1, 0,
1588      /* opt state flags  */ SET_SO_PIN_FLAGS, 0,
1589      /* last opt argumnt */ { NULL }, /* --set-so-pin */
1590      /* arg list/cookie  */ NULL,
1591      /* must/cannot opts */ NULL, NULL,
1592      /* option proc      */ NULL,
1593      /* desc, NAME, name */ SET_SO_PIN_DESC, SET_SO_PIN_NAME, SET_SO_PIN_name,
1594      /* disablement strs */ NULL, NULL },
1595
1596   {  /* entry idx, value */ 51, VALUE_OPT_PROVIDER,
1597      /* equiv idx, value */ 51, VALUE_OPT_PROVIDER,
1598      /* equivalenced to  */ NO_EQUIVALENT,
1599      /* min, max, act ct */ 0, 1, 0,
1600      /* opt state flags  */ PROVIDER_FLAGS, 0,
1601      /* last opt argumnt */ { NULL }, /* --provider */
1602      /* arg list/cookie  */ NULL,
1603      /* must/cannot opts */ NULL, NULL,
1604      /* option proc      */ doOptProvider,
1605      /* desc, NAME, name */ PROVIDER_DESC, PROVIDER_NAME, PROVIDER_name,
1606      /* disablement strs */ NULL, NULL },
1607
1608   {  /* entry idx, value */ 52, VALUE_OPT_BATCH,
1609      /* equiv idx, value */ 52, VALUE_OPT_BATCH,
1610      /* equivalenced to  */ NO_EQUIVALENT,
1611      /* min, max, act ct */ 0, 1, 0,
1612      /* opt state flags  */ BATCH_FLAGS, 0,
1613      /* last opt argumnt */ { NULL }, /* --batch */
1614      /* arg list/cookie  */ NULL,
1615      /* must/cannot opts */ NULL, NULL,
1616      /* option proc      */ NULL,
1617      /* desc, NAME, name */ BATCH_DESC, BATCH_NAME, BATCH_name,
1618      /* disablement strs */ NULL, NULL },
1619
1620   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
1621      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_VERSION,
1622      /* equivalenced to  */ NO_EQUIVALENT,
1623      /* min, max, act ct */ 0, 1, 0,
1624      /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
1625      /* last opt argumnt */ { NULL },
1626      /* arg list/cookie  */ NULL,
1627      /* must/cannot opts */ NULL, NULL,
1628      /* option proc      */ VER_PROC,
1629      /* desc, NAME, name */ VER_DESC, NULL, VER_name,
1630      /* disablement strs */ NULL, NULL },
1631
1632
1633
1634   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
1635      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_HELP,
1636      /* equivalenced to  */ NO_EQUIVALENT,
1637      /* min, max, act ct */ 0, 1, 0,
1638      /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
1639      /* last opt argumnt */ { NULL },
1640      /* arg list/cookie  */ NULL,
1641      /* must/cannot opts */ NULL, NULL,
1642      /* option proc      */ doUsageOpt,
1643      /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
1644      /* disablement strs */ NULL, NULL },
1645
1646   {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
1647      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
1648      /* equivalenced to  */ NO_EQUIVALENT,
1649      /* min, max, act ct */ 0, 1, 0,
1650      /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
1651      /* last opt argumnt */ { NULL },
1652      /* arg list/cookie  */ NULL,
1653      /* must/cannot opts */ NULL,  NULL,
1654      /* option proc      */ optionPagedUsage,
1655      /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
1656      /* disablement strs */ NULL, NULL }
1657 };
1658
1659
1660 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1661 /** Reference to the upper cased version of p11tool. */
1662 #define zPROGNAME       (p11tool_opt_strs+4127)
1663 /** Reference to the title line for p11tool usage. */
1664 #define zUsageTitle     (p11tool_opt_strs+4135)
1665 /** There is no p11tool configuration file. */
1666 #define zRcName         NULL
1667 /** There are no directories to search for p11tool config files. */
1668 #define apzHomeList     NULL
1669 /** The p11tool program bug email address. */
1670 #define zBugsAddr       (p11tool_opt_strs+4230)
1671 /** Clarification/explanation of what p11tool does. */
1672 #define zExplain        (p11tool_opt_strs+4246)
1673 /** Extra detail explaining what p11tool does. */
1674 #define zDetail         (p11tool_opt_strs+4248)
1675 /** The full version string for p11tool. */
1676 #define zFullVersion    (p11tool_opt_strs+4790)
1677 /* extracted from optcode.tlib near line 364 */
1678
1679 #if defined(ENABLE_NLS)
1680 # define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT
1681   static tOptionXlateProc translate_option_strings;
1682 #else
1683 # define OPTPROC_BASE OPTPROC_NONE
1684 # define translate_option_strings NULL
1685 #endif /* ENABLE_NLS */
1686
1687 #define p11tool_full_usage (NULL)
1688 #define p11tool_short_usage (p11tool_opt_strs+4805)
1689
1690 #endif /* not defined __doxygen__ */
1691
1692 /*
1693  *  Create the static procedure(s) declared above.
1694  */
1695 /**
1696  * The callout function that invokes the optionUsage function.
1697  *
1698  * @param[in] opts the AutoOpts option description structure
1699  * @param[in] od   the descriptor for the "help" (usage) option.
1700  * @noreturn
1701  */
1702 static void
1703 doUsageOpt(tOptions * opts, tOptDesc * od)
1704 {
1705     int ex_code;
1706     ex_code = P11TOOL_EXIT_SUCCESS;
1707     optionUsage(&p11toolOptions, ex_code);
1708     /* NOTREACHED */
1709     exit(P11TOOL_EXIT_FAILURE);
1710     (void)opts;
1711     (void)od;
1712 }
1713
1714 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1715 /**
1716  * Code to handle the debug option.
1717  * Specifies the debug level.
1718  * @param[in] pOptions the p11tool options data structure
1719  * @param[in,out] pOptDesc the option descriptor for this option.
1720  */
1721 static void
1722 doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc)
1723 {
1724     static struct {long rmin, rmax;} const rng[1] = {
1725         { 0 ,  9999 } };
1726     int  ix;
1727
1728     if (pOptions <= OPTPROC_EMIT_LIMIT)
1729         goto emit_ranges;
1730     optionNumericVal(pOptions, pOptDesc);
1731
1732     for (ix = 0; ix < 1; ix++) {
1733         if (pOptDesc->optArg.argInt < rng[ix].rmin)
1734             continue;  /* ranges need not be ordered. */
1735         if (pOptDesc->optArg.argInt == rng[ix].rmin)
1736             return;
1737         if (rng[ix].rmax == LONG_MIN)
1738             continue;
1739         if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1740             return;
1741     }
1742
1743     option_usage_fp = stderr;
1744
1745  emit_ranges:
1746 optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
1747 }
1748
1749 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1750 /**
1751  * Code to handle the list-privkeys option.
1752  *
1753  * @param[in] pOptions the p11tool options data structure
1754  * @param[in,out] pOptDesc the option descriptor for this option.
1755  */
1756 static void
1757 doOptList_Privkeys(tOptions* pOptions, tOptDesc* pOptDesc)
1758 {
1759     int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_LIST_ALL_PRIVKEYS);
1760     if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0))
1761         USAGE(P11TOOL_EXIT_USAGE_ERROR);
1762
1763 }
1764
1765 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1766 /**
1767  * Code to handle the list-keys option.
1768  *
1769  * @param[in] pOptions the p11tool options data structure
1770  * @param[in,out] pOptDesc the option descriptor for this option.
1771  */
1772 static void
1773 doOptList_Keys(tOptions* pOptions, tOptDesc* pOptDesc)
1774 {
1775     int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_LIST_ALL_PRIVKEYS);
1776     if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0))
1777         USAGE(P11TOOL_EXIT_USAGE_ERROR);
1778
1779 }
1780
1781 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1782 /**
1783  * Code to handle the trusted option.
1784  *
1785  * @param[in] pOptions the p11tool options data structure
1786  * @param[in,out] pOptDesc the option descriptor for this option.
1787  */
1788 static void
1789 doOptTrusted(tOptions* pOptions, tOptDesc* pOptDesc)
1790 {
1791     int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_MARK_TRUSTED);
1792     if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0))
1793         USAGE(P11TOOL_EXIT_USAGE_ERROR);
1794
1795 }
1796
1797 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1798 /**
1799  * Code to handle the ca option.
1800  *
1801  * @param[in] pOptions the p11tool options data structure
1802  * @param[in,out] pOptDesc the option descriptor for this option.
1803  */
1804 static void
1805 doOptCa(tOptions* pOptions, tOptDesc* pOptDesc)
1806 {
1807     int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_MARK_CA);
1808     if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0))
1809         USAGE(P11TOOL_EXIT_USAGE_ERROR);
1810
1811 }
1812
1813 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1814 /**
1815  * Code to handle the private option.
1816  *
1817  * @param[in] pOptions the p11tool options data structure
1818  * @param[in,out] pOptDesc the option descriptor for this option.
1819  */
1820 static void
1821 doOptPrivate(tOptions* pOptions, tOptDesc* pOptDesc)
1822 {
1823     int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_MARK_PRIVATE);
1824     if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0))
1825         USAGE(P11TOOL_EXIT_USAGE_ERROR);
1826
1827 }
1828
1829 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1830 /**
1831  * Code to handle the admin-login option.
1832  *
1833  * @param[in] pOptions the p11tool options data structure
1834  * @param[in,out] pOptDesc the option descriptor for this option.
1835  */
1836 static void
1837 doOptAdmin_Login(tOptions* pOptions, tOptDesc* pOptDesc)
1838 {
1839     int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_SO_LOGIN);
1840     if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0))
1841         USAGE(P11TOOL_EXIT_USAGE_ERROR);
1842
1843 }
1844
1845 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1846 /**
1847  * Code to handle the load-privkey option.
1848  *
1849  * @param[in] pOptions the p11tool options data structure
1850  * @param[in,out] pOptDesc the option descriptor for this option.
1851  */
1852 static void
1853 doOptLoad_Privkey(tOptions* pOptions, tOptDesc* pOptDesc)
1854 {
1855     static teOptFileType const  type =
1856         FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1857     static tuFileMode           mode;
1858 #ifndef O_CLOEXEC
1859 #  define O_CLOEXEC 0
1860 #endif
1861     mode.file_flags = O_CLOEXEC;
1862
1863     /*
1864      * This function handles special invalid values for "pOptions"
1865      */
1866     optionFileCheck(pOptions, pOptDesc, type, mode);
1867 }
1868
1869 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1870 /**
1871  * Code to handle the load-pubkey option.
1872  *
1873  * @param[in] pOptions the p11tool options data structure
1874  * @param[in,out] pOptDesc the option descriptor for this option.
1875  */
1876 static void
1877 doOptLoad_Pubkey(tOptions* pOptions, tOptDesc* pOptDesc)
1878 {
1879     static teOptFileType const  type =
1880         FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1881     static tuFileMode           mode;
1882 #ifndef O_CLOEXEC
1883 #  define O_CLOEXEC 0
1884 #endif
1885     mode.file_flags = O_CLOEXEC;
1886
1887     /*
1888      * This function handles special invalid values for "pOptions"
1889      */
1890     optionFileCheck(pOptions, pOptDesc, type, mode);
1891 }
1892
1893 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1894 /**
1895  * Code to handle the load-certificate option.
1896  *
1897  * @param[in] pOptions the p11tool options data structure
1898  * @param[in,out] pOptDesc the option descriptor for this option.
1899  */
1900 static void
1901 doOptLoad_Certificate(tOptions* pOptions, tOptDesc* pOptDesc)
1902 {
1903     static teOptFileType const  type =
1904         FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1905     static tuFileMode           mode;
1906 #ifndef O_CLOEXEC
1907 #  define O_CLOEXEC 0
1908 #endif
1909     mode.file_flags = O_CLOEXEC;
1910
1911     /*
1912      * This function handles special invalid values for "pOptions"
1913      */
1914     optionFileCheck(pOptions, pOptDesc, type, mode);
1915 }
1916
1917 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1918 /**
1919  * Code to handle the inraw option.
1920  *
1921  * @param[in] pOptions the p11tool options data structure
1922  * @param[in,out] pOptDesc the option descriptor for this option.
1923  */
1924 static void
1925 doOptInraw(tOptions* pOptions, tOptDesc* pOptDesc)
1926 {
1927     int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_INDER);
1928     if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0))
1929         USAGE(P11TOOL_EXIT_USAGE_ERROR);
1930
1931 }
1932
1933 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1934 /**
1935  * Code to handle the outraw option.
1936  *
1937  * @param[in] pOptions the p11tool options data structure
1938  * @param[in,out] pOptDesc the option descriptor for this option.
1939  */
1940 static void
1941 doOptOutraw(tOptions* pOptions, tOptDesc* pOptDesc)
1942 {
1943     int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_OUTDER);
1944     if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0))
1945         USAGE(P11TOOL_EXIT_USAGE_ERROR);
1946
1947 }
1948
1949 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1950 /**
1951  * Code to handle the provider option.
1952  * This will override the default options in /etc/gnutls/pkcs11.conf
1953  * @param[in] pOptions the p11tool options data structure
1954  * @param[in,out] pOptDesc the option descriptor for this option.
1955  */
1956 static void
1957 doOptProvider(tOptions* pOptions, tOptDesc* pOptDesc)
1958 {
1959     static teOptFileType const  type =
1960         FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1961     static tuFileMode           mode;
1962 #ifndef O_CLOEXEC
1963 #  define O_CLOEXEC 0
1964 #endif
1965     mode.file_flags = O_CLOEXEC;
1966
1967     /*
1968      * This function handles special invalid values for "pOptions"
1969      */
1970     optionFileCheck(pOptions, pOptDesc, type, mode);
1971 }
1972 /* extracted from optmain.tlib near line 1250 */
1973
1974 /**
1975  * The directory containing the data associated with p11tool.
1976  */
1977 #ifndef  PKGDATADIR
1978 # define PKGDATADIR ""
1979 #endif
1980
1981 /**
1982  * Information about the person or institution that packaged p11tool
1983  * for the current distribution.
1984  */
1985 #ifndef  WITH_PACKAGER
1986 # define p11tool_packager_info NULL
1987 #else
1988 /** Packager information for p11tool. */
1989 static char const p11tool_packager_info[] =
1990     "Packaged by " WITH_PACKAGER
1991
1992 # ifdef WITH_PACKAGER_VERSION
1993         " ("WITH_PACKAGER_VERSION")"
1994 # endif
1995
1996 # ifdef WITH_PACKAGER_BUG_REPORTS
1997     "\nReport p11tool bugs to " WITH_PACKAGER_BUG_REPORTS
1998 # endif
1999     "\n";
2000 #endif
2001 #ifndef __doxygen__
2002
2003 #endif /* __doxygen__ */
2004 /**
2005  * The option definitions for p11tool.  The one structure that
2006  * binds them all.
2007  */
2008 tOptions p11toolOptions = {
2009     OPTIONS_STRUCT_VERSION,
2010     0, NULL,                    /* original argc + argv    */
2011     ( OPTPROC_BASE
2012     + OPTPROC_ERRSTOP
2013     + OPTPROC_SHORTOPT
2014     + OPTPROC_LONGOPT
2015     + OPTPROC_NO_REQ_OPT
2016     + OPTPROC_NEGATIONS
2017     + OPTPROC_REORDER
2018     + OPTPROC_GNUUSAGE
2019     + OPTPROC_MISUSE ),
2020     0, NULL,                    /* current option index, current option */
2021     NULL,         NULL,         zPROGNAME,
2022     zRcName,      zCopyright,   zLicenseDescrip,
2023     zFullVersion, apzHomeList,  zUsageTitle,
2024     zExplain,     zDetail,      optDesc,
2025     zBugsAddr,                  /* address to send bugs to */
2026     NULL, NULL,                 /* extensions/saved state  */
2027     optionUsage, /* usage procedure */
2028     translate_option_strings,   /* translation procedure */
2029     /*
2030      *  Indexes to special options
2031      */
2032     { INDEX_OPT_MORE_HELP, /* more-help option index */
2033       NO_EQUIVALENT, /* save option index */
2034       NO_EQUIVALENT, /* '-#' option index */
2035       NO_EQUIVALENT /* index of default opt */
2036     },
2037     56 /* full option count */, 53 /* user option count */,
2038     p11tool_full_usage, p11tool_short_usage,
2039     NULL, NULL,
2040     PKGDATADIR, p11tool_packager_info
2041 };
2042
2043 #if ENABLE_NLS
2044 /**
2045  * This code is designed to translate translatable option text for the
2046  * p11tool program.  These translations happen upon entry
2047  * to optionProcess().
2048  */
2049 #include <stdio.h>
2050 #include <stdlib.h>
2051 #include <string.h>
2052 #include <unistd.h>
2053 #ifdef HAVE_DCGETTEXT
2054 # include <gettext.h>
2055 #endif
2056 #include <autoopts/usage-txt.h>
2057
2058 static char * AO_gettext(char const * pz);
2059 static void   coerce_it(void ** s);
2060
2061 /**
2062  * AutoGen specific wrapper function for gettext.  It relies on the macro _()
2063  * to convert from English to the target language, then strdup-duplicates the
2064  * result string.  It tries the "libopts" domain first, then whatever has been
2065  * set via the \a textdomain(3) call.
2066  *
2067  * @param[in] pz the input text used as a lookup key.
2068  * @returns the translated text (if there is one),
2069  *   or the original text (if not).
2070  */
2071 static char *
2072 AO_gettext(char const * pz)
2073 {
2074     char * res;
2075     if (pz == NULL)
2076         return NULL;
2077 #ifdef HAVE_DCGETTEXT
2078     /*
2079      * While processing the option_xlateable_txt data, try to use the
2080      * "libopts" domain.  Once we switch to the option descriptor data,
2081      * do *not* use that domain.
2082      */
2083     if (option_xlateable_txt.field_ct != 0) {
2084         res = dgettext("libopts", pz);
2085         if (res == pz)
2086             res = (char *)VOIDP(_(pz));
2087     } else
2088         res = (char *)VOIDP(_(pz));
2089 #else
2090     res = (char *)VOIDP(_(pz));
2091 #endif
2092     if (res == pz)
2093         return res;
2094     res = strdup(res);
2095     if (res == NULL) {
2096         fputs(_("No memory for duping translated strings\n"), stderr);
2097         exit(P11TOOL_EXIT_FAILURE);
2098     }
2099     return res;
2100 }
2101
2102 /**
2103  * All the pointers we use are marked "* const", but they are stored in
2104  * writable memory.  Coerce the mutability and set the pointer.
2105  */
2106 static void coerce_it(void ** s) { *s = AO_gettext(*s);
2107 }
2108
2109 /**
2110  * Translate all the translatable strings in the p11toolOptions
2111  * structure defined above.  This is done only once.
2112  */
2113 static void
2114 translate_option_strings(void)
2115 {
2116     tOptions * const opts = &p11toolOptions;
2117
2118     /*
2119      *  Guard against re-translation.  It won't work.  The strings will have
2120      *  been changed by the first pass through this code.  One shot only.
2121      */
2122     if (option_xlateable_txt.field_ct != 0) {
2123         /*
2124          *  Do the translations.  The first pointer follows the field count
2125          *  field.  The field count field is the size of a pointer.
2126          */
2127         char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
2128         int     ix  = option_xlateable_txt.field_ct;
2129
2130         do {
2131             ppz++; /* skip over field_ct */
2132             *ppz = AO_gettext(*ppz);
2133         } while (--ix > 0);
2134         /* prevent re-translation and disable "libopts" domain lookup */
2135         option_xlateable_txt.field_ct = 0;
2136
2137         coerce_it(VOIDP(&(opts->pzCopyright)));
2138         coerce_it(VOIDP(&(opts->pzCopyNotice)));
2139         coerce_it(VOIDP(&(opts->pzFullVersion)));
2140         coerce_it(VOIDP(&(opts->pzUsageTitle)));
2141         coerce_it(VOIDP(&(opts->pzExplain)));
2142         coerce_it(VOIDP(&(opts->pzDetail)));
2143         {
2144             tOptDesc * od = opts->pOptDesc;
2145             for (ix = opts->optCt; ix > 0; ix--, od++)
2146                 coerce_it(VOIDP(&(od->pzText)));
2147         }
2148     }
2149 }
2150 #endif /* ENABLE_NLS */
2151
2152 #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
2153 /** I18N function strictly for xgettext.  Do not compile. */
2154 static void bogus_function(void) {
2155   /* TRANSLATORS:
2156
2157      The following dummy function was crated solely so that xgettext can
2158      extract the correct strings.  These strings are actually referenced
2159      by a field name in the p11toolOptions structure noted in the
2160      comments below.  The literal text is defined in p11tool_opt_strs.
2161    
2162      NOTE: the strings below are segmented with respect to the source string
2163      p11tool_opt_strs.  The strings above are handed off for translation
2164      at run time a paragraph at a time.  Consequently, they are presented here
2165      for translation a paragraph at a time.
2166    
2167      ALSO: often the description for an option will reference another option
2168      by name.  These are set off with apostrophe quotes (I hope).  Do not
2169      translate option names.
2170    */
2171   /* referenced via p11toolOptions.pzCopyright */
2172   puts(_("p11tool 3.3.27\n\
2173 Copyright (C) 2000-2017 Free Software Foundation, and others, all rights reserved.\n\
2174 This is free software. It is licensed for use, modification and\n\
2175 redistribution under the terms of the GNU General Public License,\n\
2176 version 3 or later <http://gnu.org/licenses/gpl.html>\n"));
2177
2178   /* referenced via p11toolOptions.pzCopyNotice */
2179   puts(_("p11tool is free software: you can redistribute it and/or modify it under\n\
2180 the terms of the GNU General Public License as published by the Free\n\
2181 Software Foundation, either version 3 of the License, or (at your option)\n\
2182 any later version.\n\n"));
2183   puts(_("p11tool is distributed in the hope that it will be useful, but WITHOUT ANY\n\
2184 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n\
2185 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\n\
2186 details.\n\n"));
2187   puts(_("You should have received a copy of the GNU General Public License along\n\
2188 with this program.  If not, see <http://www.gnu.org/licenses/>.\n"));
2189
2190   /* referenced via p11toolOptions.pOptDesc->pzText */
2191   puts(_("Enable debugging"));
2192
2193   /* referenced via p11toolOptions.pOptDesc->pzText */
2194   puts(_("Output file"));
2195
2196   /* referenced via p11toolOptions.pOptDesc->pzText */
2197   puts(_("List all available tokens"));
2198
2199   /* referenced via p11toolOptions.pOptDesc->pzText */
2200   puts(_("Export the object specified by the URL"));
2201
2202   /* referenced via p11toolOptions.pOptDesc->pzText */
2203   puts(_("Export the certificate specified by the URL and its chain of trust"));
2204
2205   /* referenced via p11toolOptions.pOptDesc->pzText */
2206   puts(_("List all available mechanisms in a token"));
2207
2208   /* referenced via p11toolOptions.pOptDesc->pzText */
2209   puts(_("List information on an available object in a token"));
2210
2211   /* referenced via p11toolOptions.pOptDesc->pzText */
2212   puts(_("List all available objects in a token"));
2213
2214   /* referenced via p11toolOptions.pOptDesc->pzText */
2215   puts(_("List all available certificates in a token"));
2216
2217   /* referenced via p11toolOptions.pOptDesc->pzText */
2218   puts(_("List all certificates that have an associated private key"));
2219
2220   /* referenced via p11toolOptions.pOptDesc->pzText */
2221   puts(_("List all available private keys in a token"));
2222
2223   /* referenced via p11toolOptions.pOptDesc->pzText */
2224   puts(_("an alias for the 'list-all-privkeys' option"));
2225
2226   /* referenced via p11toolOptions.pOptDesc->pzText */
2227   puts(_("an alias for the 'list-all-privkeys' option"));
2228
2229   /* referenced via p11toolOptions.pOptDesc->pzText */
2230   puts(_("List all available certificates marked as trusted"));
2231
2232   /* referenced via p11toolOptions.pOptDesc->pzText */
2233   puts(_("Writes the loaded objects to a PKCS #11 token"));
2234
2235   /* referenced via p11toolOptions.pOptDesc->pzText */
2236   puts(_("Deletes the objects matching the PKCS #11 URL"));
2237
2238   /* referenced via p11toolOptions.pOptDesc->pzText */
2239   puts(_("Generate random data"));
2240
2241   /* referenced via p11toolOptions.pOptDesc->pzText */
2242   puts(_("Generate an RSA private-public key pair"));
2243
2244   /* referenced via p11toolOptions.pOptDesc->pzText */
2245   puts(_("Generate a DSA private-public key pair"));
2246
2247   /* referenced via p11toolOptions.pOptDesc->pzText */
2248   puts(_("Generate an ECDSA private-public key pair"));
2249
2250   /* referenced via p11toolOptions.pOptDesc->pzText */
2251   puts(_("Export the public key for a private key"));
2252
2253   /* referenced via p11toolOptions.pOptDesc->pzText */
2254   puts(_("Set the CKA_ID (in hex) for the specified by the URL object"));
2255
2256   /* referenced via p11toolOptions.pOptDesc->pzText */
2257   puts(_("Set the CKA_LABEL for the specified by the URL object"));
2258
2259   /* referenced via p11toolOptions.pOptDesc->pzText */
2260   puts(_("Sets a label for the write operation"));
2261
2262   /* referenced via p11toolOptions.pOptDesc->pzText */
2263   puts(_("Sets an ID for the write operation"));
2264
2265   /* referenced via p11toolOptions.pOptDesc->pzText */
2266   puts(_("Marks the generated key to be a wrapping key"));
2267
2268   /* referenced via p11toolOptions.pOptDesc->pzText */
2269   puts(_("Marks the object to be written as trusted"));
2270
2271   /* referenced via p11toolOptions.pOptDesc->pzText */
2272   puts(_("Marks the object to be written as a CA"));
2273
2274   /* referenced via p11toolOptions.pOptDesc->pzText */
2275   puts(_("Marks the object to be written as private"));
2276
2277   /* referenced via p11toolOptions.pOptDesc->pzText */
2278   puts(_("an alias for the 'mark-trusted' option"));
2279
2280   /* referenced via p11toolOptions.pOptDesc->pzText */
2281   puts(_("an alias for the 'mark-ca' option"));
2282
2283   /* referenced via p11toolOptions.pOptDesc->pzText */
2284   puts(_("an alias for the 'mark-private' option"));
2285
2286   /* referenced via p11toolOptions.pOptDesc->pzText */
2287   puts(_("Force (user) login to token"));
2288
2289   /* referenced via p11toolOptions.pOptDesc->pzText */
2290   puts(_("Force security officer login to token"));
2291
2292   /* referenced via p11toolOptions.pOptDesc->pzText */
2293   puts(_("an alias for the 'so-login' option"));
2294
2295   /* referenced via p11toolOptions.pOptDesc->pzText */
2296   puts(_("Print detailed URLs"));
2297
2298   /* referenced via p11toolOptions.pOptDesc->pzText */
2299   puts(_("Provide a hex encoded secret key"));
2300
2301   /* referenced via p11toolOptions.pOptDesc->pzText */
2302   puts(_("Private key file to use"));
2303
2304   /* referenced via p11toolOptions.pOptDesc->pzText */
2305   puts(_("Public key file to use"));
2306
2307   /* referenced via p11toolOptions.pOptDesc->pzText */
2308   puts(_("Certificate file to use"));
2309
2310   /* referenced via p11toolOptions.pOptDesc->pzText */
2311   puts(_("Use PKCS #8 format for private keys"));
2312
2313   /* referenced via p11toolOptions.pOptDesc->pzText */
2314   puts(_("Specify the number of bits for key generate"));
2315
2316   /* referenced via p11toolOptions.pOptDesc->pzText */
2317   puts(_("Specify the curve used for EC key generation"));
2318
2319   /* referenced via p11toolOptions.pOptDesc->pzText */
2320   puts(_("Specify the security level"));
2321
2322   /* referenced via p11toolOptions.pOptDesc->pzText */
2323   puts(_("Use DER/RAW format for input"));
2324
2325   /* referenced via p11toolOptions.pOptDesc->pzText */
2326   puts(_("an alias for the 'inder' option"));
2327
2328   /* referenced via p11toolOptions.pOptDesc->pzText */
2329   puts(_("Use DER format for output certificates, private keys, and DH parameters"));
2330
2331   /* referenced via p11toolOptions.pOptDesc->pzText */
2332   puts(_("an alias for the 'outder' option"));
2333
2334   /* referenced via p11toolOptions.pOptDesc->pzText */
2335   puts(_("Initializes a PKCS #11 token"));
2336
2337   /* referenced via p11toolOptions.pOptDesc->pzText */
2338   puts(_("Specify the PIN to use on token initialization"));
2339
2340   /* referenced via p11toolOptions.pOptDesc->pzText */
2341   puts(_("Specify the Security Officer's PIN to use on token initialization"));
2342
2343   /* referenced via p11toolOptions.pOptDesc->pzText */
2344   puts(_("Specify the PKCS #11 provider library"));
2345
2346   /* referenced via p11toolOptions.pOptDesc->pzText */
2347   puts(_("Disable all interaction with the tool.  All parameters need to be\n\
2348 specified on command line."));
2349
2350   /* referenced via p11toolOptions.pOptDesc->pzText */
2351   puts(_("display extended usage information and exit"));
2352
2353   /* referenced via p11toolOptions.pOptDesc->pzText */
2354   puts(_("extended usage information passed thru pager"));
2355
2356   /* referenced via p11toolOptions.pOptDesc->pzText */
2357   puts(_("output version information and exit"));
2358
2359   /* referenced via p11toolOptions.pzUsageTitle */
2360   puts(_("p11tool - GnuTLS PKCS #11 tool\n\
2361 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [url]\n"));
2362
2363   /* referenced via p11toolOptions.pzExplain */
2364   puts(_("\n"));
2365
2366   /* referenced via p11toolOptions.pzDetail */
2367   puts(_("Program that allows operations on PKCS #11 smart cards and security\n\
2368 modules.\n\n"));
2369   puts(_("To use PKCS #11 tokens with GnuTLS the p11-kit configuration files need to\n\
2370 be setup.  That is create a .module file in /etc/pkcs11/modules with the\n\
2371 contents 'module: /path/to/pkcs11.so'.  Alternatively the configuration\n\
2372 file /etc/gnutls/pkcs11.conf has to exist and contain a number of lines of\n\
2373 the form 'load=/usr/lib/opensc-pkcs11.so'.\n\n"));
2374   puts(_("You can provide the PIN to be used for the PKCS #11 operations with the\n\
2375 environment variables GNUTLS_PIN and GNUTLS_SO_PIN.\n"));
2376
2377   /* referenced via p11toolOptions.pzFullVersion */
2378   puts(_("p11tool 3.3.27"));
2379
2380   /* referenced via p11toolOptions.pzFullUsage */
2381   puts(_("<<<NOT-FOUND>>>"));
2382
2383   /* referenced via p11toolOptions.pzShortUsage */
2384   puts(_("p11tool [options] [url]\n\
2385 p11tool --help for usage instructions.\n"));
2386   /* LIBOPTS-MESSAGES: */
2387 #line 67 "../autoopts.c"
2388   puts(_("allocation of %d bytes failed\n"));
2389 #line 93 "../autoopts.c"
2390   puts(_("allocation of %d bytes failed\n"));
2391 #line 53 "../init.c"
2392   puts(_("AutoOpts function called without option descriptor\n"));
2393 #line 86 "../init.c"
2394   puts(_("\tThis exceeds the compiled library version:  "));
2395 #line 84 "../init.c"
2396   puts(_("Automated Options Processing Error!\n"
2397        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
2398 #line 80 "../autoopts.c"
2399   puts(_("realloc of %d bytes at 0x%p failed\n"));
2400 #line 88 "../init.c"
2401   puts(_("\tThis is less than the minimum library version:  "));
2402 #line 121 "../version.c"
2403   puts(_("Automated Options version %s\n"
2404        "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
2405 #line 87 "../makeshell.c"
2406   puts(_("(AutoOpts bug):  %s.\n"));
2407 #line 90 "../reset.c"
2408   puts(_("optionResetOpt() called, but reset-option not configured"));
2409 #line 295 "../usage.c"
2410   puts(_("could not locate the 'help' option"));
2411 #line 336 "../autoopts.c"
2412   puts(_("optionProcess() was called with invalid data"));
2413 #line 751 "../usage.c"
2414   puts(_("invalid argument type specified"));
2415 #line 598 "../find.c"
2416   puts(_("defaulted to option with optional arg"));
2417 #line 76 "../alias.c"
2418   puts(_("aliasing option is out of range."));
2419 #line 235 "../enum.c"
2420   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
2421 #line 108 "../find.c"
2422   puts(_("  The following options match:\n"));
2423 #line 293 "../find.c"
2424   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
2425 #line 161 "../check.c"
2426   puts(_("%s: Command line arguments required\n"));
2427 #line 43 "../alias.c"
2428   puts(_("%d %s%s options allowed\n"));
2429 #line 94 "../makeshell.c"
2430   puts(_("%s error %d (%s) calling %s for '%s'\n"));
2431 #line 306 "../makeshell.c"
2432   puts(_("interprocess pipe"));
2433 #line 168 "../version.c"
2434   puts(_("error: version option argument '%c' invalid.  Use:\n"
2435        "\t'v' - version only\n"
2436        "\t'c' - version and copyright\n"
2437        "\t'n' - version and full copyright notice\n"));
2438 #line 58 "../check.c"
2439   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
2440 #line 217 "../find.c"
2441   puts(_("%s: The '%s' option has been disabled."));
2442 #line 430 "../find.c"
2443   puts(_("%s: The '%s' option has been disabled."));
2444 #line 38 "../alias.c"
2445   puts(_("-equivalence"));
2446 #line 469 "../find.c"
2447   puts(_("%s: illegal option -- %c\n"));
2448 #line 110 "../reset.c"
2449   puts(_("%s: illegal option -- %c\n"));
2450 #line 271 "../find.c"
2451   puts(_("%s: illegal option -- %s\n"));
2452 #line 755 "../find.c"
2453   puts(_("%s: illegal option -- %s\n"));
2454 #line 118 "../reset.c"
2455   puts(_("%s: illegal option -- %s\n"));
2456 #line 335 "../find.c"
2457   puts(_("%s: unknown vendor extension option -- %s\n"));
2458 #line 160 "../enum.c"
2459   puts(_("  or an integer from %d through %d\n"));
2460 #line 170 "../enum.c"
2461   puts(_("  or an integer from %d through %d\n"));
2462 #line 750 "../usage.c"
2463   puts(_("%s error:  invalid option descriptor for %s\n"));
2464 #line 1084 "../usage.c"
2465   puts(_("%s error:  invalid option descriptor for %s\n"));
2466 #line 385 "../find.c"
2467   puts(_("%s: invalid option name: %s\n"));
2468 #line 527 "../find.c"
2469   puts(_("%s: The '%s' option requires an argument.\n"));
2470 #line 156 "../autoopts.c"
2471   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
2472        "\t'%s' and '%s'."));
2473 #line 94 "../check.c"
2474   puts(_("%s error:  The %s option is required\n"));
2475 #line 632 "../find.c"
2476   puts(_("%s: The '%s' option cannot have an argument.\n"));
2477 #line 151 "../check.c"
2478   puts(_("%s: Command line arguments are not allowed.\n"));
2479 #line 536 "../save.c"
2480   puts(_("error %d (%s) creating %s\n"));
2481 #line 235 "../enum.c"
2482   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
2483 #line 93 "../reset.c"
2484   puts(_("%s error: The '%s' option requires an argument.\n"));
2485 #line 186 "../save.c"
2486   puts(_("error %d (%s) stat-ing %s\n"));
2487 #line 239 "../save.c"
2488   puts(_("error %d (%s) stat-ing %s\n"));
2489 #line 143 "../restore.c"
2490   puts(_("%s error: no saved option state\n"));
2491 #line 231 "../autoopts.c"
2492   puts(_("'%s' is not a command line option.\n"));
2493 #line 113 "../time.c"
2494   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
2495 #line 131 "../save.c"
2496   puts(_("'%s' not defined\n"));
2497 #line 50 "../time.c"
2498   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
2499 #line 92 "../check.c"
2500   puts(_("%s error:  The %s option must appear %d times.\n"));
2501 #line 165 "../numeric.c"
2502   puts(_("%s error:  '%s' is not a recognizable number.\n"));
2503 #line 201 "../enum.c"
2504   puts(_("%s error:  %s exceeds %s keyword count\n"));
2505 #line 333 "../usage.c"
2506   puts(_("Try '%s %s' for more information.\n"));
2507 #line 45 "../alias.c"
2508   puts(_("one %s%s option allowed\n"));
2509 #line 208 "../makeshell.c"
2510   puts(_("standard output"));
2511 #line 943 "../makeshell.c"
2512   puts(_("standard output"));
2513 #line 277 "../usage.c"
2514   puts(_("standard output"));
2515 #line 418 "../usage.c"
2516   puts(_("standard output"));
2517 #line 628 "../usage.c"
2518   puts(_("standard output"));
2519 #line 175 "../version.c"
2520   puts(_("standard output"));
2521 #line 277 "../usage.c"
2522   puts(_("standard error"));
2523 #line 418 "../usage.c"
2524   puts(_("standard error"));
2525 #line 628 "../usage.c"
2526   puts(_("standard error"));
2527 #line 175 "../version.c"
2528   puts(_("standard error"));
2529 #line 208 "../makeshell.c"
2530   puts(_("write"));
2531 #line 943 "../makeshell.c"
2532   puts(_("write"));
2533 #line 276 "../usage.c"
2534   puts(_("write"));
2535 #line 417 "../usage.c"
2536   puts(_("write"));
2537 #line 627 "../usage.c"
2538   puts(_("write"));
2539 #line 174 "../version.c"
2540   puts(_("write"));
2541 #line 60 "../numeric.c"
2542   puts(_("%s error:  %s option value %ld is out of range.\n"));
2543 #line 44 "../check.c"
2544   puts(_("%s error:  %s option requires the %s option\n"));
2545 #line 130 "../save.c"
2546   puts(_("%s warning:  cannot save options - %s not regular file\n"));
2547 #line 185 "../save.c"
2548   puts(_("%s warning:  cannot save options - %s not regular file\n"));
2549 #line 238 "../save.c"
2550   puts(_("%s warning:  cannot save options - %s not regular file\n"));
2551 #line 257 "../save.c"
2552   puts(_("%s warning:  cannot save options - %s not regular file\n"));
2553 #line 535 "../save.c"
2554   puts(_("%s warning:  cannot save options - %s not regular file\n"));
2555   /* END-LIBOPTS-MESSAGES */
2556
2557   /* USAGE-TEXT: */
2558 #line 876 "../usage.c"
2559   puts(_("\t\t\t\t- an alternate for '%s'\n"));
2560 #line 1151 "../usage.c"
2561   puts(_("Version, usage and configuration options:"));
2562 #line 927 "../usage.c"
2563   puts(_("\t\t\t\t- default option for unnamed options\n"));
2564 #line 840 "../usage.c"
2565   puts(_("\t\t\t\t- disabled as '--%s'\n"));
2566 #line 1120 "../usage.c"
2567   puts(_(" --- %-14s %s\n"));
2568 #line 1118 "../usage.c"
2569   puts(_("This option has been disabled"));
2570 #line 867 "../usage.c"
2571   puts(_("\t\t\t\t- enabled by default\n"));
2572 #line 40 "../alias.c"
2573   puts(_("%s error:  only "));
2574 #line 1197 "../usage.c"
2575   puts(_(" - examining environment variables named %s_*\n"));
2576 #line 168 "../file.c"
2577   puts(_("\t\t\t\t- file must not pre-exist\n"));
2578 #line 172 "../file.c"
2579   puts(_("\t\t\t\t- file must pre-exist\n"));
2580 #line 383 "../usage.c"
2581   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
2582        "hyphen and the flag character.\n"));
2583 #line 921 "../makeshell.c"
2584   puts(_("\n"
2585        "= = = = = = = =\n\n"
2586        "This incarnation of genshell will produce\n"
2587        "a shell script to parse the options for %s:\n\n"));
2588 #line 167 "../enum.c"
2589   puts(_("  or an integer mask with any of the lower %d bits set\n"));
2590 #line 900 "../usage.c"
2591   puts(_("\t\t\t\t- is a set membership option\n"));
2592 #line 921 "../usage.c"
2593   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
2594 #line 385 "../usage.c"
2595   puts(_("Options are specified by single or double hyphens and their name.\n"));
2596 #line 907 "../usage.c"
2597   puts(_("\t\t\t\t- may appear multiple times\n"));
2598 #line 894 "../usage.c"
2599   puts(_("\t\t\t\t- may not be preset\n"));
2600 #line 1312 "../usage.c"
2601   puts(_("   Arg Option-Name    Description\n"));
2602 #line 1248 "../usage.c"
2603   puts(_("  Flg Arg Option-Name    Description\n"));
2604 #line 1306 "../usage.c"
2605   puts(_("  Flg Arg Option-Name    Description\n"));
2606 #line 1307 "../usage.c"
2607   puts(_(" %3s %s"));
2608 #line 1313 "../usage.c"
2609   puts(_(" %3s %s"));
2610 #line 390 "../usage.c"
2611   puts(_("The '-#<number>' option may omit the hash char\n"));
2612 #line 386 "../usage.c"
2613   puts(_("All arguments are named options.\n"));
2614 #line 974 "../usage.c"
2615   puts(_(" - reading file %s"));
2616 #line 412 "../usage.c"
2617   puts(_("\n"
2618        "Please send bug reports to:  <%s>\n"));
2619 #line 100 "../version.c"
2620   puts(_("\n"
2621        "Please send bug reports to:  <%s>\n"));
2622 #line 129 "../version.c"
2623   puts(_("\n"
2624        "Please send bug reports to:  <%s>\n"));
2625 #line 906 "../usage.c"
2626   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
2627 #line 947 "../usage.c"
2628   puts(_("\n"
2629        "The following option preset mechanisms are supported:\n"));
2630 #line 1195 "../usage.c"
2631   puts(_("\n"
2632        "The following option preset mechanisms are supported:\n"));
2633 #line 685 "../usage.c"
2634   puts(_("prohibits these options:\n"));
2635 #line 680 "../usage.c"
2636   puts(_("prohibits the option '%s'\n"));
2637 #line 81 "../numeric.c"
2638   puts(_("%s%ld to %ld"));
2639 #line 79 "../numeric.c"
2640   puts(_("%sgreater than or equal to %ld"));
2641 #line 75 "../numeric.c"
2642   puts(_("%s%ld exactly"));
2643 #line 68 "../numeric.c"
2644   puts(_("%sit must lie in one of the ranges:\n"));
2645 #line 68 "../numeric.c"
2646   puts(_("%sit must be in the range:\n"));
2647 #line 88 "../numeric.c"
2648   puts(_(", or\n"));
2649 #line 66 "../numeric.c"
2650   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
2651 #line 77 "../numeric.c"
2652   puts(_("%sless than or equal to %ld"));
2653 #line 393 "../usage.c"
2654   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
2655 #line 655 "../usage.c"
2656   puts(_("requires the option '%s'\n"));
2657 #line 658 "../usage.c"
2658   puts(_("requires these options:\n"));
2659 #line 1324 "../usage.c"
2660   puts(_("   Arg Option-Name   Req?  Description\n"));
2661 #line 1318 "../usage.c"
2662   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
2663 #line 168 "../enum.c"
2664   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
2665        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
2666        "will set them all.  Multiple entries may be passed as an option\n"
2667        "argument list.\n"));
2668 #line 913 "../usage.c"
2669   puts(_("\t\t\t\t- may appear up to %d times\n"));
2670 #line 77 "../enum.c"
2671   puts(_("The valid \"%s\" option keywords are:\n"));
2672 #line 1155 "../usage.c"
2673   puts(_("The next option supports vendor supported extra options:"));
2674 #line 776 "../usage.c"
2675   puts(_("These additional options are:"));
2676   /* END-USAGE-TEXT */
2677 }
2678 #endif /* uncompilable code */
2679 #ifdef  __cplusplus
2680 }
2681 #endif
2682 /* p11tool-args.c ends here */