public
Description: Production Kitchen Sink Computer Graphics File Format
Homepage: http://www.tweaksoftware.com/products/open-source-software/gto/
Clone URL: git://github.com/jimhourihan/gto.git
gto / lib / Gto / zhacks.cpp
100644 23 lines (17 sloc) 0.456 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "zhacks.h"
 
z_off_t gzseek_raw(gzFile file, z_off_t raw_offset)
{
    gz_stream *s = (gz_stream*)file;
 
    if (s == NULL || s->mode != 'r') return -1;
 
    s->start = raw_offset;
 
    s->z_err = Z_OK;
    s->z_eof = 0;
    s->back = EOF;
    s->stream.avail_in = 0;
    s->stream.next_in = s->inbuf;
    s->crc = crc32(0L, Z_NULL, 0);
    inflateReset(&s->stream);
    s->in = 0;
    s->out = 0;
    return fseek(s->file, s->start, SEEK_SET);
}