Function imageflow::imageflow_context_add_to_callstack
[−]
[src]
#[no_mangle]pub unsafe extern fn imageflow_context_add_to_callstack(context: *mut Context,
filename: *const c_char,
line: i32,
function_name: *const c_char)
-> bool
Adds the given filename, line number, and function name to the call stack.
Strings function_name
, and filename
should be null-terminated UTF-8 strings who will outlive context
Returns true
if add was successful.
Will fail and return false if...
- You haven't previously called
imageflow_context_raise_error
- You tried to raise a second error without clearing the first one. Call will be ignored.
- You've exceeded the capacity of the call stack (which, at one point, was 14). But this category of failure is acceptable.
Expectations
- An error has been raised.
- You may provide a null value for
filename
orfunction_name
, but for the love of puppies, don't provide a dangling or invalid pointer, that will segfault... a long time later. - The lifetime of
file
andfunction_name
(if provided), is expected to match or exceed the lifetime ofcontext
. - All strings must be null-terminated, C-style, valid UTF-8.
Caveats
- Behavior is undefined if
context
is a null or invalid ptr; segfault likely.