What is the best practice for this? You can't do it in one time, I suppose you'll have to use FFI, so my idea was to port Xash3D (Half-Life engine), but its too complicated, the modules are too big and depend of globals, void functions, hash tables, structs with function pointers, etc.
So how would you do it bit by bit?