add new file with extern c functions and some realted changes
missed these at first