Wasmtime
table.h
Go to the documentation of this file.
1
7#ifndef WASMTIME_TABLE_H
8#define WASMTIME_TABLE_H
9
10#include <wasm.h>
11#include <wasmtime/error.h>
12#include <wasmtime/extern.h>
13#include <wasmtime/store.h>
14#include <wasmtime/val.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
26WASM_API_EXTERN uint64_t wasmtime_tabletype_minimum(const wasm_tabletype_t *ty);
27
38WASM_API_EXTERN bool wasmtime_tabletype_maximum(const wasm_tabletype_t *ty,
39 uint64_t *max);
40
44WASM_API_EXTERN bool wasmtime_tabletype_is64(const wasm_tabletype_t *ty);
45
59 const wasm_tabletype_t *ty,
60 const wasmtime_val_t *init,
61 wasmtime_table_t *table);
62
68WASM_API_EXTERN wasm_tabletype_t *
70 const wasmtime_table_t *table);
71
84WASM_API_EXTERN bool wasmtime_table_get(wasmtime_context_t *store,
85 const wasmtime_table_t *table,
86 uint64_t index, wasmtime_val_t *val);
87
101WASM_API_EXTERN wasmtime_error_t *
103 uint64_t index, const wasmtime_val_t *value);
104
108WASM_API_EXTERN uint64_t wasmtime_table_size(const wasmtime_context_t *store,
109 const wasmtime_table_t *table);
110
128WASM_API_EXTERN wasmtime_error_t *
130 uint64_t delta, const wasmtime_val_t *init,
131 uint64_t *prev_size);
132
133#ifdef __cplusplus
134} // extern "C"
135#endif
136
137#endif // WASMTIME_TABLE_H
Definition and accessors of wasmtime_error_t.
Definition of wasmtime_extern_t and external items.
An opaque object representing the type of a table.
An interior pointer into a wasmtime_store_t which is used as "context" for many functions.
Errors generated by Wasmtime.
Representation of a table in Wasmtime.
Definition: extern.h:44
Container for different kinds of wasm values.
Definition: val.h:399
WASM_API_EXTERN wasm_tabletype_t * wasmtime_table_type(const wasmtime_context_t *store, const wasmtime_table_t *table)
Returns the type of this table.
WASM_API_EXTERN wasmtime_error_t * wasmtime_table_set(wasmtime_context_t *store, const wasmtime_table_t *table, uint64_t index, const wasmtime_val_t *value)
Sets a value in a table.
WASM_API_EXTERN uint64_t wasmtime_tabletype_minimum(const wasm_tabletype_t *ty)
Returns the minimum size, in elements, of the specified table type.
WASM_API_EXTERN wasmtime_error_t * wasmtime_table_grow(wasmtime_context_t *store, const wasmtime_table_t *table, uint64_t delta, const wasmtime_val_t *init, uint64_t *prev_size)
Grows a table.
WASM_API_EXTERN bool wasmtime_tabletype_maximum(const wasm_tabletype_t *ty, uint64_t *max)
Returns the maximum size, in elements, of the specified table type.
WASM_API_EXTERN bool wasmtime_table_get(wasmtime_context_t *store, const wasmtime_table_t *table, uint64_t index, wasmtime_val_t *val)
Gets a value in a table.
WASM_API_EXTERN uint64_t wasmtime_table_size(const wasmtime_context_t *store, const wasmtime_table_t *table)
Returns the size, in elements, of the specified table.
WASM_API_EXTERN wasmtime_error_t * wasmtime_table_new(wasmtime_context_t *store, const wasm_tabletype_t *ty, const wasmtime_val_t *init, wasmtime_table_t *table)
Creates a new host-defined wasm table.
WASM_API_EXTERN bool wasmtime_tabletype_is64(const wasm_tabletype_t *ty)
Returns whether this type of table represents a 64-bit table.