Last change
on this file since 40 was 40, checked in by cheese, 11 years ago |
#1 change interface of log from context to id-number
|
File size:
1.1 KB
|
Rev | Line | |
---|
[4] | 1 | /**
|
---|
[26] | 2 | * @file cf_file.h
|
---|
| 3 | * @author myusgun <myusgun@gmail.com>
|
---|
| 4 | * @version 0.1
|
---|
[34] | 5 | *
|
---|
[35] | 6 | * @example file.c
|
---|
[4] | 7 | */
|
---|
| 8 | #ifndef __CF_FILE_H__
|
---|
| 9 | #define __CF_FILE_H__
|
---|
| 10 |
|
---|
| 11 | #include "cf_base.h"
|
---|
| 12 | #include <fcntl.h>
|
---|
| 13 |
|
---|
[26] | 14 | /** 파일 열기 옵션 플래그 */
|
---|
| 15 | typedef enum {
|
---|
| 16 | CF_FILE_RO = O_RDONLY, /**< 읽기 전용 */
|
---|
| 17 | CF_FILE_WO = O_WRONLY, /**< 쓰기 전용 */
|
---|
| 18 | CF_FILE_WR = O_RDWR, /**< 읽기/쓰기 */
|
---|
| 19 | CF_FILE_CR = O_CREAT, /**< 파일이 존재하지 않으면 생성 */
|
---|
| 20 | CF_FILE_TR = O_TRUNC, /**< 파일이 존재하면 비우기 */
|
---|
| 21 | CF_FILE_AP = O_APPEND /**< 파일이 존재하면 이어서 쓰기 */
|
---|
[16] | 22 | } E_CF_FILE_FLAG, CF_FILE_FLAG;
|
---|
[15] | 23 |
|
---|
[4] | 24 | #ifdef __cplusplus
|
---|
| 25 | extern "C" {
|
---|
| 26 | #endif
|
---|
| 27 |
|
---|
| 28 | CF_EXPORT int
|
---|
[16] | 29 | CF_File_Open (const char * path,
|
---|
| 30 | const CF_FILE_FLAG flag);
|
---|
[4] | 31 |
|
---|
| 32 | CF_EXPORT int
|
---|
[35] | 33 | CF_File_Create (const char * path);
|
---|
[4] | 34 |
|
---|
| 35 | CF_EXPORT int
|
---|
[35] | 36 | CF_File_Close (const int fd);
|
---|
[4] | 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.