hirokawa Tue Mar 21 02:11:55 2006 UTC
Modified files:
/php-src/ext/mbstring mbstring.c mbstring.h
/php-src/ext/mbstring/libmbfl/mbfl mbfilter.c mbfilter.h
mbfl_convert.c mbfl_convert.h
Log:
MF PHP_5_1
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mbstring.c?r1=1.244&r2=1.245&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.244
php-src/ext/mbstring/mbstring.c:1.245
--- php-src/ext/mbstring/mbstring.c:1.244 Thu Mar 16 15:21:12 2006
+++ php-src/ext/mbstring/mbstring.c Tue Mar 21 02:11:55 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.244 2006/03/16 15:21:12 masugata Exp $ */
+/* $Id: mbstring.c,v 1.245 2006/03/21 02:11:55 hirokawa Exp $ */
/*
* PHP 4 Multibyte String module "mbstring"
@@ -786,6 +786,7 @@
MBSTRG(filter_illegal_substchar) = 0x3f; /* '?' */
MBSTRG(current_filter_illegal_mode) =
MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
MBSTRG(current_filter_illegal_substchar) = 0x3f; /* '?' */
+ MBSTRG(illegalchars) = 0;
MBSTRG(func_overload) = 0;
MBSTRG(encoding_translation) = 0;
MBSTRG(strict_detection) = 0;
@@ -928,6 +929,7 @@
MBSTRG(current_http_output_encoding) = MBSTRG(http_output_encoding);
MBSTRG(current_filter_illegal_mode) = MBSTRG(filter_illegal_mode);
MBSTRG(current_filter_illegal_substchar) =
MBSTRG(filter_illegal_substchar);
+ MBSTRG(illegalchars) = 0;
n = 0;
if (MBSTRG(detect_order_list)) {
@@ -996,6 +998,7 @@
MBSTRG(current_detect_order_list_size) = 0;
}
if (MBSTRG(outconv) != NULL) {
+ MBSTRG(illegalchars) +=
mbfl_buffer_illegalchars(MBSTRG(outconv));
mbfl_buffer_converter_delete(MBSTRG(outconv));
MBSTRG(outconv) = NULL;
}
@@ -1451,6 +1454,7 @@
if ((arg_status & PHP_OUTPUT_HANDLER_START) != 0) {
/* delete the converter just in case. */
if (MBSTRG(outconv)) {
+ MBSTRG(illegalchars) +=
mbfl_buffer_illegalchars(MBSTRG(outconv));
mbfl_buffer_converter_delete(MBSTRG(outconv));
MBSTRG(outconv) = NULL;
}
@@ -1515,6 +1519,7 @@
/* delete the converter if it is the last feed. */
if (last_feed) {
+ MBSTRG(illegalchars) +=
mbfl_buffer_illegalchars(MBSTRG(outconv));
mbfl_buffer_converter_delete(MBSTRG(outconv));
MBSTRG(outconv) = NULL;
}
@@ -2079,6 +2084,7 @@
output = (char *)ret->val;
}
+ MBSTRG(illegalchars) += mbfl_buffer_illegalchars(MBSTRG(outconv));
mbfl_buffer_converter_delete(convd);
return output;
}
@@ -2747,6 +2753,7 @@
}
efree(stack);
+ MBSTRG(illegalchars) += mbfl_buffer_illegalchars(convd);
mbfl_buffer_converter_delete(convd);
}
@@ -3439,6 +3446,8 @@
if (lang != NULL && (name = (char
*)mbfl_no_encoding2name(lang->mail_body_encoding)) != NULL) {
RETVAL_STRING(name, 1);
}
+ } else if (!strcasecmp("illegalchars", typ)) {
+ RETVAL_LONG(MBSTRG(illegalchars));
} else {
RETURN_FALSE;
}
@@ -3605,6 +3614,7 @@
str[i] = ret->val;
len[i] = ret->len;
}
+ MBSTRG(illegalchars) += mbfl_buffer_illegalchars(convd);
mbfl_buffer_converter_delete(convd);
}
@@ -3821,6 +3831,7 @@
*to = ret->val;
*to_length = ret->len;
}
+ MBSTRG(illegalchars) += mbfl_buffer_illegalchars(convd);
mbfl_buffer_converter_delete(convd);
return ret ? 0 : -1;
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mbstring.h?r1=1.68&r2=1.69&diff_format=u
Index: php-src/ext/mbstring/mbstring.h
diff -u php-src/ext/mbstring/mbstring.h:1.68
php-src/ext/mbstring/mbstring.h:1.69
--- php-src/ext/mbstring/mbstring.h:1.68 Sun Jan 1 13:09:51 2006
+++ php-src/ext/mbstring/mbstring.h Tue Mar 21 02:11:55 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.h,v 1.68 2006/01/01 13:09:51 sniper Exp $ */
+/* $Id: mbstring.h,v 1.69 2006/03/21 02:11:55 hirokawa Exp $ */
/*
* PHP 4 Multibyte String module "mbstring" (currently only for Japanese)
@@ -181,6 +181,7 @@
long func_overload;
zend_bool encoding_translation;
long strict_detection;
+ long illegalchars;
mbfl_buffer_converter *outconv;
#if HAVE_MBREGEX && defined(PHP_MBREGEX_GLOBALS)
PHP_MBREGEX_GLOBALS
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c?r1=1.10&r2=1.11&diff_format=u
Index: php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c
diff -u php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c:1.10
php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c:1.11
--- php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c:1.10 Sun Dec 25 15:21:54 2005
+++ php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c Tue Mar 21 02:11:55 2006
@@ -331,6 +331,20 @@
return mbfl_memory_device_result(&convd->device, result);
}
+int mbfl_buffer_illegalchars(mbfl_buffer_converter *convd)
+{
+ int num_illegalchars = 0;
+
+ if (convd->filter1 != NULL) {
+ num_illegalchars += convd->filter1->num_illegalchar;
+ }
+
+ if (convd->filter2 != NULL) {
+ num_illegalchars += convd->filter2->num_illegalchar;
+ }
+
+ return (num_illegalchars);
+}
/*
* encoding detector
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/libmbfl/mbfl/mbfilter.h?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/mbstring/libmbfl/mbfl/mbfilter.h
diff -u php-src/ext/mbstring/libmbfl/mbfl/mbfilter.h:1.5
php-src/ext/mbstring/libmbfl/mbfl/mbfilter.h:1.6
--- php-src/ext/mbstring/libmbfl/mbfl/mbfilter.h:1.5 Sun Dec 25 15:21:54 2005
+++ php-src/ext/mbstring/libmbfl/mbfl/mbfilter.h Tue Mar 21 02:11:55 2006
@@ -129,6 +129,7 @@
MBFLAPI extern mbfl_string *
mbfl_buffer_converter_getbuffer(mbfl_buffer_converter *convd, mbfl_string
*result);
MBFLAPI extern mbfl_string *
mbfl_buffer_converter_result(mbfl_buffer_converter *convd, mbfl_string *result);
MBFLAPI extern mbfl_string *
mbfl_buffer_converter_feed_result(mbfl_buffer_converter *convd, mbfl_string
*string, mbfl_string *result);
+MBFLAPI extern int mbfl_buffer_illegalchars(mbfl_buffer_converter *convd);
/*
* encoding detector
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.c?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.c
diff -u php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.c:1.5
php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.c:1.6
--- php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.c:1.5 Tue Mar 22
22:22:10 2005
+++ php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.c Tue Mar 21 02:11:55 2006
@@ -250,6 +250,7 @@
filter->data = data;
filter->illegal_mode = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
filter->illegal_substchar = 0x3f; /* '?' */
+ filter->num_illegalchar = 0;
/* setup the function table */
mbfl_convert_filter_reset_vtbl(filter);
@@ -317,6 +318,7 @@
dist->to = src->to;
dist->illegal_mode = src->illegal_mode;
dist->illegal_substchar = src->illegal_substchar;
+ dist->num_illegalchar = src->num_illegalchar;
}
int mbfl_convert_filter_devcat(mbfl_convert_filter *filter, mbfl_memory_device
*src)
@@ -432,7 +434,7 @@
break;
}
filter->illegal_mode = mode_backup;
-
+ filter->num_illegalchar++;
return ret;
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.h?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.h
diff -u php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.h:1.4
php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.h:1.5
--- php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.h:1.4 Mon Feb 21
10:12:43 2005
+++ php-src/ext/mbstring/libmbfl/mbfl/mbfl_convert.h Tue Mar 21 02:11:55 2006
@@ -51,6 +51,7 @@
const mbfl_encoding *to;
int illegal_mode;
int illegal_substchar;
+ int num_illegalchar;
void *opaque;
};
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php