cvs: ZendEngine2 / zend_API.c

From: Date: Wed, 02 Aug 2006 17:36:28 +0000
Subject: cvs: ZendEngine2 / zend_API.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5143@lists.php.net to get a copy of this message
andrei Wed Aug 2 17:36:28 2006 UTC Modified files: /ZendEngine2 zend_API.c Log: Add '&' modifier (for 's' type) that will apply the specified converter during conversion of Unicode strings. http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.389&r2=1.390&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.389 ZendEngine2/zend_API.c:1.390 --- ZendEngine2/zend_API.c:1.389 Tue Jul 25 06:50:26 2006 +++ ZendEngine2/zend_API.c Wed Aug 2 17:36:28 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.389 2006/07/25 06:50:26 derick Exp $ */ +/* $Id: zend_API.c,v 1.390 2006/08/02 17:36:28 andrei Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -435,7 +435,16 @@ /* break omitted intentionally */ case IS_UNICODE: - if (c == 'S') { + /* handle conversion of Unicode to binary with a specific converter */ + if (c == 's' && *spec_walk == '&') { + UConverter *conv = va_arg(*va, UConverter *); + SEPARATE_ZVAL_IF_NOT_REF(arg); + convert_to_string_with_converter(*arg, conv); + *p = Z_STRVAL_PP(arg); + *pl = Z_STRLEN_PP(arg); + spec_walk++; + break; + } else if (c == 'S') { return "definitely a binary string"; } /* fall through */ @@ -862,8 +871,8 @@ min_num_args = max_num_args; break; - case '/': - case '!': + case '/': case '!': + case '&': /* Pass */ break; @@ -948,7 +957,7 @@ break; case '|': case '!': - case '/': + case '/': case '&': /* pass */ break;

« previous php.zend-engine.cvs (#5143) next »