MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / gzbuffer

Function gzbuffer

ZLib/gzlib.c:314–336  ·  view source on GitHub ↗

-- see zlib.h -- */

(file, size)

Source from the content-addressed store, hash-verified

312
313/* -- see zlib.h -- */
314int ZEXPORT gzbuffer(file, size)
315 gzFile file;
316 unsigned size;
317{
318 gz_statep state;
319
320 /* get internal structure and check integrity */
321 if (file == NULL)
322 return -1;
323 state = (gz_statep)file;
324 if (state->mode != GZ_READ && state->mode != GZ_WRITE)
325 return -1;
326
327 /* make sure we haven't already allocated memory */
328 if (state->size != 0)
329 return -1;
330
331 /* check and set requested size */
332 if (size < 2)
333 size = 2; /* need two bytes to check magic header */
334 state->want = size;
335 return 0;
336}
337
338/* -- see zlib.h -- */
339int ZEXPORT gzrewind(file)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected