functions_and_types/functions_and_types.rs
1use wrapgen::{WrapGen, WrapperType};
2
3fn main() {
4 WrapGen::default()
5 .wrap_pointer_type(
6 WrapperType::new("inode", "Inode")
7 .with_field("i_sb", "*mut super_block")
8 .with_field_writeonly("i_ino", "cty::c_int"),
9 )
10 .wrap_pointer_type(WrapperType::new("dentry", "Dentry"))
11 .add_function("fn get_inode(sb: *mut super_block) -> *mut inode")
12 .add_function("fn c_dget(dentry: *mut dentry) -> *mut dentry;")
13 .generate("outfile.rs")
14}