Google\\Protobuf\\BoolValue $ret = stripSuffix($filename, ".php"); return str_replace("/", "\\\\", $ret); } function toCSymbolName($filename) { # Google/Protobuf/BoolValue.php -> Google__Protobuf__BoolValue $ret = stripSuffix($filename, ".php"); return str_replace("/", "__", $ret); } $f = fopen($output, "w"); fwrite($f, "#include \"bundled_php.h\"\n"); fwrite($f, "#include \"stdlib.h\"\n"); foreach ($filenames as $filename) { print("Reading $filename...\n"); $contents = file_get_contents($filename); $contents = substr($contents, 5); // Strip