========================================================================= */
(strm)
| 355 | |
| 356 | /* ========================================================================= */ |
| 357 | int ZEXPORT deflateReset (strm) |
| 358 | z_streamp strm; |
| 359 | { |
| 360 | deflate_state *s; |
| 361 | |
| 362 | if (strm == Z_NULL || strm->state == Z_NULL || |
| 363 | strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) { |
| 364 | return Z_STREAM_ERROR; |
| 365 | } |
| 366 | |
| 367 | strm->total_in = strm->total_out = 0; |
| 368 | strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ |
| 369 | strm->data_type = Z_UNKNOWN; |
| 370 | |
| 371 | s = (deflate_state *)strm->state; |
| 372 | s->pending = 0; |
| 373 | s->pending_out = s->pending_buf; |
| 374 | |
| 375 | if (s->wrap < 0) { |
| 376 | s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ |
| 377 | } |
| 378 | s->status = s->wrap ? INIT_STATE : BUSY_STATE; |
| 379 | strm->adler = |
| 380 | #ifdef GZIP |
| 381 | s->wrap == 2 ? crc32(0L, Z_NULL, 0) : |
| 382 | #endif |
| 383 | adler32(0L, Z_NULL, 0); |
| 384 | s->last_flush = Z_NO_FLUSH; |
| 385 | |
| 386 | _tr_init(s); |
| 387 | lm_init(s); |
| 388 | |
| 389 | return Z_OK; |
| 390 | } |
| 391 | |
| 392 | /* ========================================================================= */ |
| 393 | int ZEXPORT deflateSetHeader (strm, head) |
no test coverage detected