diff options
author | Rob Richards <rrichards@php.net> | 2004-02-15 10:54:37 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2004-02-15 10:54:37 +0000 |
commit | a2e1844de9d2584769fbd4a06e7b67e418919198 (patch) | |
tree | e45fd090071c7df7cd445694b8db039929fdee21 /ext/dom/xpath.c | |
parent | 104f2b5ff4940727b06346979750f0cb387d4c7e (diff) | |
download | php-git-a2e1844de9d2584769fbd4a06e7b67e418919198.tar.gz |
start of dom update
switch to zend_parse_method_parameters for consistancy
insure object parameters are correct class types
convert zvals to correct type if needed for property writes
Diffstat (limited to 'ext/dom/xpath.c')
-rw-r--r-- | ext/dom/xpath.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index 4b693bb465..abaf35b9fa 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -49,7 +49,7 @@ PHP_FUNCTION(dom_xpath_xpath) dom_object *docobj, *intern; xmlXPathContextPtr ctx, oldctx; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oo", &id, dom_xpath_class_entry, &doc) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_xpath_class_entry, &doc, dom_document_class_entry) == FAILURE) { return; } @@ -106,7 +106,9 @@ PHP_FUNCTION(dom_xpath_register_ns) dom_object *intern; unsigned char *prefix, *ns_uri; - DOM_GET_THIS(id); + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_xpath_class_entry, &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) { + return; + } intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); @@ -116,10 +118,6 @@ PHP_FUNCTION(dom_xpath_register_ns) RETURN_FALSE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) { - RETURN_FALSE; - } - if (xmlXPathRegisterNs(ctxp, prefix, ns_uri) != 0) { RETURN_FALSE } @@ -149,7 +147,10 @@ PHP_FUNCTION(dom_xpath_query) xmlDoc *docp = NULL; xmlNsPtr *ns; - DOM_GET_THIS(id); + + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|O", &id, dom_xpath_class_entry, &expr, &expr_len, &context, dom_node_class_entry) == FAILURE) { + return; + } intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); @@ -165,10 +166,6 @@ PHP_FUNCTION(dom_xpath_query) RETURN_FALSE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|o", &expr, &expr_len, &context) == FAILURE) { - RETURN_FALSE; - } - if (context != NULL) { DOM_GET_OBJ(nodep, context, xmlNodePtr, nodeobj); } |