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
|
---|
30 | extern "C" {
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | CF_EXPORT int
|
---|
34 | CF_File_Open (const char * path,
|
---|
35 | const int flag);
|
---|
36 |
|
---|
37 | CF_EXPORT int
|
---|
38 | CF_FILE_Close (const int fd);
|
---|
39 |
|
---|
40 | CF_EXPORT int
|
---|
41 | CF_File_Create (const char * path);
|
---|
42 |
|
---|
43 | CF_EXPORT int
|
---|
44 | CF_File_Read (const int fd,
|
---|
45 | void * buf,
|
---|
46 | const size_t len);
|
---|
47 |
|
---|
48 | CF_EXPORT int
|
---|
49 | CF_File_Write (const int fd,
|
---|
50 | const void * buf,
|
---|
51 | const size_t len);
|
---|
52 |
|
---|
53 | CF_EXPORT int
|
---|
54 | CF_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.