dir.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Standard directory I/O 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. static const FileFunctions __PHYSFS_FileHandle_DIR =
  13. {
  14. DIR_read, /* read() method */
  15. NULL, /* write() method */
  16. DIR_eof, /* eof() method */
  17. DIR_tell, /* tell() method */
  18. DIR_seek, /* seek() method */
  19. DIR_close, /* close() method */
  20. };
  21. static const FileFunctions __PHYSFS_FileHandle_DIRW =
  22. {
  23. NULL, /* read() method */
  24. DIR_write, /* write() method */
  25. DIR_eof, /* eof() method */
  26. DIR_tell, /* tell() method */
  27. DIR_seek, /* seek() method */
  28. DIR_close, /* close() method */
  29. };
  30. const DirFunctions __PHYSFS_DirFunctions_DIR =
  31. {
  32. DIR_isArchive, /* isArchive() method */
  33. DIR_openArchive, /* openArchive() method */
  34. DIR_enumerate, /* enumerateFiles() method */
  35. DIR_isDirectory, /* isDirectory() method */
  36. DIR_isSymLink, /* isSymLink() method */
  37. DIR_isOpenable, /* isOpenable() method */
  38. DIR_openRead, /* openRead() method */
  39. DIR_openWrite, /* openWrite() method */
  40. DIR_dirClose, /* close() method */
  41. };
  42. /* This doesn't get listed, since it's technically not an archive... */
  43. #if 0
  44. const __PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
  45. {
  46. "DIR",
  47. "non-archive directory I/O"
  48. };
  49. #endif
  50. /* end of dir.c ... */