I’ve been yak shaving the interfaces not the implementation.
I used ai to convert c headers into in nice zig code. Then I link to the library.
It’s cheap to use zig translate-c to convert c headers but the output isn’t nice.
You can give ai c++ source which usually has more documentation than the compromised flat c header. It allows you to do a better zig port. Zig greatly cuts down the noise in c headers as everything needs to have long prefix for namespacing. But in zig we can just nest things properly.
We can introduce intermediate layers to use proper tagged unions and distinguish ?T, *T, [*]T