lfs.h 693 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. ** LuaFileSystem
  3. ** Copyright Kepler Project 2003 - 2017 (http://keplerproject.github.io/luafilesystem)
  4. */
  5. /* Define 'chdir' for systems that do not implement it */
  6. #ifdef NO_CHDIR
  7. #define chdir(p) (-1)
  8. #define chdir_error "Function 'chdir' not provided by system"
  9. #else
  10. #define chdir_error strerror(errno)
  11. #endif
  12. #ifdef _WIN32
  13. #define chdir(p) (_chdir(p))
  14. #define getcwd(d, s) (_getcwd(d, s))
  15. #define rmdir(p) (_rmdir(p))
  16. #define LFS_EXPORT __declspec (dllexport)
  17. #ifndef fileno
  18. #define fileno(f) (_fileno(f))
  19. #endif
  20. #else
  21. #define LFS_EXPORT
  22. #endif
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. LFS_EXPORT int luaopen_lfs (lua_State *L);
  27. #ifdef __cplusplus
  28. }
  29. #endif