language detection assumes .h files are c files, lots of people use .h for c++ as well.
ensure_apiname is the location where user rc info is parsed, so I allow the language to be explicitly specified.