add 'extern "C"'
fix a typo
typedef structures
update makefile