zip.c 2.7 KB

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