Hello,
To convert these codes, you need to know a little C programming for PIC18, search the web and find lots of information. Including IDE MPLABX explains how to use each function. You also need to reconfigure the configuration bits.
Hope this helps;-)