Hi. I'm writing a small tool calling into a C library. My original idea was to use bindgen to create the FFI code. The problem is that the library uses a lot of opaque pointers, something like this:
There's nothing wrong with leaving opaque pointers opaque. The dummy struct that bindgen generates is not a problem; you should be using the C api to access it anyway.
Yes if I want to exclusively use the library API (I mean, there is a reason why they are opaque after all ) I was actually thinking to add a layer or top of the library having access to the struct internals but on a second thought this is probably not a good idea.