* `inflate(Z_BLOCK)` and `inflate(Z_TREES)`
* `inflateMark()`
* `inflatePrime()`
+* `inflateSyncPoint()`
When used, these functions will either switch to software, or, in case
this is not possible, gracefully fail.
parameter block using `DEFLATE_RESET_KEEP_HOOK()` and
`INFLATE_RESET_KEEP_HOOK()` macros.
-`INFLATE_PRIME_HOOK()` and `INFLATE_MARK_HOOK()` macros make the
-unsupported `inflatePrime()` and `inflateMark()` calls fail gracefully.
+`INFLATE_PRIME_HOOK()`, `INFLATE_MARK_HOOK()` and
+`INFLATE_SYNC_POINT_HOOK()` macros make the respective unsupported
+calls gracefully fail.
`DEFLATE_PARAMS_HOOK()` implements switching between hardware and
software compression mid-stream using `deflateParams()`. Switching
if (dfltcc_was_inflate_used((strm))) return -(1L << 16); \
} while (0)
+#define INFLATE_SYNC_POINT_HOOK(strm) \
+ do { \
+ if (dfltcc_was_inflate_used((strm))) return Z_STREAM_ERROR; \
+ } while (0)
+
#endif
# define INFLATE_NEED_UPDATEWINDOW(strm) 1
/* Invoked at the beginning of inflateMark(). Useful for updating arch-specific pointers and offsets. */
# define INFLATE_MARK_HOOK(strm) do {} while (0)
+/* Invoked at the beginning of inflateSyncPoint(). Useful for performing arch-specific state checks. */
+#define INFLATE_SYNC_POINT_HOOK(strm) do {} while (0)
#endif
/* function prototypes */
if (inflateStateCheck(strm))
return Z_STREAM_ERROR;
+ INFLATE_SYNC_POINT_HOOK(strm);
state = (struct inflate_state *)strm->state;
return state->mode == STORED && state->bits == 0;
}