Yes, building a module is the best way if you want to keep your code in C
<snip>