Skip to content

Commit

Permalink
Showing 2 changed files with 22 additions and 8 deletions.
16 changes: 12 additions & 4 deletions lib/runtime-c-api/wasmer.h
Original file line number Diff line number Diff line change
@@ -66,6 +66,10 @@ typedef struct {

typedef struct {

} wasmer_memory_t;

typedef struct {

} wasmer_exports_t;

typedef struct {
@@ -99,10 +103,6 @@ typedef struct {

typedef struct {

} wasmer_memory_t;

typedef struct {

} wasmer_table_t;

typedef union {
@@ -241,6 +241,14 @@ wasmer_byte_array wasmer_export_name(wasmer_export_t *export_);
*/
const wasmer_export_func_t *wasmer_export_to_func(const wasmer_export_t *export_);

/**
* Gets a memory pointer from an export pointer.
* Returns `wasmer_result_t::WASMER_OK` upon success.
* Returns `wasmer_result_t::WASMER_ERROR` upon failure. Use `wasmer_last_error_length`
* and `wasmer_last_error_message` to get an error message.
*/
wasmer_result_t wasmer_export_to_memory(const wasmer_export_t *export_, wasmer_memory_t **memory);

/**
* Frees the memory for the given exports
*/
14 changes: 10 additions & 4 deletions lib/runtime-c-api/wasmer.hh
Original file line number Diff line number Diff line change
@@ -61,6 +61,10 @@ struct wasmer_export_t {

};

struct wasmer_memory_t {

};

struct wasmer_exports_t {

};
@@ -94,10 +98,6 @@ struct wasmer_instance_context_t {

};

struct wasmer_memory_t {

};

struct wasmer_table_t {

};
@@ -210,6 +210,12 @@ wasmer_byte_array wasmer_export_name(wasmer_export_t *export_);
/// Gets export func from export
const wasmer_export_func_t *wasmer_export_to_func(const wasmer_export_t *export_);

/// Gets a memory pointer from an export pointer.
/// Returns `wasmer_result_t::WASMER_OK` upon success.
/// Returns `wasmer_result_t::WASMER_ERROR` upon failure. Use `wasmer_last_error_length`
/// and `wasmer_last_error_message` to get an error message.
wasmer_result_t wasmer_export_to_memory(const wasmer_export_t *export_, wasmer_memory_t **memory);

/// Frees the memory for the given exports
void wasmer_exports_destroy(wasmer_exports_t *exports);

0 comments on commit a59ce13

Please sign in to comment.