Function hyperscan_sys::hs_reset_and_expand_stream
source · [−]pub unsafe extern "C" fn hs_reset_and_expand_stream(
to_stream: *mut hs_stream_t,
buf: *const c_char,
buf_size: usize,
scratch: *mut hs_scratch_t,
onEvent: match_event_handler,
context: *mut c_void
) -> hs_error_t
Expand description
Decompresses a compressed representation created by @ref hs_compress_stream() on top of the ‘to’ stream. The ‘to’ stream will first be reset (reporting any EOD matches if a non-NULL @p onEvent callback handler is provided).
Note: the ‘to’ stream must be opened against the same database as the compressed stream.
Note: @p buf must correspond to a complete compressed representation created by @ref hs_compress_stream() of a stream that was opened against @p db. It is not always possible to detect misuse of this API and behaviour is undefined if these properties are not satisfied.
@param to_stream A pointer to a valid stream state. A pointer to the expanded @ref hs_stream_t will be returned; NULL on failure.
@param buf A compressed representation of a stream. These compressed forms are created by @ref hs_compress_stream().
@param buf_size The size in bytes of the compressed representation.
@param scratch A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is allowed to be NULL only if the @p onEvent callback is also NULL.
@param onEvent Pointer to a match event callback function. If a NULL pointer is given, no matches will be returned.
@param context The user defined pointer which will be passed to the callback function when a match occurs.
@return @ref HS_SUCCESS on success, other values on failure.