sensorial-systems / ligen

Apache License 2.0
19 stars 3 forks source link

Callback marshalling #14

Open notdanilo opened 3 years ago

notdanilo commented 3 years ago

Turn

fn f(callback: Box<dyn Fn(i32,i32) -> i32> { ... }

into

void f(int (*callback)(int, int)) { ... }
notdanilo commented 3 years ago

Ref: https://stackoverflow.com/questions/32270030/how-do-i-convert-a-rust-closure-to-a-c-style-callback

notdanilo commented 3 years ago

Ref2: https://users.rust-lang.org/t/callback-based-c-ffi/26583