#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc/util/abc_global.h"
#include "gzguts.h"
Go to the source code of this file.
|
local void gz_reset | OF ((gz_statep)) |
|
local gzFile gz_open | OF ((const char *, int, const char *)) |
|
local void | gz_reset (gz_statep state) |
|
local gzFile | gz_open (const char *path, int fd, const char *mode) |
|
gzFile ZEXPORT | gzopen (const char *path, const char *mode) |
|
gzFile ZEXPORT | gzopen64 (const char *path, const char *mode) |
|
gzFile ZEXPORT | gzdopen (int fd, const char *mode) |
|
int ZEXPORT | gzbuffer (gzFile file, unsigned size) |
|
int ZEXPORT | gzrewind (gzFile file) |
|
z_off64_t ZEXPORT | gzseek64 (gzFile file, z_off64_t offset, int whence) |
|
z_off_t ZEXPORT | gzseek (gzFile file, z_off_t offset, int whence) |
|
z_off64_t ZEXPORT | gztell64 (gzFile file) |
|
z_off_t ZEXPORT | gztell (gzFile file) |
|
z_off64_t ZEXPORT | gzoffset64 (gzFile file) |
|
z_off_t ZEXPORT | gzoffset (gzFile file) |
|
int ZEXPORT | gzeof (gzFile file) |
|
const char *ZEXPORT | gzerror (gzFile file, int *errnum) |
|
void ZEXPORT | gzclearerr (gzFile file) |
|
void ZLIB_INTERNAL | gz_error (gz_statep state, int err, const char *msg) |
|
unsigned ZLIB_INTERNAL | gz_intmax () |
|
Definition at line 464 of file gzlib.c.
467 if (state->msg != NULL) {
480 state->msg = (
char *)msg;
487 state->msg = (
char *)
"out of memory";
490 strcpy(state->msg, state->path);
Definition at line 92 of file gzlib.c.
109 if (*mode >=
'0' && *mode <=
'9')
110 state->level = *mode -
'0';
116 #ifndef NO_GZCOMPRESS
136 state->strategy =
Z_RLE;
154 if (state->path == NULL) {
158 strcpy(state->path, path);
161 state->fd = fd != -1 ? fd :
171 (O_WRONLY | O_CREAT | (
176 if (state->fd == -1) {
187 if (state->start == -1) state->start = 0;
local void gz_reset(gz_statep state)
#define Z_DEFAULT_STRATEGY
#define Z_DEFAULT_COMPRESSION
Definition at line 77 of file gzlib.c.
88 state->strm.avail_in = 0;
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg)
Definition at line 224 of file gzlib.c.
236 if (state->size != 0)
Definition at line 441 of file gzlib.c.
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg)
Definition at line 210 of file gzlib.c.
215 if (fd == -1 || (path = (
char *)
malloc(7 + 3 *
sizeof(
int))) == NULL)
local gzFile gz_open(const char *path, int fd, const char *mode)
Definition at line 406 of file gzlib.c.
418 return state->mode ==
GZ_READ ?
419 (state->eof && state->strm.avail_in == 0 && state->have == 0) : 0;
Definition at line 423 of file gzlib.c.
436 *errnum = state->err;
437 return state->msg == NULL ?
"" : state->msg;
Definition at line 397 of file gzlib.c.
z_off64_t ZEXPORT gzoffset64(gzFile file)
Definition at line 375 of file gzlib.c.
392 offset -= state->strm.avail_in;
Definition at line 198 of file gzlib.c.
200 return gz_open(path, -1, mode);
local gzFile gz_open(const char *path, int fd, const char *mode)
Definition at line 204 of file gzlib.c.
206 return gz_open(path, -1, mode);
local gzFile gz_open(const char *path, int fd, const char *mode)
Definition at line 247 of file gzlib.c.
local void gz_reset(gz_statep state)
Definition at line 341 of file gzlib.c.
z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence)
Definition at line 268 of file gzlib.c.
282 if (state->err !=
Z_OK)
291 offset -= state->pos;
292 else if (state->seek)
293 offset += state->skip;
297 if (state->mode ==
GZ_READ && state->how ==
COPY &&
298 state->pos + offset >= state->raw) {
306 state->strm.avail_in = 0;
307 state->pos += offset;
315 offset += state->pos;
325 (
unsigned)offset : state->have;
335 state->skip = offset;
337 return state->pos + offset;
int ZEXPORT gzrewind(gzFile file)
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg)
Definition at line 366 of file gzlib.c.
z_off64_t ZEXPORT gztell64(gzFile file)
Definition at line 350 of file gzlib.c.
362 return state->pos + (state->seek ? state->skip : 0);