MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / gzgetc

Function gzgetc

extern/zlib/src/gzread.c:408–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406# undef gzgetc
407#endif
408int ZEXPORT gzgetc(gzFile file) {
409 unsigned char buf[1];
410 gz_statep state;
411
412 /* get internal structure */
413 if (file == NULL)
414 return -1;
415 state = (gz_statep)file;
416
417 /* check that we're reading and that there's no (serious) error */
418 if (state->mode != GZ_READ ||
419 (state->err != Z_OK && state->err != Z_BUF_ERROR))
420 return -1;
421
422 /* try output buffer (no need to check for skip request) */
423 if (state->x.have) {
424 state->x.have--;
425 state->x.pos++;
426 return *(state->x.next)++;
427 }
428
429 /* nothing there -- try gz_read() */
430 return gz_read(state, buf, 1) < 1 ? -1 : buf[0];
431}
432
433int ZEXPORT gzgetc_(gzFile file) {
434 return gzgetc(file);

Callers 1

gzgetc_Function · 0.85

Calls 1

gz_readFunction · 0.85

Tested by

no test coverage detected