Function hyperscan_sys::hs_scan_stream
source · [−]pub unsafe extern "C" fn hs_scan_stream(
id: *mut hs_stream_t,
data: *const c_char,
length: c_uint,
flags: c_uint,
scratch: *mut hs_scratch_t,
onEvent: match_event_handler,
ctxt: *mut c_void
) -> hs_error_t
Expand description
Write data to be scanned to the opened stream.
This is the function call in which the actual pattern matching takes place as data is written to the stream. Matches will be returned via the @ref match_event_handler callback supplied.
@param id The stream ID (returned by @ref hs_open_stream()) to which the data will be written.
@param data Pointer to the data to be scanned.
@param length The number of bytes to scan.
@param flags Flags modifying the behaviour of the stream. This parameter is provided for future use and is unused at present.
@param scratch A per-thread scratch space allocated by @ref hs_alloc_scratch().
@param onEvent Pointer to a match event callback function. If a NULL pointer is given, no matches will be returned.
@param ctxt The user defined pointer which will be passed to the callback function when a match occurs.
@return Returns @ref HS_SUCCESS on success; @ref HS_SCAN_TERMINATED if the match callback indicated that scanning should stop; other values on error.