nss: import at 3.0.1 beta 1
[mozilla-nss.git] / security / nss / cmd / modutil / install-ds.h
blob9af6144377688c10edc23b9e044aad29f9907606
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
12 * License.
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.
21 * Contributor(s):
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 ***** */
37 #ifndef INSTALL_DS_H
38 #define INSTALL_DS_H
40 #include <stdio.h>
41 #include <prio.h>
42 #include <prmem.h>
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 //////////////////////////////////////////////////////////////////////////
66 // Pk11Install_Pair
67 //////////////////////////////////////////////////////////////////////////
70 struct Pk11Install_Pair_str {
71 char * key;
72 Pk11Install_ValueList *list;
76 Pk11Install_Pair*
77 Pk11Install_Pair_new_default();
78 Pk11Install_Pair*
79 Pk11Install_Pair_new( char* _key, Pk11Install_ValueList* _list);
80 void
81 Pk11Install_Pair_delete(Pk11Install_Pair* _this);
82 void
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;
94 char *string;
98 //////////////////////////////////////////////////////////////////////////
99 // Pk11Install_Value
100 //////////////////////////////////////////////////////////////////////////
102 struct Pk11Install_Value_str {
104 ValueType type;
105 char *string;
106 Pk11Install_Pair *pair;
107 struct Pk11Install_Value_str *next;
110 Pk11Install_Value*
111 Pk11Install_Value_new_default();
112 Pk11Install_Value*
113 Pk11Install_Value_new(ValueType _type, Pk11Install_Pointer ptr);
114 void
115 Pk11Install_Value_delete(Pk11Install_Value* _this);
116 void
117 Pk11Install_Value_Print(Pk11Install_Value* _this, int pad);
120 //////////////////////////////////////////////////////////////////////////
121 // Pk11Install_ValueList
122 //////////////////////////////////////////////////////////////////////////
124 struct Pk11Install_ValueList_str {
125 int numItems;
126 int numPairs;
127 int numStrings;
128 Pk11Install_Value *head;
131 Pk11Install_ValueList*
132 Pk11Install_ValueList_new();
133 void
134 Pk11Install_ValueList_delete(Pk11Install_ValueList* _this);
135 void
136 Pk11Install_ValueList_AddItem(Pk11Install_ValueList* _this,
137 Pk11Install_Value* item);
138 void
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();
154 void
155 Pk11Install_ListIter_init(Pk11Install_ListIter* _this);
156 Pk11Install_ListIter*
157 Pk11Install_ListIter_new(const Pk11Install_ValueList* _list);
158 void
159 Pk11Install_ListIter_delete(Pk11Install_ListIter* _this);
160 void
161 Pk11Install_ListIter_reset(Pk11Install_ListIter* _this);
162 Pk11Install_Value*
163 Pk11Install_ListIter_nextItem(Pk11Install_ListIter* _this);
165 /************************************************************************
167 * Pk11Install_File
169 struct Pk11Install_File_str {
170 char *jarPath;
171 char *relativePath;
172 char *absolutePath;
173 PRBool executable;
174 int permissions;
177 Pk11Install_File*
178 Pk11Install_File_new();
179 void
180 Pk11Install_File_init(Pk11Install_File* _this);
181 void
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.*/
185 char*
186 Pk11Install_File_Generate(Pk11Install_File* _this,
187 const Pk11Install_Pair* pair);
188 void
189 Pk11Install_File_Print(Pk11Install_File* _this, int pad);
190 void
191 Pk11Install_File_Cleanup(Pk11Install_File* _this);
193 /************************************************************************
195 * Pk11Install_PlatformName
197 struct Pk11Install_PlatformName_str {
198 char *OS;
199 char **verString;
200 int numDigits;
201 char *arch;
204 Pk11Install_PlatformName*
205 Pk11Install_PlatformName_new();
206 void
207 Pk11Install_PlatformName_init(Pk11Install_PlatformName* _this);
208 void
209 Pk11Install_PlatformName_delete(Pk11Install_PlatformName* _this);
210 char*
211 Pk11Install_PlatformName_Generate(Pk11Install_PlatformName* _this,
212 const char* str);
213 char*
214 Pk11Install_PlatformName_GetString(Pk11Install_PlatformName* _this);
215 char*
216 Pk11Install_PlatformName_GetVerString(Pk11Install_PlatformName* _this);
217 void
218 Pk11Install_PlatformName_Print(Pk11Install_PlatformName* _this, int pad);
219 void
220 Pk11Install_PlatformName_Cleanup(Pk11Install_PlatformName* _this);
221 PRBool
222 Pk11Install_PlatformName_equal(Pk11Install_PlatformName* _this,
223 Pk11Install_PlatformName* cmp);
224 PRBool
225 Pk11Install_PlatformName_lteq(Pk11Install_PlatformName* _this,
226 Pk11Install_PlatformName* cmp);
227 PRBool
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;
239 PRBool usesEquiv;
240 char *moduleFile;
241 char *moduleName;
242 int modFile;
243 unsigned long mechFlags;
244 unsigned long cipherFlags;
245 Pk11Install_File *files;
246 int numFiles;
249 Pk11Install_Platform*
250 Pk11Install_Platform_new();
251 void
252 Pk11Install_Platform_init(Pk11Install_Platform* _this);
253 void
254 Pk11Install_Platform_delete(Pk11Install_Platform* _this);
255 /*// Returns NULL for success, error message if parse error.*/
256 char*
257 Pk11Install_Platform_Generate(Pk11Install_Platform* _this,
258 const Pk11Install_Pair *pair);
259 void
260 Pk11Install_Platform_Print(Pk11Install_Platform* _this, int pad);
261 void
262 Pk11Install_Platform_Cleanup(Pk11Install_Platform* _this);
264 /************************************************************************
266 * Pk11Install_Info
268 struct Pk11Install_Info_str {
269 Pk11Install_Platform *platforms;
270 int numPlatforms;
271 Pk11Install_PlatformName *forwardCompatible;
272 int numForwardCompatible;
275 Pk11Install_Info*
276 Pk11Install_Info_new();
277 void
278 Pk11Install_Info_init();
279 void
280 Pk11Install_Info_delete(Pk11Install_Info* _this);
281 /*// Returns NULL for success, error message if parse error.*/
282 char*
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);
288 void
289 Pk11Install_Info_Print(Pk11Install_Info* _this, int pad);
290 void
291 Pk11Install_Info_Cleanup(Pk11Install_Info* _this);
293 #endif /* INSTALL_DS_H */