/** * cf_file.h */ #ifndef __CF_FILE_H__ #define __CF_FILE_H__ #include "cf_base.h" #include #ifdef _WIN32 # define O_RDONLY _O_RDONLY | _O_BINARY # define O_WRONLY _O_WRONLY | _O_BINARY # define O_RDWR _O_RDWR | _O_BINARY # define O_APPEND _O_APPEND | _O_BINARY # define O_CREAT _O_CREAT | _O_BINARY # define O_TRUNC _O_TRUNC #endif // #ifdef _WIN32 #define CF_ERROR_FILE CF_ERROR_BASE * 2 #define CF_ERROR_FILE_OPEN CF_ERROR_FILE - 1 #define CF_ERROR_FILE_INVALID_ARGS CF_ERROR_FILE - 2 #define CF_ERROR_FILE_READ CF_ERROR_FILE - 3 #define CF_ERROR_FILE_WRITE CF_ERROR_FILE - 4 #define CF_ERROR_FILE_CREATE CF_ERROR_FILE - 5 #define CF_ERROR_FILE_CLOSE CF_ERROR_FILE - 6 #define CF_ERROR_FILE_GET_SIZE CF_ERROR_FILE - 7 #ifdef __cplusplus extern "C" { #endif CF_EXPORT int CF_File_Open (const char * path, const int flag); CF_EXPORT int CF_FILE_Close (const int fd); CF_EXPORT int CF_File_Create (const char * path); CF_EXPORT int CF_File_Read (const int fd, void * buf, const size_t len); CF_EXPORT int CF_File_Write (const int fd, const void * buf, const size_t len); CF_EXPORT int CF_File_GetSize (const int fd); #ifdef __cplusplus } #endif #endif // #ifndef __CF_FILE_H__