Last change
on this file since 66 was 66, checked in by cheese, 11 years ago |
#1 add codec module (bin <-> hex-string)
|
File size:
1.2 KB
|
Rev | Line | |
---|
[4] | 1 | /**
|
---|
[26] | 2 | * @file cf_file.h
|
---|
| 3 | * @author myusgun <myusgun@gmail.com>
|
---|
[34] | 4 | *
|
---|
[35] | 5 | * @example file.c
|
---|
[4] | 6 | */
|
---|
| 7 | #ifndef __CF_FILE_H__
|
---|
| 8 | #define __CF_FILE_H__
|
---|
| 9 |
|
---|
| 10 | #include "cf_base.h"
|
---|
| 11 | #include <fcntl.h>
|
---|
| 12 |
|
---|
[26] | 13 | /** 파일 열기 옵션 플래그 */
|
---|
| 14 | typedef enum {
|
---|
| 15 | CF_FILE_RO = O_RDONLY, /**< 읽기 전용 */
|
---|
| 16 | CF_FILE_WO = O_WRONLY, /**< 쓰기 전용 */
|
---|
| 17 | CF_FILE_WR = O_RDWR, /**< 읽기/쓰기 */
|
---|
| 18 | CF_FILE_CR = O_CREAT, /**< 파일이 존재하지 않으면 생성 */
|
---|
| 19 | CF_FILE_TR = O_TRUNC, /**< 파일이 존재하면 비우기 */
|
---|
| 20 | CF_FILE_AP = O_APPEND /**< 파일이 존재하면 이어서 쓰기 */
|
---|
[16] | 21 | } E_CF_FILE_FLAG, CF_FILE_FLAG;
|
---|
[15] | 22 |
|
---|
[4] | 23 | #ifdef __cplusplus
|
---|
| 24 | extern "C" {
|
---|
| 25 | #endif
|
---|
| 26 |
|
---|
| 27 | CF_EXPORT int
|
---|
[16] | 28 | CF_File_Open (const char * path,
|
---|
| 29 | const CF_FILE_FLAG flag);
|
---|
[4] | 30 |
|
---|
| 31 | CF_EXPORT int
|
---|
[35] | 32 | CF_File_Create (const char * path);
|
---|
[4] | 33 |
|
---|
| 34 | CF_EXPORT int
|
---|
[35] | 35 | CF_File_Close (const int fd);
|
---|
[4] | 36 |
|
---|
| 37 | CF_EXPORT int
|
---|
| 38 | CF_File_Read (const int fd,
|
---|
| 39 | void * buf,
|
---|
| 40 | const size_t len);
|
---|
| 41 |
|
---|
| 42 | CF_EXPORT int
|
---|
| 43 | CF_File_Write (const int fd,
|
---|
| 44 | const void * buf,
|
---|
| 45 | const size_t len);
|
---|
| 46 |
|
---|
| 47 | CF_EXPORT int
|
---|
| 48 | CF_File_GetSize (const int fd);
|
---|
| 49 |
|
---|
[41] | 50 | CF_EXPORT int
|
---|
| 51 | CF_File_MakeDirectory (const char * path);
|
---|
| 52 |
|
---|
[4] | 53 | #ifdef __cplusplus
|
---|
| 54 | }
|
---|
| 55 | #endif
|
---|
| 56 |
|
---|
| 57 | #endif // #ifndef __CF_FILE_H__
|
---|
Note:
See
TracBrowser
for help on using the repository browser.