Generating .di header files from ImportC files

Bradley Chatha sealabjaster at gmail.com
Wed Dec 27 12:58:42 UTC 2023


On Saturday, 21 October 2023 at 02:13:24 UTC, Walter Bright wrote:
> ...

Great hidden feature!

I just tried this out for converting the libsodium headers into a 
.di file. It requires a little work before turning it into a .di 
(e.g. removing extensions) and then a little bit after (since the 
compiler generates code like `void someFunc(const struct 
someStruct* param1)`.

But after a few seds and a small D script to remove declarations 
I don't care about, it actually wasn't too painful compared to 
using something like dstep which is a 50/50 gamble on whether it 
works, and is a much bigger pain to automatically clean the 
output of.


More information about the Digitalmars-d mailing list