#include "gzguts.h"
#include <io.h>
#include <direct.h>
Go to the source code of this file.
|
void ZLIB_INTERNAL | gz_error (gz_statep state, int err, const char *msg) |
|
unsigned ZLIB_INTERNAL | gz_intmax () |
|
local gzFile | gz_open (void *path, int fd, const char *mode) const |
|
local void | gz_reset (gz_statep state) |
|
int ZEXPORT | gzbuffer (gzFile file, unsigned size) |
|
void ZEXPORT | gzclearerr (gzFile file) |
|
gzFile ZEXPORT | gzdopen (int fd, const char *mode) |
|
int ZEXPORT | gzeof (gzFile file) |
|
const char *ZEXPORT | gzerror (gzFile file, int *errnum) |
|
z_off_t ZEXPORT | gzoffset (gzFile file) |
|
z_off64_t ZEXPORT | gzoffset64 (gzFile file) |
|
gzFile ZEXPORT | gzopen (char *path, const char *mode) const |
|
gzFile ZEXPORT | gzopen64 (char *path, const char *mode) const |
|
int ZEXPORT | gzrewind (gzFile file) |
|
z_off_t ZEXPORT | gzseek (gzFile file, z_off_t offset, int whence) |
|
z_off64_t ZEXPORT | gzseek64 (gzFile file, z_off64_t offset, int whence) |
|
z_off_t ZEXPORT | gztell (gzFile file) |
|
z_off64_t ZEXPORT | gztell64 (gzFile file) |
|
local void gz_reset | OF ((gz_statep)) |
|
local gzFile gz_open | OF ((const void *, int, const char *)) |
|
Definition at line 583 of file gzlib.c.
589 if (state->msg !=
NULL) {
609 if ((state->msg = (
char *)
malloc(strlen(state->path) + strlen(msg) + 3)) ==
614 #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
615 snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
616 "%s%s%s", state->path,
": ", msg);
618 strcpy(state->msg, state->path);
619 strcat(state->msg,
": ");
620 strcat(state->msg, msg);
Definition at line 99 of file gzlib.c.
132 if (*mode >=
'0' && *mode <=
'9')
133 state->level = *mode -
'0';
139 #ifndef NO_GZCOMPRESS
169 state->strategy =
Z_RLE;
201 len = wcstombs(
NULL, path, 0);
202 if (len == (
size_t)-1)
207 len = strlen((
const char *)path);
208 state->path = (
char *)
malloc(len + 1);
209 if (state->path ==
NULL) {
216 wcstombs(state->path, path, len + 1);
221 #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
222 snprintf(state->path, len + 1,
"%s", (
const char *)path);
224 strcpy(state->path, path);
236 (cloexec ? O_CLOEXEC : 0) |
240 (O_WRONLY | O_CREAT |
242 (exclusive ? O_EXCL : 0) |
249 state->fd = fd > -1 ? fd : (
251 fd == -2 ? _wopen(path, oflag, 0666) :
253 open((
const char *)path, oflag, 0666));
254 if (state->fd == -1) {
265 if (state->start == -1) state->start = 0;
#define Z_DEFAULT_COMPRESSION
local void gz_reset(gz_statep state)
#define Z_DEFAULT_STRATEGY
Definition at line 83 of file gzlib.c.
95 state->strm.avail_in = 0;
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg)
Definition at line 322 of file gzlib.c.
336 if (state->size != 0)
Definition at line 557 of file gzlib.c.
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg)
Definition at line 292 of file gzlib.c.
299 if (fd == -1 || (path = (
char *)
malloc(7 + 3 *
sizeof(
int))) ==
NULL)
301 #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
302 snprintf(path, 7 + 3 *
sizeof(
int),
"<fd:%d>", fd);
304 sprintf(path,
"<fd:%d>", fd);
local gzFile gz_open(void *path, int fd, const char *mode) const
Definition at line 519 of file gzlib.c.
532 return state->mode ==
GZ_READ ? state->past : 0;
Definition at line 536 of file gzlib.c.
551 *errnum = state->err;
552 return state->err ==
Z_MEM_ERROR ?
"out of memory" :
553 (state->msg ==
NULL ?
"" : state->msg);
Definition at line 509 of file gzlib.c.
z_off64_t ZEXPORT gzoffset64(gzFile file)
Definition at line 486 of file gzlib.c.
504 offset -= state->strm.avail_in;
Definition at line 276 of file gzlib.c.
280 return gz_open(path, -1, mode);
local gzFile gz_open(void *path, int fd, const char *mode) const
Definition at line 284 of file gzlib.c.
288 return gz_open(path, -1, mode);
local gzFile gz_open(void *path, int fd, const char *mode) const
Definition at line 347 of file gzlib.c.
local void gz_reset(gz_statep state)
Definition at line 447 of file gzlib.c.
z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence)
Definition at line 370 of file gzlib.c.
396 offset -= state->x.
pos;
397 else if (state->seek)
398 offset += state->skip;
402 if (state->mode ==
GZ_READ && state->how ==
COPY &&
403 state->x.pos + offset >= 0) {
412 state->strm.avail_in = 0;
413 state->x.pos += offset;
421 offset += state->x.pos;
431 (
unsigned)offset : state->x.have;
441 state->skip = offset;
443 return state->x.pos + offset;
int ZEXPORT gzrewind(gzFile file)
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg)
Definition at line 476 of file gzlib.c.
z_off64_t ZEXPORT gztell64(gzFile file)
Definition at line 459 of file gzlib.c.
472 return state->x.
pos + (state->seek ? state->skip : 0);