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

Last change on this file since 73 was 73, checked in by cheese, 11 years ago

#1 fix makefile for multi-platform

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#include <fcntl.h>
14
15/** 파일 열기 옵션 플래그 */
16typedef enum {
17 CF_FILE_RO = O_RDONLY, /**< 읽기 전용 */
18 CF_FILE_WO = O_WRONLY, /**< 쓰기 전용 */
19 CF_FILE_WR = O_RDWR, /**< 읽기/쓰기 */
20 CF_FILE_CR = O_CREAT, /**< 파일이 존재하지 않으면 생성 */
21 CF_FILE_TR = O_TRUNC, /**< 파일이 존재하면 비우기 */
22 CF_FILE_AP = O_APPEND /**< 파일이 존재하면 이어서 쓰기 */
23} E_CF_FILE_FLAG, CF_FILE_FLAG;
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29CF_EXPORT int
30CF_File_Open (const char * path,
31 const CF_FILE_FLAG flag);
32
33CF_EXPORT int
34CF_File_Create (const char * path);
35
36CF_EXPORT int
37CF_File_Close (const int fd);
38
39CF_EXPORT int
40CF_File_Read (const int fd,
41 void * buf,
42 const size_t len);
43
44CF_EXPORT int
45CF_File_Write (const int fd,
46 const void * buf,
47 const size_t len);
48
49CF_EXPORT int
50CF_File_GetSize (const int fd);
51
52CF_EXPORT int
53CF_File_MakeDirectory (const char * path);
54
55#ifdef __cplusplus
56}
57#endif
58
59#endif // #ifndef __CF_FILE_H__
Note: See TracBrowser for help on using the repository browser.