mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-21 03:29:49 +00:00
22 lines
359 B
C
22 lines
359 B
C
#include <zlib.h>
|
|
|
|
#include "libstream.h"
|
|
|
|
extern gzFile gzopen (stream_t *stream);
|
|
|
|
int stream_uncompress(stream_t *stream)
|
|
{
|
|
gzFile *gz;
|
|
|
|
gz = gzopen(stream);
|
|
if (gz == NULL)
|
|
return -1;
|
|
|
|
stream->file = gz;
|
|
stream->fs.read = (stream_read_t)gzread;
|
|
stream->fs.lseek = (stream_lseek_t)gzseek;
|
|
stream->fs.close = (stream_close_t)gzclose;
|
|
|
|
return 0;
|
|
}
|