dir.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_exists, /* exists() method */
  36. DIR_isDirectory, /* isDirectory() method */
  37. DIR_isSymLink, /* isSymLink() method */
  38. DIR_openRead, /* openRead() method */
  39. DIR_openWrite, /* openWrite() method */
  40. DIR_openAppend, /* openAppend() method */
  41. DIR_remove, /* remove() method */
  42. DIR_mkdir, /* mkdir() method */
  43. DIR_close, /* close() method */
  44. };
  45. /* This doesn't get listed, since it's technically not an archive... */
  46. #if 0
  47. const __PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
  48. {
  49. "DIR",
  50. "non-archive directory I/O"
  51. };
  52. #endif
  53. /* end of dir.c ... */