Example #1
0
        $inc_file = "\"ext_{$name}.h\"";
    } else {
        $inc_file = "<runtime/ext/ext_{$name}.h>";
    }
    fprintf($f, <<<EOT

#include {$inc_file}

namespace HPHP {
///////////////////////////////////////////////////////////////////////////////


EOT
);
    foreach ($funcs as $func) {
        generateFuncCPPImplementation($func, $f);
    }
    fprintf($f, <<<EOT

///////////////////////////////////////////////////////////////////////////////
}

EOT
);
}
/*****************************************************************************/
if ($inc) {
    ($f = fopen($inc, 'w')) || die("cannot open {$inc}");
    fprintf($f, "#if EXT_TYPE == 0\n");
    foreach ($funcs as $func) {
        generateFuncCPPInclude($func, $f);
Example #2
0
File: idl.php Project: afaltz/hhvm
function idl_format_cpp_impl($impl)
{
    global $funcs, $name, $mode, $constants, $classes;
    ($f = fopen($impl, 'w')) || die("cannot open {$impl}");
    if ($mode) {
        $header_file = "\"ext_{$name}.h\"";
    } else {
        $header_file = "<runtime/ext/ext_{$name}.h>";
    }
    fprintf($f, <<<EOT

#include {$header_file}

namespace HPHP {
///////////////////////////////////////////////////////////////////////////////


EOT
);
    foreach ($constants as $const) {
        generateConstCPPImplementation($const, $f);
    }
    foreach ($funcs as $func) {
        generateFuncCPPImplementation($func, $f);
    }
    foreach ($classes as $class) {
        generateClassCPPImplementation($class, $f);
    }
    fprintf($f, <<<EOT

///////////////////////////////////////////////////////////////////////////////
}

EOT
);
}
Example #3
0
function generateMethodCPPImplementation($method, $class, $f)
{
    if ($method['flags'] & IsStatic) {
        $prefix = "c_{$class['name']}::ti_";
    } else {
        $prefix = "c_{$class['name']}::t_";
    }
    generateFuncCPPImplementation($method, $f, $prefix);
}