diff options
| author | Kenichi Handa | 1999-12-15 00:03:45 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1999-12-15 00:03:45 +0000 |
| commit | 6982083b65de7526b4ff88815524addbbbceee80 (patch) | |
| tree | 119d1e20645f6d6e8c64c1dbe2e1d31548f08657 /src/ccl.c | |
| parent | 70414a3dac2e1c71ec07cc0cdf7d79008b599a31 (diff) | |
| download | emacs-6982083b65de7526b4ff88815524addbbbceee80.tar.gz emacs-6982083b65de7526b4ff88815524addbbbceee80.zip | |
(CCL_WRITE_CHAR): Adjusted for the change of CHAR_STRING.
(ccl_driver): Delete codes for a composite character.
Diffstat (limited to 'src/ccl.c')
| -rw-r--r-- | src/ccl.c | 82 |
1 files changed, 15 insertions, 67 deletions
| @@ -666,21 +666,21 @@ static tr_stack *mapping_stack_pointer; | |||
| 666 | 666 | ||
| 667 | /* Encode one character CH to multibyte form and write to the current | 667 | /* Encode one character CH to multibyte form and write to the current |
| 668 | output buffer. If CH is less than 256, CH is written as is. */ | 668 | output buffer. If CH is less than 256, CH is written as is. */ |
| 669 | #define CCL_WRITE_CHAR(ch) \ | 669 | #define CCL_WRITE_CHAR(ch) \ |
| 670 | do { \ | 670 | do { \ |
| 671 | if (!dst) \ | 671 | if (!dst) \ |
| 672 | CCL_INVALID_CMD; \ | 672 | CCL_INVALID_CMD; \ |
| 673 | else \ | 673 | else \ |
| 674 | { \ | 674 | { \ |
| 675 | unsigned char work[4], *str; \ | 675 | unsigned char str[MAX_MULTIBYTE_LENGTH], *p = str; \ |
| 676 | int len = CHAR_STRING (ch, work, str); \ | 676 | int len = CHAR_STRING (ch, str); \ |
| 677 | if (dst + len <= (dst_bytes ? dst_end : src)) \ | 677 | if (dst + len <= (dst_bytes ? dst_end : src)) \ |
| 678 | { \ | 678 | { \ |
| 679 | while (len--) *dst++ = *str++; \ | 679 | while (len--) *dst++ = *p++; \ |
| 680 | } \ | 680 | } \ |
| 681 | else \ | 681 | else \ |
| 682 | CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ | 682 | CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ |
| 683 | } \ | 683 | } \ |
| 684 | } while (0) | 684 | } while (0) |
| 685 | 685 | ||
| 686 | /* Write a string at ccl_prog[IC] of length LEN to the current output | 686 | /* Write a string at ccl_prog[IC] of length LEN to the current output |
| @@ -1125,46 +1125,6 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) | |||
| 1125 | } | 1125 | } |
| 1126 | 1126 | ||
| 1127 | i = *src++; | 1127 | i = *src++; |
| 1128 | if (i == LEADING_CODE_COMPOSITION) | ||
| 1129 | { | ||
| 1130 | if (src >= src_end) | ||
| 1131 | goto ccl_read_multibyte_character_suspend; | ||
| 1132 | if (*src == 0xFF) | ||
| 1133 | { | ||
| 1134 | ccl->private_state = COMPOSING_WITH_RULE_HEAD; | ||
| 1135 | src++; | ||
| 1136 | } | ||
| 1137 | else | ||
| 1138 | ccl->private_state = COMPOSING_NO_RULE_HEAD; | ||
| 1139 | |||
| 1140 | continue; | ||
| 1141 | } | ||
| 1142 | if (ccl->private_state != COMPOSING_NO) | ||
| 1143 | { | ||
| 1144 | /* composite character */ | ||
| 1145 | if (i < 0xA0) | ||
| 1146 | ccl->private_state = COMPOSING_NO; | ||
| 1147 | else | ||
| 1148 | { | ||
| 1149 | if (COMPOSING_WITH_RULE_RULE == ccl->private_state) | ||
| 1150 | { | ||
| 1151 | ccl->private_state = COMPOSING_WITH_RULE_HEAD; | ||
| 1152 | continue; | ||
| 1153 | } | ||
| 1154 | else if (COMPOSING_WITH_RULE_HEAD == ccl->private_state) | ||
| 1155 | ccl->private_state = COMPOSING_WITH_RULE_RULE; | ||
| 1156 | |||
| 1157 | if (i == 0xA0) | ||
| 1158 | { | ||
| 1159 | if (src >= src_end) | ||
| 1160 | goto ccl_read_multibyte_character_suspend; | ||
| 1161 | i = *src++ & 0x7F; | ||
| 1162 | } | ||
| 1163 | else | ||
| 1164 | i -= 0x20; | ||
| 1165 | } | ||
| 1166 | } | ||
| 1167 | |||
| 1168 | if (i < 0x80) | 1128 | if (i < 0x80) |
| 1169 | { | 1129 | { |
| 1170 | /* ASCII */ | 1130 | /* ASCII */ |
| @@ -1231,8 +1191,6 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) | |||
| 1231 | i = reg[RRR]; /* charset */ | 1191 | i = reg[RRR]; /* charset */ |
| 1232 | if (i == CHARSET_ASCII) | 1192 | if (i == CHARSET_ASCII) |
| 1233 | i = reg[rrr] & 0xFF; | 1193 | i = reg[rrr] & 0xFF; |
| 1234 | else if (i == CHARSET_COMPOSITION) | ||
| 1235 | i = MAKE_COMPOSITE_CHAR (reg[rrr]); | ||
| 1236 | else if (CHARSET_DIMENSION (i) == 1) | 1194 | else if (CHARSET_DIMENSION (i) == 1) |
| 1237 | i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F); | 1195 | i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F); |
| 1238 | else if (i < MIN_CHARSET_PRIVATE_DIMENSION2) | 1196 | else if (i < MIN_CHARSET_PRIVATE_DIMENSION2) |
| @@ -1248,11 +1206,6 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) | |||
| 1248 | i = reg[RRR]; /* charset */ | 1206 | i = reg[RRR]; /* charset */ |
| 1249 | if (i == CHARSET_ASCII) | 1207 | if (i == CHARSET_ASCII) |
| 1250 | i = reg[rrr]; | 1208 | i = reg[rrr]; |
| 1251 | else if (i == CHARSET_COMPOSITION) | ||
| 1252 | { | ||
| 1253 | reg[RRR] = -1; | ||
| 1254 | break; | ||
| 1255 | } | ||
| 1256 | else if (CHARSET_DIMENSION (i) == 1) | 1209 | else if (CHARSET_DIMENSION (i) == 1) |
| 1257 | i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F); | 1210 | i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F); |
| 1258 | else if (i < MIN_CHARSET_PRIVATE_DIMENSION2) | 1211 | else if (i < MIN_CHARSET_PRIVATE_DIMENSION2) |
| @@ -1275,11 +1228,6 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) | |||
| 1275 | i = reg[RRR]; /* charset */ | 1228 | i = reg[RRR]; /* charset */ |
| 1276 | if (i == CHARSET_ASCII) | 1229 | if (i == CHARSET_ASCII) |
| 1277 | i = reg[rrr]; | 1230 | i = reg[rrr]; |
| 1278 | else if (i == CHARSET_COMPOSITION) | ||
| 1279 | { | ||
| 1280 | reg[RRR] = -1; | ||
| 1281 | break; | ||
| 1282 | } | ||
| 1283 | else if (CHARSET_DIMENSION (i) == 1) | 1231 | else if (CHARSET_DIMENSION (i) == 1) |
| 1284 | i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F); | 1232 | i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F); |
| 1285 | else if (i < MIN_CHARSET_PRIVATE_DIMENSION2) | 1233 | else if (i < MIN_CHARSET_PRIVATE_DIMENSION2) |