/PC/bdist_wininst/archive.h

http://unladen-swallow.googlecode.com/ · C++ Header · 105 lines · 75 code · 17 blank · 13 comment · 0 complexity · b57f29b4455f3fcdf09beb7f13de177a MD5 · raw file

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