cvs: pear /CodeGen/CodeGen Extension.php ExtensionParser.php /CodeGen_PECL/PECL Extension.php ExtensionParser.php
| From: | Hartmut Holzgraefe | Date: | Sun, 12 Nov 2006 07:20:26 +0000 |
| Subject: | cvs: pear /CodeGen/CodeGen Extension.php ExtensionParser.php /CodeGen_PECL/PECL Extension.php ExtensionParser.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-43049@lists.php.net to get a copy of this message | ||
hholzgra Sun Nov 12 07:20:26 2006 UTC
Modified files:
/pear/CodeGen/CodeGen Extension.php ExtensionParser.php
/pear/CodeGen_PECL/PECL Extension.php ExtensionParser.php
Log:
configure and Makefile fragment handling moved up to CodeGen,
up front #define handling added
http://cvs.php.net/viewvc.cgi/pear/CodeGen/CodeGen/Extension.php?r1=1.26&r2=1.27&diff_format=u
Index: pear/CodeGen/CodeGen/Extension.php
diff -u pear/CodeGen/CodeGen/Extension.php:1.26 pear/CodeGen/CodeGen/Extension.php:1.27
--- pear/CodeGen/CodeGen/Extension.php:1.26 Sun Nov 12 06:32:03 2006
+++ pear/CodeGen/CodeGen/Extension.php Sun Nov 12 07:20:25 2006
@@ -15,7 +15,7 @@
* @author Hartmut Holzgraefe <hartmut@php.net>
* @copyright 2005 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Extension.php,v 1.26 2006/11/12 06:32:03 hholzgra Exp $
+ * @version CVS: $Id: Extension.php,v 1.27 2006/11/12 07:20:25 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -189,6 +189,14 @@
/**
+ * Up front #defines
+ *
+ * @var array
+ */
+ protected $defines = array();
+
+
+ /**
* Makefile fragments
*
* @var array
@@ -635,6 +643,26 @@
return $this->addPackageFile('copy', $filename, $dir);
}
+ /**
+ * Add up front define
+ *
+ * @access public
+ * @param string #define name
+ * @param string value
+ * @param string comment
+ */
+ function addDefine($name, $value, $comment) {
+ if (! CodeGen_Element::isName($name)) {
+ return PEAR::raiseError("'$name' is not a valid define name");
+ }
+
+ // TODO check for invalid comment characters
+
+ $this->defines = array("name" => $name, "value" => $value,
"comment" => $comment);
+
+ return true;
+ }
+
/**
* Add makefile fragment
*
http://cvs.php.net/viewvc.cgi/pear/CodeGen/CodeGen/ExtensionParser.php?r1=1.17&r2=1.18&diff_format=u
Index: pear/CodeGen/CodeGen/ExtensionParser.php
diff -u pear/CodeGen/CodeGen/ExtensionParser.php:1.17 pear/CodeGen/CodeGen/ExtensionParser.php:1.18
--- pear/CodeGen/CodeGen/ExtensionParser.php:1.17 Wed Oct 11 10:07:41 2006
+++ pear/CodeGen/CodeGen/ExtensionParser.php Sun Nov 12 07:20:25 2006
@@ -15,7 +15,7 @@
* @author Hartmut Holzgraefe <hartmut@php.net>
* @copyright 2005 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: ExtensionParser.php,v 1.17 2006/10/11 10:07:41 hholzgra Exp $
+ * @version CVS: $Id: ExtensionParser.php,v 1.18 2006/11/12 07:20:25 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -409,6 +409,23 @@
$this->extension->addHeader($header);
}
+
+ function tagstart_deps_define($attr) {
+ if (!isset($attr["name"])) {
+ return PEAR::raiseError("name attribut for define missing");
+ }
+
+ return $this->extension->addDefine($attr['name'],
@$attr['value'], @$attr['comment']);
+ }
+
+ function tagend_extension_makefile($attr, $data) {
+ return $this->extension->addMakeFragment(CodeGen_Tools_IndentC::linetrim($data));
+ }
+
+ function tagend_deps_configm4($attr, $data) {
+ return $this->extension->addConfigFragment(CodeGen_Tools_IndentC::linetrim($data),
+ isset($attr['position']) ?
$attr['position'] : "top");
+ }
}
http://cvs.php.net/viewvc.cgi/pear/CodeGen_PECL/PECL/Extension.php?r1=1.64&r2=1.65&diff_format=u
Index: pear/CodeGen_PECL/PECL/Extension.php
diff -u pear/CodeGen_PECL/PECL/Extension.php:1.64 pear/CodeGen_PECL/PECL/Extension.php:1.65
--- pear/CodeGen_PECL/PECL/Extension.php:1.64 Wed Oct 18 01:25:26 2006
+++ pear/CodeGen_PECL/PECL/Extension.php Sun Nov 12 07:20:25 2006
@@ -15,7 +15,7 @@
* @author Hartmut Holzgraefe <hartmut@php.net>
* @copyright 2005, 2006 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Extension.php,v 1.64 2006/10/18 01:25:26 hholzgra Exp $
+ * @version CVS: $Id: Extension.php,v 1.65 2006/11/12 07:20:25 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen_PECL
*/
@@ -166,23 +166,6 @@
/**
- * Makefile fragments
- *
- * @var array
- * @access private
- */
- protected $makefragments = array();
-
-
- /**
- * config.m4 fragments
- *
- * @var array
- * @access private
- */
- protected $configfragments = array("top"=>array(),
"bottom"=>array());
-
- /**
* generate #line specs?
*
* @var bool
http://cvs.php.net/viewvc.cgi/pear/CodeGen_PECL/PECL/ExtensionParser.php?r1=1.60&r2=1.61&diff_format=u
Index: pear/CodeGen_PECL/PECL/ExtensionParser.php
diff -u pear/CodeGen_PECL/PECL/ExtensionParser.php:1.60
pear/CodeGen_PECL/PECL/ExtensionParser.php:1.61
--- pear/CodeGen_PECL/PECL/ExtensionParser.php:1.60 Tue Sep 5 08:31:08 2006
+++ pear/CodeGen_PECL/PECL/ExtensionParser.php Sun Nov 12 07:20:26 2006
@@ -15,7 +15,7 @@
* @author Hartmut Holzgraefe <hartmut@php.net>
* @copyright 2005, 2006 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: ExtensionParser.php,v 1.60 2006/09/05 08:31:08 hholzgra Exp $
+ * @version CVS: $Id: ExtensionParser.php,v 1.61 2006/11/12 07:20:26 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -756,15 +756,6 @@
}
}
- function tagend_extension_makefile($attr, $data) {
- return $this->extension->addMakeFragment(CodeGen_Tools_IndentC::linetrim($data));
- }
-
- function tagend_deps_configm4($attr, $data) {
- return $this->extension->addConfigFragment(CodeGen_Tools_IndentC::linetrim($data),
- isset($attr['position']) ?
$attr['position'] : "top");
- }
-
function tagstart_extension_test($attr) {
static $testCount = 0;