zip.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. extern const DirFunctions __PHYSFS_DirFunctions_ZIP;
  16. extern const FileFunctions __PHYSFS_FileHandle_ZIP;
  17. static int ZIP_read(FileHandle *handle, void *buffer,
  18. unsigned int objSize, unsigned int objCount)
  19. {
  20. } /* ZIP_read */
  21. static int ZIP_eof(FileHandle *handle)
  22. {
  23. } /* ZIP_eof */
  24. static int ZIP_tell(FileHandle *handle)
  25. {
  26. } /* ZIP_tell */
  27. static int ZIP_seek(FileHandle *handle, int offset)
  28. {
  29. } /* ZIP_seek */
  30. static int ZIP_fileClose(FileHandle *handle)
  31. {
  32. } /* ZIP_fileClose */
  33. static int ZIP_isArchive(const char *filename, int forWriting)
  34. {
  35. } /* ZIP_isArchive */
  36. static DirHandle *ZIP_openArchive(const char *name, int forWriting)
  37. {
  38. } /* ZIP_openArchive */
  39. static LinkedStringList *ZIP_enumerateFiles(DirHandle *h, const char *dirname)
  40. {
  41. } /* ZIP_enumerateFiles */
  42. static int ZIP_exists(DirHandle *h, const char *name)
  43. {
  44. } /* ZIP_exists */
  45. static int ZIP_isDirectory(DirHandle *h, const char *name)
  46. {
  47. } /* ZIP_isDirectory */
  48. static int ZIP_isSymLink(DirHandle *h, const char *name)
  49. {
  50. } /* ZIP_isSymLink */
  51. static FileHandle *ZIP_openRead(DirHandle *h, const char *filename)
  52. {
  53. } /* ZIP_openRead */
  54. static void ZIP_dirClose(DirHandle *h)
  55. {
  56. } /* ZIP_dirClose */
  57. static const FileFunctions __PHYSFS_FileFunctions_ZIP =
  58. {
  59. ZIP_read, /* read() method */
  60. NULL, /* write() method */
  61. ZIP_eof, /* eof() method */
  62. ZIP_tell, /* tell() method */
  63. ZIP_seek, /* seek() method */
  64. ZIP_fileClose, /* fileClose() method */
  65. };
  66. const DirFunctions __PHYSFS_DirFunctions_ZIP =
  67. {
  68. ZIP_isArchive, /* isArchive() method */
  69. ZIP_openArchive, /* openArchive() method */
  70. ZIP_enumerateFiles, /* enumerateFiles() method */
  71. ZIP_exists, /* exists() method */
  72. ZIP_isDirectory, /* isDirectory() method */
  73. ZIP_isSymLink, /* isSymLink() method */
  74. ZIP_openRead, /* openRead() method */
  75. NULL, /* openWrite() method */
  76. NULL, /* openAppend() method */
  77. NULL, /* remove() method */
  78. NULL, /* mkdir() method */
  79. ZIP_dirClose, /* dirClose() method */
  80. };
  81. const __PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
  82. {
  83. "ZIP",
  84. "PkZip/WinZip/Info-Zip compatible"
  85. };
  86. /* end of zip.c ... */