cvs: php4 /ext/domxml php_domxml.c

From: Date: Tue, 27 Aug 2002 07:25:54 +0000
Subject: cvs: php4 /ext/domxml php_domxml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13699@lists.php.net to get a copy of this message
chregu Tue Aug 27 03:25:54 2002 EDT Modified files: /php4/ext/domxml php_domxml.c Log: stupid typo Index: php4/ext/domxml/php_domxml.c diff -u php4/ext/domxml/php_domxml.c:1.205 php4/ext/domxml/php_domxml.c:1.206 --- php4/ext/domxml/php_domxml.c:1.205 Tue Aug 27 02:54:21 2002 +++ php4/ext/domxml/php_domxml.c Tue Aug 27 03:25:53 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_domxml.c,v 1.205 2002/08/27 06:54:21 chregu Exp $ */ +/* $Id: php_domxml.c,v 1.206 2002/08/27 07:25:53 chregu Exp $ */ /* TODO * - Support Notation Nodes @@ -229,6 +229,8 @@ PHP_FE(domxml_doc_document_element, NULL) PHP_FE(domxml_doc_add_root, NULL) PHP_FE(domxml_doc_set_root, NULL) + PHP_FE(domxml_doc_free, NULL) + PHP_FE(domxml_dump_mem, NULL) PHP_FE(domxml_dump_mem_file, NULL) PHP_FE(domxml_dump_node, NULL) @@ -326,6 +328,7 @@ /* PHP_FALIAS(children, domxml_node_children, NULL) */ PHP_FALIAS(add_root, domxml_doc_add_root, NULL) PHP_FALIAS(set_root, domxml_doc_set_root, NULL) + PHP_FALIAS(free, domxml_doc_free, NULL) PHP_FALIAS(get_root, domxml_doc_document_element, NULL) PHP_FALIAS(root, domxml_doc_document_element, NULL) PHP_FALIAS(imported_node, domxml_doc_imported_node, NULL) @@ -582,7 +585,7 @@ wrapper = dom_object_get_data(node); - if (wrapper != NULL) { + if (wrapper != NULL ) { refcount = wrapper->refcount; zval_ptr_dtor(&wrapper); /*only set it to null, if refcount was 1 before, otherwise it has still needed references */ @@ -3667,6 +3670,24 @@ } /* }}} */ +/* {{{ proto string domxml_dump_mem(object doc_handle [, int format][, encoding]) + Dumps document into string and optionally formats it */ +PHP_FUNCTION(domxml_doc_free) +{ + zval *id; + xmlDoc *docp; + zval *wrapper; + zval **handle; + int refcount; + + DOMXML_PARAM_NONE(docp, id, le_domxmldocp); + + zend_hash_index_find(Z_OBJPROP_P(id), 0, (void **) &handle); + zend_list_delete(Z_LVAL_PP(handle)); + RETURN_TRUE; +} +/* }}} */ + /* {{{ proto int domxml_dump_mem_file(string filename [, int compressmode [, int format]]) Dumps document into file and uses compression if specified. Returns false on error, otherwise the length of the xml-document (uncompressed) */ PHP_FUNCTION(domxml_dump_mem_file) @@ -5061,10 +5082,10 @@ get_active_function_name(TSRMLS_C)); return NULL; } - value = (xmlChar*) emalloc (str_len * sizeof(xmlChar *) ); + value = (xmlChar*) emalloc (str_len * sizeof(xmlChar) ); snprintf(value, str_len, "'%s'", string); } else { - value = (xmlChar*) emalloc (str_len * sizeof(xmlChar *) ); + value = (xmlChar*) emalloc (str_len * sizeof(xmlChar) ); snprintf(value, str_len, "\"%s\"", string); }

« previous php.cvs (#13699) next »