From 843e3449cf57e16caf32eec366c325648d61441c Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Wed, 19 Feb 2003 16:02:45 +0000 Subject: 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 --- scripts/ext_skel_ng/php_function.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'scripts/ext_skel_ng/php_function.php') 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; } -- cgit v1.2.1