if (!$this->is_type($tokens[$n])) return("type name expected instead of '$tokens[$n]'");
$params[$param]['type']=$tokens[$n];
$n++;
+ if ($tokens[$n] == "&") {
+ $params[$param]['by_ref'] = true;
+ $n++;
+ }
if ($this->is_name($tokens[$n])) {
$params[$param]['name']=$tokens[$n];
$n++;
}
+ if ($tokens[$n] == "&") {
+ $params[$param]['by_ref'] = true;
+ $n++;
+ }
if ($params[$param]['type'] === "resource" && $this->is_name($tokens[$n])) {
$params[$param]['subtype'] = $params[$param]['name'];
$params[$param]['name'] = $tokens[$n];
return true;
}
- function c_code(&$extension) {
+ function c_code($extension) {
$code = "";
$returns = explode(" ", $this->returns);
$code .= $param['subtype']." ";
}
if ($param['type'] !== 'void') {
+ if (isset($param['by_ref'])) {
+ $code .= "&";
+ }
$code .= $param['name'];
}
}
} else {
$xml .= " <methodparam>";
}
- $xml .= "<type>$param[type]</type><parameter>$param[name]</parameter>";
+ $xml .= "<type>$param[type]</type><parameter>";
+ if (isset($param['by_ref'])) {
+ $xml .= "&";
+ }
+ $xml .= "$param[name]</parameter>";
$xml .= "</methodparam>\n";
}
}
</refsect1>
</refentry>
';
- $xml .= $this->docbook_editor_footer(4);
+ $xml .= $this->docbook_editor_settings(4);
return $xml;
}
+
+ function write_test($extension) {
+ $fp = fopen("{$extension->name}/tests/{$this->name}.phpt", "w");
+ fputs($fp,
+"--TEST--
+{$this->name}() function
+--SKIPIF--
+<?php if (!extension_loaded('{$extension->name}')) print 'skip'; ?>
+--POST--
+--GET--
+--FILE--
+<?php
+ echo 'no test case for {$this->name}() yet';
+?>
+--EXPECT--
+no test case for {$this->name}() yet");
+ fclose($fp);
+ }
}
?>
\ No newline at end of file