integrate with mac build system and add skeleton

This commit is contained in:
Grant Limberg 2021-10-27 17:09:01 -07:00
commit c689c0bd8c
No known key found for this signature in database
GPG key ID: 2BA62CCABBB4095A
3 changed files with 29 additions and 13 deletions

View file

@ -9,7 +9,7 @@ fn main() {
let package_name = env::var("CARGO_PKG_NAME").unwrap();
let output_file = target_dir()
.join(format!("{}.hpp", package_name))
.join(format!("{}.h", package_name))
.display()
.to_string();

View file

@ -1,13 +1,22 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}
#[repr(C)]
pub struct ZeroIDC {}
#[no_mangle]
pub extern "C" fn hello_rust() {
println!("Hello, Rust from C!")
pub extern "C" fn zeroidc_new() -> Box<ZeroIDC> {
Box::new(ZeroIDC{})
}
#[no_mangle]
pub extern "C" fn zeroidc_delete(_: Option<Box<ZeroIDC>>) {}
#[no_mangle]
pub extern "C" fn zeroidc_start(idc: &mut ZeroIDC) {
}
#[no_mangle]
pub extern "C" fn zeroidc_stop(idc: &mut ZeroIDC) {
}