ark-api-ffi 0.17.0-pre.15

Ark low-level Wasm FFI API
Documentation
define_api_id!(5, "core-v4");

use crate::ErrorCode;

#[link(wasm_import_module = "ark-core-v4")]
extern "C" {
    /// If there was a pending host return vector, copies its content to the given mutable slice
    /// formed by the `out_ptr` and `out_len` parameters.
    pub fn core__take_host_return_vec(out_ptr: *mut u8, out_len: u32) -> ErrorCode;

    /// Add/push debug context property
    ///
    /// This is a named property with a value to describe the current state of something in the module code
    /// that can be useful to see as a developer in case of a reported error, or panic, or crash of the module.
    ///
    /// The name and value strings may be capped by the host.
    ///
    /// If called multiple times with the same name this functions as a stack that one pushes values on, and
    /// when removing/popping the stack it will be set to the top value on the stack if there is one
    ///
    /// Note: for future API revisions we likely should call this `push_debug_context_property`
    pub fn core__add_debug_context(
        name_str_ptr: *const u8,
        name_str_len: u32,
        value_str_ptr: *const u8,
        value_str_len: u32,
    );

    /// Remove/pop debug context property
    ///
    /// This is a named property with a value to describe the current state of something in the module code
    /// that can be useful to see as a developer in case of a reported error, or panic, or crash of the module
    ///
    /// Note: for future API revisions we likely should call this `pop_debug_context_property`
    pub fn core__remove_debug_context(name_str_ptr: *const u8, name_str_len: u32);
}