Similar code written for PICC compiler, slightly more readable IMHO.
// Creating the long integer
long int ADC_Num;
// Setting up Port A to do ADC on Pin 2
// (Note: Pin 2 is A0)
// Allowing a delay to make sure the ADC
// works properly
// Getting the value from the ADC port
ADC_Num = read_adc();
It uses functions which are defined for the CCS inc compiler though, so you'd need their headers to compile it.