aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-12-15 04:35:38 +0000
committerKenichi Handa1998-12-15 04:35:38 +0000
commitad3d1b1d670f8106faa0ca23c0a0f50300e2bc31 (patch)
tree811b1234c599bf567aa996135a9db4769e26aec9 /src
parent0282eb691536b39247884452ac76473d05cdf369 (diff)
downloademacs-ad3d1b1d670f8106faa0ca23c0a0f50300e2bc31.tar.gz
emacs-ad3d1b1d670f8106faa0ca23c0a0f50300e2bc31.zip
(CCL_SUCCESS): Don't set ccl->ic.
(ccl_driver) <CCL_End>: Pretend that all source text is consumed. Set `ic' to the head of this command. (ccl_driver) <CCL_ReadMultibyteChar2>: Return a single byte 8-bit code for an invalid code. (setup_ccl_program): If the arg VEC is nil, skip setting ups based on VEC.
Diffstat (limited to 'src')
-rw-r--r--src/ccl.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/ccl.c b/src/ccl.c
index 55bd2ca388e..d00eef2c7cd 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -636,7 +636,6 @@ static tr_stack *mapping_stack_pointer;
636#define CCL_SUCCESS \ 636#define CCL_SUCCESS \
637 do { \ 637 do { \
638 ccl->status = CCL_STAT_SUCCESS; \ 638 ccl->status = CCL_STAT_SUCCESS; \
639 ccl->ic = CCL_HEADER_MAIN; \
640 goto ccl_finish; \ 639 goto ccl_finish; \
641 } while (0) 640 } while (0)
642 641
@@ -978,6 +977,11 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
978 ic = ccl_prog_stack_struct[stack_idx].ic; 977 ic = ccl_prog_stack_struct[stack_idx].ic;
979 break; 978 break;
980 } 979 }
980 if (src)
981 src = src_end;
982 /* ccl->ic should points to this command code again to
983 suppress further processing. */
984 ic--;
981 CCL_SUCCESS; 985 CCL_SUCCESS;
982 986
983 case CCL_ExprSelfConst: /* 00000OPERATION000000rrrXXXXX */ 987 case CCL_ExprSelfConst: /* 00000OPERATION000000rrrXXXXX */
@@ -1180,9 +1184,9 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
1180 } 1184 }
1181 else 1185 else
1182 { 1186 {
1183 /* INVALID CODE 1187 /* INVALID CODE. Return a single byte character. */
1184 Returned charset is -1. */ 1188 reg[RRR] = CHARSET_ASCII;
1185 reg[RRR] = -1; 1189 reg[rrr] = i;
1186 } 1190 }
1187 } while (0); 1191 } while (0);
1188 break; 1192 break;
@@ -1608,7 +1612,8 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
1608} 1612}
1609 1613
1610/* Setup fields of the structure pointed by CCL appropriately for the 1614/* Setup fields of the structure pointed by CCL appropriately for the
1611 execution of compiled CCL code in VEC (vector of integer). */ 1615 execution of compiled CCL code in VEC (vector of integer).
1616 If VEC is nil, we skip setting ups based on VEC. */
1612void 1617void
1613setup_ccl_program (ccl, vec) 1618setup_ccl_program (ccl, vec)
1614 struct ccl_program *ccl; 1619 struct ccl_program *ccl;
@@ -1616,11 +1621,16 @@ setup_ccl_program (ccl, vec)
1616{ 1621{
1617 int i; 1622 int i;
1618 1623
1619 ccl->size = XVECTOR (vec)->size; 1624 if (VECTORP (vec))
1620 ccl->prog = XVECTOR (vec)->contents; 1625 {
1626 struct Lisp_Vector *vp = XVECTOR (vec);
1627
1628 ccl->size = vp->size;
1629 ccl->prog = vp->contents;
1630 ccl->eof_ic = XINT (vp->contents[CCL_HEADER_EOF]);
1631 ccl->buf_magnification = XINT (vp->contents[CCL_HEADER_BUF_MAG]);
1632 }
1621 ccl->ic = CCL_HEADER_MAIN; 1633 ccl->ic = CCL_HEADER_MAIN;
1622 ccl->eof_ic = XINT (XVECTOR (vec)->contents[CCL_HEADER_EOF]);
1623 ccl->buf_magnification = XINT (XVECTOR (vec)->contents[CCL_HEADER_BUF_MAG]);
1624 for (i = 0; i < 8; i++) 1634 for (i = 0; i < 8; i++)
1625 ccl->reg[i] = 0; 1635 ccl->reg[i] = 0;
1626 ccl->last_block = 0; 1636 ccl->last_block = 0;