_FindFirst.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ///
  2. /// Original file by the_viking, fixed by Rômulo Fernandes
  3. /// Should emulate windows finddata structure
  4. ///
  5. #ifndef GCC_FINDFIRST_H
  6. #define GCC_FINDFIRST_H
  7. #if (defined(__GNUC__) || defined(__ARMCC_VERSION) || defined(__GCCXML__) || defined(__S3E__) ) && !defined(__WIN32)
  8. #include <dirent.h>
  9. #include "RakString.h"
  10. #define _A_NORMAL 0x00 // Normal file
  11. #define _A_RDONLY 0x01 // Read-only file
  12. #define _A_HIDDEN 0x02 // Hidden file
  13. #define _A_SYSTEM 0x04 // System file
  14. #define _A_VOLID 0x08 // Volume ID
  15. #define _A_SUBDIR 0x10 // Subdirectory
  16. #define _A_ARCH 0x20 // File changed since last archive
  17. #define FA_NORMAL 0x00 // Synonym of _A_NORMAL
  18. #define FA_RDONLY 0x01 // Synonym of _A_RDONLY
  19. #define FA_HIDDEN 0x02 // Synonym of _A_HIDDEN
  20. #define FA_SYSTEM 0x04 // Synonym of _A_SYSTEM
  21. #define FA_LABEL 0x08 // Synonym of _A_VOLID
  22. #define FA_DIREC 0x10 // Synonym of _A_SUBDIR
  23. #define FA_ARCH 0x20 // Synonym of _A_ARCH
  24. const unsigned STRING_BUFFER_SIZE = 512;
  25. typedef struct _finddata_t
  26. {
  27. char name[STRING_BUFFER_SIZE];
  28. int attrib;
  29. unsigned long size;
  30. } _finddata;
  31. /**
  32. * Hold information about the current search
  33. */
  34. typedef struct _findinfo_t
  35. {
  36. DIR* openedDir;
  37. RakNet::RakString filter;
  38. RakNet::RakString dirName;
  39. } _findinfo;
  40. long _findfirst(const char *name, _finddata_t *f);
  41. int _findnext(long h, _finddata_t *f);
  42. int _findclose(long h);
  43. #endif
  44. #endif
粤ICP备19079148号