From 7f77dddda9161a692fca7837290420a3a5dd05e9 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sun, 12 Nov 2023 13:37:11 -0800 Subject: [PATCH] stub rust sneakers effect --- src/lib.rs | 1 + src/sneakers.c | 6 ++++++ src/sneakers.rs | 10 ++++++++++ 3 files changed, 17 insertions(+) create mode 100644 src/sneakers.rs diff --git a/src/lib.rs b/src/lib.rs index 4c03658..81fd0d4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ mod args; mod charset; mod color; +mod sneakers; use libc::{c_char, c_int, c_void}; use std::ffi::CString; diff --git a/src/sneakers.c b/src/sneakers.c index db5b012..3e8b21f 100644 --- a/src/sneakers.c +++ b/src/sneakers.c @@ -11,7 +11,13 @@ #include #include "nmseffect.h" +extern void rust_sneakers_effect(); + int main(void) { + + rust_sneakers_effect(); + + int termCols, spaces = 0; unsigned char *display_uc = NULL; char *display = NULL; diff --git a/src/sneakers.rs b/src/sneakers.rs new file mode 100644 index 0000000..72cb4a0 --- /dev/null +++ b/src/sneakers.rs @@ -0,0 +1,10 @@ + + +#[no_mangle] +pub extern "C" fn rust_sneakers_effect() { + println!("Rust sneakers effect"); + use std::time::Duration; + + let dur = Duration::from_millis(2000); + std::thread::sleep(dur); +}