felipe Tue Jul 1 11:26:10 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/wddx wddx.c Log: - Fixed types - Fixed protos http://cvs.php.net/viewvc.cgi/php-src/ext/wddx/wddx.c?r1=1.119.2.10.2.17.2.8&r2=1.119.2.10.2.17.2.9&diff_format=u Index: php-src/ext/wddx/wddx.c diff -u php-src/ext/wddx/wddx.c:1.119.2.10.2.17.2.8 php-src/ext/wddx/wddx.c:1.119.2.10.2.17.2.9 --- php-src/ext/wddx/wddx.c:1.119.2.10.2.17.2.8 Tue Jul 1 07:56:24 2008 +++ php-src/ext/wddx/wddx.c Tue Jul 1 11:26:10 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: wddx.c,v 1.119.2.10.2.17.2.8 2008/07/01 07:56:24 tony2001 Exp $ */ +/* $Id: wddx.c,v 1.119.2.10.2.17.2.9 2008/07/01 11:26:10 felipe Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1237,7 +1237,7 @@ } /* }}} */ -/* {{{ proto int wddx_packet_start([string comment]) +/* {{{ proto resource wddx_packet_start([string comment]) Starts a WDDX packet with optional comment and returns the packet id */ PHP_FUNCTION(wddx_packet_start) { @@ -1259,15 +1259,16 @@ } /* }}} */ -/* {{{ proto string wddx_packet_end(int packet_id) +/* {{{ proto string wddx_packet_end(resource packet_id) Ends specified WDDX packet and returns the string containing the packet */ PHP_FUNCTION(wddx_packet_end) { zval *packet_id; wddx_packet *packet = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &packet_id) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &packet_id) == FAILURE) { return; + } ZEND_FETCH_RESOURCE(packet, wddx_packet *, &packet_id, -1, "WDDX packet ID", le_wddx); @@ -1281,20 +1282,21 @@ } /* }}} */ -/* {{{ proto int wddx_add_vars(int packet_id, mixed var_names [, mixed ...]) +/* {{{ proto int wddx_add_vars(resource packet_id, mixed var_names [, mixed ...]) Serializes given variables and adds them to packet given by packet_id */ PHP_FUNCTION(wddx_add_vars) { int num_args, i; zval ***args = NULL; - long packet_id; + zval *packet_id; wddx_packet *packet = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l+", &packet_id, &args, &num_args) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r+", &packet_id, &args, &num_args) == FAILURE) { return; } - packet = (wddx_packet *)zend_fetch_resource(&packet_id TSRMLS_CC, -1, "WDDX packet ID", NULL, 1, le_wddx); + ZEND_FETCH_RESOURCE(packet, wddx_packet *, &packet_id, -1, "WDDX packet ID", le_wddx); + if (!packet) { efree(args); RETURN_FALSE;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php