I think write a ACK() fuction and put the following code in it.
void ACK(void)
{
/*configure the SDA as output port */
/* SDA is Low */
SDA=LOW;
delay_i2c(20);
/* SCL is kept High */
SCL=HIGH;
delay_i2c(20);
/* SCL is kept Low */
SCL=LOW;
/* delay */
delay_i2c(20);
}
and the NACK() is just opposite logic of ACK();
And write the EEPROM_read() or EEPROM_write pass the device id ,address location and the data
in the last check for the ACK ().