Function hyperscan_sys::hs_serialize_database
source · [−]pub unsafe extern "C" fn hs_serialize_database(
db: *const hs_database_t,
bytes: *mut *mut c_char,
length: *mut usize
) -> hs_error_t
Expand description
Serialize a pattern database to a stream of bytes.
The allocator callback set by @ref hs_set_misc_allocator() (or @ref hs_set_allocator()) will be used by this function.
@param db A compiled pattern database.
@param bytes On success, a pointer to an array of bytes will be returned here. These bytes can be subsequently relocated or written to disk. The caller is responsible for freeing this block.
@param length On success, the number of bytes in the generated byte array will be returned here.
@return @ref HS_SUCCESS on success, @ref HS_NOMEM if the byte array cannot be allocated, other values may be returned if errors are detected.