MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / get_byte

Function get_byte

zlib/gzio.c:266–282  ·  view source on GitHub ↗

=========================================================================== Read a byte from a gz_stream; update next_in and avail_in. Return EOF for end of file. IN assertion: the stream s has been sucessfully opened for reading. */

(s)

Source from the content-addressed store, hash-verified

264 IN assertion: the stream s has been sucessfully opened for reading.
265*/
266local int get_byte(s)
267 gz_stream *s;
268{
269 if (s->z_eof) return EOF;
270 if (s->stream.avail_in == 0) {
271 errno = 0;
272 s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
273 if (s->stream.avail_in == 0) {
274 s->z_eof = 1;
275 if (ferror(s->file)) s->z_err = Z_ERRNO;
276 return EOF;
277 }
278 s->stream.next_in = s->inbuf;
279 }
280 s->stream.avail_in--;
281 return *(s->stream.next_in)++;
282}
283
284/* ===========================================================================
285 Check the gzip header of a gz_stream opened for reading. Set the stream

Callers 2

check_headerFunction · 0.85
getLongFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected