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
33 const wasm_tabletype_t *ty,
34 const wasmtime_val_t *init,
35 wasmtime_table_t *table);
36
42WASM_API_EXTERN wasm_tabletype_t *
44 const wasmtime_table_t *table);
45
58WASM_API_EXTERN bool wasmtime_table_get(wasmtime_context_t *store,
59 const wasmtime_table_t *table,
60 uint64_t index, wasmtime_val_t *val);
61
75WASM_API_EXTERN wasmtime_error_t *
77 uint64_t index, const wasmtime_val_t *value);
78
82WASM_API_EXTERN uint64_t wasmtime_table_size(const wasmtime_context_t *store,
83 const wasmtime_table_t *table);
84
102WASM_API_EXTERN wasmtime_error_t *
104 uint64_t delta, const wasmtime_val_t *init,
105 uint64_t *prev_size);
106
107#ifdef __cplusplus
108} // extern "C"
109#endif
110
111#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:43
Container for different kinds of wasm values.
Definition: val.h:441
wasm_tabletype_t * wasmtime_table_type(const wasmtime_context_t *store, const wasmtime_table_t *table)
Returns the type of this table.
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.
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.
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.
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.
uint64_t wasmtime_table_size(const wasmtime_context_t *store, const wasmtime_table_t *table)
Returns the size, in elements, of the specified table.