MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / define

Method define

crates/c-api/include/wasmtime/linker.hh:40–51  ·  view source on GitHub ↗

Defines the provided item into this linker with the given name.

Source from the content-addressed store, hash-verified

38
39 /// Defines the provided item into this linker with the given name.
40 Result<std::monostate> define(Store::Context cx, std::string_view module,
41 std::string_view name, const Extern &item) {
42 wasmtime_extern_t raw;
43 detail::cvt_extern(item, raw);
44 auto *error =
45 wasmtime_linker_define(ptr.get(), cx.ptr, module.data(), module.size(),
46 name.data(), name.size(), &raw);
47 if (error != nullptr) {
48 return Error(error);
49 }
50 return std::monostate();
51 }
52
53#ifdef WASMTIME_FEATURE_WASI
54 /// Defines WASI functions within this linker.

Callers 2

wasmtime_linker_defineFunction · 0.45
TESTFunction · 0.45

Calls 6

cvt_externFunction · 0.85
wasmtime_linker_defineFunction · 0.85
ErrorClass · 0.70
getMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.36