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

Function gzwrite

freebsd/contrib/zstd/zlibWrapper/examples/minigzip.c:241–261  ·  view source on GitHub ↗
(gz, buf, len)

Source from the content-addressed store, hash-verified

239int gzwrite OF((gzFile, const void *, unsigned));
240
241int gzwrite(gz, buf, len)
242 gzFile gz;
243 const void *buf;
244 unsigned len;
245{
246 z_stream *strm;
247 unsigned char out[BUFLEN];
248
249 if (gz == NULL || !gz->write)
250 return 0;
251 strm = &(gz->strm);
252 strm->next_in = (void *)buf;
253 strm->avail_in = len;
254 do {
255 strm->next_out = out;
256 strm->avail_out = BUFLEN;
257 (void)deflate(strm, Z_NO_FLUSH);
258 fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
259 } while (strm->avail_out == 0);
260 return len;
261}
262
263int gzread OF((gzFile, void *, unsigned));
264

Callers 2

gz_compressFunction · 0.70
gz_compress_mmapFunction · 0.70

Calls 1

deflateFunction · 0.85

Tested by

no test coverage detected