Function imageflow::imageflow_context_error_and_stacktrace [] [src]

#[no_mangle]
pub unsafe extern fn imageflow_context_error_and_stacktrace(context: *mut Context,
                                                            buffer: *mut c_char,
                                                            buffer_length: size_t,
                                                            full_file_path: bool)
                                                            -> i64

Prints the error messages and stacktrace to the given buffer in UTF-8 form; writes a null character to terminate the string, and ALSO returns the number of bytes written.

Happy(ish) path: Returns the length of the error message written to the buffer. Sad path: Returns -1 if buffer_length was too small or buffer was nullptr. full_file_path, if true, will display the directory associated with the files in each stack frame.

Please be accurate with the buffer length, or a buffer overflow will occur.

Behavior is undefined if context is a null or invalid ptr; segfault likely.