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

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

#1 add windows project and fix build compatibility

File size: 1018 bytes
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 CF_ERROR_BASE * 2
11
12#define CF_ERROR_FILE_OPEN CF_ERROR_FILE - 1
13#define CF_ERROR_FILE_INVALID_ARGS CF_ERROR_FILE - 2
14#define CF_ERROR_FILE_READ CF_ERROR_FILE - 3
15#define CF_ERROR_FILE_WRITE CF_ERROR_FILE - 4
16#define CF_ERROR_FILE_CREATE CF_ERROR_FILE - 5
17#define CF_ERROR_FILE_CLOSE CF_ERROR_FILE - 6
18#define CF_ERROR_FILE_GET_SIZE CF_ERROR_FILE - 7
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24CF_EXPORT int
25CF_File_Open (const char * path,
26 const int flag);
27
28CF_EXPORT int
29CF_FILE_Close (const int fd);
30
31CF_EXPORT int
32CF_File_Create (const char * path);
33
34CF_EXPORT int
35CF_File_Read (const int fd,
36 void * buf,
37 const size_t len);
38
39CF_EXPORT int
40CF_File_Write (const int fd,
41 const void * buf,
42 const size_t len);
43
44CF_EXPORT int
45CF_File_GetSize (const int fd);
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif // #ifndef __CF_FILE_H__
Note: See TracBrowser for help on using the repository browser.