MCPcopy Create free account
hub / github.com/F-Stack/f-stack / gzrewind

Function gzrewind

freebsd/contrib/zstd/zlibWrapper/gzlib.c:346–366  ·  view source on GitHub ↗

-- see zlib.h -- */

(file)

Source from the content-addressed store, hash-verified

344
345/* -- see zlib.h -- */
346int ZEXPORT gzrewind(file)
347 gzFile file;
348{
349 gz_statep state;
350
351 /* get internal structure */
352 if (file == NULL)
353 return -1;
354 state.file = file;
355
356 /* check that we're reading and that there's no error */
357 if (state.state->mode != GZ_READ ||
358 (state.state->err != Z_OK && state.state->err != Z_BUF_ERROR))
359 return -1;
360
361 /* back up and start over */
362 if (LSEEK(state.state->fd, state.state->start, SEEK_SET) == -1)
363 return -1;
364 gz_reset(state);
365 return 0;
366}
367
368/* -- see zlib.h -- */
369z_off64_t ZEXPORT gzseek64(file, offset, whence)

Callers 1

gzseek64Function · 0.70

Calls 1

gz_resetFunction · 0.70

Tested by

no test coverage detected