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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* \file wasmtime/types/arrayref.h
*
* APIs for interacting with WebAssembly GC `structref` type in Wasmtime.
*/
#ifndef WASMTIME_TYPES_ARRAYREF_H
#define WASMTIME_TYPES_ARRAYREF_H
#include <wasm.h>
#include <wasmtime/types/structref.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief An opaque handle to a WebAssembly array type definition.
*
* An array type describes the element type of an array. It is used to create a
* #wasmtime_array_ref_pre_t, which can then allocate array instances.
*
* Owned. Must be deleted with #wasmtime_array_type_delete.
*/
typedef struct wasmtime_array_type wasmtime_array_type_t;
/**
* \brief Create a new array type.
*
* \param engine The engine to register the type with.
* \param field The element type descriptor.
*
* \return Returns a new array type.
*/
WASM_API_EXTERN wasmtime_array_type_t *
wasmtime_array_type_new(const wasm_engine_t *engine,
const wasmtime_field_type_t *field);
/**
* \brief Clone an array type.
*/
WASM_API_EXTERN wasmtime_array_type_t *
wasmtime_array_type_copy(const wasmtime_array_type_t *ty);
/**
* \brief Delete an array type.
*/
WASM_API_EXTERN void wasmtime_array_type_delete(wasmtime_array_type_t *ty);
/// \brief Get the element type of an array type.
WASM_API_EXTERN void
wasmtime_array_type_element(const wasmtime_array_type_t *ty,
wasmtime_field_type_t *out);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // WASMTIME_TYPES_ARRAYREF_H