source: libcf/trunk/include/cf_file.h@ 109

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
Line 
1/**
2 * @file cf_file.h
3 * @author myusgun <myusgun@gmail.com>
4 *
5 * @remarks 파일 I/O
6 *
7 * @example file.c
8 */
9#ifndef __CF_FILE_H__
10#define __CF_FILE_H__
11
12#include "cf_base.h"
13
14#include <stddef.h>
15
16/** 파일 열기 옵션 플래그 */
17typedef enum
18{
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 /**< 파일이 존재하면 이어서 쓰기 */
25} CF_FILE_FLAG;
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31CF_EXPORT int
32CF_File_Open (const char * path,
33 const CF_FILE_FLAG flag);
34
35CF_EXPORT int
36CF_File_Create (const char * path);
37
38CF_EXPORT int
39CF_File_Close (const int fd);
40
41CF_EXPORT int
42CF_File_Read (const int fd,
43 void * buf,
44 const size_t len);
45
46CF_EXPORT int
47CF_File_Write (const int fd,
48 const void * buf,
49 const size_t len);
50
51CF_EXPORT int
52CF_File_GetSize (const char * path);
53
54CF_EXPORT CF_BOOL
55CF_File_Exists (const char * path);
56
57CF_EXPORT int
58CF_File_MakeDirectory (const char * path);
59
60#ifdef __cplusplus
61}
62#endif
63
64#endif // #ifndef __CF_FILE_H__
Note: See TracBrowser for help on using the repository browser.