From: SVN Migration Date: Fri, 8 Oct 2004 14:40:47 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. X-Git-Tag: php-5.0.3RC1~165 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82dae9d9be6e06005d92ea049cef9a8b75685bde;p=php This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. --- diff --git a/ext/mbstring/libmbfl/mbfl/eaw_table.h b/ext/mbstring/libmbfl/mbfl/eaw_table.h new file mode 100644 index 0000000000..95c895df1b --- /dev/null +++ b/ext/mbstring/libmbfl/mbfl/eaw_table.h @@ -0,0 +1,36 @@ +static const struct { + int begin; + int end; +} mbfl_eaw_table[] = { + { 0x1100, 0x1159 }, + { 0x115f, 0x115f }, + { 0x2329, 0x232a }, + { 0x2e80, 0x2e99 }, + { 0x2e9b, 0x2ef3 }, + { 0x2f00, 0x2fd5 }, + { 0x2ff0, 0x2ffb }, + { 0x3000, 0x303e }, + { 0x3041, 0x3096 }, + { 0x3099, 0x30ff }, + { 0x3105, 0x312c }, + { 0x3131, 0x318e }, + { 0x3190, 0x31b7 }, + { 0x31f0, 0x321e }, + { 0x3220, 0x3243 }, + { 0x3250, 0x327d }, + { 0x327f, 0x32fe }, + { 0x3300, 0x4db5 }, + { 0x4e00, 0x9fa5 }, + { 0xa000, 0xa48c }, + { 0xa490, 0xa4c6 }, + { 0xac00, 0xd7a3 }, + { 0xf900, 0xfa2d }, + { 0xfa30, 0xfa6a }, + { 0xfe30, 0xfe52 }, + { 0xfe54, 0xfe66 }, + { 0xfe68, 0xfe6b }, + { 0xff01, 0xff60 }, + { 0xffe0, 0xffe6 }, + { 0x20000, 0x2fffd }, + { 0x30000, 0x3fffd } +}; diff --git a/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk b/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk new file mode 100644 index 0000000000..c7deb4cdf5 --- /dev/null +++ b/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk @@ -0,0 +1,80 @@ +#!/usr/bin/awk -f +# +# $Id$ +# +# Description: a script to generate east asian width table. +# + +BEGIN { + prev = -1 + comma = 0 + ORS = "" + FS = "[;.|# ]" + print "static const struct {\n\tint begin;\n\tint end;\n} " TABLE_NAME "[] = {\n\t" +} + +/^#/ { +} + +/^[0-9a-fA-F]+;/ { + if ($2 == "W" || $2 == "F") { + v = ( "0x" $1 ) + 0 + if (prev < 0) { + first = v + } else if (v - prev > 1) { + if (comma) { + print ",\n\t" + } + printf("{ 0x%04x, 0x%04x }", first, prev) + first = v + comma = 1 + } + prev = v + } else { + if (prev >= 0) { + if (comma) { + print ",\n\t" + } + printf("{ 0x%04x, 0x%04x }", first, prev) + prev = -1 + comma = 1 + } + } +} + +/^[0-9a-fA-F]+\.\./ { + if ($4 == "W" || $4 == "F") { + vs = ( "0x" $1 ) + 0 + ve = ( "0x" $3 ) + 0 + if (prev < 0) { + first = vs + } else if (vs - prev > 1) { + if (comma) { + print ",\n\t" + } + printf("{ 0x%04x, 0x%04x }", first, prev) + first = vs + comma = 1 + } + prev = ve + } else { + if (prev >= 0) { + if (comma) { + print ",\n\t" + } + printf("{ 0x%04x, 0x%04x }", first, prev) + prev = -1 + comma = 1 + } + } +} + +END { + if (prev >= 0) { + if (comma) { + print ",\n\t" + } + printf("{ 0x%04x, 0x%04x }", first, prev) + } + print "\n};\n" +}