Lines Matching refs:zp
153 struct zlib_writer *zp)
155 z_stream *z = &zp->z;
157 uInt len = z->avail_in < zp->trailerlen? z->avail_in: zp->trailerlen;
162 zp->trailerlen -= len;
167 if(result || !zp->trailerlen)
168 result = exit_zlib(data, z, &zp->zlib_init, result);
171 zp->zlib_init = ZLIB_EXTERNAL_TRAILER;
180 struct zlib_writer *zp = (struct zlib_writer *) writer;
181 z_stream *z = &zp->z; /* zlib state structure */
189 if(zp->zlib_init != ZLIB_INIT &&
190 zp->zlib_init != ZLIB_INFLATING &&
191 zp->zlib_init != ZLIB_INIT_GZIP &&
192 zp->zlib_init != ZLIB_GZIP_INFLATING)
193 return exit_zlib(data, z, &zp->zlib_init, CURLE_WRITE_ERROR);
199 return exit_zlib(data, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
222 zp->zlib_init = started; /* Data started. */
226 exit_zlib(data, z, &zp->zlib_init, result);
242 result = process_trailer(data, zp);
247 if(zp->zlib_init == ZLIB_INIT) {
253 zp->zlib_init = ZLIB_INFLATING;
254 zp->trailerlen = 4; /* Tolerate up to 4 unknown trailer bytes. */
258 zp->zlib_init = ZLIB_UNINIT; /* inflateEnd() already called. */
260 result = exit_zlib(data, z, &zp->zlib_init, process_zlib_error(data, z));
263 result = exit_zlib(data, z, &zp->zlib_init, process_zlib_error(data, z));
272 if(nread && zp->zlib_init == ZLIB_INIT)
273 zp->zlib_init = started; /* Cannot restart anymore. */
283 struct zlib_writer *zp = (struct zlib_writer *) writer;
284 z_stream *z = &zp->z; /* zlib state structure */
292 zp->zlib_init = ZLIB_INIT;
300 struct zlib_writer *zp = (struct zlib_writer *) writer;
301 z_stream *z = &zp->z; /* zlib state structure */
310 if(zp->zlib_init == ZLIB_EXTERNAL_TRAILER)
311 return process_trailer(data, zp);
320 struct zlib_writer *zp = (struct zlib_writer *) writer;
321 z_stream *z = &zp->z; /* zlib state structure */
323 exit_zlib(data, z, &zp->zlib_init, CURLE_OK);
340 struct zlib_writer *zp = (struct zlib_writer *) writer;
341 z_stream *z = &zp->z; /* zlib state structure */
352 zp->zlib_init = ZLIB_INIT_GZIP; /* Transparent gzip decompress state */
359 zp->trailerlen = 8; /* A CRC-32 and a 32-bit input size (RFC 1952, 2.2) */
360 zp->zlib_init = ZLIB_INIT; /* Initial call state */
457 struct zlib_writer *zp = (struct zlib_writer *) writer;
458 z_stream *z = &zp->z; /* zlib state structure */
463 if(zp->zlib_init == ZLIB_INIT_GZIP) {
474 return exit_zlib(data, z, &zp->zlib_init, CURLE_WRITE_ERROR);
487 switch(zp->zlib_init) {
498 zp->zlib_init = ZLIB_GZIP_INFLATING; /* Inflating stream state */
512 return exit_zlib(data, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
515 zp->zlib_init = ZLIB_GZIP_HEADER; /* Need more gzip header data state */
521 return exit_zlib(data, z, &zp->zlib_init, process_zlib_error(data, z));
534 return exit_zlib(data, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
546 zp->zlib_init = ZLIB_GZIP_INFLATING; /* Inflating stream state */
555 return exit_zlib(data, z, &zp->zlib_init, process_zlib_error(data, z));
564 return process_trailer(data, zp);
587 struct zlib_writer *zp = (struct zlib_writer *) writer;
588 z_stream *z = &zp->z; /* zlib state structure */
590 exit_zlib(data, z, &zp->zlib_init, CURLE_OK);
746 struct zstd_writer *zp = (struct zstd_writer *) writer;
750 zp->zds = ZSTD_createDStream();
751 zp->decomp = NULL;
752 return zp->zds ? CURLE_OK : CURLE_OUT_OF_MEMORY;
760 struct zstd_writer *zp = (struct zstd_writer *) writer;
768 if(!zp->decomp) {
769 zp->decomp = malloc(DSIZ);
770 if(!zp->decomp)
779 out.dst = zp->decomp;
782 errorCode = ZSTD_decompressStream(zp->zds, &out, &in);
788 zp->decomp, out.pos);
802 struct zstd_writer *zp = (struct zstd_writer *) writer;
806 if(zp->decomp) {
807 free(zp->decomp);
808 zp->decomp = NULL;
810 if(zp->zds) {
811 ZSTD_freeDStream(zp->zds);
812 zp->zds = NULL;