rrichards               Tue Jan 13 18:05:41 2009 UTC

  Modified files:              
    /php-src/ext/dom    dom_fe.h node.c 
  Log:
  Add method DomNode::getLineNo to return line number for a parsed node
  
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/dom_fe.h?r1=1.24&r2=1.25&diff_format=u
Index: php-src/ext/dom/dom_fe.h
diff -u php-src/ext/dom/dom_fe.h:1.24 php-src/ext/dom/dom_fe.h:1.25
--- php-src/ext/dom/dom_fe.h:1.24       Wed Dec 31 11:12:30 2008
+++ php-src/ext/dom/dom_fe.h    Tue Jan 13 18:05:41 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: dom_fe.h,v 1.24 2008/12/31 11:12:30 sebastian Exp $ */
+/* $Id: dom_fe.h,v 1.25 2009/01/13 18:05:41 rrichards Exp $ */
 #ifndef DOM_FE_H
 #define DOM_FE_H
 
@@ -168,6 +168,7 @@
 PHP_METHOD(domnode, C14N);
 PHP_METHOD(domnode, C14NFile);
 PHP_METHOD(domnode, getNodePath);
+PHP_METHOD(domnode, getLineNo);
 
 /* domnodelist methods */
 PHP_FUNCTION(dom_nodelist_item);
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/node.c?r1=1.68&r2=1.69&diff_format=u
Index: php-src/ext/dom/node.c
diff -u php-src/ext/dom/node.c:1.68 php-src/ext/dom/node.c:1.69
--- php-src/ext/dom/node.c:1.68 Wed Dec 31 11:12:30 2008
+++ php-src/ext/dom/node.c      Tue Jan 13 18:05:41 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: node.c,v 1.68 2008/12/31 11:12:30 sebastian Exp $ */
+/* $Id: node.c,v 1.69 2009/01/13 18:05:41 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -106,6 +106,9 @@
 ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_getNodePath, 0, 0, 0)
 ZEND_END_ARG_INFO();
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_getLineNo, 0, 0, 0)
+ZEND_END_ARG_INFO();
+
 ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_C14N, 0, 0, 0)
        ZEND_ARG_INFO(0, exclusive)
        ZEND_ARG_INFO(0, with_comments)
@@ -149,6 +152,7 @@
        PHP_FALIAS(setUserData, dom_node_set_user_data, 
arginfo_dom_node_set_user_data)
        PHP_FALIAS(getUserData, dom_node_get_user_data, 
arginfo_dom_node_get_user_data)
        PHP_ME(domnode, getNodePath, arginfo_dom_node_getNodePath, 
ZEND_ACC_PUBLIC)
+       PHP_ME(domnode, getLineNo, arginfo_dom_node_getLineNo, ZEND_ACC_PUBLIC)
        PHP_ME(domnode, C14N, arginfo_dom_node_C14N, ZEND_ACC_PUBLIC)
        PHP_ME(domnode, C14NFile, arginfo_dom_node_C14NFile, ZEND_ACC_PUBLIC)
        {NULL, NULL, NULL}
@@ -2029,6 +2033,24 @@
 }
 /* }}} */
 
+/* {{{ proto int DOMNode::getLineNo()
+   Gets line number for a node */
+PHP_METHOD(domnode, getLineNo)
+{
+       zval *id;
+       xmlNode *nodep;
+       dom_object *intern;
+       
+       if (zend_parse_parameters_none() == FAILURE) {
+               return;
+       }
+
+       DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern);
+
+       RETURN_LONG(xmlGetLineNo(nodep));
+}
+/* }}} */
+
 #endif
 
 /*



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to