#ifndef RAY_FILEIO_H
#define RAY_FILEIO_H
#include "core/platform.h"
#ifdef RAY_OS_WINDOWS
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
typedef HANDLE ray_fd_t;
#define RAY_FD_INVALID INVALID_HANDLE_VALUE
#else
typedef int ray_fd_t;
#define RAY_FD_INVALID (-1)
#endif
#define RAY_OPEN_READ 0x01
#define RAY_OPEN_WRITE 0x02
#define RAY_OPEN_CREATE 0x04
ray_fd_t ray_file_open(const char* path, int flags);
void ray_file_close(ray_fd_t fd);
ray_err_t ray_file_lock_ex(ray_fd_t fd);
ray_err_t ray_file_lock_sh(ray_fd_t fd);
ray_err_t ray_file_unlock(ray_fd_t fd);
ray_err_t ray_file_sync(ray_fd_t fd);
ray_err_t ray_file_sync_dir(const char* path);
ray_err_t ray_file_rename(const char* old_path, const char* new_path);
ray_err_t ray_mkdir(const char* path);
ray_err_t ray_mkdir_p(const char* path);
#endif