rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Generate placeholder for .h implementation

Open Yamakaky opened this issue 8 years ago • 6 comments
trafficstars

Use case: implement in Rust the functions defined in a .h. Currently I use bindgen + manual modifications (no_mangle, unimplemented!()).

Yamakaky avatar Jan 25 '17 03:01 Yamakaky

You mean to generate a .h file from a rust file, right?

emilio avatar Jan 25 '17 11:01 emilio

Ohh, ok, the other way around, I see

emilio avatar Jan 25 '17 11:01 emilio

I think this should be sort of trivial once we have #429. We'd only have to change the code generation for functions after that.

emilio avatar Jan 25 '17 11:01 emilio

Example of generated output: https://github.com/Yamakaky/cinder/blob/master/src/vulkan_h.rs#L2875-L2879

Yamakaky avatar Jan 25 '17 13:01 Yamakaky

Is there any update on this ? I need to implement a rust library based on a large C header and did not find an appropriate tool to generate those placeholders. For now, I'm doing it by hand, based on what bindgen normally outputs, and it's long... Does someone has a better solution ?

Zorvalt avatar Nov 14 '20 18:11 Zorvalt

Triage note:

It has been long and the example url that is mentioned in the comment above is gone.

To get clarification -

  • is this still needed?
  • is it only about generating skeleton fns with unimplemented!?

amanjeev avatar Sep 20 '22 18:09 amanjeev

We have not heard back in a while. I am closing this for now. Please reopen if this is needed again. Thank you.

amanjeev avatar Jan 13 '23 21:01 amanjeev