Wasmtime
component/types/component.h
Go to the documentation of this file.
1
2
3#ifndef WASMTIME_COMPONENT_TYPES_COMPONENT_H
4#define WASMTIME_COMPONENT_TYPES_COMPONENT_H
5
6#include <wasmtime/conf.h>
7
8#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
9
10#include <wasm.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
23
28WASM_API_EXTERN
31
33WASM_API_EXTERN
35
37WASM_API_EXTERN
39 const wasm_engine_t *engine);
40
45WASM_API_EXTERN
47 const wasm_engine_t *engine,
48 const char *name, size_t name_len,
49 struct wasmtime_component_item_t *ret);
50
55WASM_API_EXTERN
57 const wasmtime_component_type_t *ty, const wasm_engine_t *engine,
58 size_t nth, const char **name_ret, size_t *name_len_ret,
59 struct wasmtime_component_item_t *type_ret);
60
62WASM_API_EXTERN
64 const wasm_engine_t *engine);
65
70WASM_API_EXTERN
72 const wasm_engine_t *engine,
73 const char *name, size_t name_len,
74 struct wasmtime_component_item_t *ret);
75
80WASM_API_EXTERN
82 const wasmtime_component_type_t *ty, const wasm_engine_t *engine,
83 size_t nth, const char **name_ret, size_t *name_len_ret,
84 struct wasmtime_component_item_t *type_ret);
85
88#define WASMTIME_COMPONENT_ITEM_COMPONENT 0
91#define WASMTIME_COMPONENT_ITEM_COMPONENT_INSTANCE 1
94#define WASMTIME_COMPONENT_ITEM_MODULE 2
97#define WASMTIME_COMPONENT_ITEM_COMPONENT_FUNC 3
100#define WASMTIME_COMPONENT_ITEM_RESOURCE 4
103#define WASMTIME_COMPONENT_ITEM_CORE_FUNC 5
106#define WASMTIME_COMPONENT_ITEM_TYPE 6
107
110
135
143
148WASM_API_EXTERN
151
153WASM_API_EXTERN
155
156#ifdef __cplusplus
157} // extern "C"
158#endif
159
160#endif // WASMTIME_FEATURE_COMPONENT_MODEL
161
162#endif // WASMTIME_COMPONENT_TYPES_COMPONENT_H
WASM_API_EXTERN bool wasmtime_component_type_export_get(const wasmtime_component_type_t *ty, const wasm_engine_t *engine, const char *name, size_t name_len, struct wasmtime_component_item_t *ret)
Retrieves the export with the specified name.
uint8_t wasmtime_component_item_kind_t
Discriminant used in wasmtime_component_item_t::kind.
Definition: component/types/component.h:109
WASM_API_EXTERN bool wasmtime_component_type_import_get(const wasmtime_component_type_t *ty, const wasm_engine_t *engine, const char *name, size_t name_len, struct wasmtime_component_item_t *ret)
Retrieves the import with the specified name.
struct wasmtime_component_type_t wasmtime_component_type_t
Represents the type of a WebAssembly component.
Definition: component/types/component.h:22
struct wasmtime_component_item_t wasmtime_component_item_t
Represents a single item in a component's import or export list.
WASM_API_EXTERN void wasmtime_component_item_delete(wasmtime_component_item_t *ptr)
Deallocates a component item.
WASM_API_EXTERN wasmtime_component_type_t * wasmtime_component_type_clone(const wasmtime_component_type_t *ty)
Clones a component type.
WASM_API_EXTERN bool wasmtime_component_type_import_nth(const wasmtime_component_type_t *ty, const wasm_engine_t *engine, size_t nth, const char **name_ret, size_t *name_len_ret, struct wasmtime_component_item_t *type_ret)
Retrieves the nth import.
union wasmtime_component_item_union wasmtime_component_item_union_t
Represents a single item in a component's import or export list.
WASM_API_EXTERN bool wasmtime_component_type_export_nth(const wasmtime_component_type_t *ty, const wasm_engine_t *engine, size_t nth, const char **name_ret, size_t *name_len_ret, struct wasmtime_component_item_t *type_ret)
Retrieves the nth export.
WASM_API_EXTERN size_t wasmtime_component_type_import_count(const wasmtime_component_type_t *ty, const wasm_engine_t *engine)
Returns the number of imports of a component type.
WASM_API_EXTERN size_t wasmtime_component_type_export_count(const wasmtime_component_type_t *ty, const wasm_engine_t *engine)
Returns the number of exports of a component type.
WASM_API_EXTERN void wasmtime_component_item_clone(const wasmtime_component_item_t *item, wasmtime_component_item_t *out)
Clones a component item.
WASM_API_EXTERN void wasmtime_component_type_delete(wasmtime_component_type_t *ty)
Deallocates a component type.
struct wasmtime_component_func_type_t wasmtime_component_func_type_t
Opaque type representing a component function type.
Definition: component/types/func.h:18
struct wasmtime_component_instance_type wasmtime_component_instance_type_t
Represents the type of a component instance.
Definition: component/types/instance.h:19
struct wasmtime_module_type wasmtime_module_type_t
Represents the type of a module.
Definition: component/types/module.h:17
Build-time defines for how the C API was built.
struct wasmtime_component_resource_type wasmtime_component_resource_type_t
Represents the type of a component resource.
Definition: resource.h:21
Compilation environment and configuration.
An opaque object representing the type of a function.
Represents a single item in a component's import or export list.
Definition: component/types/component.h:137
wasmtime_component_item_union_t of
The actual item.
Definition: component/types/component.h:141
wasmtime_component_item_kind_t kind
The type discriminant for the of union.
Definition: component/types/component.h:139
Represents a single value type in the component model.
Definition: component/types/val.h:463
Represents a single item in a component's import or export list.
Definition: component/types/component.h:112
wasmtime_component_valtype_t type
Definition: component/types/component.h:133
wasmtime_component_type_t * component
Definition: component/types/component.h:115
wasmtime_component_func_type_t * component_func
Definition: component/types/component.h:124
wasmtime_module_type_t * module
Definition: component/types/component.h:121
wasmtime_component_resource_type_t * resource
Definition: component/types/component.h:127
wasm_functype_t * core_func
Definition: component/types/component.h:130
wasmtime_component_instance_type_t * component_instance
Definition: component/types/component.h:118