Initial PROTEL 2026 toolchain import

This commit is contained in:
2026-06-08 18:04:03 -05:00
commit 98a0bb329d
125 changed files with 12223 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
// Rust function called from PROTEL via EXTERNAL / #[no_mangle] extern "C".
use std::ffi::CStr;
use std::os::raw::c_char;
#[no_mangle]
pub extern "C" fn rust_greet(name: *const c_char, value: i16) {
let label = unsafe {
if name.is_null() {
"<null>"
} else {
CStr::from_ptr(name).to_str().unwrap_or("<invalid utf-8>")
}
};
println!("Rust: rust_greet(name={label}, value={value})");
}