Skip to main content

crashlog_read_from_buffer

Function crashlog_read_from_buffer 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn crashlog_read_from_buffer( context: *mut CrashLogContext, data: *const u8, size: usize, ) -> *mut CrashLog
Available on crate feature ffi only.
Expand description

Creates a CrashLog object from a binary blob.

The binary blob pointed by the data argument can be a raw Crash Log region, a BERT dump, or a CPER record.

The memory allocated by this function can be freed using the crashlog_release function.

§Safety

This must be called with a pointer to a CrashLogContext that was earlier obtained by calling the crashlog_init function.

The data pointer must point to a valid memory region that contains at most size bytes of Crash Log data.

§Errors

Returns a NULL pointer if the binary blob does not encode any valid Crash Log records.