https://github.com/ninjascl/dome-rust-plugin-example
An example for creating DOME plugins that calls Rust functions
https://github.com/ninjascl/dome-rust-plugin-example
dome example plugin rust wren
Last synced: 2 months ago
JSON representation
An example for creating DOME plugins that calls Rust functions
- Host: GitHub
- URL: https://github.com/ninjascl/dome-rust-plugin-example
- Owner: NinjasCL
- License: mit
- Created: 2023-01-01T22:05:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-01T22:07:20.000Z (over 2 years ago)
- Last Synced: 2025-01-21T03:42:17.805Z (4 months ago)
- Topics: dome, example, plugin, rust, wren
- Language: C
- Homepage:
- Size: 5.31 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example DOME Rust Plugin
This example is similar to the [traditional plugin](https://github.com/domeengine/dome/tree/main/examples/plugin). But
we are calling a Rust function to log a message.
- *test.c*:
```c
void alertMethod(WrenVM* vm) {
// ...
core->log(ctx, "%s\n", rust_function());
// ...
}
```Is important to include the generated static lib in the compilation step. `libexample.a`
```Makefile
test.dylib: test.c
gcc -dynamiclib -o test.dylib -I../../include test.c libexample.a -undefined dynamic_lookup
```