michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef INSTALL_DS_H michael@0: #define INSTALL_DS_H michael@0: michael@0: #include michael@0: #include michael@0: #include michael@0: michael@0: extern PRFileDesc *Pk11Install_FD; michael@0: extern int Pk11Install_yylex(); michael@0: extern int Pk11Install_yylinenum; michael@0: extern char *Pk11Install_yyerrstr; michael@0: michael@0: typedef enum { STRING_VALUE, PAIR_VALUE } ValueType; michael@0: michael@0: typedef struct Pk11Install_Pair_str Pk11Install_Pair; michael@0: typedef union Pk11Install_Pointer_str Pk11Install_Pointer; michael@0: typedef struct Pk11Install_Value_str Pk11Install_Value; michael@0: typedef struct Pk11Install_ValueList_str Pk11Install_ValueList; michael@0: typedef struct Pk11Install_ListIter_str Pk11Install_ListIter; michael@0: typedef struct Pk11Install_File_str Pk11Install_File; michael@0: typedef struct Pk11Install_PlatformName_str Pk11Install_PlatformName; michael@0: typedef struct Pk11Install_Platform_str Pk11Install_Platform; michael@0: typedef struct Pk11Install_Info_str Pk11Install_Info; michael@0: michael@0: extern Pk11Install_Pointer Pk11Install_yylval; michael@0: extern Pk11Install_ValueList* Pk11Install_valueList; michael@0: michael@0: /* michael@0: ////////////////////////////////////////////////////////////////////////// michael@0: // Pk11Install_Pair michael@0: ////////////////////////////////////////////////////////////////////////// michael@0: */ michael@0: michael@0: struct Pk11Install_Pair_str { michael@0: char * key; michael@0: Pk11Install_ValueList *list; michael@0: michael@0: }; michael@0: michael@0: Pk11Install_Pair* michael@0: Pk11Install_Pair_new_default(); michael@0: Pk11Install_Pair* michael@0: Pk11Install_Pair_new( char* _key, Pk11Install_ValueList* _list); michael@0: void michael@0: Pk11Install_Pair_delete(Pk11Install_Pair* _this); michael@0: void michael@0: Pk11Install_Pair_Print(Pk11Install_Pair* _this, int pad); michael@0: michael@0: /* michael@0: ////////////////////////////////////////////////////////////////////////// michael@0: // Pk11Install_Pointer michael@0: ////////////////////////////////////////////////////////////////////////// michael@0: */ michael@0: union Pk11Install_Pointer_str { michael@0: Pk11Install_ValueList *list; michael@0: Pk11Install_Value *value; michael@0: Pk11Install_Pair *pair; michael@0: char *string; michael@0: }; michael@0: michael@0: /* michael@0: ////////////////////////////////////////////////////////////////////////// michael@0: // Pk11Install_Value michael@0: ////////////////////////////////////////////////////////////////////////// michael@0: */ michael@0: struct Pk11Install_Value_str { michael@0: michael@0: ValueType type; michael@0: char *string; michael@0: Pk11Install_Pair *pair; michael@0: struct Pk11Install_Value_str *next; michael@0: }; michael@0: michael@0: Pk11Install_Value* michael@0: Pk11Install_Value_new_default(); michael@0: Pk11Install_Value* michael@0: Pk11Install_Value_new(ValueType _type, Pk11Install_Pointer ptr); michael@0: void michael@0: Pk11Install_Value_delete(Pk11Install_Value* _this); michael@0: void michael@0: Pk11Install_Value_Print(Pk11Install_Value* _this, int pad); michael@0: michael@0: /* michael@0: ////////////////////////////////////////////////////////////////////////// michael@0: // Pk11Install_ValueList michael@0: ////////////////////////////////////////////////////////////////////////// michael@0: */ michael@0: struct Pk11Install_ValueList_str { michael@0: int numItems; michael@0: int numPairs; michael@0: int numStrings; michael@0: Pk11Install_Value *head; michael@0: }; michael@0: michael@0: Pk11Install_ValueList* michael@0: Pk11Install_ValueList_new(); michael@0: void michael@0: Pk11Install_ValueList_delete(Pk11Install_ValueList* _this); michael@0: void michael@0: Pk11Install_ValueList_AddItem(Pk11Install_ValueList* _this, michael@0: Pk11Install_Value* item); michael@0: void michael@0: Pk11Install_ValueList_Print(Pk11Install_ValueList* _this, int pad); michael@0: michael@0: michael@0: /* michael@0: ////////////////////////////////////////////////////////////////////////// michael@0: // Pk11Install_ListIter michael@0: ////////////////////////////////////////////////////////////////////////// michael@0: */ michael@0: struct Pk11Install_ListIter_str { michael@0: const Pk11Install_ValueList *list; michael@0: Pk11Install_Value *current; michael@0: }; michael@0: michael@0: Pk11Install_ListIter* michael@0: Pk11Install_ListIter_new_default(); michael@0: void michael@0: Pk11Install_ListIter_init(Pk11Install_ListIter* _this); michael@0: Pk11Install_ListIter* michael@0: Pk11Install_ListIter_new(const Pk11Install_ValueList* _list); michael@0: void michael@0: Pk11Install_ListIter_delete(Pk11Install_ListIter* _this); michael@0: void michael@0: Pk11Install_ListIter_reset(Pk11Install_ListIter* _this); michael@0: Pk11Install_Value* michael@0: Pk11Install_ListIter_nextItem(Pk11Install_ListIter* _this); michael@0: michael@0: /************************************************************************ michael@0: * michael@0: * Pk11Install_File michael@0: */ michael@0: struct Pk11Install_File_str { michael@0: char *jarPath; michael@0: char *relativePath; michael@0: char *absolutePath; michael@0: PRBool executable; michael@0: int permissions; michael@0: }; michael@0: michael@0: Pk11Install_File* michael@0: Pk11Install_File_new(); michael@0: void michael@0: Pk11Install_File_init(Pk11Install_File* _this); michael@0: void michael@0: Pk11Install_file_delete(Pk11Install_File* _this); michael@0: /*// Parses a syntax tree to obtain all attributes. michael@0: // Returns NULL for success, error message if parse error.*/ michael@0: char* michael@0: Pk11Install_File_Generate(Pk11Install_File* _this, michael@0: const Pk11Install_Pair* pair); michael@0: void michael@0: Pk11Install_File_Print(Pk11Install_File* _this, int pad); michael@0: void michael@0: Pk11Install_File_Cleanup(Pk11Install_File* _this); michael@0: michael@0: /************************************************************************ michael@0: * michael@0: * Pk11Install_PlatformName michael@0: */ michael@0: struct Pk11Install_PlatformName_str { michael@0: char *OS; michael@0: char **verString; michael@0: int numDigits; michael@0: char *arch; michael@0: }; michael@0: michael@0: Pk11Install_PlatformName* michael@0: Pk11Install_PlatformName_new(); michael@0: void michael@0: Pk11Install_PlatformName_init(Pk11Install_PlatformName* _this); michael@0: void michael@0: Pk11Install_PlatformName_delete(Pk11Install_PlatformName* _this); michael@0: char* michael@0: Pk11Install_PlatformName_Generate(Pk11Install_PlatformName* _this, michael@0: const char* str); michael@0: char* michael@0: Pk11Install_PlatformName_GetString(Pk11Install_PlatformName* _this); michael@0: char* michael@0: Pk11Install_PlatformName_GetVerString(Pk11Install_PlatformName* _this); michael@0: void michael@0: Pk11Install_PlatformName_Print(Pk11Install_PlatformName* _this, int pad); michael@0: void michael@0: Pk11Install_PlatformName_Cleanup(Pk11Install_PlatformName* _this); michael@0: PRBool michael@0: Pk11Install_PlatformName_equal(Pk11Install_PlatformName* _this, michael@0: Pk11Install_PlatformName* cmp); michael@0: PRBool michael@0: Pk11Install_PlatformName_lteq(Pk11Install_PlatformName* _this, michael@0: Pk11Install_PlatformName* cmp); michael@0: PRBool michael@0: Pk11Install_PlatformName_lt(Pk11Install_PlatformName* _this, michael@0: Pk11Install_PlatformName* cmp); michael@0: michael@0: /************************************************************************ michael@0: * michael@0: * Pk11Install_Platform michael@0: */ michael@0: struct Pk11Install_Platform_str { michael@0: Pk11Install_PlatformName name; michael@0: Pk11Install_PlatformName equivName; michael@0: struct Pk11Install_Platform_str *equiv; michael@0: PRBool usesEquiv; michael@0: char *moduleFile; michael@0: char *moduleName; michael@0: int modFile; michael@0: unsigned long mechFlags; michael@0: unsigned long cipherFlags; michael@0: Pk11Install_File *files; michael@0: int numFiles; michael@0: }; michael@0: michael@0: Pk11Install_Platform* michael@0: Pk11Install_Platform_new(); michael@0: void michael@0: Pk11Install_Platform_init(Pk11Install_Platform* _this); michael@0: void michael@0: Pk11Install_Platform_delete(Pk11Install_Platform* _this); michael@0: /*// Returns NULL for success, error message if parse error.*/ michael@0: char* michael@0: Pk11Install_Platform_Generate(Pk11Install_Platform* _this, michael@0: const Pk11Install_Pair *pair); michael@0: void michael@0: Pk11Install_Platform_Print(Pk11Install_Platform* _this, int pad); michael@0: void michael@0: Pk11Install_Platform_Cleanup(Pk11Install_Platform* _this); michael@0: michael@0: /************************************************************************ michael@0: * michael@0: * Pk11Install_Info michael@0: */ michael@0: struct Pk11Install_Info_str { michael@0: Pk11Install_Platform *platforms; michael@0: int numPlatforms; michael@0: Pk11Install_PlatformName *forwardCompatible; michael@0: int numForwardCompatible; michael@0: }; michael@0: michael@0: Pk11Install_Info* michael@0: Pk11Install_Info_new(); michael@0: void michael@0: Pk11Install_Info_init(); michael@0: void michael@0: Pk11Install_Info_delete(Pk11Install_Info* _this); michael@0: /*// Returns NULL for success, error message if parse error.*/ michael@0: char* michael@0: Pk11Install_Info_Generate(Pk11Install_Info* _this, michael@0: const Pk11Install_ValueList *list); michael@0: /*// Returns NULL if there is no matching platform*/ michael@0: Pk11Install_Platform* michael@0: Pk11Install_Info_GetBestPlatform(Pk11Install_Info* _this, char* myPlatform); michael@0: void michael@0: Pk11Install_Info_Print(Pk11Install_Info* _this, int pad); michael@0: void michael@0: Pk11Install_Info_Cleanup(Pk11Install_Info* _this); michael@0: michael@0: #endif /* INSTALL_DS_H */