Another approach is to compile the .c file with the -di flag, which will translate the C code to D code and emit it into .di file. It doesn't do this perfectly, but usually gets it good enough that any rough edges can be edited and fixed. Then you can add @nogc and nothrow.