Functions

  • Patterns in parameters are disallowed
  • Must not have body

Examples

use std::ffi::*;

extern "C" {
    /// writes the string s and a trailing newline to stdout
    fn puts(s: *const c_char) -> c_int;
}

fn main() {
    let s = CString::new("Hello, RustBLR!").unwrap();
    assert!(unsafe { puts(s.as_ptr()) } >= 0);
}

References