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

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

#1 add test code

File size: 1.0 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
18#define RO O_RDONLY
19#define WO O_WRONLY
20#define WR O_RDWR
21#define CR O_CREAT
22#define TR O_TRUNC
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28CF_EXPORT int
29CF_File_Open (const char * path,
30 const int flag);
31
32CF_EXPORT int
33CF_File_Close (const int fd);
34
35CF_EXPORT int
36CF_File_Create (const char * path);
37
38CF_EXPORT int
39CF_File_Read (const int fd,
40 void * buf,
41 const size_t len);
42
43CF_EXPORT int
44CF_File_Write (const int fd,
45 const void * buf,
46 const size_t len);
47
48CF_EXPORT int
49CF_File_GetSize (const int fd);
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif // #ifndef __CF_FILE_H__
Note: See TracBrowser for help on using the repository browser.