5 $files = array_slice($argv, 3);
7 ($f = fopen($output, 'w')) ||
die("cannot open $output");
9 fwrite($f, "\n/* Generated by idl_list.php. Do NOT modify. */\n\n");
12 foreach ($files as $file) {
13 preg_match('%^(?:.*/([^/]*)/)?(.*)\.idl\.php$%', $file, $matches);
14 $prefix = $matches[1];
16 $ucname = $prefix ?
camelCase($name) : ucfirst($name);
20 $path = $prefix ?
"$prefix/" : "";
21 fwrite($f, "#include \"$path$name.inc\"\n");
24 $path = $prefix ?
: "test";
25 fwrite($f, "#include <$path/test_ext_$name.h>\n");
28 fwrite($f, "RUN_TESTSUITE(TestExt$ucname);\n");
31 $path = $prefix ?
: "runtime/ext";
32 fwrite($f, "#include <$path/ext_$name.h>\n");
39 function camelCase($name) {
40 $names = explode('_', $name);
41 return implode(array_map("ucfirst", $names));