[][src]Function secp256k1_abc_sys::secp256k1_context_set_error_callback

pub unsafe extern "C" fn secp256k1_context_set_error_callback(
    ctx: *mut secp256k1_context,
    fun: Option<unsafe extern "C" fn(message: *const c_char, data: *mut c_void)>,
    data: *const c_void
)

Set a callback function to be called when an internal consistency check fails. The default is crashing.

This can only trigger in case of a hardware failure, miscompilation, memory corruption, serious bug in the library, or other error would can otherwise result in undefined behaviour. It will not trigger due to mere incorrect usage of the API (see secp256k1_context_set_illegal_callback for that). After this callback returns, anything may happen, including crashing.

Args: ctx: an existing context object (cannot be NULL) In: fun: a pointer to a function to call when an internal error occurs, taking a message and an opaque pointer (NULL restores a default handler that calls abort). data: the opaque pointer to pass to fun above.