summaryrefslogtreecommitdiff
path: root/test_ffi/src
diff options
context:
space:
mode:
authorElias Sjögreen <eliassjogreen1@gmail.com>2021-08-06 23:28:10 +0200
committerGitHub <noreply@github.com>2021-08-06 23:28:10 +0200
commit33c8d790c3d358a475c9ba828043e2c19e8d4b37 (patch)
tree4ab33b3e5b352d49667d55631c76ee76af2ec5e2 /test_ffi/src
parent0d1a522a03c22749e96dab06ca7b3e8b428df701 (diff)
feat: ffi to replace plugins (#11152)
This commit removes implementation of "native plugins" and replaces it with FFI API. Effectively "Deno.openPlugin" API was replaced with "Deno.dlopen" API.
Diffstat (limited to 'test_ffi/src')
-rw-r--r--test_ffi/src/lib.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/test_ffi/src/lib.rs b/test_ffi/src/lib.rs
new file mode 100644
index 000000000..d9e950d4f
--- /dev/null
+++ b/test_ffi/src/lib.rs
@@ -0,0 +1,9 @@
+#[no_mangle]
+pub extern "C" fn print_something() {
+ println!("something");
+}
+
+#[no_mangle]
+pub extern "C" fn add(a: u32, b: u32) -> u32 {
+ a + b
+}