name = $name; $this->value= $value; $this->type = $type; $this->desc = $desc; } function c_code() { switch($this->type) { case "integer": return "REGISTER_LONG_CONSTANT(\"{$this->name}\", {$this->value}, 0);\n"; case "float": return "REGISTER_DOUBLE_CONSTANT(\"{$this->name}\", {$this->value}, 0);\n"; case "string": return "REGISTER_STRING_CONSTANT(\"{$this->name}\", \"$value\", ".strlen($this->value).", 0);\n"; } } function docbook_xml() { return trim(" {$this->name} (integer) {$this->value} {$this->desc} ")."\n"; } } ?>