Fix CVE-2017-6891 in minitasn1 code
[platform/upstream/gnutls.git] / src / srptool-args.h.bak
1 /*   -*- buffer-read-only: t -*- vi: set ro:
2  *
3  *  DO NOT EDIT THIS FILE   (srptool-args.h)
4  *
5  *  It has been AutoGen-ed
6  *  From the definitions    srptool-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 srptool 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 srptool 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  *  srptool 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  *  srptool 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 srptool 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_SRPTOOL_ARGS_H_GUARD
47 #define AUTOOPTS_SRPTOOL_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 srptool
67  */
68 typedef enum {
69     INDEX_OPT_DEBUG        =  0,
70     INDEX_OPT_INDEX        =  1,
71     INDEX_OPT_USERNAME     =  2,
72     INDEX_OPT_PASSWD       =  3,
73     INDEX_OPT_SALT         =  4,
74     INDEX_OPT_VERIFY       =  5,
75     INDEX_OPT_PASSWD_CONF  =  6,
76     INDEX_OPT_CREATE_CONF  =  7,
77     INDEX_OPT_VERSION      =  8,
78     INDEX_OPT_HELP         =  9,
79     INDEX_OPT_MORE_HELP    = 10
80 } teOptIndex;
81 /** count of all options for srptool */
82 #define OPTION_CT    11
83 /** srptool version */
84 #define SRPTOOL_VERSION       "3.3.27"
85 /** Full srptool version text */
86 #define SRPTOOL_FULL_VERSION  "srptool 3.3.27"
87
88 /**
89  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
90  *  option name (as in the teOptIndex enumeration above).
91  *  e.g. HAVE_OPT(DEBUG)
92  */
93 #define         DESC(n) (srptoolOptions.pOptDesc[INDEX_OPT_## n])
94 /** 'true' if an option has been specified in any way */
95 #define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
96 /** The string argument to an option. The argument type must be \"string\". */
97 #define      OPT_ARG(n) (DESC(n).optArg.argString)
98 /** Mask the option state revealing how an option was specified.
99  *  It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
100  * \a OPTST_DEFINED, \a OPTST_RESET or zero.
101  */
102 #define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
103 /** Count of option's occurrances *on the command line*. */
104 #define    COUNT_OPT(n) (DESC(n).optOccCt)
105 /** mask of \a OPTST_SET and \a OPTST_DEFINED. */
106 #define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
107 /** 'true' if \a HAVE_OPT would yield 'false'. */
108 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
109 /** 'true' if OPTST_DISABLED bit not set. */
110 #define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
111 /** number of stacked option arguments.
112  *  Valid only for stacked option arguments. */
113 #define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
114 /** stacked argument vector.
115  *  Valid only for stacked option arguments. */
116 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
117 /** Reset an option. */
118 #define    CLEAR_OPT(n) STMTS( \
119                 DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
120                 if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
121                     DESC(n).fOptState |= OPTST_DISABLED; \
122                 DESC(n).optCookie = NULL )
123 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
124 /**
125  *  Enumeration of srptool exit codes
126  */
127 typedef enum {
128     SRPTOOL_EXIT_SUCCESS         = 0,
129     SRPTOOL_EXIT_FAILURE         = 1,
130     SRPTOOL_EXIT_USAGE_ERROR     = 64,
131     SRPTOOL_EXIT_LIBOPTS_FAILURE = 70
132 }   srptool_exit_code_t;
133 /**
134  *  Interface defines for specific options.
135  * @{
136  */
137 #define VALUE_OPT_DEBUG          'd'
138
139 #define OPT_VALUE_DEBUG          (DESC(DEBUG).optArg.argInt)
140 #define VALUE_OPT_INDEX          'i'
141
142 #define OPT_VALUE_INDEX          (DESC(INDEX).optArg.argInt)
143 #define VALUE_OPT_USERNAME       'u'
144 #define VALUE_OPT_PASSWD         'p'
145 #define VALUE_OPT_SALT           's'
146
147 #define OPT_VALUE_SALT           (DESC(SALT).optArg.argInt)
148 #define VALUE_OPT_VERIFY         0x1001
149 #define VALUE_OPT_PASSWD_CONF    'v'
150 #define VALUE_OPT_CREATE_CONF    0x1002
151 /** option flag (value) for help-value option */
152 #define VALUE_OPT_HELP          'h'
153 /** option flag (value) for more-help-value option */
154 #define VALUE_OPT_MORE_HELP     '!'
155 /** option flag (value) for version-value option */
156 #define VALUE_OPT_VERSION       'v'
157 /*
158  *  Interface defines not associated with particular options
159  */
160 #define ERRSKIP_OPTERR  STMTS(srptoolOptions.fOptSet &= ~OPTPROC_ERRSTOP)
161 #define ERRSTOP_OPTERR  STMTS(srptoolOptions.fOptSet |= OPTPROC_ERRSTOP)
162 #define RESTART_OPT(n)  STMTS( \
163                 srptoolOptions.curOptIdx = (n); \
164                 srptoolOptions.pzCurOpt  = NULL )
165 #define START_OPT       RESTART_OPT(1)
166 #define USAGE(c)        (*srptoolOptions.pUsageProc)(&srptoolOptions, c)
167
168 #ifdef  __cplusplus
169 extern "C" {
170 #endif
171 /*
172  *  global exported definitions
173  */
174 #include <gettext.h>
175
176
177 /* * * * * *
178  *
179  *  Declare the srptool option descriptor.
180  */
181 extern tOptions srptoolOptions;
182
183 #if defined(ENABLE_NLS)
184 # ifndef _
185 #   include <stdio.h>
186 #   ifndef HAVE_GETTEXT
187       extern char * gettext(char const *);
188 #   else
189 #     include <libintl.h>
190 #   endif
191
192 # ifndef ATTRIBUTE_FORMAT_ARG
193 #   define ATTRIBUTE_FORMAT_ARG(_a)
194 # endif
195
196 static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
197 static inline char* aoGetsText(char const* pz) {
198     if (pz == NULL) return NULL;
199     return (char*)gettext(pz);
200 }
201 #   define _(s)  aoGetsText(s)
202 # endif /* _() */
203
204 # define OPT_NO_XLAT_CFG_NAMES  STMTS(srptoolOptions.fOptSet |= \
205                                     OPTPROC_NXLAT_OPT_CFG;)
206 # define OPT_NO_XLAT_OPT_NAMES  STMTS(srptoolOptions.fOptSet |= \
207                                     OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
208
209 # define OPT_XLAT_CFG_NAMES     STMTS(srptoolOptions.fOptSet &= \
210                                   ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
211 # define OPT_XLAT_OPT_NAMES     STMTS(srptoolOptions.fOptSet &= \
212                                   ~OPTPROC_NXLAT_OPT;)
213
214 #else   /* ENABLE_NLS */
215 # define OPT_NO_XLAT_CFG_NAMES
216 # define OPT_NO_XLAT_OPT_NAMES
217
218 # define OPT_XLAT_CFG_NAMES
219 # define OPT_XLAT_OPT_NAMES
220
221 # ifndef _
222 #   define _(_s)  _s
223 # endif
224 #endif  /* ENABLE_NLS */
225
226 #ifdef  __cplusplus
227 }
228 #endif
229 #endif /* AUTOOPTS_SRPTOOL_ARGS_H_GUARD */
230
231 /* srptool-args.h ends here */