Last change
on this file since 16 was 16, checked in by cheese, 11 years ago |
#1 add function for non-context debugging message printing
|
File size:
1.1 KB
|
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 |
|
---|
[16] | 18 | typedef enum{
|
---|
| 19 | CF_FILE_RO = O_RDONLY,
|
---|
| 20 | CF_FILE_WO = O_WRONLY,
|
---|
| 21 | CF_FILE_WR = O_RDWR,
|
---|
| 22 | CF_FILE_CR = O_CREAT,
|
---|
| 23 | CF_FILE_TR = O_TRUNC
|
---|
| 24 | } E_CF_FILE_FLAG, CF_FILE_FLAG;
|
---|
[15] | 25 |
|
---|
[4] | 26 | #ifdef __cplusplus
|
---|
| 27 | extern "C" {
|
---|
| 28 | #endif
|
---|
| 29 |
|
---|
| 30 | CF_EXPORT int
|
---|
[16] | 31 | CF_File_Open (const char * path,
|
---|
| 32 | const CF_FILE_FLAG flag);
|
---|
[4] | 33 |
|
---|
| 34 | CF_EXPORT int
|
---|
[12] | 35 | CF_File_Close (const int fd);
|
---|
[4] | 36 |
|
---|
| 37 | CF_EXPORT int
|
---|
| 38 | CF_File_Create (const char * path);
|
---|
| 39 |
|
---|
| 40 | CF_EXPORT int
|
---|
| 41 | CF_File_Read (const int fd,
|
---|
| 42 | void * buf,
|
---|
| 43 | const size_t len);
|
---|
| 44 |
|
---|
| 45 | CF_EXPORT int
|
---|
| 46 | CF_File_Write (const int fd,
|
---|
| 47 | const void * buf,
|
---|
| 48 | const size_t len);
|
---|
| 49 |
|
---|
| 50 | CF_EXPORT int
|
---|
| 51 | CF_File_GetSize (const int fd);
|
---|
| 52 |
|
---|
| 53 | #ifdef __cplusplus
|
---|
| 54 | }
|
---|
| 55 | #endif
|
---|
| 56 |
|
---|
| 57 | #endif // #ifndef __CF_FILE_H__
|
---|
Note:
See
TracBrowser
for help on using the repository browser.