function to handle c functions
C function completed