mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-17 09:35:46 +01:00
setup project files
Added (most) of the project files to the working tree. Some work still needs to be done to make the rust/C communication better before we can fully move on to starting to write the actual applicaiton.
This commit is contained in:
12
src/lib.rs
Normal file
12
src/lib.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
#![no_std]
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn get_str() -> *const u8 {
|
||||
let str = "Hello, World\0";
|
||||
return str.as_ptr();
|
||||
}
|
||||
8
src/main.c
Normal file
8
src/main.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
extern char const* get_str(void);
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
(void)argc, (void)argv;
|
||||
printf("%s\n", get_str());
|
||||
}
|
||||
Reference in New Issue
Block a user