Merge branch 'upstream' into tizen
[platform/upstream/gnutls.git] / src / danetool-args.h.bak
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
6  *  From the definitions    danetool-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 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.
18  *
19  * The danetool program is copyrighted and licensed
20  * under the following terms:
21  *
22  *  Copyright (C) 2000-2016 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  *  danetool 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  *  danetool 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  *  This file contains the programmatic interface to the Automated
42  *  Options generated for the danetool program.
43  *  These macros are documented in the AutoGen info file in the
44  *  "AutoOpts" chapter.  Please refer to that doc for usage help.
45  */
46 #ifndef AUTOOPTS_DANETOOL_ARGS_H_GUARD
47 #define AUTOOPTS_DANETOOL_ARGS_H_GUARD 1
48 #include "config.h"
49 #include <autoopts/options.h>
50
51 /**
52  *  Ensure that the library used for compiling this generated header is at
53  *  least as new as the version current when the header template was released
54  *  (not counting patch version increments).  Also ensure that the oldest
55  *  tolerable version is at least as old as what was current when the header
56  *  template was released.
57  */
58 #define AO_TEMPLATE_VERSION 167937
59 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
60  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
61 # error option template version mismatches autoopts/options.h header
62   Choke Me.
63 #endif
64
65 /**
66  *  Enumeration of each option type for danetool
67  */
68 typedef enum {
69     INDEX_OPT_DEBUG             =  0,
70     INDEX_OPT_VERBOSE           =  1,
71     INDEX_OPT_INFILE            =  2,
72     INDEX_OPT_OUTFILE           =  3,
73     INDEX_OPT_LOAD_PUBKEY       =  4,
74     INDEX_OPT_LOAD_CERTIFICATE  =  5,
75     INDEX_OPT_DLV               =  6,
76     INDEX_OPT_HASH              =  7,
77     INDEX_OPT_CHECK             =  8,
78     INDEX_OPT_CHECK_EE          =  9,
79     INDEX_OPT_CHECK_CA          = 10,
80     INDEX_OPT_TLSA_RR           = 11,
81     INDEX_OPT_HOST              = 12,
82     INDEX_OPT_PROTO             = 13,
83     INDEX_OPT_PORT              = 14,
84     INDEX_OPT_APP_PROTO         = 15,
85     INDEX_OPT_STARTTLS_PROTO    = 16,
86     INDEX_OPT_CA                = 17,
87     INDEX_OPT_X509              = 18,
88     INDEX_OPT_LOCAL             = 19,
89     INDEX_OPT_DOMAIN            = 20,
90     INDEX_OPT_LOCAL_DNS         = 21,
91     INDEX_OPT_INSECURE          = 22,
92     INDEX_OPT_INDER             = 23,
93     INDEX_OPT_INRAW             = 24,
94     INDEX_OPT_PRINT_RAW         = 25,
95     INDEX_OPT_QUIET             = 26,
96     INDEX_OPT_VERSION           = 27,
97     INDEX_OPT_HELP              = 28,
98     INDEX_OPT_MORE_HELP         = 29
99 } teOptIndex;
100 /** count of all options for danetool */
101 #define OPTION_CT    30
102 /** danetool version */
103 #define DANETOOL_VERSION       "3.4.11"
104 /** Full danetool version text */
105 #define DANETOOL_FULL_VERSION  "danetool 3.4.11"
106
107 /**
108  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
109  *  option name (as in the teOptIndex enumeration above).
110  *  e.g. HAVE_OPT(DEBUG)
111  */
112 #define         DESC(n) (danetoolOptions.pOptDesc[INDEX_OPT_## n])
113 /** 'true' if an option has been specified in any way */
114 #define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
115 /** The string argument to an option. The argument type must be \"string\". */
116 #define      OPT_ARG(n) (DESC(n).optArg.argString)
117 /** Mask the option state revealing how an option was specified.
118  *  It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
119  * \a OPTST_DEFINED, \a OPTST_RESET or zero.
120  */
121 #define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
122 /** Count of option's occurrances *on the command line*. */
123 #define    COUNT_OPT(n) (DESC(n).optOccCt)
124 /** mask of \a OPTST_SET and \a OPTST_DEFINED. */
125 #define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
126 /** 'true' if \a HAVE_OPT would yield 'false'. */
127 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
128 /** 'true' if OPTST_DISABLED bit not set. */
129 #define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
130 /** number of stacked option arguments.
131  *  Valid only for stacked option arguments. */
132 #define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
133 /** stacked argument vector.
134  *  Valid only for stacked option arguments. */
135 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
136 /** Reset an option. */
137 #define    CLEAR_OPT(n) STMTS( \
138                 DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
139                 if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
140                     DESC(n).fOptState |= OPTST_DISABLED; \
141                 DESC(n).optCookie = NULL )
142 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
143 /**
144  *  Enumeration of danetool exit codes
145  */
146 typedef enum {
147     DANETOOL_EXIT_SUCCESS         = 0,
148     DANETOOL_EXIT_FAILURE         = 1,
149     DANETOOL_EXIT_USAGE_ERROR     = 64,
150     DANETOOL_EXIT_LIBOPTS_FAILURE = 70
151 }   danetool_exit_code_t;
152 /**
153  *  Interface defines for specific options.
154  * @{
155  */
156 #define VALUE_OPT_DEBUG          'd'
157
158 #define OPT_VALUE_DEBUG          (DESC(DEBUG).optArg.argInt)
159 #define VALUE_OPT_VERBOSE        'V'
160 #define VALUE_OPT_INFILE         0x1001
161 #define VALUE_OPT_OUTFILE        0x1002
162 #define VALUE_OPT_LOAD_PUBKEY    0x1003
163 #define VALUE_OPT_LOAD_CERTIFICATE 0x1004
164 #define VALUE_OPT_DLV            0x1005
165 #define VALUE_OPT_HASH           0x1006
166 #define VALUE_OPT_CHECK          0x1007
167 #define VALUE_OPT_CHECK_EE       0x1008
168 #define VALUE_OPT_CHECK_CA       0x1009
169 #define VALUE_OPT_TLSA_RR        0x100A
170 #define VALUE_OPT_HOST           0x100B
171 #define VALUE_OPT_PROTO          0x100C
172 #define VALUE_OPT_PORT           0x100D
173
174 #define OPT_VALUE_PORT           (DESC(PORT).optArg.argInt)
175 #define VALUE_OPT_APP_PROTO      0x100E
176 #define VALUE_OPT_STARTTLS_PROTO 0x100F
177 #define VALUE_OPT_CA             0x1010
178 #define VALUE_OPT_X509           0x1011
179 #define VALUE_OPT_LOCAL          0x1012
180 #define VALUE_OPT_DOMAIN         0x1013
181 #define VALUE_OPT_LOCAL_DNS      0x1014
182 #define VALUE_OPT_INSECURE       0x1015
183 #define VALUE_OPT_INDER          0x1016
184 #define VALUE_OPT_INRAW          0x1017
185 #define VALUE_OPT_PRINT_RAW      0x1018
186 #define VALUE_OPT_QUIET          0x1019
187 /** option flag (value) for help-value option */
188 #define VALUE_OPT_HELP          'h'
189 /** option flag (value) for more-help-value option */
190 #define VALUE_OPT_MORE_HELP     '!'
191 /** option flag (value) for version-value option */
192 #define VALUE_OPT_VERSION       'v'
193 /*
194  *  Interface defines not associated with particular options
195  */
196 #define ERRSKIP_OPTERR  STMTS(danetoolOptions.fOptSet &= ~OPTPROC_ERRSTOP)
197 #define ERRSTOP_OPTERR  STMTS(danetoolOptions.fOptSet |= OPTPROC_ERRSTOP)
198 #define RESTART_OPT(n)  STMTS( \
199                 danetoolOptions.curOptIdx = (n); \
200                 danetoolOptions.pzCurOpt  = NULL )
201 #define START_OPT       RESTART_OPT(1)
202 #define USAGE(c)        (*danetoolOptions.pUsageProc)(&danetoolOptions, c)
203
204 #ifdef  __cplusplus
205 extern "C" {
206 #endif
207 /*
208  *  global exported definitions
209  */
210 #include <gettext.h>
211
212
213 /* * * * * *
214  *
215  *  Declare the danetool option descriptor.
216  */
217 extern tOptions danetoolOptions;
218
219 #if defined(ENABLE_NLS)
220 # ifndef _
221 #   include <stdio.h>
222 #   ifndef HAVE_GETTEXT
223       extern char * gettext(char const *);
224 #   else
225 #     include <libintl.h>
226 #   endif
227
228 # ifndef ATTRIBUTE_FORMAT_ARG
229 #   define ATTRIBUTE_FORMAT_ARG(_a)
230 # endif
231
232 static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
233 static inline char* aoGetsText(char const* pz) {
234     if (pz == NULL) return NULL;
235     return (char*)gettext(pz);
236 }
237 #   define _(s)  aoGetsText(s)
238 # endif /* _() */
239
240 # define OPT_NO_XLAT_CFG_NAMES  STMTS(danetoolOptions.fOptSet |= \
241                                     OPTPROC_NXLAT_OPT_CFG;)
242 # define OPT_NO_XLAT_OPT_NAMES  STMTS(danetoolOptions.fOptSet |= \
243                                     OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
244
245 # define OPT_XLAT_CFG_NAMES     STMTS(danetoolOptions.fOptSet &= \
246                                   ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
247 # define OPT_XLAT_OPT_NAMES     STMTS(danetoolOptions.fOptSet &= \
248                                   ~OPTPROC_NXLAT_OPT;)
249
250 #else   /* ENABLE_NLS */
251 # define OPT_NO_XLAT_CFG_NAMES
252 # define OPT_NO_XLAT_OPT_NAMES
253
254 # define OPT_XLAT_CFG_NAMES
255 # define OPT_XLAT_OPT_NAMES
256
257 # ifndef _
258 #   define _(_s)  _s
259 # endif
260 #endif  /* ENABLE_NLS */
261
262 #ifdef  __cplusplus
263 }
264 #endif
265 #endif /* AUTOOPTS_DANETOOL_ARGS_H_GUARD */
266
267 /* danetool-args.h ends here */