I have looked at the code and it is for PC I think, so the libraries need to be rewritten.
The best way is to start from scratch but use the interface to be compatible with existing documentaton. Could be a nice class (OO iso functional)
If you post your code you have sofar we might be able to help