[][src]Function dqcsim::bindings::dqcs_pdef_set_drop_cb

#[no_mangle]pub extern "C" fn dqcs_pdef_set_drop_cb(
    pdef: dqcs_handle_t,
    callback: Option<extern "C" fn(user_data: *mut c_void, state: dqcs_plugin_state_t) -> dqcs_return_t>,
    user_free: Option<extern "C" fn(user_data: *mut c_void)>,
    user_data: *mut c_void
) -> dqcs_return_t

Sets the user logic drop/cleanup callback.

This is called when a plugin is gracefully terminated. It is not recommended to execute any downstream instructions at this time, but it is supported in case this is really necessary.

The default behavior is no-op.

The callback can return an error by setting an error message using dqcs_error_set() and returning DQCS_FAILURE. Otherwise, it should return DQCS_SUCCESS.