From: Christian Stocker Date: Fri, 14 Jun 2002 12:20:13 +0000 (+0000) Subject: - oops, that didn't even compile X-Git-Tag: php5_5_0~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f185f06f27dd34cb52e90d1f11f7ba70aabfafc6;p=php - oops, that didn't even compile - added domxml_parser_reference(reference) --- diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 7c5cdd9b70..10627f7ff7 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -237,6 +237,7 @@ static zend_function_entry domxml_functions[] = { PHP_FE(domxml_parser_end_element, NULL) PHP_FE(domxml_parser_comment, NULL) PHP_FE(domxml_parser_characters, NULL) + PHP_FE(domxml_parser_reference, NULL) PHP_FE(domxml_parser_cdata_block, NULL) PHP_FE(domxml_parser_start_document, NULL) PHP_FE(domxml_parser_end_document, NULL) @@ -329,6 +330,7 @@ static function_entry php_domxmlparser_class_functions[] = { PHP_FALIAS(start_element, domxml_parser_start_element, NULL) PHP_FALIAS(end_element, domxml_parser_end_element, NULL) PHP_FALIAS(characters, domxml_parser_characters, NULL) + PHP_FALIAS(reference, domxml_parser_reference, NULL) PHP_FALIAS(cdata_block, domxml_parser_cdata_block, NULL) PHP_FALIAS(comment, domxml_parser_comment, NULL) PHP_FALIAS(start_document, domxml_parser_start_document, NULL) @@ -4093,17 +4095,17 @@ PHP_FUNCTION(domxml_parser_comment) { zval *id; xmlParserCtxtPtr parserp; - char *comment; - int comment_len, error; + char *commentstring; + int commentstring_len, error; - DOMXML_PARAM_TWO(parserp, id, le_domxmlparserp,"s", &comment, &comment_len); + DOMXML_PARAM_TWO(parserp, id, le_domxmlparserp,"s", &commentstring, &commentstring_len); if (parserp->myDoc == NULL) { php_error(E_WARNING, "%s(): Document was not started", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } - comment(parserp, (xmlChar *) comment); + comment(parserp, (xmlChar *) commentstring); RETURN_TRUE; } @@ -4137,17 +4139,39 @@ PHP_FUNCTION(domxml_parser_characters) { zval *id; xmlParserCtxtPtr parserp; - char *characters; + char *charactersstring; int characters_len, error; - DOMXML_PARAM_TWO(parserp, id, le_domxmlparserp,"s", &characters, &characters_len); + DOMXML_PARAM_TWO(parserp, id, le_domxmlparserp,"s", &charactersstring, &characters_len); if (parserp->myDoc == NULL) { php_error(E_WARNING, "%s(): Document was not started", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } - characters(parserp, (xmlChar *) characters, characters_len); + characters(parserp, (xmlChar *) charactersstring, characters_len); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool domxml_parser_reference(string reference) + Adds entity reference */ +PHP_FUNCTION(domxml_parser_reference) +{ + zval *id; + xmlParserCtxtPtr parserp; + char *referencestring; + int reference_len, error; + + DOMXML_PARAM_TWO(parserp, id, le_domxmlparserp,"s", &referencestring, &reference_len); + + if (parserp->myDoc == NULL) { + php_error(E_WARNING, "%s(): Document was not started", get_active_function_name(TSRMLS_C)); + RETURN_FALSE; + } + + reference(parserp, (xmlChar *) referencestring); RETURN_TRUE; } diff --git a/ext/domxml/php_domxml.h b/ext/domxml/php_domxml.h index 81cd85c865..de15d5bbd1 100644 --- a/ext/domxml/php_domxml.h +++ b/ext/domxml/php_domxml.h @@ -189,6 +189,7 @@ PHP_FUNCTION(domxml_parser_set_keep_blanks); PHP_FUNCTION(domxml_parser_start_element); PHP_FUNCTION(domxml_parser_end_element); PHP_FUNCTION(domxml_parser_characters); +PHP_FUNCTION(domxml_parser_reference); PHP_FUNCTION(domxml_parser_comment); PHP_FUNCTION(domxml_parser_cdata_block); PHP_FUNCTION(domxml_parser_start_document);