Skip to content

Commit

Permalink
chore(runtime-c-api) Update C/C++ header files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed May 22, 2019
1 parent c92230e commit 11f1bba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 6 additions & 6 deletions lib/runtime-c-api/wasmer.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,12 @@ void wasmer_import_descriptors_destroy(wasmer_import_descriptors_t *import_descr
* Gets import descriptor by index
*/
wasmer_import_descriptor_t *wasmer_import_descriptors_get(wasmer_import_descriptors_t *import_descriptors,
int idx);
unsigned int idx);

/**
* Gets the length of the import descriptors
*/
int wasmer_import_descriptors_len(wasmer_import_descriptors_t *exports);
unsigned int wasmer_import_descriptors_len(wasmer_import_descriptors_t *exports);

/**
* Frees memory for the given Func
Expand All @@ -339,9 +339,9 @@ void wasmer_import_func_destroy(wasmer_import_func_t *func);
*/
wasmer_import_func_t *wasmer_import_func_new(void (*func)(void *data),
const wasmer_value_tag *params,
int params_len,
unsigned int params_len,
const wasmer_value_tag *returns,
int returns_len);
unsigned int returns_len);

/**
* Sets the params buffer to the parameter types of the given wasmer_import_func_t
Expand All @@ -351,7 +351,7 @@ wasmer_import_func_t *wasmer_import_func_new(void (*func)(void *data),
*/
wasmer_result_t wasmer_import_func_params(const wasmer_import_func_t *func,
wasmer_value_tag *params,
int params_len);
unsigned int params_len);

/**
* Sets the result parameter to the arity of the params of the wasmer_import_func_t
Expand All @@ -369,7 +369,7 @@ wasmer_result_t wasmer_import_func_params_arity(const wasmer_import_func_t *func
*/
wasmer_result_t wasmer_import_func_returns(const wasmer_import_func_t *func,
wasmer_value_tag *returns,
int returns_len);
unsigned int returns_len);

/**
* Sets the result parameter to the arity of the returns of the wasmer_import_func_t
Expand Down
13 changes: 7 additions & 6 deletions lib/runtime-c-api/wasmer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <new>

enum class wasmer_import_export_kind : uint32_t {
WASM_FUNCTION,
Expand Down Expand Up @@ -260,10 +261,10 @@ void wasmer_import_descriptors_destroy(wasmer_import_descriptors_t *import_descr

/// Gets import descriptor by index
wasmer_import_descriptor_t *wasmer_import_descriptors_get(wasmer_import_descriptors_t *import_descriptors,
int idx);
unsigned int idx);

/// Gets the length of the import descriptors
int wasmer_import_descriptors_len(wasmer_import_descriptors_t *exports);
unsigned int wasmer_import_descriptors_len(wasmer_import_descriptors_t *exports);

/// Frees memory for the given Func
void wasmer_import_func_destroy(wasmer_import_func_t *func);
Expand All @@ -272,17 +273,17 @@ void wasmer_import_func_destroy(wasmer_import_func_t *func);
/// The caller owns the object and should call `wasmer_import_func_destroy` to free it.
wasmer_import_func_t *wasmer_import_func_new(void (*func)(void *data),
const wasmer_value_tag *params,
int params_len,
unsigned int params_len,
const wasmer_value_tag *returns,
int returns_len);
unsigned int returns_len);

/// Sets the params buffer to the parameter types of the given wasmer_import_func_t
/// 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_import_func_params(const wasmer_import_func_t *func,
wasmer_value_tag *params,
int params_len);
unsigned int params_len);

/// Sets the result parameter to the arity of the params of the wasmer_import_func_t
/// Returns `wasmer_result_t::WASMER_OK` upon success.
Expand All @@ -296,7 +297,7 @@ wasmer_result_t wasmer_import_func_params_arity(const wasmer_import_func_t *func
/// and `wasmer_last_error_message` to get an error message.
wasmer_result_t wasmer_import_func_returns(const wasmer_import_func_t *func,
wasmer_value_tag *returns,
int returns_len);
unsigned int returns_len);

/// Sets the result parameter to the arity of the returns of the wasmer_import_func_t
/// Returns `wasmer_result_t::WASMER_OK` upon success.
Expand Down

0 comments on commit 11f1bba

Please sign in to comment.