Rev | Line | |
---|
[4] | 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 | #define CF_ERROR_FILE_OPEN CF_ERROR_FILE - 1
|
---|
| 11 | #define CF_ERROR_FILE_INVALID_ARGS CF_ERROR_FILE - 2
|
---|
| 12 | #define CF_ERROR_FILE_READ CF_ERROR_FILE - 3
|
---|
| 13 | #define CF_ERROR_FILE_WRITE CF_ERROR_FILE - 4
|
---|
| 14 | #define CF_ERROR_FILE_CREATE CF_ERROR_FILE - 5
|
---|
| 15 | #define CF_ERROR_FILE_CLOSE CF_ERROR_FILE - 6
|
---|
| 16 | #define CF_ERROR_FILE_GET_SIZE CF_ERROR_FILE - 7
|
---|
| 17 |
|
---|
[15] | 18 | #define RO O_RDONLY
|
---|
| 19 | #define WO O_WRONLY
|
---|
| 20 | #define WR O_RDWR
|
---|
| 21 | #define CR O_CREAT
|
---|
| 22 | #define TR O_TRUNC
|
---|
| 23 |
|
---|
[4] | 24 | #ifdef __cplusplus
|
---|
| 25 | extern "C" {
|
---|
| 26 | #endif
|
---|
| 27 |
|
---|
| 28 | CF_EXPORT int
|
---|
| 29 | CF_File_Open (const char * path,
|
---|
| 30 | const int flag);
|
---|
| 31 |
|
---|
| 32 | CF_EXPORT int
|
---|
[12] | 33 | CF_File_Close (const int fd);
|
---|
[4] | 34 |
|
---|
| 35 | CF_EXPORT int
|
---|
| 36 | CF_File_Create (const char * path);
|
---|
| 37 |
|
---|
| 38 | CF_EXPORT int
|
---|
| 39 | CF_File_Read (const int fd,
|
---|
| 40 | void * buf,
|
---|
| 41 | const size_t len);
|
---|
| 42 |
|
---|
| 43 | CF_EXPORT int
|
---|
| 44 | CF_File_Write (const int fd,
|
---|
| 45 | const void * buf,
|
---|
| 46 | const size_t len);
|
---|
| 47 |
|
---|
| 48 | CF_EXPORT int
|
---|
| 49 | CF_File_GetSize (const int fd);
|
---|
| 50 |
|
---|
| 51 | #ifdef __cplusplus
|
---|
| 52 | }
|
---|
| 53 | #endif
|
---|
| 54 |
|
---|
| 55 | #endif // #ifndef __CF_FILE_H__
|
---|
Note:
See
TracBrowser
for help on using the repository browser.