mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
add dynamic compression to the public api
This commit is contained in:
parent
e099d85524
commit
d878e8cdf3
@ -356,8 +356,8 @@ hs_error_t HS_CDECL hs_reset_and_copy_stream(hs_stream_t *to_id,
|
|||||||
* @ref HS_SUCCESS on success, @ref HS_INSUFFICIENT_SPACE if the provided
|
* @ref HS_SUCCESS on success, @ref HS_INSUFFICIENT_SPACE if the provided
|
||||||
* buffer is too small.
|
* buffer is too small.
|
||||||
*/
|
*/
|
||||||
hs_error_t hs_compress_stream(const hs_stream_t *stream, char *buf,
|
hs_error_t HS_CDECL hs_compress_stream(const hs_stream_t *stream, char *buf,
|
||||||
size_t buf_space, size_t *used_space);
|
size_t buf_space, size_t *used_space);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decompresses a compressed representation created by @ref hs_compress_stream()
|
* Decompresses a compressed representation created by @ref hs_compress_stream()
|
||||||
@ -386,8 +386,9 @@ hs_error_t hs_compress_stream(const hs_stream_t *stream, char *buf,
|
|||||||
* @return
|
* @return
|
||||||
* @ref HS_SUCCESS on success, other values on failure.
|
* @ref HS_SUCCESS on success, other values on failure.
|
||||||
*/
|
*/
|
||||||
hs_error_t hs_expand_stream(const hs_database_t *db, hs_stream_t **stream,
|
hs_error_t HS_CDECL hs_expand_stream(const hs_database_t *db,
|
||||||
const char *buf, size_t buf_size);
|
hs_stream_t **stream, const char *buf,
|
||||||
|
size_t buf_size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decompresses a compressed representation created by @ref hs_compress_stream()
|
* Decompresses a compressed representation created by @ref hs_compress_stream()
|
||||||
@ -428,11 +429,11 @@ hs_error_t hs_expand_stream(const hs_database_t *db, hs_stream_t **stream,
|
|||||||
* @return
|
* @return
|
||||||
* @ref HS_SUCCESS on success, other values on failure.
|
* @ref HS_SUCCESS on success, other values on failure.
|
||||||
*/
|
*/
|
||||||
hs_error_t hs_reset_and_expand_stream(hs_stream_t *to_stream,
|
hs_error_t HS_CDECL hs_reset_and_expand_stream(hs_stream_t *to_stream,
|
||||||
const char *buf, size_t buf_size,
|
const char *buf, size_t buf_size,
|
||||||
hs_scratch_t *scratch,
|
hs_scratch_t *scratch,
|
||||||
match_event_handler onEvent,
|
match_event_handler onEvent,
|
||||||
void *context);
|
void *context);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The block (non-streaming) regular expression scanner.
|
* The block (non-streaming) regular expression scanner.
|
||||||
|
@ -1121,6 +1121,7 @@ hs_error_t hs_compress_stream(const hs_stream_t *stream, char *buf,
|
|||||||
return HS_SUCCESS;
|
return HS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HS_PUBLIC_API
|
||||||
hs_error_t hs_expand_stream(const hs_database_t *db, hs_stream_t **stream,
|
hs_error_t hs_expand_stream(const hs_database_t *db, hs_stream_t **stream,
|
||||||
const char *buf, size_t buf_size) {
|
const char *buf, size_t buf_size) {
|
||||||
if (unlikely(!stream || !buf)) {
|
if (unlikely(!stream || !buf)) {
|
||||||
@ -1159,6 +1160,7 @@ hs_error_t hs_expand_stream(const hs_database_t *db, hs_stream_t **stream,
|
|||||||
return HS_SUCCESS;
|
return HS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HS_PUBLIC_API
|
||||||
hs_error_t hs_reset_and_expand_stream(hs_stream_t *to_stream,
|
hs_error_t hs_reset_and_expand_stream(hs_stream_t *to_stream,
|
||||||
const char *buf, size_t buf_size,
|
const char *buf, size_t buf_size,
|
||||||
hs_scratch_t *scratch,
|
hs_scratch_t *scratch,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user