File-c-api.h 999 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "OSGlobalEnums.h"
  3. #if defined(__cplusplus)
  4. #include "os/ErrorCodes.h"
  5. #include "os/File.h"
  6. typedef il2cpp::os::FileHandle UnityPalFileHandle;
  7. #else
  8. typedef struct UnityPalFileHandle UnityPalFileHandle;
  9. #endif //__cplusplus
  10. typedef struct
  11. {
  12. char* name;
  13. int32_t attributes;
  14. int64_t length;
  15. int64_t creation_time;
  16. int64_t last_access_time;
  17. int64_t last_write_time;
  18. } UnityPalFileStat;
  19. #if defined(__cplusplus)
  20. extern "C"
  21. {
  22. #endif
  23. UnityPalFileAttributes UnityPalGetFileAttributes(const char* path, int* error);
  24. int32_t UnityPalGetFileStat(const char* path, UnityPalFileStat * stat, int* error);
  25. UnityPalFileHandle* UnityPalOpen(const char* path, int openMode, int accessMode, int shareMode, int options, int *error);
  26. int32_t UnityPalClose(UnityPalFileHandle* handle, int *error);
  27. int UnityPalRead(UnityPalFileHandle* handle, char *dest, int count, int *error);
  28. int32_t UnityPalIsExecutable(const char* filename);
  29. #if defined(__cplusplus)
  30. }
  31. #endif