Back to index

lightning-sunbird  0.9+nobinonly
install-ds.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is the Netscape security libraries.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corporation.
00018  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  *
00035  * ***** END LICENSE BLOCK ***** */
00036 
00037 #ifndef INSTALL_DS_H
00038 #define INSTALL_DS_H
00039 
00040 #include <stdio.h>
00041 #include <prio.h>
00042 #include <prmem.h>
00043 
00044 extern PRFileDesc *Pk11Install_FD;
00045 extern int Pk11Install_yylex();
00046 extern int Pk11Install_yylinenum;
00047 extern char *Pk11Install_yyerrstr;
00048 
00049 typedef enum { STRING_VALUE, PAIR_VALUE } ValueType;
00050 
00051 typedef struct Pk11Install_Pair_str Pk11Install_Pair;
00052 typedef union Pk11Install_Pointer_str Pk11Install_Pointer;
00053 typedef struct Pk11Install_Value_str Pk11Install_Value;
00054 typedef struct Pk11Install_ValueList_str Pk11Install_ValueList;
00055 typedef struct Pk11Install_ListIter_str Pk11Install_ListIter;
00056 typedef struct Pk11Install_File_str Pk11Install_File;
00057 typedef struct Pk11Install_PlatformName_str Pk11Install_PlatformName;
00058 typedef struct Pk11Install_Platform_str Pk11Install_Platform;
00059 typedef struct Pk11Install_Info_str Pk11Install_Info;
00060 
00061 extern Pk11Install_Pointer Pk11Install_yylval;
00062 extern Pk11Install_ValueList* Pk11Install_valueList;
00063 
00064 /*
00066 // Pk11Install_Pair
00068 */
00069 
00070 struct Pk11Install_Pair_str {
00071        char * key;
00072        Pk11Install_ValueList *list;
00073 
00074 };
00075 
00076 Pk11Install_Pair* 
00077 Pk11Install_Pair_new_default();
00078 Pk11Install_Pair* 
00079 Pk11Install_Pair_new( char* _key, Pk11Install_ValueList* _list);
00080 void 
00081 Pk11Install_Pair_delete(Pk11Install_Pair* _this);
00082 void
00083 Pk11Install_Pair_Print(Pk11Install_Pair* _this, int pad);
00084 
00085 /*
00087 // Pk11Install_Pointer
00089 */
00090 union Pk11Install_Pointer_str {
00091        Pk11Install_ValueList *list;
00092        Pk11Install_Value *value;
00093        Pk11Install_Pair *pair;
00094        char *string;
00095 };
00096 
00097 /*
00099 // Pk11Install_Value
00101 */
00102 struct Pk11Install_Value_str {
00103 
00104        ValueType type;
00105        char *string; 
00106        Pk11Install_Pair *pair;
00107        struct Pk11Install_Value_str *next;
00108 };
00109 
00110 Pk11Install_Value* 
00111 Pk11Install_Value_new_default();
00112 Pk11Install_Value*
00113 Pk11Install_Value_new(ValueType _type, Pk11Install_Pointer ptr);
00114 void
00115 Pk11Install_Value_delete(Pk11Install_Value* _this);
00116 void
00117 Pk11Install_Value_Print(Pk11Install_Value* _this, int pad);
00118 
00119 /*
00121 // Pk11Install_ValueList
00123 */
00124 struct Pk11Install_ValueList_str {
00125        int numItems;
00126        int numPairs;
00127        int numStrings;
00128        Pk11Install_Value *head;
00129 };
00130 
00131 Pk11Install_ValueList* 
00132 Pk11Install_ValueList_new();
00133 void
00134 Pk11Install_ValueList_delete(Pk11Install_ValueList* _this);
00135 void
00136 Pk11Install_ValueList_AddItem(Pk11Install_ValueList* _this,
00137                               Pk11Install_Value* item);
00138 void
00139 Pk11Install_ValueList_Print(Pk11Install_ValueList* _this, int pad);
00140 
00141 
00142 /*
00144 // Pk11Install_ListIter
00146 */
00147 struct Pk11Install_ListIter_str {
00148        const Pk11Install_ValueList *list;
00149        Pk11Install_Value *current;
00150 };
00151 
00152 Pk11Install_ListIter* 
00153 Pk11Install_ListIter_new_default();
00154 void
00155 Pk11Install_ListIter_init(Pk11Install_ListIter* _this);
00156 Pk11Install_ListIter*
00157 Pk11Install_ListIter_new(const Pk11Install_ValueList* _list);
00158 void
00159 Pk11Install_ListIter_delete(Pk11Install_ListIter* _this);
00160 void
00161 Pk11Install_ListIter_reset(Pk11Install_ListIter* _this);
00162 Pk11Install_Value*
00163 Pk11Install_ListIter_nextItem(Pk11Install_ListIter* _this);
00164 
00165 /************************************************************************
00166  *
00167  * Pk11Install_File
00168  */
00169 struct Pk11Install_File_str {
00170        char *jarPath;
00171        char *relativePath;
00172        char *absolutePath;
00173        PRBool executable;
00174        int permissions;
00175 };
00176 
00177 Pk11Install_File*
00178 Pk11Install_File_new();
00179 void
00180 Pk11Install_File_init(Pk11Install_File* _this);
00181 void
00182 Pk11Install_file_delete(Pk11Install_File* _this);
00183 /*// Parses a syntax tree to obtain all attributes.
00184 // Returns NULL for success, error message if parse error.*/
00185 char*
00186 Pk11Install_File_Generate(Pk11Install_File* _this, 
00187                           const Pk11Install_Pair* pair);
00188 void
00189 Pk11Install_File_Print(Pk11Install_File* _this, int pad);
00190 void
00191 Pk11Install_File_Cleanup(Pk11Install_File* _this);
00192 
00193 /************************************************************************
00194  *
00195  * Pk11Install_PlatformName
00196  */
00197 struct Pk11Install_PlatformName_str {
00198        char *OS;
00199        char **verString;
00200        int numDigits;
00201        char *arch;
00202 };
00203 
00204 Pk11Install_PlatformName*
00205 Pk11Install_PlatformName_new();
00206 void
00207 Pk11Install_PlatformName_init(Pk11Install_PlatformName* _this);
00208 void
00209 Pk11Install_PlatformName_delete(Pk11Install_PlatformName* _this);
00210 char*
00211 Pk11Install_PlatformName_Generate(Pk11Install_PlatformName* _this,
00212                                   const char* str);
00213 char*
00214 Pk11Install_PlatformName_GetString(Pk11Install_PlatformName* _this);
00215 char*
00216 Pk11Install_PlatformName_GetVerString(Pk11Install_PlatformName* _this);
00217 void
00218 Pk11Install_PlatformName_Print(Pk11Install_PlatformName* _this, int pad);
00219 void
00220 Pk11Install_PlatformName_Cleanup(Pk11Install_PlatformName* _this);
00221 PRBool
00222 Pk11Install_PlatformName_equal(Pk11Install_PlatformName* _this,
00223                                Pk11Install_PlatformName* cmp);
00224 PRBool
00225 Pk11Install_PlatformName_lteq(Pk11Install_PlatformName* _this,
00226                               Pk11Install_PlatformName* cmp);
00227 PRBool
00228 Pk11Install_PlatformName_lt(Pk11Install_PlatformName* _this,
00229                             Pk11Install_PlatformName* cmp);
00230 
00231 /************************************************************************
00232  *
00233  * Pk11Install_Platform
00234  */
00235 struct Pk11Install_Platform_str {
00236        Pk11Install_PlatformName name;
00237        Pk11Install_PlatformName equivName;
00238        struct Pk11Install_Platform_str *equiv;
00239        PRBool usesEquiv;
00240        char *moduleFile;
00241        char *moduleName;
00242        int modFile;
00243        unsigned long mechFlags;
00244        unsigned long cipherFlags;
00245        Pk11Install_File *files;
00246        int numFiles;
00247 };
00248 
00249 Pk11Install_Platform*
00250 Pk11Install_Platform_new();
00251 void
00252 Pk11Install_Platform_init(Pk11Install_Platform* _this);
00253 void
00254 Pk11Install_Platform_delete(Pk11Install_Platform* _this);
00255 /*// Returns NULL for success, error message if parse error.*/
00256 char* 
00257 Pk11Install_Platform_Generate(Pk11Install_Platform* _this,
00258                               const Pk11Install_Pair *pair);
00259 void 
00260 Pk11Install_Platform_Print(Pk11Install_Platform* _this, int pad);
00261 void 
00262 Pk11Install_Platform_Cleanup(Pk11Install_Platform* _this);
00263 
00264 /************************************************************************
00265  *
00266  * Pk11Install_Info
00267  */
00268 struct Pk11Install_Info_str {
00269        Pk11Install_Platform *platforms;
00270        int numPlatforms;
00271        Pk11Install_PlatformName *forwardCompatible;
00272        int numForwardCompatible;
00273 };
00274 
00275 Pk11Install_Info*
00276 Pk11Install_Info_new();
00277 void
00278 Pk11Install_Info_init();
00279 void
00280 Pk11Install_Info_delete(Pk11Install_Info* _this);
00281 /*// Returns NULL for success, error message if parse error.*/
00282 char* 
00283 Pk11Install_Info_Generate(Pk11Install_Info* _this, 
00284                           const Pk11Install_ValueList *list);
00285        /*// Returns NULL if there is no matching platform*/
00286 Pk11Install_Platform* 
00287 Pk11Install_Info_GetBestPlatform(Pk11Install_Info* _this, char* myPlatform);
00288 void 
00289 Pk11Install_Info_Print(Pk11Install_Info* _this, int pad);
00290 void 
00291 Pk11Install_Info_Cleanup(Pk11Install_Info* _this);
00292 
00293 #endif /* INSTALL_DS_H */