diff options
author | Miles Bader <[email protected]> | 2004-06-28 07:56:49 +0000 |
---|---|---|
committer | Miles Bader <[email protected]> | 2004-06-28 07:56:49 +0000 |
commit | 327719ee8a3fcdb36ed6acaf6d8cb5fbdf0bd801 (patch) | |
tree | 21de188e13b5e41a79bb50040933072ae0235217 /src/ccl.c | |
parent | 852f73b7fa7b71910282eacb6263b3ecfd4ee783 (diff) | |
parent | 376de73927383d6062483db10b8a82448505f52b (diff) |
Revision: [email protected]/emacs--unicode--0--patch-15
Merge from emacs--cvs-trunk--0
Patches applied:
* [email protected]/emacs--cvs-trunk--0--patch-218
- [email protected]/emacs--cvs-trunk--0--patch-220
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-221
Restore deleted tagline in etc/TUTORIAL.ru
* [email protected]/emacs--cvs-trunk--0--patch-222
- [email protected]/emacs--cvs-trunk--0--patch-228
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-229
Remove TeX output files from the archive
* [email protected]/emacs--cvs-trunk--0--patch-230
- [email protected]/emacs--cvs-trunk--0--patch-247
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-248
src/lisp.h (CYCLE_CHECK): Macro moved from xfaces.c
* [email protected]/emacs--cvs-trunk--0--patch-249
- [email protected]/emacs--cvs-trunk--0--patch-256
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-258
- [email protected]/emacs--cvs-trunk--0--patch-263
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-264
Update from CVS: lispref/display.texi: emacs -> Emacs.
* [email protected]/emacs--cvs-trunk--0--patch-265
- [email protected]/emacs--cvs-trunk--0--patch-274
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-275
Update from CVS: man/makefile.w32-in: Revert last change
* [email protected]/emacs--cvs-trunk--0--patch-276
- [email protected]/emacs--cvs-trunk--0--patch-295
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-296
Allow restarting an existing debugger session that's exited
* [email protected]/emacs--cvs-trunk--0--patch-297
- [email protected]/emacs--cvs-trunk--0--patch-299
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-300
- [email protected]/emacs--cvs-trunk--0--patch-327
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-328
Update from CVS: src/.gdbinit (xsymbol): Fix last change.
* [email protected]/emacs--cvs-trunk--0--patch-329
- [email protected]/emacs--cvs-trunk--0--patch-344
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-345
Tweak source regexps so that building in place won't cause problems
* [email protected]/emacs--cvs-trunk--0--patch-346
- [email protected]/emacs--cvs-trunk--0--patch-351
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-352
Update from CVS: lisp/flymake.el: New file.
* [email protected]/emacs--cvs-trunk--0--patch-353
- [email protected]/emacs--cvs-trunk--0--patch-361
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-362
Support " [...]" style defaults in minibuffer-electric-default-mode
* [email protected]/emacs--cvs-trunk--0--patch-363
(read-number): Use canonical format for default in prompt.
* [email protected]/emacs--cvs-trunk--0--patch-364
- [email protected]/emacs--cvs-trunk--0--patch-367
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-368
Improve display-supports-face-attributes-p on non-ttys
* [email protected]/emacs--cvs-trunk--0--patch-369
Rewrite face-differs-from-default-p
* [email protected]/emacs--cvs-trunk--0--patch-370
Move `display-supports-face-attributes-p' entirely into C code
* [email protected]/emacs--cvs-trunk--0--patch-371
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-372
Simplify face-differs-from-default-p; don't consider :stipple.
* [email protected]/emacs--cvs-trunk--0--patch-373
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-374
(tty_supports_face_attributes_p): Ensure attributes differ from default
* [email protected]/emacs--cvs-trunk--0--patch-375
- [email protected]/emacs--cvs-trunk--0--patch-376
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-377
(Fdisplay_supports_face_attributes_p): Work around bootstrapping problem
* [email protected]/emacs--cvs-trunk--0--patch-378
- [email protected]/emacs--cvs-trunk--0--patch-380
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-381
Face merging cleanups
* [email protected]/emacs--cvs-trunk--0--patch-382
- [email protected]/emacs--cvs-trunk--0--patch-384
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-385
src/xfaces.c (push_named_merge_point): Return 0 if a cycle is detected
* [email protected]/emacs--cvs-trunk--0--patch-386
- [email protected]/emacs--cvs-trunk--0--patch-395
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-396
Tweak arch tagging to make build/install-in-place less annoying
* [email protected]/emacs--cvs-trunk--0--patch-397
Work around vc-arch problems when building eshell
* [email protected]/emacs--cvs-trunk--0--patch-398
Tweak permissions
* [email protected]/emacs--cvs-trunk--0--patch-399
Tweak directory permissions
* [email protected]/emacs--cvs-trunk--0--patch-400
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-401
More build-in-place tweaking of arch tagging
* [email protected]/emacs--cvs-trunk--0--patch-402
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-403
Yet more build-in-place tweaking of arch tagging
* [email protected]/emacs--cvs-trunk--0--patch-404
- [email protected]/emacs--cvs-trunk--0--patch-409
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-410
Make sure image types are initialized for lookup too
* [email protected]/emacs--cvs-trunk--0--patch-411
- [email protected]/emacs--cvs-trunk--0--patch-416
Update from CVS
Diffstat (limited to 'src/ccl.c')
-rw-r--r-- | src/ccl.c | 37 |
1 files changed, 36 insertions, 1 deletions
@@ -634,14 +634,17 @@ do \ { \ ccl_prog = ccl_prog_stack_struct[0].ccl_prog; \ ic = ccl_prog_stack_struct[0].ic; \ + eof_ic = ccl_prog_stack_struct[0].eof_ic; \ } \ CCL_INVALID_CMD; \ } \ ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog; \ ccl_prog_stack_struct[stack_idx].ic = (ret_ic); \ + ccl_prog_stack_struct[stack_idx].eof_ic = eof_ic; \ stack_idx++; \ ccl_prog = called_ccl.prog; \ ic = CCL_HEADER_MAIN; \ + eof_ic = XFASTINT (ccl_prog[CCL_HEADER_EOF]); \ goto ccl_repeat; \ } \ while (0) @@ -718,14 +721,29 @@ while (0) /* Terminate CCL program because of invalid command. Should not occur in the normal case. */ +#ifndef CCL_DEBUG + +#define CCL_INVALID_CMD \ +do \ + { \ + ccl->status = CCL_STAT_INVALID_CMD; \ + goto ccl_error_handler; \ + } \ +while(0) + +#else + #define CCL_INVALID_CMD \ do \ { \ + ccl_debug_hook (this_ic); \ ccl->status = CCL_STAT_INVALID_CMD; \ goto ccl_error_handler; \ } \ while(0) +#endif + /* Encode one character CH to multibyte form and write to the current output buffer. If CH is less than 256, CH is written as is. */ #define CCL_WRITE_CHAR(ch) \ @@ -762,6 +780,7 @@ while(0) r = *src++; \ else if (ccl->last_block) \ { \ + r = -1; \ ic = ccl->eof_ic; \ goto ccl_repeat; \ } \ @@ -807,12 +826,20 @@ while(0) #define CCL_DEBUG_BACKTRACE_LEN 256 int ccl_backtrace_table[CCL_DEBUG_BACKTRACE_LEN]; int ccl_backtrace_idx; + +int +ccl_debug_hook (int ic) +{ + return ic; +} + #endif struct ccl_prog_stack { Lisp_Object *ccl_prog; /* Pointer to an array of CCL code. */ int ic; /* Instruction Counter. */ + int eof_ic; /* Instruction Counter to jump on EOF. */ }; /* For the moment, we only support depth 256 of stack. */ @@ -837,8 +864,10 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list) /* Instruction counter of the current CCL code. */ int this_ic = 0; struct charset *charset; + int eof_ic = ccl->eof_ic; + int eof_hit = 0; - if (ic >= ccl->eof_ic) + if (ic >= eof_ic) ic = CCL_HEADER_MAIN; if (ccl->buf_magnification == 0) /* We can't read/produce any bytes. */ @@ -1042,15 +1071,18 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list) { ccl_prog = ccl_prog_stack_struct[0].ccl_prog; ic = ccl_prog_stack_struct[0].ic; + eof_ic = ccl_prog_stack_struct[0].eof_ic; } CCL_INVALID_CMD; } ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog; ccl_prog_stack_struct[stack_idx].ic = ic; + ccl_prog_stack_struct[stack_idx].eof_ic = eof_ic; stack_idx++; ccl_prog = XVECTOR (AREF (slot, 1))->contents; ic = CCL_HEADER_MAIN; + eof_ic = XFASTINT (ccl_prog[CCL_HEADER_EOF]); } break; @@ -1080,6 +1112,9 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list) stack_idx--; ccl_prog = ccl_prog_stack_struct[stack_idx].ccl_prog; ic = ccl_prog_stack_struct[stack_idx].ic; + eof_ic = ccl_prog_stack_struct[stack_idx].eof_ic; + if (eof_hit) + ic = eof_ic; break; } if (src) |