[][src]Function dqcsim::bindings::dqcs_pdef_set_host_arb_cb

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

Sets the callback function function for handling an arb from the host.

The default behavior for this is no-op.

Besides the common arguments, the callback receives a handle to the ArbCmd object representing the request. It must return a valid ArbData handle containing the response. Both objects are deleted automatically after invocation.

The callback can return an error by setting an error message using dqcs_error_set() and returning 0. Otherwise, it should return a valid ArbData handle.