diff options
author | Rob Richards <rrichards@php.net> | 2009-01-13 18:06:48 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2009-01-13 18:06:48 +0000 |
commit | 5336054811ad2d746c125fc2a5bbb28fc5446411 (patch) | |
tree | 2d42a2e2960e47662c8819c6c47b7b8a89d2fc0e /ext/dom/node.c | |
parent | 6757c0c9fc74f834908537445b7e979783187dde (diff) | |
download | php-git-5336054811ad2d746c125fc2a5bbb28fc5446411.tar.gz |
MFH: Add method DomNode::getLineNo to return line number for a parsed node
Diffstat (limited to 'ext/dom/node.c')
-rw-r--r-- | ext/dom/node.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/dom/node.c b/ext/dom/node.c index 61b4e90688..e2ad8a31d5 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -106,6 +106,9 @@ ZEND_END_ARG_INFO(); 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 @@ const zend_function_entry php_dom_node_class_functions[] = { /* {{{ */ 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} @@ -1950,6 +1954,24 @@ PHP_METHOD(domnode, getNodePath) } /* }}} */ +/* {{{ 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 /* |