Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18652 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30821 invoked by uid 1010); 2 Sep 2005 06:52:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30806 invoked from network); 2 Sep 2005 06:52:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2005 06:52:12 -0000 X-Host-Fingerprint: 213.46.255.28 viefep19-int.chello.at Solaris 8 (1) Received: from ([213.46.255.28:20701] helo=viefep11-int.chello.at) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 33/71-15098-B96F7134 for ; Fri, 02 Sep 2005 02:52:12 -0400 Received: from genuine ([80.108.136.197]) by viefep11-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20050902065206.UZPH1994.viefep11-int.chello.at@genuine>; Fri, 2 Sep 2005 08:52:06 +0200 Received: from [213.164.23.137] (helo=[10.15.10.17]) by genuine with esmtpa (Exim 4.50) id 1EB5MU-0001CW-AJ; Fri, 02 Sep 2005 08:49:20 +0200 Message-ID: <4317F693.2020501@fischer.name> Date: Fri, 02 Sep 2005 08:52:03 +0200 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: john@coggeshall.org CC: internals@lists.php.net Content-Type: multipart/mixed; boundary="------------010205020309000506070009" X-Spam-Score: 0 X-Spam-Level: / X-Spam-Report: Spam detection software, running on the system "genuine", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, attached the initial email to the list with the patch. I've been running this now since July in a web crawling application which runs every day and had no problems. The application is CLI based and runs for some hours everytime without any sign of memory leaking. However my c knowledge is quite rusty already so reviewing should be done :) [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- Subject: [Fwd: [PHP-DEV] [Patch] tidy node and getParent] From: markus@fischer.name (Markus Fischer) --------------010205020309000506070009 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, attached the initial email to the list with the patch. I've been running this now since July in a web crawling application which runs every day and had no problems. The application is CLI based and runs for some hours everytime without any sign of memory leaking. However my c knowledge is quite rusty already so reviewing should be done :) thanks, - Markus --------------010205020309000506070009 Content-Type: message/rfc822; name="[PHP-DEV] [Patch] tidy node and getParent" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="[PHP-DEV] [Patch] tidy node and getParent" Return-Path: Received: from sunshine ([unix socket]) by sunshine (Cyrus v2.1.18-IPv6-Debian-2.1.18-1) with LMTP; Fri, 15 Jul 2005 10:15:25 +0200 X-Sieve: CMU Sieve 2.2 Received: from mx05.nic.name ([198.41.3.35] ident=nobody) by sunshine.home with smtp (Exim 4.50) id 1DtLLu-0001Oj-OQ for MAIL@MARKUS.FISCHER.NAME; Fri, 15 Jul 2005 10:15:24 +0200 Received: (qmail 20623 invoked by uid 1004); Fri, 15 Jul 2005 10:10:19 -0000 Delivered-To: markus@fischer.name Received: (qmail 20613 invoked by alias); Fri, 15 Jul 2005 10:10:19 -0000 Received: from unknown (HELO pb1.pair.com) (216.92.131.4) by mx05.nic.name with SMTP; Fri, 15 Jul 2005 10:10:19 -0000 X-Host-Fingerprint: 216.92.131.4 lists.php.net Received: from ([216.92.131.4:4809] helo=lists.php.net) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id E9/EB-56617-A8B87D24 for ; Fri, 15 Jul 2005 06:10:18 -0400 Received: (qmail 77130 invoked by uid 1010); 15 Jul 2005 10:09:52 -0000 Mailing-List: contact internals-help@lists.php.net; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list internals@lists.php.net Received: (qmail 77122 invoked by uid 1010); 15 Jul 2005 10:09:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net X-Host-Fingerprint: 213.46.255.17 viefep16-int.chello.at Solaris 8 (1) Message-ID: <42D78B4A.7080208@fischer.name> Date: Fri, 15 Jul 2005 12:09:14 +0200 From: Markus Fischer User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Thunderbird/1.0.2 Mnenhy/0.7.2.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net CC: iliaa@php.net Content-Type: multipart/mixed; boundary="------------000200010603070100030509" X-Spam-Score: 0 X-Spam-Level: / X-Spam-Report: Spam detection software, running on the system "sunshine.home", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, attached is a patch to add the getParent() method for the tidyNode against HEAD. It's just a quick patch for me. I don't know if all tidy version support the getTidyParent function and if it's memory leak free so someone should review it first. [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- Subject: [PHP-DEV] [Patch] tidy node and getParent X-Spam-Score: 1 X-Spam-Level: / X-Spam-Report: Spam detection software, running on the system "sunshine.home", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, attached is a patch to add the getParent() method for the tidyNode against HEAD. It's just a quick patch for me. I don't know if all tidy version support the getTidyParent function and if it's memory leak free so someone should review it first. [...] Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.1 FORGED_RCVD_HELO Received: contains a forged HELO --------------000200010603070100030509 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, attached is a patch to add the getParent() method for the tidyNode against HEAD. It's just a quick patch for me. I don't know if all tidy version support the getTidyParent function and if it's memory leak free so someone should review it first. cheers, - Markus --------------000200010603070100030509 Content-Type: text/plain; name="tidy_getParent.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tidy_getParent.diff.txt" ? tidy_getParent.diff.txt Index: php_tidy.h =================================================================== RCS file: /repository/php-src/ext/tidy/php_tidy.h,v retrieving revision 1.25 diff -u -r1.25 php_tidy.h --- php_tidy.h 25 Apr 2005 20:46:16 -0000 1.25 +++ php_tidy.h 15 Jul 2005 09:59:44 -0000 @@ -89,6 +89,7 @@ TIDY_NODE_METHOD(isJste); TIDY_NODE_METHOD(isAsp); TIDY_NODE_METHOD(isPhp); +TIDY_NODE_METHOD(getParent); ZEND_BEGIN_MODULE_GLOBALS(tidy) char *default_config; Index: tidy.c =================================================================== RCS file: /repository/php-src/ext/tidy/tidy.c,v retrieving revision 1.65 diff -u -r1.65 tidy.c --- tidy.c 25 Apr 2005 20:46:16 -0000 1.65 +++ tidy.c 15 Jul 2005 09:59:45 -0000 @@ -291,6 +291,7 @@ TIDY_NODE_ME(isJste, NULL) TIDY_NODE_ME(isAsp, NULL) TIDY_NODE_ME(isPhp, NULL) + TIDY_NODE_ME(getParent, NULL) {NULL, NULL, NULL} }; @@ -1668,6 +1669,30 @@ } /* }}} */ +/* {{{ proto boolean tidyNode::getParent() + Returns the parent node if available or NULL */ +TIDY_NODE_METHOD(getParent) +{ + TidyNode parent_node; + PHPTidyObj *newobj; + TIDY_FETCH_ONLY_OBJECT; + + parent_node = tidyGetParent(obj->node); + if(parent_node) { + tidy_instanciate(tidy_ce_node, return_value TSRMLS_CC); + newobj = (PHPTidyObj *) zend_object_store_get_object(return_value TSRMLS_CC); + newobj->node = parent_node; + newobj->type = is_node; + newobj->ptdoc = obj->ptdoc; + newobj->ptdoc->ref_count++; + tidy_add_default_properties(newobj, is_node TSRMLS_CC); + } else { + ZVAL_NULL(return_value); + } +} +/* }}} */ + + static void _php_tidy_register_nodetypes(INIT_FUNC_ARGS) { TIDY_NODE_CONST(ROOT, Root); --------------000200010603070100030509 Content-Type: text/plain; charset=us-ascii -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php --------------000200010603070100030509-- --------------010205020309000506070009--