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/conf.h>
12#include <wasmtime/error.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
30
31#ifdef WASMTIME_FEATURE_COMPILER
32
48 const uint8_t *wasm,
49 size_t wasm_len,
50 wasmtime_module_t **ret);
51
52#endif // WASMTIME_FEATURE_COMPILER
53
58
63WASM_API_EXTERN wasmtime_module_t *
65
69WASM_API_EXTERN void wasmtime_module_imports(const wasmtime_module_t *module,
71
75WASM_API_EXTERN void wasmtime_module_exports(const wasmtime_module_t *module,
77
78#ifdef WASMTIME_FEATURE_COMPILER
79
92WASM_API_EXTERN wasmtime_error_t *
93wasmtime_module_validate(wasm_engine_t *engine, const uint8_t *wasm,
94 size_t wasm_len);
95
109WASM_API_EXTERN wasmtime_error_t *
111 wasm_byte_vec_t *ret);
112
113#endif // WASMTIME_FEATURE_COMPILER
114
125WASM_API_EXTERN wasmtime_error_t *
126wasmtime_module_deserialize(wasm_engine_t *engine, const uint8_t *bytes,
127 size_t bytes_len, wasmtime_module_t **ret);
128
143WASM_API_EXTERN wasmtime_error_t *
145 wasmtime_module_t **ret);
146
158WASM_API_EXTERN void
160 void **end);
161
162#ifdef __cplusplus
163} // extern "C"
164#endif
165
166#endif // WASMTIME_MODULE_H
Build-time defines for how the C API was built.
Definition and accessors of wasmtime_error_t.
WASM_API_EXTERN wasmtime_module_t * wasmtime_module_clone(const wasmtime_module_t *m)
Creates a shallow clone of the specified module, increasing the internal reference count.
WASM_API_EXTERN void wasmtime_module_delete(wasmtime_module_t *m)
Deletes a module.
WASM_API_EXTERN void wasmtime_module_imports(const wasmtime_module_t *module, wasm_importtype_vec_t *out)
Same as wasm_module_imports, but for wasmtime_module_t.
WASM_API_EXTERN wasmtime_error_t * wasmtime_module_serialize(const wasmtime_module_t *module, wasm_byte_vec_t *ret)
This function serializes compiled module artifacts as blob data.
WASM_API_EXTERN void wasmtime_module_exports(const wasmtime_module_t *module, wasm_exporttype_vec_t *out)
Same as wasm_module_exports, but for wasmtime_module_t.
WASM_API_EXTERN 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.
WASM_API_EXTERN wasmtime_error_t * wasmtime_module_validate(wasm_engine_t *engine, const uint8_t *wasm, size_t wasm_len)
Validate a WebAssembly binary.
WASM_API_EXTERN wasmtime_error_t * wasmtime_module_new(wasm_engine_t *engine, const uint8_t *wasm, size_t wasm_len, wasmtime_module_t **ret)
Compiles a WebAssembly binary into a wasmtime_module_t.
WASM_API_EXTERN 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.
WASM_API_EXTERN 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.
A list of bytes.
Definition: wasm.h:102
Compilation environment and configuration.
A list of wasm_exporttype_t values.
Definition: wasm.h:319
A list of wasm_importtype_t values.
Definition: wasm.h:307
Errors generated by Wasmtime.
A compiled Wasmtime module.