PULSEIN Function Code

Where can i find the coding behind the pulsein function?
I'm looking to adapt this for PIC.

Cheers,
Pracas

"pulseIn" is in "wiring_pulse.c"