diff options
author | Hartmut Holzgraefe <hholzgra@php.net> | 2003-02-19 16:02:45 +0000 |
---|---|---|
committer | Hartmut Holzgraefe <hholzgra@php.net> | 2003-02-19 16:02:45 +0000 |
commit | 843e3449cf57e16caf32eec366c325648d61441c (patch) | |
tree | 237ecf9119057fff5a879710438548e252744215 /scripts/ext_skel_ng/php_function.php | |
parent | 397785bdcd82589616f81f3ec83ae43dd5727c3a (diff) | |
download | php-git-843e3449cf57e16caf32eec366c325648d61441c.tar.gz |
code for the special functions MINIT, MSHUTDOWN, RINIT, RSHUTDOWN, MINFO
and for private internal C helper functions may now be embedded into
the XML specification
Diffstat (limited to 'scripts/ext_skel_ng/php_function.php')
-rw-r--r-- | scripts/ext_skel_ng/php_function.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/scripts/ext_skel_ng/php_function.php b/scripts/ext_skel_ng/php_function.php index c9abe73035..c5df80893f 100644 --- a/scripts/ext_skel_ng/php_function.php +++ b/scripts/ext_skel_ng/php_function.php @@ -2,12 +2,13 @@ class php_function extends php_element { // all known php types - function php_function($name, $summary, $proto, $desc="", $code="") { + function php_function($name, $summary, $proto, $desc="", $code="", $role="") { $this->name = $name; $this->summary = $summary; - $this->parse_proto($proto); $this->desc = empty($desc) ? "&warn.undocumented.func;" : $desc; $this->code = $code; + $this->role = empty($role) ? "public" : $role; + if($this->role === "public") $this->parse_proto($proto); } function parse_proto($proto) { @@ -76,6 +77,10 @@ } function c_code() { + $code = ""; + + switch($this->role) { + case "public": $code .= "\n/* {{{ proto {$this->returns} {$this->name}("; if(isset($this->params)) { foreach($this->params as $param) { @@ -160,7 +165,18 @@ } $code .= "\tphp_error(E_WARNING, \"{$this->name}: not yet implemented\");\n"; $code .= "}\n/* }}} */\n\n"; - + break; + case "internal": + if(!empty($this->code)) { + $code .= "\t\t{\n"; + $code .= $this->code."\n"; + $code .= "\t\t}\n"; + } + break; + case "private": + $code .= $this->code."\n"; + break; + } return $code; } |