Wasmtime
types/structref.h
Go to the documentation of this file.
1
7#ifndef WASMTIME_TYPES_STRUCTREF_H
8#define WASMTIME_TYPES_STRUCTREF_H
9
10#include <wasm.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
20
22#define WASMTIME_STORAGE_TYPE_KIND_I8 0
24#define WASMTIME_STORAGE_TYPE_KIND_I16 1
26#define WASMTIME_STORAGE_TYPE_KIND_VALTYPE 2
27
29typedef struct wasmtime_storage_type {
36
38WASM_API_EXTERN void
41
46WASM_API_EXTERN void
48
56typedef struct wasmtime_field_type {
63
65WASM_API_EXTERN void
68
71
80typedef struct wasmtime_struct_type wasmtime_struct_type_t;
81
92WASM_API_EXTERN wasmtime_struct_type_t *
94 const wasmtime_field_type_t *fields, size_t nfields);
95
99WASM_API_EXTERN wasmtime_struct_type_t *
101
106
108WASM_API_EXTERN size_t
110
115WASM_API_EXTERN bool
118
119#ifdef __cplusplus
120} // extern "C"
121#endif
122
123#endif // WASMTIME_TYPES_STRUCTREF_H
Compilation environment and configuration.
An object representing the type of a value.
Describes the type and mutability of a struct field or array element.
Definition: types/structref.h:56
bool mutable_
Definition: types/structref.h:59
wasmtime_storage_type_t storage
The type stored in this field.
Definition: types/structref.h:61
A storage type descriptor for struct/array fields.
Definition: types/structref.h:29
wasmtime_storage_type_kind_t kind
The kind of storage type this is.
Definition: types/structref.h:31
wasm_valtype_t * valtype
Definition: types/structref.h:34
WASM_API_EXTERN void wasmtime_struct_type_delete(wasmtime_struct_type_t *ty)
Delete a struct type.
WASM_API_EXTERN bool wasmtime_struct_type_field(const wasmtime_struct_type_t *ty, size_t index, wasmtime_field_type_t *out)
Get the field type of a struct type's field by index.
struct wasmtime_field_type wasmtime_field_type_t
Convenience alias for wasmtime_field_type.
struct wasmtime_struct_type wasmtime_struct_type_t
An opaque handle to a WebAssembly struct type definition.
Definition: types/structref.h:80
WASM_API_EXTERN wasmtime_struct_type_t * wasmtime_struct_type_new(const wasm_engine_t *engine, const wasmtime_field_type_t *fields, size_t nfields)
Create a new struct type.
WASM_API_EXTERN wasmtime_struct_type_t * wasmtime_struct_type_copy(const wasmtime_struct_type_t *ty)
Clone a struct type.
WASM_API_EXTERN void wasmtime_storage_type_clone(const wasmtime_storage_type_t *storage, wasmtime_storage_type_t *out)
Clone a storage type into out.
WASM_API_EXTERN void wasmtime_storage_type_delete(wasmtime_storage_type_t *storage)
Delete a storage type.
struct wasmtime_storage_type wasmtime_storage_type_t
A storage type descriptor for struct/array fields.
WASM_API_EXTERN void wasmtime_field_type_clone(const wasmtime_field_type_t *field, wasmtime_field_type_t *out)
Clone a field type into out.
WASM_API_EXTERN void wasmtime_field_type_delete(wasmtime_field_type_t *field)
Delete a field type.
WASM_API_EXTERN size_t wasmtime_struct_type_num_fields(const wasmtime_struct_type_t *ty)
Get the number of fields in a struct type.
uint8_t wasmtime_storage_type_kind_t
Discriminant for storage types in struct/array field types.
Definition: types/structref.h:19