logo       

cvs: ZendEngine2 / zend_API.c zend_API.h zend_exceptions.c: msg#00089

Subject: cvs: ZendEngine2 / zend_API.c zend_API.h zend_exceptions.c
dmitry          Thu Aug 18 11:42:48 2005 EDT

  Modified files:              
    /ZendEngine2        zend_API.c zend_API.h zend_exceptions.c 
  Log:
  Suppoer for unicode exception messages
  
  
http://cvs.php.net/diff.php/ZendEngine2/zend_API.c?r1=1.306&r2=1.307&ty=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.306 ZendEngine2/zend_API.c:1.307
--- ZendEngine2/zend_API.c:1.306        Thu Aug 18 02:33:44 2005
+++ ZendEngine2/zend_API.c      Thu Aug 18 11:42:45 2005
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_API.c,v 1.306 2005/08/18 06:33:44 dmitry Exp $ */
+/* $Id: zend_API.c,v 1.307 2005/08/18 15:42:45 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_execute.h"
@@ -2884,6 +2884,28 @@
        zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
 }
 
+ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval 
*object, UChar *name, int name_length, char *value TSRMLS_DC)
+{
+       zval *tmp;
+       
+       ALLOC_ZVAL(tmp);
+       tmp->is_ref = 0;
+       tmp->refcount = 0;
+       ZVAL_UNICODE(tmp, value, 1);
+       zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
+}
+
+ZEND_API void zend_update_property_unicodel(zend_class_entry *scope, zval 
*object, UChar *name, int name_length, char *value, int value_len TSRMLS_DC)
+{
+       zval *tmp;
+       
+       ALLOC_ZVAL(tmp);
+       tmp->is_ref = 0;
+       tmp->refcount = 0;
+       ZVAL_UNICODEL(tmp, value, value_len, 1);
+       zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
+}
+
 ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char 
*name, int name_length, zend_bool silent TSRMLS_DC)
 {
        zval property, *value;
http://cvs.php.net/diff.php/ZendEngine2/zend_API.h?r1=1.212&r2=1.213&ty=u
Index: ZendEngine2/zend_API.h
diff -u ZendEngine2/zend_API.h:1.212 ZendEngine2/zend_API.h:1.213
--- ZendEngine2/zend_API.h:1.212        Thu Aug 18 11:14:08 2005
+++ ZendEngine2/zend_API.h      Thu Aug 18 11:42:46 2005
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_API.h,v 1.212 2005/08/18 15:14:08 dmitry Exp $ */
+/* $Id: zend_API.h,v 1.213 2005/08/18 15:42:46 dmitry Exp $ */
 
 #ifndef ZEND_API_H
 #define ZEND_API_H
@@ -228,6 +228,8 @@
 ZEND_API void zend_update_property_double(zend_class_entry *scope, zval 
*object, char *name, int name_length, double value TSRMLS_DC);
 ZEND_API void zend_update_property_string(zend_class_entry *scope, zval 
*object, char *name, int name_length, char *value TSRMLS_DC);
 ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval 
*object, char *name, int name_length, char *value, int value_length TSRMLS_DC);
+ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval 
*object, UChar *name, int name_length, char *value TSRMLS_DC);
+ZEND_API void zend_update_property_unicodel(zend_class_entry *scope, zval 
*object, UChar *name, int name_length, char *value, int value_length TSRMLS_DC);
 
 ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char 
*name, int name_length, zend_bool silent TSRMLS_DC);
 
http://cvs.php.net/diff.php/ZendEngine2/zend_exceptions.c?r1=1.85&r2=1.86&ty=u
Index: ZendEngine2/zend_exceptions.c
diff -u ZendEngine2/zend_exceptions.c:1.85 ZendEngine2/zend_exceptions.c:1.86
--- ZendEngine2/zend_exceptions.c:1.85  Thu Aug 18 06:18:12 2005
+++ ZendEngine2/zend_exceptions.c       Thu Aug 18 11:42:46 2005
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_exceptions.c,v 1.85 2005/08/18 10:18:12 dmitry Exp $ */
+/* $Id: zend_exceptions.c,v 1.86 2005/08/18 15:42:46 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_API.h"
@@ -130,15 +130,20 @@
        long   code = 0;
        zval  *object;
        int    argc = ZEND_NUM_ARGS(), message_len;
+       zend_uchar message_type;
 
-       if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, 
"|sl", &message, &message_len, &code) == FAILURE) {
+       if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, 
"|tl", &message, &message_len, &message_type, &code) == FAILURE) {
                zend_error(E_ERROR, "Wrong parameter count for 
exception([string $exception [, long $code ]])");
        }
 
        object = getThis();
 
        if (message) {
-               
zend_update_property_string(U_CLASS_ENTRY(default_exception_ce), object, 
"message", sizeof("message")-1, message TSRMLS_CC);
+               if (message_type == IS_UNICODE) {
+                       
zend_update_property_unicodel(U_CLASS_ENTRY(default_exception_ce), object, 
"message", sizeof("message")-1, message, message_len TSRMLS_CC);
+               } else {
+                       
zend_update_property_stringl(U_CLASS_ENTRY(default_exception_ce), object, 
"message", sizeof("message")-1, message, message_len TSRMLS_CC);
+               }
        }
 
        if (code) {
@@ -156,15 +161,20 @@
        long   code = 0, severity = E_ERROR, lineno;
        zval  *object;
        int    argc = ZEND_NUM_ARGS(), message_len, filename_len;
+       zend_uchar message_type, file_type;
 
-       if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, 
"|sllsl", &message, &message_len, &code, &severity, &filename, &filename_len, 
&lineno) == FAILURE) {
+       if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, 
"|tlltl", &message, &message_len, &message_type, &code, &severity, &filename, 
&filename_len, &file_type, &lineno) == FAILURE) {
                zend_error(E_ERROR, "Wrong parameter count for 
exception([string $exception [, long $code ]])");
        }
 
        object = getThis();
 
        if (message) {
-               
zend_update_property_string(U_CLASS_ENTRY(default_exception_ce), object, 
"message", sizeof("message")-1, message TSRMLS_CC);
+               if (message_type == IS_UNICODE) {
+                       
zend_update_property_unicodel(U_CLASS_ENTRY(default_exception_ce), object, 
"message", sizeof("message")-1, message, message_len TSRMLS_CC);
+               } else {
+                       
zend_update_property_stringl(U_CLASS_ENTRY(default_exception_ce), object, 
"message", sizeof("message")-1, message, message_len TSRMLS_CC);
+               }
        }
 
        if (code) {
@@ -174,11 +184,15 @@
        zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), object, 
"severity", sizeof("severity")-1, severity TSRMLS_CC);
        
        if (argc >= 4) {
-           zend_update_property_string(U_CLASS_ENTRY(default_exception_ce), 
object, "file", sizeof("file")-1, filename TSRMLS_CC);
-       if (argc < 5) {
-           lineno = 0; /* invalidate lineno */
-       }
-       zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), object, 
"line", sizeof("line")-1, lineno TSRMLS_CC);
+               if (file_type == IS_UNICODE) {
+                       
zend_update_property_unicodel(U_CLASS_ENTRY(default_exception_ce), object, 
"file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
+               } else {        
+                       
zend_update_property_stringl(U_CLASS_ENTRY(default_exception_ce), object, 
"file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
+               }
+               if (argc < 5) {
+                       lineno = 0; /* invalidate lineno */
+               }
+               zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), 
object, "line", sizeof("line")-1, lineno TSRMLS_CC);
        }
 }
 /* }}} */

-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe