summaryrefslogtreecommitdiff
path: root/test/c-from-rust/rust_interface/foo.rs
blob: acfe2a7a041532ea104dd66423de0d2f9d89ee6d (plain)
1
2
3
4
5
6
7
8
9
10
11
// declaration of the function implemented in the C library
extern "C" {
    pub fn c_func(input: i32) -> i32;
}

// wrapper to call the C function
pub fn c_call(i:i32) -> i32{
   unsafe {
    return c_func(i);
    }
}