diff --git a/README.md b/README.md index a1ec2b7..cf73105 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,9 @@ extern "ExtismHost" { } ``` +> **Note**: Under the hood this macro turns this into an interface that passes a pointer as an argument +> and a pointer as a return. If you want to pass raw, dereferenced wasm values see the raw interface documentation below. + To declare a host function in a specific namespace, pass the module name to the `host_fn` macro: ```rust @@ -335,6 +338,19 @@ python3 app.py # => An argument to send to Python! ``` +## Raw Import Interface + +Like exports, with imports we do some magic to turn the parameters and returns into pointers for you. +In some rare situations, you might wish to pass raw wasm values to the host (not pointers). +If you do, you need to drop down into a raw interface. +E.g, imagine an interface that sums two i64s + +```rust +extern "C" { + fn sum(a: i64, b: i64) -> i64; +} +``` + ### Reach Out! Have a question or just want to drop in and say hi? [Hop on the Discord](https://extism.org/discord)! diff --git a/count_vowels.wasm b/count_vowels.wasm new file mode 100644 index 0000000..23b70b5 Binary files /dev/null and b/count_vowels.wasm differ diff --git a/test/code.wasm b/test/code.wasm index 75e1a83..3e5b54c 100755 Binary files a/test/code.wasm and b/test/code.wasm differ diff --git a/test/host_function.wasm b/test/host_function.wasm index bba3366..7a32758 100755 Binary files a/test/host_function.wasm and b/test/host_function.wasm differ diff --git a/test/http.wasm b/test/http.wasm index b082736..8d780e4 100755 Binary files a/test/http.wasm and b/test/http.wasm differ