1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
14 * The Original Code is the Netscape security libraries.
16 * The Initial Developer of the Original Code is
17 * Netscape Communications Corporation.
18 * Portions created by the Initial Developer are Copyright (C) 1994-2000
19 * the Initial Developer. All Rights Reserved.
23 * Alternatively, the contents of this file may be used under the terms of
24 * either the GNU General Public License Version 2 or later (the "GPL"), or
25 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26 * in which case the provisions of the GPL or the LGPL are applicable instead
27 * of those above. If you wish to allow use of your version of this file only
28 * under the terms of either the GPL or the LGPL, and not to allow others to
29 * use your version of this file under the terms of the MPL, indicate your
30 * decision by deleting the provisions above and replace them with the notice
31 * and other provisions required by the GPL or the LGPL. If you do not delete
32 * the provisions above, a recipient may use your version of this file under
33 * the terms of any one of the MPL, the GPL or the LGPL.
35 * ***** END LICENSE BLOCK ***** */
44 extern PRFileDesc
*Pk11Install_FD
;
45 extern int Pk11Install_yylex();
46 extern int Pk11Install_yylinenum
;
47 extern char *Pk11Install_yyerrstr
;
49 typedef enum { STRING_VALUE
, PAIR_VALUE
} ValueType
;
51 typedef struct Pk11Install_Pair_str Pk11Install_Pair
;
52 typedef union Pk11Install_Pointer_str Pk11Install_Pointer
;
53 typedef struct Pk11Install_Value_str Pk11Install_Value
;
54 typedef struct Pk11Install_ValueList_str Pk11Install_ValueList
;
55 typedef struct Pk11Install_ListIter_str Pk11Install_ListIter
;
56 typedef struct Pk11Install_File_str Pk11Install_File
;
57 typedef struct Pk11Install_PlatformName_str Pk11Install_PlatformName
;
58 typedef struct Pk11Install_Platform_str Pk11Install_Platform
;
59 typedef struct Pk11Install_Info_str Pk11Install_Info
;
61 extern Pk11Install_Pointer Pk11Install_yylval
;
62 extern Pk11Install_ValueList
* Pk11Install_valueList
;
65 //////////////////////////////////////////////////////////////////////////
67 //////////////////////////////////////////////////////////////////////////
70 struct Pk11Install_Pair_str
{
72 Pk11Install_ValueList
*list
;
77 Pk11Install_Pair_new_default();
79 Pk11Install_Pair_new( char* _key
, Pk11Install_ValueList
* _list
);
81 Pk11Install_Pair_delete(Pk11Install_Pair
* _this
);
83 Pk11Install_Pair_Print(Pk11Install_Pair
* _this
, int pad
);
86 //////////////////////////////////////////////////////////////////////////
87 // Pk11Install_Pointer
88 //////////////////////////////////////////////////////////////////////////
90 union Pk11Install_Pointer_str
{
91 Pk11Install_ValueList
*list
;
92 Pk11Install_Value
*value
;
93 Pk11Install_Pair
*pair
;
98 //////////////////////////////////////////////////////////////////////////
100 //////////////////////////////////////////////////////////////////////////
102 struct Pk11Install_Value_str
{
106 Pk11Install_Pair
*pair
;
107 struct Pk11Install_Value_str
*next
;
111 Pk11Install_Value_new_default();
113 Pk11Install_Value_new(ValueType _type
, Pk11Install_Pointer ptr
);
115 Pk11Install_Value_delete(Pk11Install_Value
* _this
);
117 Pk11Install_Value_Print(Pk11Install_Value
* _this
, int pad
);
120 //////////////////////////////////////////////////////////////////////////
121 // Pk11Install_ValueList
122 //////////////////////////////////////////////////////////////////////////
124 struct Pk11Install_ValueList_str
{
128 Pk11Install_Value
*head
;
131 Pk11Install_ValueList
*
132 Pk11Install_ValueList_new();
134 Pk11Install_ValueList_delete(Pk11Install_ValueList
* _this
);
136 Pk11Install_ValueList_AddItem(Pk11Install_ValueList
* _this
,
137 Pk11Install_Value
* item
);
139 Pk11Install_ValueList_Print(Pk11Install_ValueList
* _this
, int pad
);
143 //////////////////////////////////////////////////////////////////////////
144 // Pk11Install_ListIter
145 //////////////////////////////////////////////////////////////////////////
147 struct Pk11Install_ListIter_str
{
148 const Pk11Install_ValueList
*list
;
149 Pk11Install_Value
*current
;
152 Pk11Install_ListIter
*
153 Pk11Install_ListIter_new_default();
155 Pk11Install_ListIter_init(Pk11Install_ListIter
* _this
);
156 Pk11Install_ListIter
*
157 Pk11Install_ListIter_new(const Pk11Install_ValueList
* _list
);
159 Pk11Install_ListIter_delete(Pk11Install_ListIter
* _this
);
161 Pk11Install_ListIter_reset(Pk11Install_ListIter
* _this
);
163 Pk11Install_ListIter_nextItem(Pk11Install_ListIter
* _this
);
165 /************************************************************************
169 struct Pk11Install_File_str
{
178 Pk11Install_File_new();
180 Pk11Install_File_init(Pk11Install_File
* _this
);
182 Pk11Install_file_delete(Pk11Install_File
* _this
);
183 /*// Parses a syntax tree to obtain all attributes.
184 // Returns NULL for success, error message if parse error.*/
186 Pk11Install_File_Generate(Pk11Install_File
* _this
,
187 const Pk11Install_Pair
* pair
);
189 Pk11Install_File_Print(Pk11Install_File
* _this
, int pad
);
191 Pk11Install_File_Cleanup(Pk11Install_File
* _this
);
193 /************************************************************************
195 * Pk11Install_PlatformName
197 struct Pk11Install_PlatformName_str
{
204 Pk11Install_PlatformName
*
205 Pk11Install_PlatformName_new();
207 Pk11Install_PlatformName_init(Pk11Install_PlatformName
* _this
);
209 Pk11Install_PlatformName_delete(Pk11Install_PlatformName
* _this
);
211 Pk11Install_PlatformName_Generate(Pk11Install_PlatformName
* _this
,
214 Pk11Install_PlatformName_GetString(Pk11Install_PlatformName
* _this
);
216 Pk11Install_PlatformName_GetVerString(Pk11Install_PlatformName
* _this
);
218 Pk11Install_PlatformName_Print(Pk11Install_PlatformName
* _this
, int pad
);
220 Pk11Install_PlatformName_Cleanup(Pk11Install_PlatformName
* _this
);
222 Pk11Install_PlatformName_equal(Pk11Install_PlatformName
* _this
,
223 Pk11Install_PlatformName
* cmp
);
225 Pk11Install_PlatformName_lteq(Pk11Install_PlatformName
* _this
,
226 Pk11Install_PlatformName
* cmp
);
228 Pk11Install_PlatformName_lt(Pk11Install_PlatformName
* _this
,
229 Pk11Install_PlatformName
* cmp
);
231 /************************************************************************
233 * Pk11Install_Platform
235 struct Pk11Install_Platform_str
{
236 Pk11Install_PlatformName name
;
237 Pk11Install_PlatformName equivName
;
238 struct Pk11Install_Platform_str
*equiv
;
243 unsigned long mechFlags
;
244 unsigned long cipherFlags
;
245 Pk11Install_File
*files
;
249 Pk11Install_Platform
*
250 Pk11Install_Platform_new();
252 Pk11Install_Platform_init(Pk11Install_Platform
* _this
);
254 Pk11Install_Platform_delete(Pk11Install_Platform
* _this
);
255 /*// Returns NULL for success, error message if parse error.*/
257 Pk11Install_Platform_Generate(Pk11Install_Platform
* _this
,
258 const Pk11Install_Pair
*pair
);
260 Pk11Install_Platform_Print(Pk11Install_Platform
* _this
, int pad
);
262 Pk11Install_Platform_Cleanup(Pk11Install_Platform
* _this
);
264 /************************************************************************
268 struct Pk11Install_Info_str
{
269 Pk11Install_Platform
*platforms
;
271 Pk11Install_PlatformName
*forwardCompatible
;
272 int numForwardCompatible
;
276 Pk11Install_Info_new();
278 Pk11Install_Info_init();
280 Pk11Install_Info_delete(Pk11Install_Info
* _this
);
281 /*// Returns NULL for success, error message if parse error.*/
283 Pk11Install_Info_Generate(Pk11Install_Info
* _this
,
284 const Pk11Install_ValueList
*list
);
285 /*// Returns NULL if there is no matching platform*/
286 Pk11Install_Platform
*
287 Pk11Install_Info_GetBestPlatform(Pk11Install_Info
* _this
, char* myPlatform
);
289 Pk11Install_Info_Print(Pk11Install_Info
* _this
, int pad
);
291 Pk11Install_Info_Cleanup(Pk11Install_Info
* _this
);
293 #endif /* INSTALL_DS_H */