question to all the #rustlang #FFI experts out there: Within a bigger C code base I like to replace some C code with Rust. I have a existing C header file describing the API and data types which I really don't like to touch. And it seems like this use-case is not really covered by bindgen or cbindgen.

#bindgen helps to generate Rust types, etc. from header files but assumes that your goal is to call from Rust into existing C code. All API functions are inside `extern` blocks.

And there is #cbindgen which is designed to somehow support my use case (calling Rust code from C) but it generates the C header instead of relying on existing ones.

So far I guess the way to go is to use bindgen to generate the bindings and manully adapt the generated code by replacing `extern { fn foo(); }` with `#[no_mangle] pub extern fn foo() { ... }`.

Am I missing something?