diff --git a/lib/c-api/src/error.rs b/lib/c-api/src/error.rs index ee713aebb..1d81b8729 100644 --- a/lib/c-api/src/error.rs +++ b/lib/c-api/src/error.rs @@ -47,9 +47,9 @@ pub extern "C" fn wasmer_last_error_length() -> c_int { /// error occurs. Potential errors are: /// /// * The buffer is a null pointer, -/// * The buffer is too smal to hold the error message. +/// * The buffer is too small to hold the error message. /// -/// Note: The error message always has a trailing null character. +/// Note: The error message always has a trailing NUL character. /// /// Example: /// diff --git a/lib/c-api/tests/wasm-c-api-wasi.c b/lib/c-api/tests/wasm-c-api-wasi.c index 0f077fd32..4d91ae33c 100644 --- a/lib/c-api/tests/wasm-c-api-wasi.c +++ b/lib/c-api/tests/wasm-c-api-wasi.c @@ -3,7 +3,7 @@ #include #include -//#include "wasm.h" +#include "wasm.h" #include "wasmer_wasm.h" #define BUF_SIZE 128 diff --git a/lib/c-api/wasmer.h b/lib/c-api/wasmer.h index ae4219533..807a1f177 100644 --- a/lib/c-api/wasmer.h +++ b/lib/c-api/wasmer.h @@ -1108,9 +1108,9 @@ int wasmer_last_error_length(void); * error occurs. Potential errors are: * * * The buffer is a null pointer, - * * The buffer is too smal to hold the error message. + * * The buffer is too small to hold the error message. * - * Note: The error message always has a trailing null character. + * Note: The error message always has a trailing NUL character. * * Example: * diff --git a/lib/c-api/wasmer.hh b/lib/c-api/wasmer.hh index 5bffbb267..3ca704f8a 100644 --- a/lib/c-api/wasmer.hh +++ b/lib/c-api/wasmer.hh @@ -906,9 +906,9 @@ int wasmer_last_error_length(); /// error occurs. Potential errors are: /// /// * The buffer is a null pointer, -/// * The buffer is too smal to hold the error message. +/// * The buffer is too small to hold the error message. /// -/// Note: The error message always has a trailing null character. +/// Note: The error message always has a trailing NUL character. /// /// Example: /// diff --git a/lib/c-api/wasmer_wasm.h b/lib/c-api/wasmer_wasm.h index ad7e4110b..058f83954 100644 --- a/lib/c-api/wasmer_wasm.h +++ b/lib/c-api/wasmer_wasm.h @@ -29,11 +29,12 @@ typedef struct wasi_env_t wasi_env_t; // The version of WASI to use. typedef uint32_t wasi_version_t; -const uint32_t WASI_VERSION_LATEST = 0; -const uint32_t WASI_VERSION_SNAPSHOT0 = 1; -const uint32_t WASI_VERSION_SNAPSHOT1 = 2; -const uint32_t WASI_VERSION_INVALID = ~0; - +enum { + WASI_VERSION_LATEST = 0, + WASI_VERSION_SNAPSHOT0 = 1, + WASI_VERSION_SNAPSHOT1 = 2, + WASI_VERSION_INVALID = ~0 +}; // Create a `wasi_state_builder_t`. // @@ -47,7 +48,7 @@ void wasi_state_builder_arg(wasi_state_builder_t*, const char* arg); // Add an environment variable to be passed to the Wasi program. void wasi_state_builder_env(wasi_state_builder_t*, const char* key, const char* value); -// Override `sdtout` with the given `wasi_file_handle_t`. +// Override `stdout` with the given `wasi_file_handle_t`. void wasi_state_builder_set_stdout(wasi_state_builder_t*, wasi_file_handle_t*); // Consume the `wasi_state_builder_t` and get a `wasi_state_t`. @@ -60,7 +61,10 @@ own wasi_env_t* wasi_env_new(own wasi_state_t*); void wasi_env_delete(own wasi_env_t*); // Get an array of imports that can be used to instantiate the given module. -own const wasm_extern_t* own const* wasi_get_imports(wasm_store_t*, wasm_module_t*, wasi_env_t*, wasi_version_t); +own const wasm_extern_t* own const* wasi_get_imports(wasm_store_t* store, + wasm_module_t* module, + wasi_env_t* wasi_env, + wasi_version_t version); // TODO: investigate removing this part of the API // TODO: investigate removing the wasi_version stuff from the API @@ -81,7 +85,7 @@ own wasi_file_handle_t* wasi_output_capturing_file_new(); // Delete an owned `wasi_file_handle_t` void wasi_output_capturing_file_delete(own wasi_file_handle_t*); -// Read from a capturing file (created by `wasi_output_capturing_file_new`. +// Read from a capturing file (created by `wasi_output_capturing_file_new`). size_t wasi_output_capturing_file_read(wasi_file_handle_t* file, char* buffer, size_t buffer_len, @@ -113,7 +117,7 @@ int wasmer_last_error_length(); * error occurs. Potential errors are: * * * The buffer is a null pointer, - * * The buffer is too smal to hold the error message. + * * The buffer is too small to hold the error message. * * Note: The error message always has a trailing null character. *