| 1 |
use std::ffi::CString; |
| 2 |
use std::os::raw::{c_char, c_int}; |
| 3 |
|
| 4 |
#[no_mangle] |
| 5 |
pub unsafe extern "C" fn say_hello() -> *const c_char { |
| 6 |
CString::new("hello").unwrap().into_raw() |
| 7 |
} |
| 8 |
|
| 9 |
#[no_mangle] |
| 10 |
pub unsafe extern "C" fn one() -> c_int { |
| 11 |
1 |
| 12 |
} |