diff options
-rw-r--r-- | ext/dom/dom_fe.h | 1 | ||||
-rw-r--r-- | ext/dom/node.c | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/ext/dom/dom_fe.h b/ext/dom/dom_fe.h index 3879b5b7c9..58698f0028 100644 --- a/ext/dom/dom_fe.h +++ b/ext/dom/dom_fe.h @@ -168,6 +168,7 @@ PHP_FUNCTION(dom_node_get_user_data); PHP_METHOD(domnode, C14N); PHP_METHOD(domnode, C14NFile); PHP_METHOD(domnode, getNodePath); +PHP_METHOD(domnode, getLineNo); /* domnodelist methods */ PHP_FUNCTION(dom_nodelist_item); 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 /* |