wrote foreign ccall declarations for all C functions; added some types
for better safety