cvs: php4 /ext/xslt php_xslt.h xslt.c

From: Date: Thu, 26 Apr 2001 02:12:07 +0000
Subject: cvs: php4 /ext/xslt php_xslt.h xslt.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-5282@lists.php.net to get a copy of this message
sterling Wed Apr 25 19:12:07 2001 EDT Modified files: /php4/ext/xslt php_xslt.h xslt.c Log: Add a free function to free the returned structure. Index: php4/ext/xslt/php_xslt.h diff -u php4/ext/xslt/php_xslt.h:1.2 php4/ext/xslt/php_xslt.h:1.3 --- php4/ext/xslt/php_xslt.h:1.2 Wed Apr 25 19:01:08 2001 +++ php4/ext/xslt/php_xslt.h Wed Apr 25 19:12:06 2001 @@ -46,6 +46,7 @@ } xslt_args; extern xslt_args *parse_xslt_arguments(char *, char *, char *, char **); +extern void free_xslt_arguments(xslt_args *to_free); extern void assign_xslt_handler(struct xslt_function **, zval **); extern void free_xslt_handler(struct xslt_function *); Index: php4/ext/xslt/xslt.c diff -u php4/ext/xslt/xslt.c:1.2 php4/ext/xslt/xslt.c:1.3 --- php4/ext/xslt/xslt.c:1.2 Wed Apr 25 19:01:08 2001 +++ php4/ext/xslt/xslt.c Wed Apr 25 19:12:06 2001 @@ -67,10 +67,10 @@ /* {{{ parse_xslt_arguments() Parse an XSLT argument buffer */ -extern xslt_args *parse_xslt_arguments(char *xml, - char *xsl, - char *result, - char **argv) +extern xslt_args *parse_xslt_arguments(char *xml, + char *xsl, + char *result, + char **argv) { xslt_args *return_value; @@ -116,6 +116,26 @@ } return return_value; +} +/* }}} */ + +/* {{{ free_xslt_arguments() + Free's an XSLT argument list returned from parse_xslt_arguments() */ +extern void free_xslt_arguments(xslt_args *to_free) +{ + if (to_free->xml.ptr) { + efree(to_free->xml.ptr); + } + + if (to_free->xsl.ptr) { + efree(to_free->xsl.ptr); + } + + if (to_free->result.ptr) { + efree(to_free->result.ptr); + } + + efree(to_free); } /* }}} */

« previous php.cvs (#5282) next »