core: Double extension file names support

Extend the foo.c.in parser selection algorithm to work with any other double
extension file name.