felipe Thu Jul 3 12:40:48 2008 UTC Modified files: /php-src/ext/recode recode.c Log: - MFB: New parameter parsing API http://cvs.php.net/viewvc.cgi/php-src/ext/recode/recode.c?r1=1.45&r2=1.46&diff_format=u Index: php-src/ext/recode/recode.c diff -u php-src/ext/recode/recode.c:1.45 php-src/ext/recode/recode.c:1.46 --- php-src/ext/recode/recode.c:1.45 Thu Jul 3 12:21:25 2008 +++ php-src/ext/recode/recode.c Thu Jul 3 12:40:48 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: recode.c,v 1.45 2008/07/03 12:21:25 felipe Exp $ */ +/* $Id: recode.c,v 1.46 2008/07/03 12:40:48 felipe Exp $ */ /* {{{ includes & prototypes */ @@ -137,7 +137,7 @@ { php_info_print_table_start(); php_info_print_table_row(2, "Recode Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.45 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.46 $"); php_info_print_table_end(); } @@ -188,17 +188,18 @@ PHP_FUNCTION(recode_file) { RECODE_REQUEST request = NULL; - zval **req; - zval **input, **output; + char *req; + int req_len; + zval *input, *output; php_stream *instream, *outstream; FILE *in_fp, *out_fp; - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &req, &input, &output) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "srr", &req, &req_len, &input, &output) == FAILURE) { + return; } - php_stream_from_zval(instream, input); - php_stream_from_zval(outstream, output); + php_stream_from_zval(instream, &input); + php_stream_from_zval(outstream, &output); if (FAILURE == php_stream_cast(instream, PHP_STREAM_AS_STDIO, (void**)&in_fp, REPORT_ERRORS)) { RETURN_FALSE; @@ -207,8 +208,6 @@ if (FAILURE == php_stream_cast(outstream, PHP_STREAM_AS_STDIO, (void**)&out_fp, REPORT_ERRORS)) { RETURN_FALSE; } - - convert_to_string_ex(req); request = recode_new_request(ReSG(outer)); if (request == NULL) { @@ -216,8 +215,8 @@ RETURN_FALSE; } - if (!recode_scan_request(request, Z_STRVAL_PP(req))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", Z_STRVAL_PP(req)); + if (!recode_scan_request(request, req)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", req); goto error_exit; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php