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

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

#1 implement logging module

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