pub unsafe extern "C" fn hs_deserialize_database(
    bytes: *const c_char,
    length: usize,
    db: *mut *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().

This function will allocate sufficient space for the database using the allocator set with @ref hs_set_database_allocator() (or @ref hs_set_allocator()); to use a pre-allocated region of memory, use the @ref hs_deserialize_database_at() 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 On success, a pointer to a newly allocated @ref hs_database_t will be returned here. This database can then be used for scanning, and eventually freed by the caller using @ref hs_free_database().

@return @ref HS_SUCCESS on success, other values on failure.