1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//! Holds the internal/private globals used by the zome api library.
//! Also contains the functions declarations of the external functions provided by the Ribosome.

use holochain_wasm_utils::{api_serialization::ZomeApiGlobals, memory_allocation::SinglePageStack};
use init_globals::init_globals;

// Internal global for memory usage
pub static mut G_MEM_STACK: Option<SinglePageStack> = None;

// Internal global for retrieving all Zome API globals
lazy_static! {
    pub(crate) static ref GLOBALS: ZomeApiGlobals = init_globals();
}

// Invokable functions in the Ribosome
// WARNING Names must be in sync with ZomeAPIFunction in holochain-rust
#[allow(dead_code)]
extern "C" {
    pub(crate) fn hc_property(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_hash_entry(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_debug(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_call(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_sign(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_verify_signature(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_commit_entry(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_update_entry(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_remove_entry(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_get_entry(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_link_entries(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_get_links(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_query(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_send(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_start_bundle(encoded_allocation_of_input: u32) -> u32;
    pub(crate) fn hc_close_bundle(encoded_allocation_of_input: u32) -> u32;
}