--- metal/metal_class.php 2004/10/17 01:41:24 1.108 +++ metal/metal_class.php 2005/10/23 03:59:49 1.109 @@ -6,7 +6,7 @@ if(!defined("METAL_CLASS_INCLUDED")) /* * metal_class.php * - * @(#) $Header: /opt2/mlemos/cvs/metal/metal/metal_class.php,v 1.108 2004/10/17 01:41:24 mlemos Exp $ + * @(#) $Header: /opt2/mlemos/cvs/metal/metal/metal_class.php,v 1.109 2005/10/23 03:59:49 mlemos Exp $ * */ @@ -266,6 +266,24 @@ class metal_class_class extends metal_ba return(0); } break; + case "verifyreturntype": + if(!$compiler->GetValidData($attributes->file,$function_element_path,$value,"it was not defined a valid class function verify return type option")) + return(0); + switch($value) + { + case "0": + case "1": + break; + default: + return($this->SetElementError($attributes->file,$function_element_path,"it was not defined a valid class function verify return type option")); + } + if(IsSet($function["verifyreturntype"])) + { + $compiler->SetElementError($attributes->file,$function_element_path,"it was defined the class function verify return type option more than once"); + return(0); + } + $function[$data["Tag"]]=intval($value); + break; case "package": if(!IsSet($this->classes[$index]["package"])) { @@ -851,6 +869,8 @@ class metal_class_class extends metal_ba || !$success) return(0); if(strcmp($this->classes[$class]["functions"][$name]["type"],"VOID") + && (!IsSet($this->classes[$class]["functions"][$name]["verifyreturntype"]) + || $this->classes[$class]["functions"][$name]["verifyreturntype"]) && $this->classes[$class]["return_value_set"]==0) { $compiler->SetElementError($this->classes[$class]["functions"][$name]["do"]["file"],$this->classes[$class]["functions"][$name]["do"]["path"],"it was not set the class function return value");