ralfbiedert / interoptopus

The polyglot bindings generator for your library (C#, C, Python, …) 🐙
MIT License
321 stars 28 forks source link

Added ability to customise naming style for C backend #56

Closed pixsperdavid closed 2 years ago

pixsperdavid commented 2 years ago

Added ability to customise the config to select the naming style used for C types, enum variants, constants and function arguments.

I've added a dependency to the "heck" crate to perform the case conversion. If there is an objection to this I can implement the conversion methods natively in the library.

ralfbiedert commented 2 years ago

I've added a dependency to the "heck" crate to perform the case conversion.

I try to avoid dependencies, but we're using it already in C#. Let's use it for now and maybe replace with lightweight common conversion in interoptopus.

Since you're working a lot on the C backend and add new config flags, could you materialize some of them in another header?

Maybe rename the existing my_header.h to my_header_nodocs.h, and then pick your favorite option combo and produce an my_header_docs_xxx.h residing next to it. You probably also have to update some existing links (e.g., in the main README, which in turn is generated from lib.rs), and change update_ui_tests.sh.

That would make it a bit easier to review changes and prevent unintended changes later down the line. Let me know if you run into any issues.

pixsperdavid commented 2 years ago

Done. I followed the pattern of the C sharp backend in terms of the way multiple test outputs are generated.

ralfbiedert commented 2 years ago

Thanks!

ralfbiedert commented 2 years ago

0.14.8