cvs: ZendEngine2 / zend_API.c
| From: | Andrei Zmievski | Date: | Mon, 27 Mar 2006 02:52:06 +0000 |
| Subject: | cvs: ZendEngine2 / zend_API.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4767@lists.php.net to get a copy of this message | ||
andrei Mon Mar 27 02:52:06 2006 UTC
Modified files:
/ZendEngine2 zend_API.c
Log:
Some functions may want to accept only Unicode or binary strings,
without having auto-conversion from the other string type. Add 'U' and
'S' specifiers for this. Also, remove traces of 'native' strings.
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.c?r1=1.356&r2=1.357&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.356 ZendEngine2/zend_API.c:1.357
--- ZendEngine2/zend_API.c:1.356 Thu Mar 23 13:09:28 2006
+++ ZendEngine2/zend_API.c Mon Mar 27 02:52:06 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.356 2006/03/23 13:09:28 helly Exp $ */
+/* $Id: zend_API.c,v 1.357 2006/03/27 02:52:06 andrei Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -208,7 +208,7 @@
return "double";
case IS_STRING:
- return "native string";
+ return "binary string";
case IS_ARRAY:
return "array";
@@ -375,6 +375,7 @@
break;
case 's':
+ case 'S':
{
char **p = va_arg(*va, char **);
int *pl = va_arg(*va, int *);
@@ -387,11 +388,15 @@
}
/* break omitted intentionally */
+ case IS_UNICODE:
+ if (c == 'S') {
+ return "definitely a binary string";
+ }
+ /* fall through */
case IS_STRING:
case IS_LONG:
case IS_DOUBLE:
case IS_BOOL:
- case IS_UNICODE:
convert_to_string_ex(arg);
*p = Z_STRVAL_PP(arg);
*pl = Z_STRLEN_PP(arg);
@@ -405,7 +410,7 @@
*p = Z_STRVAL_PP(arg);
break;
} else {
- return "native string";
+ return "binary string";
}
}
}
@@ -413,12 +418,13 @@
case IS_ARRAY:
case IS_RESOURCE:
default:
- return "native string";
+ return "binary string";
}
}
break;
case 'u':
+ case 'U':
{
UChar **p = va_arg(*va, UChar **);
int *pl = va_arg(*va, int *);
@@ -432,6 +438,10 @@
/* break omitted intentionally */
case IS_STRING:
+ if (c == 'U') {
+ return "definitely a Unicode string";
+ }
+ /* fall through */
case IS_LONG:
case IS_DOUBLE:
case IS_BOOL:
@@ -517,7 +527,7 @@
case IS_ARRAY:
case IS_RESOURCE:
default:
- return "string (native, Unicode, or binary)";
+ return "string (Unicode or binary)";
}
break;
@@ -579,7 +589,7 @@
case IS_ARRAY:
case IS_RESOURCE:
default:
- return "string (native, Unicode, or binary)";
+ return "string (Unicode or binary)";
}
}
break;
@@ -795,7 +805,8 @@
case 'z': case 'Z':
case 't': case 'y':
case 'u': case 'C':
- case 'h':
+ case 'h': case 'U':
+ case 'S':
max_num_args++;
break;