Created
December 13, 2017 12:10
-
-
Save anonymous/c5c26a52a9b6d62a0806302e45336311 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int hello(char args[]) | |
{ | |
printf("%s\n", args); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate libc; | |
#[link(name="libcore")] | |
extern { | |
fn hello(args: &str) -> i32; | |
} | |
fn main(){ | |
let input = "hello, cffi!"; | |
unsafe{ | |
hello(&input); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment