cbindgen icon indicating copy to clipboard operation
cbindgen copied to clipboard

Allow excluding prefixes for objects

Open Cryoris opened this issue 9 months ago • 0 comments

Summary

I went ahead and opened a proposal to fix #1061. This would add a new config called prefix_excludes, which allows to exclude objects from being prefixed, if a prefix is enabled. If this solution is not what you'd expect I'd be happy to discuss!

Details

Usage would for example look like

[export]
prefix = "MyPrefix_"
prefix_excludes = ["NoPrefixForMe", "NoneForMe"]

This is something that would be greatly appreciated for the C API we're building in Qiskit, where cbindgen has proven to be very useful so far 🙂

I have no experience in committing to cbindgen, I've added a test which produces the output I'm expecting, and I'm happy to add more things that are required for a PR.

Cryoris avatar Apr 04 '25 15:04 Cryoris