Update C code and .gitignore