aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2003-01-30 02:23:40 +0000
committerKenichi Handa2003-01-30 02:23:40 +0000
commit8dcbea820b5aa9258b3696ba74138ddbe512dac5 (patch)
tree18e11c39535fdbe113182810bdaac8990433dc09 /src/coding.c
parent35d47d18bed28ac16908ff4ed22af47952f8c3da (diff)
downloademacs-8dcbea820b5aa9258b3696ba74138ddbe512dac5.tar.gz
emacs-8dcbea820b5aa9258b3696ba74138ddbe512dac5.zip
(decode_coding_ccl, encode_coding_ccl): Call ccl_driver
with the last arg charset_list acquired from coding. (Fdefine_coding_system_internal): For ccl-based coding system, fix the attribute coding_attr_ccl_valids.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/coding.c b/src/coding.c
index 8340e8dc271..cd44b246981 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -4302,7 +4302,9 @@ decode_coding_ccl (coding)
4302 struct ccl_program ccl; 4302 struct ccl_program ccl;
4303 int source_charbuf[1024]; 4303 int source_charbuf[1024];
4304 int source_byteidx[1024]; 4304 int source_byteidx[1024];
4305 Lisp_Object attrs, eol_type, charset_list, valids;
4305 4306
4307 CODING_GET_INFO (coding, attrs, eol_type, charset_list);
4306 setup_ccl_program (&ccl, CODING_CCL_DECODER (coding)); 4308 setup_ccl_program (&ccl, CODING_CCL_DECODER (coding));
4307 4309
4308 while (src < src_end) 4310 while (src < src_end)
@@ -4329,7 +4331,8 @@ decode_coding_ccl (coding)
4329 while (source < source_end) 4331 while (source < source_end)
4330 { 4332 {
4331 ccl_driver (&ccl, source, charbuf, 4333 ccl_driver (&ccl, source, charbuf,
4332 source_end - source, charbuf_end - charbuf); 4334 source_end - source, charbuf_end - charbuf,
4335 charset_list);
4333 source += ccl.consumed; 4336 source += ccl.consumed;
4334 charbuf += ccl.produced; 4337 charbuf += ccl.produced;
4335 if (ccl.status != CCL_STAT_SUSPEND_BY_DST) 4338 if (ccl.status != CCL_STAT_SUSPEND_BY_DST)
@@ -4379,7 +4382,9 @@ encode_coding_ccl (coding)
4379 unsigned char *adjusted_dst_end = dst_end - 1; 4382 unsigned char *adjusted_dst_end = dst_end - 1;
4380 int destination_charbuf[1024]; 4383 int destination_charbuf[1024];
4381 int i, produced_chars = 0; 4384 int i, produced_chars = 0;
4385 Lisp_Object attrs, eol_type, charset_list;
4382 4386
4387 CODING_GET_INFO (coding, attrs, eol_type, charset_list);
4383 setup_ccl_program (&ccl, CODING_CCL_ENCODER (coding)); 4388 setup_ccl_program (&ccl, CODING_CCL_ENCODER (coding));
4384 4389
4385 ccl.last_block = coding->mode & CODING_MODE_LAST_BLOCK; 4390 ccl.last_block = coding->mode & CODING_MODE_LAST_BLOCK;
@@ -4392,7 +4397,7 @@ encode_coding_ccl (coding)
4392 dst_bytes = 1024; 4397 dst_bytes = 1024;
4393 4398
4394 ccl_driver (&ccl, charbuf, destination_charbuf, 4399 ccl_driver (&ccl, charbuf, destination_charbuf,
4395 charbuf_end - charbuf, dst_bytes); 4400 charbuf_end - charbuf, dst_bytes, charset_list);
4396 charbuf += ccl.consumed; 4401 charbuf += ccl.consumed;
4397 if (multibytep) 4402 if (multibytep)
4398 for (i = 0; i < ccl.produced; i++) 4403 for (i = 0; i < ccl.produced; i++)
@@ -7909,21 +7914,31 @@ usage: (define-coding-system-internal ...) */)
7909 valids = Fmake_string (make_number (256), make_number (0)); 7914 valids = Fmake_string (make_number (256), make_number (0));
7910 for (tail = val; !NILP (tail); tail = Fcdr (tail)) 7915 for (tail = val; !NILP (tail); tail = Fcdr (tail))
7911 { 7916 {
7917 int from, to;
7918
7912 val = Fcar (tail); 7919 val = Fcar (tail);
7913 if (INTEGERP (val)) 7920 if (INTEGERP (val))
7914 ASET (valids, XINT (val), make_number (1)); 7921 {
7922 from = to = XINT (val);
7923 if (from < 0 || from > 255)
7924 args_out_of_range_3 (val, make_number (0), make_number (255));
7925 }
7915 else 7926 else
7916 { 7927 {
7917 int from, to;
7918
7919 CHECK_CONS (val); 7928 CHECK_CONS (val);
7920 CHECK_NUMBER (XCAR (val)); 7929 CHECK_NUMBER (XCAR (val));
7921 CHECK_NUMBER (XCDR (val)); 7930 CHECK_NUMBER (XCDR (val));
7922 from = XINT (XCAR (val)); 7931 from = XINT (XCAR (val));
7932 if (from < 0 || from > 255)
7933 args_out_of_range_3 (XCAR (val),
7934 make_number (0), make_number (255));
7923 to = XINT (XCDR (val)); 7935 to = XINT (XCDR (val));
7924 for (i = from; i <= to; i++) 7936 if (to < from || to > 255)
7925 ASET (valids, i, make_number (1)); 7937 args_out_of_range_3 (XCDR (val),
7938 XCAR (val), make_number (255));
7926 } 7939 }
7940 for (i = from; i <= to; i++)
7941 XSTRING (valids)->data[i] = 1;
7927 } 7942 }
7928 ASET (attrs, coding_attr_ccl_valids, valids); 7943 ASET (attrs, coding_attr_ccl_valids, valids);
7929 7944