00001
00023 #ifndef _LIBCOMPREX_IO_H_
00024 #define _LIBCOMPREX_IO_H_
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030 #include <libcomprex/file.h>
00031 #include <libcomprex/fp.h>
00032 #include <libcomprex/types.h>
00033
00047 CxFP *cxOpenFile(const char *path, CxAccessMode mode);
00048
00062 CxFP *cxOpenFileHandle(CxFile *file, CxAccessMode mode);
00063
00076 CxFP *cxOpenStream(FILE *stream);
00077
00091 CxFP *cxOpenBuffer(char *buffer, size_t size);
00092
00105 void cxClose(CxFP *fp);
00106
00122 size_t cxRead(void *ptr, size_t size, size_t nmemb, CxFP *fp);
00123
00139 size_t cxWrite(const void *ptr, size_t size, size_t nmemb, CxFP *fp);
00140
00151 void cxSeek(CxFP *fp, long offset, int whence);
00152
00161 void cxRewind(CxFP *fp);
00162
00173 long cxTell(CxFP *fp);
00174
00184 void cxClearErr(CxFP *fp);
00185
00197 int cxEof(CxFP *fp);
00198
00210 int cxError(CxFP *fp);
00211
00224 const char *cxStrError(CxFP *fp, int errnum);
00225
00226 #ifdef __cplusplus
00227 }
00228 #endif
00229
00230 #endif