|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #ifndef INSTALL_DS_H |
|
6 #define INSTALL_DS_H |
|
7 |
|
8 #include <stdio.h> |
|
9 #include <prio.h> |
|
10 #include <prmem.h> |
|
11 |
|
12 extern PRFileDesc *Pk11Install_FD; |
|
13 extern int Pk11Install_yylex(); |
|
14 extern int Pk11Install_yylinenum; |
|
15 extern char *Pk11Install_yyerrstr; |
|
16 |
|
17 typedef enum { STRING_VALUE, PAIR_VALUE } ValueType; |
|
18 |
|
19 typedef struct Pk11Install_Pair_str Pk11Install_Pair; |
|
20 typedef union Pk11Install_Pointer_str Pk11Install_Pointer; |
|
21 typedef struct Pk11Install_Value_str Pk11Install_Value; |
|
22 typedef struct Pk11Install_ValueList_str Pk11Install_ValueList; |
|
23 typedef struct Pk11Install_ListIter_str Pk11Install_ListIter; |
|
24 typedef struct Pk11Install_File_str Pk11Install_File; |
|
25 typedef struct Pk11Install_PlatformName_str Pk11Install_PlatformName; |
|
26 typedef struct Pk11Install_Platform_str Pk11Install_Platform; |
|
27 typedef struct Pk11Install_Info_str Pk11Install_Info; |
|
28 |
|
29 extern Pk11Install_Pointer Pk11Install_yylval; |
|
30 extern Pk11Install_ValueList* Pk11Install_valueList; |
|
31 |
|
32 /* |
|
33 ////////////////////////////////////////////////////////////////////////// |
|
34 // Pk11Install_Pair |
|
35 ////////////////////////////////////////////////////////////////////////// |
|
36 */ |
|
37 |
|
38 struct Pk11Install_Pair_str { |
|
39 char * key; |
|
40 Pk11Install_ValueList *list; |
|
41 |
|
42 }; |
|
43 |
|
44 Pk11Install_Pair* |
|
45 Pk11Install_Pair_new_default(); |
|
46 Pk11Install_Pair* |
|
47 Pk11Install_Pair_new( char* _key, Pk11Install_ValueList* _list); |
|
48 void |
|
49 Pk11Install_Pair_delete(Pk11Install_Pair* _this); |
|
50 void |
|
51 Pk11Install_Pair_Print(Pk11Install_Pair* _this, int pad); |
|
52 |
|
53 /* |
|
54 ////////////////////////////////////////////////////////////////////////// |
|
55 // Pk11Install_Pointer |
|
56 ////////////////////////////////////////////////////////////////////////// |
|
57 */ |
|
58 union Pk11Install_Pointer_str { |
|
59 Pk11Install_ValueList *list; |
|
60 Pk11Install_Value *value; |
|
61 Pk11Install_Pair *pair; |
|
62 char *string; |
|
63 }; |
|
64 |
|
65 /* |
|
66 ////////////////////////////////////////////////////////////////////////// |
|
67 // Pk11Install_Value |
|
68 ////////////////////////////////////////////////////////////////////////// |
|
69 */ |
|
70 struct Pk11Install_Value_str { |
|
71 |
|
72 ValueType type; |
|
73 char *string; |
|
74 Pk11Install_Pair *pair; |
|
75 struct Pk11Install_Value_str *next; |
|
76 }; |
|
77 |
|
78 Pk11Install_Value* |
|
79 Pk11Install_Value_new_default(); |
|
80 Pk11Install_Value* |
|
81 Pk11Install_Value_new(ValueType _type, Pk11Install_Pointer ptr); |
|
82 void |
|
83 Pk11Install_Value_delete(Pk11Install_Value* _this); |
|
84 void |
|
85 Pk11Install_Value_Print(Pk11Install_Value* _this, int pad); |
|
86 |
|
87 /* |
|
88 ////////////////////////////////////////////////////////////////////////// |
|
89 // Pk11Install_ValueList |
|
90 ////////////////////////////////////////////////////////////////////////// |
|
91 */ |
|
92 struct Pk11Install_ValueList_str { |
|
93 int numItems; |
|
94 int numPairs; |
|
95 int numStrings; |
|
96 Pk11Install_Value *head; |
|
97 }; |
|
98 |
|
99 Pk11Install_ValueList* |
|
100 Pk11Install_ValueList_new(); |
|
101 void |
|
102 Pk11Install_ValueList_delete(Pk11Install_ValueList* _this); |
|
103 void |
|
104 Pk11Install_ValueList_AddItem(Pk11Install_ValueList* _this, |
|
105 Pk11Install_Value* item); |
|
106 void |
|
107 Pk11Install_ValueList_Print(Pk11Install_ValueList* _this, int pad); |
|
108 |
|
109 |
|
110 /* |
|
111 ////////////////////////////////////////////////////////////////////////// |
|
112 // Pk11Install_ListIter |
|
113 ////////////////////////////////////////////////////////////////////////// |
|
114 */ |
|
115 struct Pk11Install_ListIter_str { |
|
116 const Pk11Install_ValueList *list; |
|
117 Pk11Install_Value *current; |
|
118 }; |
|
119 |
|
120 Pk11Install_ListIter* |
|
121 Pk11Install_ListIter_new_default(); |
|
122 void |
|
123 Pk11Install_ListIter_init(Pk11Install_ListIter* _this); |
|
124 Pk11Install_ListIter* |
|
125 Pk11Install_ListIter_new(const Pk11Install_ValueList* _list); |
|
126 void |
|
127 Pk11Install_ListIter_delete(Pk11Install_ListIter* _this); |
|
128 void |
|
129 Pk11Install_ListIter_reset(Pk11Install_ListIter* _this); |
|
130 Pk11Install_Value* |
|
131 Pk11Install_ListIter_nextItem(Pk11Install_ListIter* _this); |
|
132 |
|
133 /************************************************************************ |
|
134 * |
|
135 * Pk11Install_File |
|
136 */ |
|
137 struct Pk11Install_File_str { |
|
138 char *jarPath; |
|
139 char *relativePath; |
|
140 char *absolutePath; |
|
141 PRBool executable; |
|
142 int permissions; |
|
143 }; |
|
144 |
|
145 Pk11Install_File* |
|
146 Pk11Install_File_new(); |
|
147 void |
|
148 Pk11Install_File_init(Pk11Install_File* _this); |
|
149 void |
|
150 Pk11Install_file_delete(Pk11Install_File* _this); |
|
151 /*// Parses a syntax tree to obtain all attributes. |
|
152 // Returns NULL for success, error message if parse error.*/ |
|
153 char* |
|
154 Pk11Install_File_Generate(Pk11Install_File* _this, |
|
155 const Pk11Install_Pair* pair); |
|
156 void |
|
157 Pk11Install_File_Print(Pk11Install_File* _this, int pad); |
|
158 void |
|
159 Pk11Install_File_Cleanup(Pk11Install_File* _this); |
|
160 |
|
161 /************************************************************************ |
|
162 * |
|
163 * Pk11Install_PlatformName |
|
164 */ |
|
165 struct Pk11Install_PlatformName_str { |
|
166 char *OS; |
|
167 char **verString; |
|
168 int numDigits; |
|
169 char *arch; |
|
170 }; |
|
171 |
|
172 Pk11Install_PlatformName* |
|
173 Pk11Install_PlatformName_new(); |
|
174 void |
|
175 Pk11Install_PlatformName_init(Pk11Install_PlatformName* _this); |
|
176 void |
|
177 Pk11Install_PlatformName_delete(Pk11Install_PlatformName* _this); |
|
178 char* |
|
179 Pk11Install_PlatformName_Generate(Pk11Install_PlatformName* _this, |
|
180 const char* str); |
|
181 char* |
|
182 Pk11Install_PlatformName_GetString(Pk11Install_PlatformName* _this); |
|
183 char* |
|
184 Pk11Install_PlatformName_GetVerString(Pk11Install_PlatformName* _this); |
|
185 void |
|
186 Pk11Install_PlatformName_Print(Pk11Install_PlatformName* _this, int pad); |
|
187 void |
|
188 Pk11Install_PlatformName_Cleanup(Pk11Install_PlatformName* _this); |
|
189 PRBool |
|
190 Pk11Install_PlatformName_equal(Pk11Install_PlatformName* _this, |
|
191 Pk11Install_PlatformName* cmp); |
|
192 PRBool |
|
193 Pk11Install_PlatformName_lteq(Pk11Install_PlatformName* _this, |
|
194 Pk11Install_PlatformName* cmp); |
|
195 PRBool |
|
196 Pk11Install_PlatformName_lt(Pk11Install_PlatformName* _this, |
|
197 Pk11Install_PlatformName* cmp); |
|
198 |
|
199 /************************************************************************ |
|
200 * |
|
201 * Pk11Install_Platform |
|
202 */ |
|
203 struct Pk11Install_Platform_str { |
|
204 Pk11Install_PlatformName name; |
|
205 Pk11Install_PlatformName equivName; |
|
206 struct Pk11Install_Platform_str *equiv; |
|
207 PRBool usesEquiv; |
|
208 char *moduleFile; |
|
209 char *moduleName; |
|
210 int modFile; |
|
211 unsigned long mechFlags; |
|
212 unsigned long cipherFlags; |
|
213 Pk11Install_File *files; |
|
214 int numFiles; |
|
215 }; |
|
216 |
|
217 Pk11Install_Platform* |
|
218 Pk11Install_Platform_new(); |
|
219 void |
|
220 Pk11Install_Platform_init(Pk11Install_Platform* _this); |
|
221 void |
|
222 Pk11Install_Platform_delete(Pk11Install_Platform* _this); |
|
223 /*// Returns NULL for success, error message if parse error.*/ |
|
224 char* |
|
225 Pk11Install_Platform_Generate(Pk11Install_Platform* _this, |
|
226 const Pk11Install_Pair *pair); |
|
227 void |
|
228 Pk11Install_Platform_Print(Pk11Install_Platform* _this, int pad); |
|
229 void |
|
230 Pk11Install_Platform_Cleanup(Pk11Install_Platform* _this); |
|
231 |
|
232 /************************************************************************ |
|
233 * |
|
234 * Pk11Install_Info |
|
235 */ |
|
236 struct Pk11Install_Info_str { |
|
237 Pk11Install_Platform *platforms; |
|
238 int numPlatforms; |
|
239 Pk11Install_PlatformName *forwardCompatible; |
|
240 int numForwardCompatible; |
|
241 }; |
|
242 |
|
243 Pk11Install_Info* |
|
244 Pk11Install_Info_new(); |
|
245 void |
|
246 Pk11Install_Info_init(); |
|
247 void |
|
248 Pk11Install_Info_delete(Pk11Install_Info* _this); |
|
249 /*// Returns NULL for success, error message if parse error.*/ |
|
250 char* |
|
251 Pk11Install_Info_Generate(Pk11Install_Info* _this, |
|
252 const Pk11Install_ValueList *list); |
|
253 /*// Returns NULL if there is no matching platform*/ |
|
254 Pk11Install_Platform* |
|
255 Pk11Install_Info_GetBestPlatform(Pk11Install_Info* _this, char* myPlatform); |
|
256 void |
|
257 Pk11Install_Info_Print(Pk11Install_Info* _this, int pad); |
|
258 void |
|
259 Pk11Install_Info_Cleanup(Pk11Install_Info* _this); |
|
260 |
|
261 #endif /* INSTALL_DS_H */ |