mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-10-10 00:02:24 +03:00
Allow no scratch for stream reset API calls
Bring hs_reset_stream(), hs_reset_and_copy_stream()'s functionality into line with hs_close_stream() by accepting a NULL scratch if and only if the match callback is also NULL, indicating that no matches should be delivered.
This commit is contained in:
committed by
Matthew Barr
parent
b59491d0db
commit
9ff1303cd8
@@ -250,7 +250,8 @@ hs_error_t hs_close_stream(hs_stream_t *id, hs_scratch_t *scratch,
|
||||
* for future use and is unused at present.
|
||||
*
|
||||
* @param scratch
|
||||
* A per-thread scratch space allocated by @ref hs_alloc_scratch().
|
||||
* A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is
|
||||
* allowed to be NULL only if the @a onEvent callback is also NULL.
|
||||
*
|
||||
* @param onEvent
|
||||
* Pointer to a match event callback function. If a NULL pointer is given,
|
||||
@@ -299,7 +300,8 @@ hs_error_t hs_copy_stream(hs_stream_t **to_id, const hs_stream_t *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().
|
||||
* A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is
|
||||
* allowed to be NULL only if the @a onEvent callback is also NULL.
|
||||
*
|
||||
* @param onEvent
|
||||
* Pointer to a match event callback function. If a NULL pointer is given,
|
||||
|
Reference in New Issue
Block a user