mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-13 00:51:20 +00:00
Add function to get export from ns/name via ImportObject to C API
This commit is contained in:
@ -10,10 +10,10 @@
|
||||
* List of export/import kinds.
|
||||
*/
|
||||
enum wasmer_import_export_kind {
|
||||
WASM_FUNCTION,
|
||||
WASM_GLOBAL,
|
||||
WASM_MEMORY,
|
||||
WASM_TABLE,
|
||||
WASM_FUNCTION = 0,
|
||||
WASM_GLOBAL = 1,
|
||||
WASM_MEMORY = 2,
|
||||
WASM_TABLE = 3,
|
||||
};
|
||||
typedef uint32_t wasmer_import_export_kind;
|
||||
|
||||
@ -469,6 +469,22 @@ wasmer_result_t wasmer_import_object_extend(wasmer_import_object_t *import_objec
|
||||
wasmer_import_t *imports,
|
||||
unsigned int imports_len);
|
||||
|
||||
/**
|
||||
* Gets an entry from an ImportObject at the name and namespace.
|
||||
* Stores an immutable reference to `name` and `namespace` in `import`.
|
||||
*
|
||||
* The caller owns all data involved.
|
||||
* `import_export_value` will be written to based on `tag`, `import_export_value` must be
|
||||
* initialized to point to the type specified by `tag`. Failure to do so may result
|
||||
* in data corruption or undefined behavior.
|
||||
*/
|
||||
wasmer_result_t wasmer_import_object_get_import(const wasmer_import_object_t *import_object,
|
||||
wasmer_byte_array namespace_,
|
||||
wasmer_byte_array name,
|
||||
wasmer_import_t *import,
|
||||
wasmer_import_export_value *import_export_value,
|
||||
uint32_t tag);
|
||||
|
||||
/**
|
||||
* Creates a new empty import object.
|
||||
* See also `wasmer_import_object_append`
|
||||
|
Reference in New Issue
Block a user