Function hyperscan_sys::hs_scan
source · [−]pub unsafe extern "C" fn hs_scan(
db: *const hs_database_t,
data: *const c_char,
length: c_uint,
flags: c_uint,
scratch: *mut hs_scratch_t,
onEvent: match_event_handler,
context: *mut c_void
) -> hs_error_t
Expand description
The block (non-streaming) regular expression scanner.
This is the function call in which the actual pattern matching takes place for block-mode pattern databases.
@param db A compiled pattern database.
@param data Pointer to the data to be scanned.
@param length The number of bytes to scan.
@param flags Flags modifying the behaviour of this function. 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() for this database.
@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.
@return Returns @ref HS_SUCCESS on success; @ref HS_SCAN_TERMINATED if the match callback indicated that scanning should stop; other values on error.