1 /* 2 IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST 3 BE REBUILT AS WELL. 4 5 IF CHANGES TO THIS FILE ARE CHECKED IN, THE RECOMPILED BINARIES MUST BE 6 CHECKED IN AS WELL! 7 */ 8 9 #pragma pack(1) 10 11 /* zip-archive headers 12 * See: http://www.pkware.com/appnote.html 13 */ 14 15 struct eof_cdir { 16 long tag; /* must be 0x06054b50 */ 17 short disknum; 18 short firstdisk; 19 short nTotalCDirThis; 20 short nTotalCDir; 21 long nBytesCDir; 22 long ofsCDir; 23 short commentlen; 24 }; 25 26 struct cdir { 27 long tag; /* must be 0x02014b50 */ 28 short version_made; 29 short version_extract; 30 short gp_bitflag; 31 short comp_method; 32 short last_mod_file_time; 33 short last_mod_file_date; 34 long crc32; 35 long comp_size; 36 long uncomp_size; 37 short fname_length; 38 short extra_length; 39 short comment_length; 40 short disknum_start; 41 short int_file_attr; 42 long ext_file_attr; 43 long ofs_local_header; 44 }; 45 46 struct fhdr { 47 long tag; /* must be 0x04034b50 */ 48 short version_needed; 49 short flags; 50 short method; 51 short last_mod_file_time; 52 short last_mod_file_date; 53 long crc32; 54 long comp_size; 55 long uncomp_size; 56 short fname_length; 57 short extra_length; 58 }; 59 60 61 struct meta_data_hdr { 62 int tag; 63 int uncomp_size; 64 int bitmap_size; 65 }; 66 67 #pragma pack() 68 69 /* installation scheme */ 70 71 typedef struct tagSCHEME { 72 char *name; 73 char *prefix; 74 } SCHEME; 75 76 typedef int (*NOTIFYPROC)(int code, LPSTR text, ...); 77 78 extern BOOL 79 extract_file(char *dst, char *src, int method, int comp_size, 80 int uncomp_size, NOTIFYPROC notify); 81 82 extern BOOL 83 unzip_archive(SCHEME *scheme, char *dirname, char *data, 84 DWORD size, NOTIFYPROC notify); 85 86 extern char * 87 map_new_file(DWORD flags, char *filename, char 88 *pathname_part, int size, 89 WORD wFatDate, WORD wFatTime, 90 NOTIFYPROC callback); 91 92 extern BOOL 93 ensure_directory (char *pathname, char *new_part, 94 NOTIFYPROC callback); 95 96 /* codes for NOITIFYPROC */ 97 #define DIR_CREATED 1 98 #define CAN_OVERWRITE 2 99 #define FILE_CREATED 3 100 #define ZLIB_ERROR 4 101 #define SYSTEM_ERROR 5 102 #define NUM_FILES 6 103 #define FILE_OVERWRITTEN 7 104 105