SSZipCommon.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef SSZipCommon
  2. #define SSZipCommon
  3. // typedefs moved from mz_compat.h to here for public access
  4. /* unz_global_info structure contain global data about the ZIPfile
  5. These data comes from the end of central dir */
  6. typedef struct unz_global_info64_s
  7. {
  8. uint64_t number_entry; /* total number of entries in the central dir on this disk */
  9. uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP */
  10. uint16_t size_comment; /* size of the global comment of the zipfile */
  11. } unz_global_info64;
  12. typedef struct unz_global_info_s
  13. {
  14. uint32_t number_entry; /* total number of entries in the central dir on this disk */
  15. uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP */
  16. uint16_t size_comment; /* size of the global comment of the zipfile */
  17. } unz_global_info;
  18. /* unz_file_info contain information about a file in the zipfile */
  19. /* https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT */
  20. typedef struct unz_file_info64_s
  21. {
  22. uint16_t version; /* version made by 2 bytes */
  23. uint16_t version_needed; /* version needed to extract 2 bytes */
  24. uint16_t flag; /* general purpose bit flag 2 bytes */
  25. uint16_t compression_method; /* compression method 2 bytes */
  26. uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */
  27. uint32_t crc; /* crc-32 4 bytes */
  28. uint64_t compressed_size; /* compressed size 8 bytes */
  29. uint64_t uncompressed_size; /* uncompressed size 8 bytes */
  30. uint16_t size_filename; /* filename length 2 bytes */
  31. uint16_t size_file_extra; /* extra field length 2 bytes */
  32. uint16_t size_file_comment; /* file comment length 2 bytes */
  33. uint32_t disk_num_start; /* disk number start 4 bytes */
  34. uint16_t internal_fa; /* internal file attributes 2 bytes */
  35. uint32_t external_fa; /* external file attributes 4 bytes */
  36. uint64_t disk_offset;
  37. uint16_t size_file_extra_internal;
  38. } unz_file_info64;
  39. typedef struct unz_file_info_s
  40. {
  41. uint16_t version; /* version made by 2 bytes */
  42. uint16_t version_needed; /* version needed to extract 2 bytes */
  43. uint16_t flag; /* general purpose bit flag 2 bytes */
  44. uint16_t compression_method; /* compression method 2 bytes */
  45. uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */
  46. uint32_t crc; /* crc-32 4 bytes */
  47. uint32_t compressed_size; /* compressed size 4 bytes */
  48. uint32_t uncompressed_size; /* uncompressed size 4 bytes */
  49. uint16_t size_filename; /* filename length 2 bytes */
  50. uint16_t size_file_extra; /* extra field length 2 bytes */
  51. uint16_t size_file_comment; /* file comment length 2 bytes */
  52. uint16_t disk_num_start; /* disk number start 2 bytes */
  53. uint16_t internal_fa; /* internal file attributes 2 bytes */
  54. uint32_t external_fa; /* external file attributes 4 bytes */
  55. uint64_t disk_offset;
  56. } unz_file_info;
  57. #endif