Wasmtime
module.h
Go to the documentation of this file.
1
7#ifndef WASMTIME_MODULE_H
8#define WASMTIME_MODULE_H
9
10#include <wasm.h>
11#include <wasmtime/error.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
29
30#ifdef WASMTIME_FEATURE_COMPILER
31
46WASM_API_EXTERN wasmtime_error_t *wasmtime_module_new(wasm_engine_t *engine,
47 const uint8_t *wasm,
48 size_t wasm_len,
49 wasmtime_module_t **ret);
50
51#endif // WASMTIME_FEATURE_COMPILER
52
57
63
67WASM_API_EXTERN void wasmtime_module_imports(const wasmtime_module_t *module,
69
73WASM_API_EXTERN void wasmtime_module_exports(const wasmtime_module_t *module,
75
76#ifdef WASMTIME_FEATURE_COMPILER
77
90WASM_API_EXTERN wasmtime_error_t *
91wasmtime_module_validate(wasm_engine_t *engine, const uint8_t *wasm,
92 size_t wasm_len);
93
107WASM_API_EXTERN wasmtime_error_t *
108wasmtime_module_serialize(wasmtime_module_t *module, wasm_byte_vec_t *ret);
109
110#endif // WASMTIME_FEATURE_COMPILER
111
122WASM_API_EXTERN wasmtime_error_t *
123wasmtime_module_deserialize(wasm_engine_t *engine, const uint8_t *bytes,
124 size_t bytes_len, wasmtime_module_t **ret);
125
140WASM_API_EXTERN wasmtime_error_t *
142 wasmtime_module_t **ret);
143
155WASM_API_EXTERN void
157 void **end);
158
159#ifdef __cplusplus
160} // extern "C"
161#endif
162
163#endif // WASMTIME_MODULE_H
Definition and accessors of wasmtime_error_t.
void wasmtime_module_image_range(const wasmtime_module_t *module, void **start, void **end)
Returns the range of bytes in memory where this module’s compilation image resides.
void wasmtime_module_imports(const wasmtime_module_t *module, wasm_importtype_vec_t *out)
Same as wasm_module_imports, but for wasmtime_module_t.
wasmtime_error_t * wasmtime_module_deserialize(wasm_engine_t *engine, const uint8_t *bytes, size_t bytes_len, wasmtime_module_t **ret)
Build a module from serialized data.
wasmtime_module_t * wasmtime_module_clone(wasmtime_module_t *m)
Creates a shallow clone of the specified module, increasing the internal reference count.
wasmtime_error_t * wasmtime_module_deserialize_file(wasm_engine_t *engine, const char *path, wasmtime_module_t **ret)
Deserialize a module from an on-disk file.
void wasmtime_module_exports(const wasmtime_module_t *module, wasm_exporttype_vec_t *out)
Same as wasm_module_exports, but for wasmtime_module_t.
void wasmtime_module_delete(wasmtime_module_t *m)
Deletes a module.
A list of bytes.
Definition: wasm.h:102
Compilation environment and configuration.
A list of wasm_exporttype_t values.
Definition: wasm.h:305
A list of wasm_importtype_t values.
Definition: wasm.h:293
Errors generated by Wasmtime.
A compiled Wasmtime module.