pub unsafe extern "C" fn ch_scan(
    db: *const ch_database_t,
    data: *const c_char,
    length: c_uint,
    flags: c_uint,
    scratch: *mut ch_scratch_t,
    onEvent: ch_match_event_handler,
    onError: ch_error_event_handler,
    context: *mut c_void
) -> ch_error_t
Expand description

The block 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 ch_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 onError Pointer to a error event callback function. If a NULL pointer is given, @ref CH_ERROR_MATCHLIMIT and @ref CH_ERROR_RECURSIONLIMIT errors will be ignored and match will continue.

@param context The user defined pointer which will be passed to the callback function.

@return Returns @ref CH_SUCCESS on success; @ref CH_SCAN_TERMINATED if the match callback indicated that scanning should stop; other values on error.