]> granicus.if.org Git - php/commitdiff
- oops, that didn't even compile
authorChristian Stocker <chregu@php.net>
Fri, 14 Jun 2002 12:20:13 +0000 (12:20 +0000)
committerChristian Stocker <chregu@php.net>
Fri, 14 Jun 2002 12:20:13 +0000 (12:20 +0000)
- added domxml_parser_reference(reference)

ext/domxml/php_domxml.c
ext/domxml/php_domxml.h

index 7c5cdd9b700962ba13b49dedea01c072d76c4e27..10627f7ff71f15fffde02e69365db78b8057a0a3 100644 (file)
@@ -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;
 }
index 81cd85c865c271248ad4d7f869e037cb435c2b32..de15d5bbd112640208da5643368c96ab4c941bce 100644 (file)
@@ -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);