_gnutls_strdatum_to_buf() will account for NULL input.
[gnutls.git] / src / danetool-args.h
bloba233656289c89115da2facdf756e3d92acf3998d
1 /* -*- buffer-read-only: t -*- vi: set ro:
2 *
3 * DO NOT EDIT THIS FILE (danetool-args.h)
4 *
5 * It has been AutoGen-ed November 21, 2012 at 10:22:22 PM by AutoGen 5.16
6 * From the definitions danetool-args.def
7 * and the template file options
9 * Generated from AutoOpts 36:4:11 templates.
11 * AutoOpts is a copyrighted work. This header file is not encumbered
12 * by AutoOpts licensing, but is provided under the licensing terms chosen
13 * by the danetool author or copyright holder. AutoOpts is
14 * licensed under the terms of the LGPL. The redistributable library
15 * (``libopts'') is licensed under the terms of either the LGPL or, at the
16 * users discretion, the BSD license. See the AutoOpts and/or libopts sources
17 * for details.
19 * The danetool program is copyrighted and licensed
20 * under the following terms:
22 * Copyright (C) 2000-2012 Free Software Foundation, all rights reserved.
23 * This is free software. It is licensed for use, modification and
24 * redistribution under the terms of the
25 * GNU General Public License, version 3 or later
26 * <http://gnu.org/licenses/gpl.html>
28 * danetool is free software: you can redistribute it and/or modify it
29 * under the terms of the GNU General Public License as published by the
30 * Free Software Foundation, either version 3 of the License, or
31 * (at your option) any later version.
33 * danetool is distributed in the hope that it will be useful, but
34 * WITHOUT ANY WARRANTY; without even the implied warranty of
35 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36 * See the GNU General Public License for more details.
38 * You should have received a copy of the GNU General Public License along
39 * with this program. If not, see <http://www.gnu.org/licenses/>.
42 * This file contains the programmatic interface to the Automated
43 * Options generated for the danetool program.
44 * These macros are documented in the AutoGen info file in the
45 * "AutoOpts" chapter. Please refer to that doc for usage help.
47 #ifndef AUTOOPTS_DANETOOL_ARGS_H_GUARD
48 #define AUTOOPTS_DANETOOL_ARGS_H_GUARD 1
49 #include "config.h"
50 #include <autoopts/options.h>
53 * Ensure that the library used for compiling this generated header is at
54 * least as new as the version current when the header template was released
55 * (not counting patch version increments). Also ensure that the oldest
56 * tolerable version is at least as old as what was current when the header
57 * template was released.
59 #define AO_TEMPLATE_VERSION 147460
60 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
61 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
62 # error option template version mismatches autoopts/options.h header
63 Choke Me.
64 #endif
67 * Enumeration of each option:
69 typedef enum {
70 INDEX_OPT_DEBUG = 0,
71 INDEX_OPT_VERBOSE = 1,
72 INDEX_OPT_INFILE = 2,
73 INDEX_OPT_OUTFILE = 3,
74 INDEX_OPT_LOAD_PUBKEY = 4,
75 INDEX_OPT_LOAD_CERTIFICATE = 5,
76 INDEX_OPT_HASH = 6,
77 INDEX_OPT_CHECK = 7,
78 INDEX_OPT_LOCAL_DNS = 8,
79 INDEX_OPT_INDER = 9,
80 INDEX_OPT_INRAW = 10,
81 INDEX_OPT_TLSA_RR = 11,
82 INDEX_OPT_HOST = 12,
83 INDEX_OPT_PROTO = 13,
84 INDEX_OPT_PORT = 14,
85 INDEX_OPT_CA = 15,
86 INDEX_OPT_X509 = 16,
87 INDEX_OPT_LOCAL = 17,
88 INDEX_OPT_VERSION = 18,
89 INDEX_OPT_HELP = 19,
90 INDEX_OPT_MORE_HELP = 20
91 } teOptIndex;
93 #define OPTION_CT 21
94 #define DANETOOL_VERSION "@VERSION@"
95 #define DANETOOL_FULL_VERSION "danetool @VERSION@"
98 * Interface defines for all options. Replace "n" with the UPPER_CASED
99 * option name (as in the teOptIndex enumeration above).
100 * e.g. HAVE_OPT(DEBUG)
102 #define DESC(n) (danetoolOptions.pOptDesc[INDEX_OPT_## n])
103 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
104 #define OPT_ARG(n) (DESC(n).optArg.argString)
105 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
106 #define COUNT_OPT(n) (DESC(n).optOccCt)
107 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
108 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
109 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
110 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
111 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
112 #define CLEAR_OPT(n) STMTS( \
113 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
114 if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
115 DESC(n).fOptState |= OPTST_DISABLED; \
116 DESC(n).optCookie = NULL )
118 /* * * * * *
120 * Enumeration of danetool exit codes
122 typedef enum {
123 DANETOOL_EXIT_SUCCESS = 0,
124 DANETOOL_EXIT_FAILURE = 1,
125 DANETOOL_EXIT_LIBOPTS_FAILURE = 70
126 } danetool_exit_code_t;
127 /* * * * * *
129 * Interface defines for specific options.
131 #define VALUE_OPT_DEBUG 'd'
133 #define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt)
134 #define VALUE_OPT_VERBOSE 'V'
135 #define VALUE_OPT_INFILE 2
136 #define VALUE_OPT_OUTFILE 3
137 #define VALUE_OPT_LOAD_PUBKEY 4
138 #define VALUE_OPT_LOAD_CERTIFICATE 5
139 #define VALUE_OPT_HASH 6
140 #define VALUE_OPT_CHECK 7
141 #define VALUE_OPT_LOCAL_DNS 8
142 #define VALUE_OPT_INDER 9
143 #define VALUE_OPT_INRAW 10
144 #define VALUE_OPT_TLSA_RR 11
145 #define VALUE_OPT_HOST 12
146 #define VALUE_OPT_PROTO 13
147 #define VALUE_OPT_PORT 14
149 #define OPT_VALUE_PORT (DESC(PORT).optArg.argInt)
150 #define VALUE_OPT_CA 15
151 #define VALUE_OPT_X509 16
152 #define VALUE_OPT_LOCAL 17
153 #define VALUE_OPT_HELP 'h'
154 #define VALUE_OPT_MORE_HELP '!'
155 #define VALUE_OPT_VERSION 'v'
157 * Interface defines not associated with particular options
159 #define ERRSKIP_OPTERR STMTS(danetoolOptions.fOptSet &= ~OPTPROC_ERRSTOP)
160 #define ERRSTOP_OPTERR STMTS(danetoolOptions.fOptSet |= OPTPROC_ERRSTOP)
161 #define RESTART_OPT(n) STMTS( \
162 danetoolOptions.curOptIdx = (n); \
163 danetoolOptions.pzCurOpt = NULL)
164 #define START_OPT RESTART_OPT(1)
165 #define USAGE(c) (*danetoolOptions.pUsageProc)(&danetoolOptions, c)
166 /* extracted from opthead.tlib near line 484 */
168 #ifdef __cplusplus
169 extern "C" {
170 #endif
172 * global exported definitions
174 #include <gettext.h>
177 /* * * * * *
179 * Declare the danetool option descriptor.
181 extern tOptions danetoolOptions;
183 #if defined(ENABLE_NLS)
184 # ifndef _
185 # include <stdio.h>
186 static inline char* aoGetsText(char const* pz) {
187 if (pz == NULL) return NULL;
188 return (char*)gettext(pz);
190 # define _(s) aoGetsText(s)
191 # endif /* _() */
193 # define OPT_NO_XLAT_CFG_NAMES STMTS(danetoolOptions.fOptSet |= \
194 OPTPROC_NXLAT_OPT_CFG;)
195 # define OPT_NO_XLAT_OPT_NAMES STMTS(danetoolOptions.fOptSet |= \
196 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
198 # define OPT_XLAT_CFG_NAMES STMTS(danetoolOptions.fOptSet &= \
199 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
200 # define OPT_XLAT_OPT_NAMES STMTS(danetoolOptions.fOptSet &= \
201 ~OPTPROC_NXLAT_OPT;)
203 #else /* ENABLE_NLS */
204 # define OPT_NO_XLAT_CFG_NAMES
205 # define OPT_NO_XLAT_OPT_NAMES
207 # define OPT_XLAT_CFG_NAMES
208 # define OPT_XLAT_OPT_NAMES
210 # ifndef _
211 # define _(_s) _s
212 # endif
213 #endif /* ENABLE_NLS */
215 #ifdef __cplusplus
217 #endif
218 #endif /* AUTOOPTS_DANETOOL_ARGS_H_GUARD */
219 /* danetool-args.h ends here */