1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #ifndef _CFILE_TOOLS_DEFINES
- #define _CFILE_TOOLS_DEFINES
- #define _GNU_SOURCE
- #define _FILE_OFFSET_BITS 64
- #include <stdio.h>
- #include <unistd.h>
- #include <bzlib.h>
- #include <zlib.h>
- struct _CFRFILE {
- int format;
- int eof;
- int closed;
- int error1;
- int error2;
- FILE * data1;
- void * data2;
-
- int bz2_stream_end;
-
- };
- typedef struct _CFRFILE CFRFILE;
- #define CFR_NUM_FORMATS 4
- CFRFILE * cfr_open(const char *path);
- int cfr_close(CFRFILE *stream);
- size_t cfr_read(void *ptr, size_t size, size_t nmemb, CFRFILE *stream);
- size_t cfr_read_n(CFRFILE *stream, void *ptr, size_t bytes);
- ssize_t cfr_getline(char **lineptr, size_t *n, CFRFILE *stream);
- int cfr_eof(CFRFILE *stream);
- int cfr_error(CFRFILE *stream);
- char * cfr_strerror(CFRFILE *stream);
- const char * cfr_compressor_str(CFRFILE *stream);
- const char * _bz2_strerror(int err);
- #endif
|