source: libcf/trunk/include/cf_file.h@ 4

Last change on this file since 4 was 4, checked in by cheese, 11 years ago

#1 로깅을 제외한 기본 코드 커밋

File size: 1.3 KB
Line 
1/**
2 * cf_file.h
3 */
4#ifndef __CF_FILE_H__
5#define __CF_FILE_H__
6
7#include "cf_base.h"
8#include <fcntl.h>
9
10#ifdef _WIN32
11# define O_RDONLY _O_RDONLY | _O_BINARY
12# define O_WRONLY _O_WRONLY | _O_BINARY
13# define O_RDWR _O_RDWR | _O_BINARY
14# define O_APPEND _O_APPEND | _O_BINARY
15# define O_CREAT _O_CREAT | _O_BINARY
16# define O_TRUNC _O_TRUNC
17#endif // #ifdef _WIN32
18
19#define CF_ERROR_FILE CF_ERROR_BASE * 2
20
21#define CF_ERROR_FILE_OPEN CF_ERROR_FILE - 1
22#define CF_ERROR_FILE_INVALID_ARGS CF_ERROR_FILE - 2
23#define CF_ERROR_FILE_READ CF_ERROR_FILE - 3
24#define CF_ERROR_FILE_WRITE CF_ERROR_FILE - 4
25#define CF_ERROR_FILE_CREATE CF_ERROR_FILE - 5
26#define CF_ERROR_FILE_CLOSE CF_ERROR_FILE - 6
27#define CF_ERROR_FILE_GET_SIZE CF_ERROR_FILE - 7
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33CF_EXPORT int
34CF_File_Open (const char * path,
35 const int flag);
36
37CF_EXPORT int
38CF_FILE_Close (const int fd);
39
40CF_EXPORT int
41CF_File_Create (const char * path);
42
43CF_EXPORT int
44CF_File_Read (const int fd,
45 void * buf,
46 const size_t len);
47
48CF_EXPORT int
49CF_File_Write (const int fd,
50 const void * buf,
51 const size_t len);
52
53CF_EXPORT int
54CF_File_GetSize (const int fd);
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif // #ifndef __CF_FILE_H__
Note: See TracBrowser for help on using the repository browser.