zip.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * ZIP support routines for PhysicsFS.
  3. *
  4. * Please see the file LICENSE in the source's root directory.
  5. *
  6. * This file written by Ryan C. Gordon.
  7. */
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #define __PHYSICSFS_INTERNAL__
  11. #include "physfs_internal.h"
  12. #if (!defined PHYSFS_SUPPORTS_ZIP)
  13. #error PHYSFS_SUPPORTS_ZIP must be defined.
  14. #endif
  15. static const FileFunctions __PHYSFS_FileHandle_ZIP =
  16. {
  17. ZIP_read, /* read() method */
  18. NULL, /* write() method */
  19. ZIP_eof, /* eof() method */
  20. ZIP_tell, /* tell() method */
  21. ZIP_seek, /* seek() method */
  22. ZIP_close, /* close() method */
  23. };
  24. const DirFunctions __PHYSFS_DirFunctions_ZIP =
  25. {
  26. ZIP_isArchive, /* isArchive() method */
  27. ZIP_openArchive, /* openArchive() method */
  28. ZIP_enumerate, /* enumerateFiles() method */
  29. ZIP_exists, /* exists() method */
  30. ZIP_isDirectory, /* isDirectory() method */
  31. ZIP_isSymLink, /* isSymLink() method */
  32. ZIP_openRead, /* openRead() method */
  33. NULL, /* openWrite() method */
  34. NULL, /* openAppend() method */
  35. NULL, /* remove() method */
  36. NULL, /* mkdir() method */
  37. ZIP_close, /* close() method */
  38. };
  39. const __PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
  40. {
  41. "ZIP",
  42. "PkZip/WinZip/Info-Zip compatible"
  43. };
  44. /* end of zip.c ... */