dir.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. /* template for filehandles. */
  13. const FileHandle __PHYSFS_FileHandle_DIR =
  14. {
  15. NULL, /* opaque */
  16. NULL, /* dirReader */
  17. DIR_read, /* read() method */
  18. NULL, /* write() method */
  19. DIR_eof, /* eof() method */
  20. DIR_tell, /* tell() method */
  21. DIR_seek, /* seek() method */
  22. DIR_close, /* close() method */
  23. };
  24. /* template for directories. */
  25. const DirReader __PHYSFS_DirReader_DIR =
  26. {
  27. NULL, /* opaque */
  28. DIR_enumerate, /* enumerateFiles() method */
  29. DIR_isDirectory, /* isDirectory() method */
  30. DIR_isSymLink, /* isSymLink() method */
  31. DIR_isOpenable, /* isOpenable() method */
  32. DIR_openRead, /* openRead() method */
  33. DIR_dirClose, /* close() method */
  34. };
  35. /* This doesn't get listed, since it's technically not an archive... */
  36. #if 0
  37. const __PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
  38. {
  39. "DIR",
  40. "non-archive directory I/O"
  41. };
  42. #endif
  43. /* end of dir.c ... */