home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Programming / Python2 / Python20_source / Misc / distutils / archive.h next >
Encoding:
C/C++ Source or Header  |  2000-10-25  |  1.7 KB  |  80 lines

  1. #pragma pack(1)
  2.  
  3. /* zip-archive headers
  4.  * See: http://www.pkware.com/appnote.html
  5.  */
  6.  
  7. struct eof_cdir {
  8.     long tag;    /* must be 0x06054b50 */
  9.     short disknum;
  10.     short firstdisk;
  11.     short nTotalCDirThis;
  12.     short nTotalCDir;
  13.     long nBytesCDir;
  14.     long ofsCDir;
  15.     short commentlen;
  16. };
  17.  
  18. struct cdir {
  19.     long tag;    /* must be 0x02014b50 */
  20.     short version_made;
  21.     short version_extract;
  22.     short gp_bitflag;
  23.     short comp_method;
  24.     short last_mod_file_time;
  25.     short last_mod_file_date;
  26.     long crc32;
  27.     long comp_size;
  28.     long uncomp_size;
  29.     short fname_length;
  30.     short extra_length;
  31.     short comment_length;
  32.     short disknum_start;
  33.     short int_file_attr;
  34.     long ext_file_attr;
  35.     long ofs_local_header;
  36. };
  37.  
  38. struct fhdr {
  39.     long tag;    /* must be 0x04034b50 */
  40.     short version_needed;
  41.     short flags;
  42.     short method;
  43.     short last_mod_file_time;
  44.     short last_mod_file_date;
  45.     long crc32;
  46.     long comp_size;
  47.     long uncomp_size;
  48.     short fname_length;
  49.     short extra_length;
  50. };
  51.  
  52.  
  53. struct meta_data_hdr {
  54.     int tag;
  55.     int uncomp_size;
  56. };
  57.  
  58. #pragma pack()
  59.  
  60. typedef int (*NOTIFYPROC)(int code, LPSTR text, ...);
  61.  
  62. extern BOOL extract_file (char *dst, char *src, int method, int comp_size,
  63.               int uncomp_size, NOTIFYPROC notify);
  64. extern BOOL unzip_archive (char *dirname, char *data, DWORD size,
  65.                NOTIFYPROC callback);
  66. extern char *map_new_file (DWORD flags, char *filename, char
  67.                *pathname_part, int size,
  68.                WORD wFatDate, WORD wFatTime,
  69.                NOTIFYPROC callback);
  70. extern BOOL ensure_directory (char *pathname, char *new_part,
  71.                   NOTIFYPROC callback);
  72.  
  73. #define DIR_CREATED 1
  74. #define CAN_OVERWRITE 2
  75. #define FILE_CREATED 3
  76. #define ZLIB_ERROR 4
  77. #define SYSTEM_ERROR 5
  78. #define NUM_FILES 6
  79. #define FILE_OVERWRITTEN 7
  80.