00001
00023 #ifndef _LIBCOMPREX_FP_H_
00024 #define _LIBCOMPREX_FP_H_
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030 typedef struct _CxFP CxFP;
00035 struct _CxFP
00036 {
00037 CxFile *file;
00038 CxArchive *archive;
00040 CxAccessMode accessMode;
00042 long pos;
00044 int eof;
00046 int error;
00047 char *errStr;
00049 void *moduleData;
00051 unsigned int refCount;
00053 struct
00054 {
00058 size_t (*read)(void *ptr, size_t size, size_t nmemb, CxFP *fp);
00059
00063 size_t (*write)(const void *ptr, size_t size, size_t nmemb,
00064 CxFP *fp);
00065
00069 void (*seek)(CxFP *fp, long offset, int whence);
00070
00074 void (*rewind)(CxFP *fp);
00075
00079 void (*close)(CxFP *fp);
00080
00081 } ops;
00082 };
00083
00091 CxFP *cxNewFp(void);
00092
00101 void cxSetFpAccessMode(CxFile *file, CxAccessMode accessMode);
00102
00127 void cxSetReadFunc(CxFP *fp, size_t (*fnc)(void *, size_t, size_t, CxFP *));
00128
00153 void cxSetWriteFunc(CxFP *fp, size_t (*fnc)(const void *, size_t, size_t,
00154 CxFP *));
00155
00180 void cxSetSeekFunc(CxFP *fp, void (*fnc)(CxFP *, long, int));
00181
00206 void cxSetCloseFunc(CxFP *fp, void (*fnc)(CxFP *));
00207
00215 void cxSetError(CxFP *fp, int errnum, const char *errstr);
00216
00226 CxAccessMode cxGetFpAccessMode(CxFile *file);
00227
00228 #ifdef __cplusplus
00229 }
00230 #endif
00231
00232 #endif