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

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

#1 file flag 추가

File size: 1.1 KB
Line 
1/**
2 * cf_file.h
3 */
4#ifndef __CF_FILE_H__
5#define __CF_FILE_H__
6
7#include "cf_base.h"
8#include <fcntl.h>
9
10#define CF_ERROR_FILE_OPEN CF_ERROR_FILE - 1
11#define CF_ERROR_FILE_INVALID_ARGS CF_ERROR_FILE - 2
12#define CF_ERROR_FILE_READ CF_ERROR_FILE - 3
13#define CF_ERROR_FILE_WRITE CF_ERROR_FILE - 4
14#define CF_ERROR_FILE_CREATE CF_ERROR_FILE - 5
15#define CF_ERROR_FILE_CLOSE CF_ERROR_FILE - 6
16#define CF_ERROR_FILE_GET_SIZE CF_ERROR_FILE - 7
17
18typedef enum{
19 CF_FILE_RO = O_RDONLY,
20 CF_FILE_WO = O_WRONLY,
21 CF_FILE_WR = O_RDWR,
22 CF_FILE_CR = O_CREAT,
23 CF_FILE_TR = O_TRUNC,
24 CF_FILE_AP = O_APPEND
25} E_CF_FILE_FLAG, 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_Close (const int fd);
37
38CF_EXPORT int
39CF_File_Create (const char * path);
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 int fd);
53
54#ifdef __cplusplus
55}
56#endif
57
58#endif // #ifndef __CF_FILE_H__
Note: See TracBrowser for help on using the repository browser.