Function hyperscan_sys::hs_reset_and_copy_stream
source · [−]pub unsafe extern "C" fn hs_reset_and_copy_stream(
to_id: *mut hs_stream_t,
from_id: *const hs_stream_t,
scratch: *mut hs_scratch_t,
onEvent: match_event_handler,
context: *mut c_void
) -> hs_error_t
Expand description
Duplicate the given ‘from’ stream state onto 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 and the ‘from’ stream must be open against the same database.
@param to_id On success, a pointer to the new, copied @ref hs_stream_t will be returned; NULL on failure.
@param from_id The stream (as created by @ref hs_open_stream()) to be copied.
@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.