[][src]Function casperlabs_contract::ext_ffi::get_named_arg

pub unsafe extern "C" fn get_named_arg(
    name_ptr: *const u8,
    name_size: usize,
    dest_ptr: *mut u8,
    dest_size: usize
) -> i32

This function copies the contents of the current runtime buffer into the wasm memory, beginning at the provided offset. It is intended that this function be called after a call to load_arg. It is up to the caller to ensure that the proper amount of memory is allocated for this write, otherwise data corruption in the wasm memory may occur due to this call overwriting some bytes unintentionally. The size of the data which will be written is returned from the load_arg call. The bytes which are written are the those corresponding to the provided argument; it is up to the developer to know how to attempt to interpret those bytes.

Arguments

  • name_ptr - pointer (offset in wasm memory) to the location where serialized argument name is present
  • name_size - size of serialized bytes of argument name
  • dest_ptr - pointer to the location where argument bytes will be copied from the host side
  • dest_size - size of destination pointer