Function hyperscan_sys::hs_deserialize_database_at
source · [−]pub unsafe extern "C" fn hs_deserialize_database_at(
bytes: *const c_char,
length: usize,
db: *mut hs_database_t
) -> hs_error_t
Expand description
Reconstruct a pattern database from a stream of bytes previously generated by @ref hs_serialize_database() at a given memory location.
This function (unlike @ref hs_deserialize_database()) will write the reconstructed database to the memory location given in the @p db parameter. The amount of space required at this location can be determined with the @ref hs_serialized_database_size() function.
@param bytes A byte array generated by @ref hs_serialize_database() representing a compiled pattern database.
@param length The length of the byte array generated by @ref hs_serialize_database(). This should be the same value as that returned by @ref hs_serialize_database().
@param db Pointer to an 8-byte aligned block of memory of sufficient size to hold the deserialized database. On success, the reconstructed database will be written to this location. This database can then be used for pattern matching. The user is responsible for freeing this memory; the @ref hs_free_database() call should not be used.
@return @ref HS_SUCCESS on success, other values on failure.