00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __PJ_FILE_IO_H__
00021 #define __PJ_FILE_IO_H__
00022
00027 #include <pj/types.h>
00028
00029 PJ_BEGIN_DECL
00030
00059 enum pj_file_access
00060 {
00061 PJ_O_RDONLY = 0x1101,
00062 PJ_O_WRONLY = 0x1102,
00063 PJ_O_RDWR = 0x1103,
00065 PJ_O_APPEND = 0x1108
00066 };
00067
00071 enum pj_file_seek_type
00072 {
00073 PJ_SEEK_SET = 0x1201,
00074 PJ_SEEK_CUR = 0x1202,
00075 PJ_SEEK_END = 0x1203
00076 };
00077
00094 PJ_DECL(pj_status_t) pj_file_open(pj_pool_t *pool,
00095 const char *pathname,
00096 unsigned flags,
00097 pj_oshandle_t *fd);
00098
00106 PJ_DECL(pj_status_t) pj_file_close(pj_oshandle_t fd);
00107
00119 PJ_DECL(pj_status_t) pj_file_write(pj_oshandle_t fd,
00120 const void *data,
00121 pj_ssize_t *size);
00122
00138 PJ_DECL(pj_status_t) pj_file_read(pj_oshandle_t fd,
00139 void *data,
00140 pj_ssize_t *size);
00141
00151 PJ_DECL(pj_status_t) pj_file_setpos(pj_oshandle_t fd,
00152 pj_off_t offset,
00153 enum pj_file_seek_type whence);
00154
00164 PJ_DECL(pj_status_t) pj_file_getpos(pj_oshandle_t fd,
00165 pj_off_t *pos);
00166
00174 PJ_DECL(pj_status_t) pj_file_flush(pj_oshandle_t fd);
00175
00176
00180 PJ_END_DECL
00181
00182 #endif
00183