differances between "coding" with arduino ide vs. AVR ide

I have been tinkering with different sketches included with the Arduino IDE and some on the net. I came accross some "code" that is "compiled" using the AVR IDE loaded on an ATmega8 through a STK500 developer board. I have a Arduino UNO board with the ATmega328p and would like to know if I can adapt the code for the 328p or would I have to start over from scratch and build the entire sketch from the ground up as the writer did in AVR IDE back in the beginning of 2008. I am a little fuzzy with the stuff that happens after you hit the upload button on a sketch. His code starts with the following lines:

#include <stdint.h>\par
#include <stdlib.h>\par
#include <inttypes.h>\par
#include <avr/eeprom.h>\par
#include <avr/interrupt.h>\par
#include <avr/io.h>\par
#include <avr/pgmspace.h>\par
#include <avr/sleep.h>\par
#include <avr/wdt.h>\par

so does the Arduino IDE add stuff like this to the program before it 'compiles' it into something the chip can execute?

Thanks,
dmac257

dmac257:
so does the Arduino IDE add stuff like this to the program before it 'compiles' it into something the chip can execute?

Yes, more or less although some functions have been replaced and some initialisation code is already provided and doesn't need to be done by your program.

If you miss the access to a AVR-glibc, you can add the include you need even in Arduino programs. Just make sure you understand what the code does before you go ahead.

Korman