changeset 30705:b37405134317

(ccl-embed-data): Make ccl-program-vector longer if necessary. (ccl-embed-code): Call ccl-embed-data to store CODE in ccl-program-vector.
author Kenichi Handa <handa@m17n.org>
date Wed, 09 Aug 2000 09:02:46 +0000
parents f0f3b74ad28e
children b0c302c3b209
files lisp/international/ccl.el
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/ccl.el	Wed Aug 09 08:59:00 2000 +0000
+++ b/lisp/international/ccl.el	Wed Aug 09 09:02:46 2000 +0000
@@ -246,6 +246,13 @@
 (defun ccl-embed-data (data &optional ic)
   (if ic
       (aset ccl-program-vector ic data)
+    (let ((len (length ccl-program-vector)))
+      (if (>= ccl-current-ic len)
+	  (let ((new (make-vector (* len 2) nil)))
+	    (while (> len 0)
+	      (setq len (1- len))
+	      (aset new len (aref ccl-program-vector len)))
+	    (setq ccl-program-vector new))))
     (aset ccl-program-vector ccl-current-ic data)
     (setq ccl-current-ic (1+ ccl-current-ic))))
 
@@ -302,8 +309,7 @@
 			  (logior (ash (get reg2 'ccl-register-number) 8)
 				  (ash data 11))
 			(ash data 8)))))
-    (aset ccl-program-vector ccl-current-ic code)
-    (setq ccl-current-ic (1+ ccl-current-ic))))
+    (ccl-embed-data code)))
 
 ;; extended ccl command format
 ;;	|- 14-bit -|- 3-bit --|- 3-bit --|- 3-bit --|- 5-bit -|