aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ccl.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/src/ccl.c b/src/ccl.c
index 743fbae21e5..0ae575fecd1 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -206,10 +206,13 @@ extern int charset_unicode;
206#define CCL_WriteStringJump 0x0A /* Write string and jump: 206#define CCL_WriteStringJump 0x0A /* Write string and jump:
207 1:A--D--D--R--E--S--S-000XXXXX 207 1:A--D--D--R--E--S--S-000XXXXX
208 2:LENGTH 208 2:LENGTH
209 3:0000STRIN[0]STRIN[1]STRIN[2] 209 3:000MSTRIN[0]STRIN[1]STRIN[2]
210 ... 210 ...
211 ------------------------------ 211 ------------------------------
212 write_string (STRING, LENGTH); 212 if (M)
213 write_multibyte_string (STRING, LENGTH);
214 else
215 write_string (STRING, LENGTH);
213 IC += ADDRESS; 216 IC += ADDRESS;
214 */ 217 */
215 218
@@ -316,13 +319,16 @@ extern int charset_unicode;
316 319
317#define CCL_WriteConstString 0x14 /* Write a constant or a string: 320#define CCL_WriteConstString 0x14 /* Write a constant or a string:
318 1:CCCCCCCCCCCCCCCCCCCCrrrXXXXX 321 1:CCCCCCCCCCCCCCCCCCCCrrrXXXXX
319 [2:0000STRIN[0]STRIN[1]STRIN[2]] 322 [2:000MSTRIN[0]STRIN[1]STRIN[2]]
320 [...] 323 [...]
321 ----------------------------- 324 -----------------------------
322 if (!rrr) 325 if (!rrr)
323 write (CC..C) 326 write (CC..C)
324 else 327 else
325 write_string (STRING, CC..C); 328 if (M)
329 write_multibyte_string (STRING, CC..C);
330 else
331 write_string (STRING, CC..C);
326 IC += (CC..C + 2) / 3; 332 IC += (CC..C + 2) / 3;
327 */ 333 */
328 334
@@ -762,17 +768,23 @@ while(0)
762 768
763/* Write a string at ccl_prog[IC] of length LEN to the current output 769/* Write a string at ccl_prog[IC] of length LEN to the current output
764 buffer. */ 770 buffer. */
765#define CCL_WRITE_STRING(len) \ 771#define CCL_WRITE_STRING(len) \
766 do { \ 772 do { \
767 int i; \ 773 int i; \
768 if (!dst) \ 774 if (!dst) \
769 CCL_INVALID_CMD; \ 775 CCL_INVALID_CMD; \
770 else if (dst + len <= dst_end) \ 776 else if (dst + len <= dst_end) \
771 for (i = 0; i < len; i++) \ 777 { \
772 *dst++ = ((XFASTINT (ccl_prog[ic + (i / 3)])) \ 778 if (XFASTINT (ccl_prog[ic]) & 0x1000000) \
773 >> ((2 - (i % 3)) * 8)) & 0xFF; \ 779 for (i = 0; i < len; i++) \
774 else \ 780 *dst++ = XFASTINT (ccl_prog[ic + i]) & 0xFFFFFF; \
775 CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ 781 else \
782 for (i = 0; i < len; i++) \
783 *dst++ = ((XFASTINT (ccl_prog[ic + (i / 3)])) \
784 >> ((2 - (i % 3)) * 8)) & 0xFF; \
785 } \
786 else \
787 CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \
776 } while (0) 788 } while (0)
777 789
778/* Read one byte from the current input buffer into Rth register. */ 790/* Read one byte from the current input buffer into Rth register. */
@@ -2164,8 +2176,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
2164 error ("Error in CCL program at %dth code", ccl.ic); 2176 error ("Error in CCL program at %dth code", ccl.ic);
2165 2177
2166 for (i = 0; i < 8; i++) 2178 for (i = 0; i < 8; i++)
2167 XSET (XVECTOR (status)->contents[i], Lisp_Int, ccl.reg[i]); 2179 ASET (status, i, make_number (ccl.reg[i]));
2168 XSETINT (XVECTOR (status)->contents[8], ccl.ic); 2180 ASET (status, 8, make_number (ccl.ic));
2169 2181
2170 if (NILP (unibyte_p)) 2182 if (NILP (unibyte_p))
2171 val = make_multibyte_string ((char *) outbuf, produced_chars, 2183 val = make_multibyte_string ((char *) outbuf, produced_chars,