Last change
on this file since 109 was 109, checked in by cheese, 11 years ago |
#1 add typical data structure algorithms (linked-list / queue / stak) and rename symbol for context of each modules
|
File size:
1.2 KB
|
Rev | Line | |
---|
[4] | 1 | /**
|
---|
[26] | 2 | * @file cf_file.h
|
---|
| 3 | * @author myusgun <myusgun@gmail.com>
|
---|
[34] | 4 | *
|
---|
[73] | 5 | * @remarks 파일 I/O
|
---|
| 6 | *
|
---|
[35] | 7 | * @example file.c
|
---|
[4] | 8 | */
|
---|
| 9 | #ifndef __CF_FILE_H__
|
---|
| 10 | #define __CF_FILE_H__
|
---|
| 11 |
|
---|
| 12 | #include "cf_base.h"
|
---|
| 13 |
|
---|
[90] | 14 | #include <stddef.h>
|
---|
| 15 |
|
---|
[26] | 16 | /** 파일 열기 옵션 플래그 */
|
---|
[109] | 17 | typedef enum
|
---|
| 18 | {
|
---|
[90] | 19 | CF_FILE_READ = 0x0001, /**< 읽기 전용 */
|
---|
| 20 | CF_FILE_WRITE = 0x0002, /**< 쓰기 전용 */
|
---|
| 21 | CF_FILE_RW = 0x0004, /**< 읽기/쓰기 */
|
---|
| 22 | CF_FILE_CREATE = 0x0008, /**< 파일이 존재하지 않으면 생성 */
|
---|
| 23 | CF_FILE_TRUNC = 0x0010, /**< 파일이 존재하면 비우기 */
|
---|
| 24 | CF_FILE_APPEND = 0x0020 /**< 파일이 존재하면 이어서 쓰기 */
|
---|
[109] | 25 | } CF_FILE_FLAG;
|
---|
[15] | 26 |
|
---|
[4] | 27 | #ifdef __cplusplus
|
---|
| 28 | extern "C" {
|
---|
| 29 | #endif
|
---|
| 30 |
|
---|
| 31 | CF_EXPORT int
|
---|
[16] | 32 | CF_File_Open (const char * path,
|
---|
| 33 | const CF_FILE_FLAG flag);
|
---|
[4] | 34 |
|
---|
| 35 | CF_EXPORT int
|
---|
[35] | 36 | CF_File_Create (const char * path);
|
---|
[4] | 37 |
|
---|
| 38 | CF_EXPORT int
|
---|
[35] | 39 | CF_File_Close (const int fd);
|
---|
[4] | 40 |
|
---|
| 41 | CF_EXPORT int
|
---|
| 42 | CF_File_Read (const int fd,
|
---|
| 43 | void * buf,
|
---|
| 44 | const size_t len);
|
---|
| 45 |
|
---|
| 46 | CF_EXPORT int
|
---|
| 47 | CF_File_Write (const int fd,
|
---|
| 48 | const void * buf,
|
---|
| 49 | const size_t len);
|
---|
| 50 |
|
---|
| 51 | CF_EXPORT int
|
---|
[94] | 52 | CF_File_GetSize (const char * path);
|
---|
[4] | 53 |
|
---|
[109] | 54 | CF_EXPORT CF_BOOL
|
---|
| 55 | CF_File_Exists (const char * path);
|
---|
| 56 |
|
---|
[41] | 57 | CF_EXPORT int
|
---|
| 58 | CF_File_MakeDirectory (const char * path);
|
---|
| 59 |
|
---|
[4] | 60 | #ifdef __cplusplus
|
---|
| 61 | }
|
---|
| 62 | #endif
|
---|
| 63 |
|
---|
| 64 | #endif // #ifndef __CF_FILE_H__
|
---|
Note:
See
TracBrowser
for help on using the repository browser.