Unzip.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Copyright (c) 2002-2012 Croteam Ltd.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of version 2 of the GNU General Public License as published by
  4. the Free Software Foundation
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along
  10. with this program; if not, write to the Free Software Foundation, Inc.,
  11. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
  12. #ifndef SE_INCL_UNZIP_H
  13. #define SE_INCL_UNZIP_H
  14. #ifdef PRAGMA_ONCE
  15. #pragma once
  16. #endif
  17. // add one zip archive to current active set
  18. void UNZIPAddArchive(const CTFileName &fnm);
  19. // read directories of all currently added archives, in reverse alphabetical order
  20. void UNZIPReadDirectoriesReverse_t(void);
  21. // check if a zip file entry exists
  22. BOOL UNZIPFileExists(const CTFileName &fnm);
  23. // open a zip file entry for reading
  24. INDEX UNZIPOpen_t(const CTFileName &fnm);
  25. // get uncompressed size of a file
  26. SLONG UNZIPGetSize(INDEX iHandle);
  27. // get CRC of a file
  28. ULONG UNZIPGetCRC(INDEX iHandle);
  29. // read a block from zip file
  30. void UNZIPReadBlock_t(INDEX iHandle, UBYTE *pub, SLONG slStart, SLONG slLen);
  31. // close a zip file entry
  32. void UNZIPClose(INDEX iHandle);
  33. // get info on a zip file entry
  34. void UNZIPGetFileInfo(INDEX iHandle, CTFileName &fnmZip,
  35. SLONG &slOffset, SLONG &slSizeCompressed, SLONG &slSizeUncompressed,
  36. BOOL &bCompressed);
  37. // enumeration for all files in all zips
  38. INDEX UNZIPGetFileCount(void);
  39. const CTFileName &UNZIPGetFileAtIndex(INDEX i);
  40. // get index of a file (-1 for no file)
  41. INDEX UNZIPGetFileIndex(const CTFileName &fnm);
  42. // check if a file is from a mod's zip
  43. BOOL UNZIPIsFileAtIndexMod(INDEX i);
  44. #endif /* include-once check. */