Fix C's .h files parsed as C++ and vice versa, fixes issue #554

Fixes #554. It uses a global variable to pass the path though, because I don't know enough Ruby to fix these without one or alternatively modifying all functions to pass the value. There probably is a better way to do it.