update idl_list.php for namespaces + lint errors

- fixes lint errors regarding generated files and generates same headers
Esse commit está contido em:
Sean Cannella
2013-05-20 11:27:01 -07:00
commit de Sara Golemon
commit c0cc5ef954
4 arquivos alterados com 48 adições e 10 exclusões
+6 -6
Ver Arquivo
@@ -54,8 +54,8 @@ function idl_format_cpp_header($header) {
fprintf($f,
<<<EOT
#ifndef __${PREFIX}_${NAME}_H__
#define __${PREFIX}_${NAME}_H__
#ifndef incl_${PREFIX}_${NAME}_H_
#define incl_${PREFIX}_${NAME}_H_
// >>>>>> Generated by idl.php. Do NOT modify. <<<<<<
@@ -93,7 +93,7 @@ EOT
///////////////////////////////////////////////////////////////////////////////
}
#endif // __${PREFIX}_${NAME}_H__
#endif // incl_${PREFIX}_${NAME}_H_
EOT
);
@@ -157,8 +157,8 @@ function idl_format_test_header($test_header) {
fprintf($f,
<<<EOT
#ifndef __TEST_${PREFIX}_${NAME}_H__
#define __TEST_${PREFIX}_${NAME}_H__
#ifndef incl_TEST_${PREFIX}_${NAME}_H_
#define incl_TEST_${PREFIX}_${NAME}_H_
// >>>>>> Generated by idl.php. Do NOT modify. <<<<<<
@@ -185,7 +185,7 @@ EOT
///////////////////////////////////////////////////////////////////////////////
#endif // __TEST_${PREFIX}_${NAME}_H__
#endif // incl_TEST_${PREFIX}_${NAME}_H_
EOT
);
+32 -4
Ver Arquivo
@@ -6,8 +6,24 @@ $files = array_slice($argv, 3);
($f = fopen($output, 'w')) || die("cannot open $output");
$FORMAT = strtoupper($format);
fwrite($f, "\n/* Generated by idl_list.php. Do NOT modify. */\n\n");
switch ($format) {
case 'test_ext':
case 'ext':
fwrite($f, <<<EOT
#ifndef incl_EXT_LIST_{$FORMAT}_H_
#define incl_EXT_LIST_{$FORMAT}_H_
EOT
);
break;
}
sort($files);
foreach ($files as $file) {
preg_match('%^(?:.*/([^/]*)/)?(.*)\.idl\.json$%', $file, $matches);
@@ -17,19 +33,31 @@ foreach ($files as $file) {
switch ($format) {
case 'test_ext':
$path = $prefix ?: "test";
fwrite($f, "#include <$path/test_ext_$name.h>\n");
$path = $prefix ?: "hphp/test";
fwrite($f, "#include \"$path/test_ext_$name.h\"\n");
break;
case 'test_suites':
fwrite($f, "RUN_TESTSUITE(TestExt$ucname);\n");
break;
case 'ext':
$path = $prefix ?: "runtime/ext";
fwrite($f, "#include <$path/ext_$name.h>\n");
$path = $prefix ?: "hphp/runtime/ext";
fwrite($f, "#include \"$path/ext_$name.h\"\n");
break;
}
}
switch ($format) {
case 'test_ext':
case 'ext':
fwrite($f, <<<EOT
#endif // incl_EXT_LIST_{$FORMAT}_H_
EOT
);
break;
}
fclose($f);
function camelCase($name) {
+5
Ver Arquivo
@@ -17,6 +17,9 @@
/* Generated by idl_list.php. Do NOT modify. */
#ifndef incl_EXT_LIST_EXT_H_
#define incl_EXT_LIST_EXT_H_
#include "hphp/runtime/ext/ext_apache.h"
#include "hphp/runtime/ext/ext_apc.h"
#include "hphp/runtime/ext/ext_apd.h"
@@ -87,3 +90,5 @@
#include "hphp/runtime/ext/ext_xmlreader.h"
#include "hphp/runtime/ext/ext_xmlwriter.h"
#include "hphp/runtime/ext/ext_zlib.h"
#endif // incl_EXT_LIST_EXT_H_
+5
Ver Arquivo
@@ -16,6 +16,9 @@
/* Generated by idl_list.php. Do NOT modify. */
#ifndef incl_EXT_LIST_TEST_EXT_H_
#define incl_EXT_LIST_TEST_EXT_H_
#include "hphp/test/test_ext_apache.h"
#include "hphp/test/test_ext_apc.h"
#include "hphp/test/test_ext_apd.h"
@@ -86,3 +89,5 @@
#include "hphp/test/test_ext_xmlreader.h"
#include "hphp/test/test_ext_xmlwriter.h"
#include "hphp/test/test_ext_zlib.h"
#endif // incl_EXT_LIST_TEST_EXT_H_