Skip to content

Commit b632a74

Browse files
jirkamarsikban-mi
andcommitted
Improved wording and fixes in C embedding guide
Co-authored-by: Betty Mann <[email protected]>
1 parent 6e7c71a commit b632a74

File tree

1 file changed

+5
-5
lines changed
  • graalwasm/graalwasm-embed-c-code-guide

1 file changed

+5
-5
lines changed

graalwasm/graalwasm-embed-c-code-guide/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ public class App {
182182

183183
## 4. Using Java functions from WebAssembly
184184

185-
You can also call Java functions from WebAssembly by importing them in your WebAssembly modules.
186-
For the sake of an example, let's try to move the logic which computes the next element of the output (by doing an integer increment) to a Java function.
185+
You can also call Java functions from WebAssembly by importing them into your WebAssembly modules.
186+
For this example, let's try to move the logic which computes the next element of the output (by doing an integer increment) to a Java function.
187187

188-
Here is what we will need to add to our C file to declare an external function whose implementation we will provide in Java:
188+
We need to add the following to our C file to declare an external function whose implementation we will provide in Java:
189189

190190
```c
191191
extern int javaInc(int number)
@@ -196,7 +196,7 @@ __attribute__((
196196
```
197197

198198
This introduces an import in the resulting WebAssembly module.
199-
The import will try to pull a function named `java-increment` from the imported module `env`.
199+
The import will pull a function named `java-increment` from the imported module `env`.
200200
Within our C code, this function will be available under the name `javaInc`.
201201
We can update our `floyd` function to use `javaInc` like so:
202202

@@ -243,7 +243,7 @@ public class App {
243243
}
244244
```
245245

246-
## 4. Building and Testing the Application
246+
## 5. Building and Testing the Application
247247

248248
Compile and run this Java application with Maven:
249249

0 commit comments

Comments
 (0)