+2003-01-30 Kenichi Handa <handa@m17n.org>
+
+ * coding.c (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.
+
+ * coding.h (enum define_coding_ccl_arg_index): Set the first
+ member coding_arg_ccl_decoder to coding_arg_max.
+
+ * ccl.h (ccl_driver): Prototype adjusted.
+
+ * ccl.c (CCL_DECODE_CHAR, CCL_ENCODE_CHAR): New macros.
+ (ccl_driver): New arg CHARSET_LIST. Use the above macros instead
+ of DECODE_CAHR, ENCODE_CHAR, CHAR_CHARSET.
+ (Fccl_execute): Call ccl_driver with the last arg Qnil.
+ (Fccl_execute_on_string): Likewise.
+
2003-01-11 Kenichi Handa <handa@m17n.org>
* charset.h (ENCODE_CHAR): If the method is SUBSET or SUPERSET,
struct ccl_program ccl;
int source_charbuf[1024];
int source_byteidx[1024];
+ Lisp_Object attrs, eol_type, charset_list, valids;
+ CODING_GET_INFO (coding, attrs, eol_type, charset_list);
setup_ccl_program (&ccl, CODING_CCL_DECODER (coding));
while (src < src_end)
while (source < source_end)
{
ccl_driver (&ccl, source, charbuf,
- source_end - source, charbuf_end - charbuf);
+ source_end - source, charbuf_end - charbuf,
+ charset_list);
source += ccl.consumed;
charbuf += ccl.produced;
if (ccl.status != CCL_STAT_SUSPEND_BY_DST)
unsigned char *adjusted_dst_end = dst_end - 1;
int destination_charbuf[1024];
int i, produced_chars = 0;
+ Lisp_Object attrs, eol_type, charset_list;
+ CODING_GET_INFO (coding, attrs, eol_type, charset_list);
setup_ccl_program (&ccl, CODING_CCL_ENCODER (coding));
ccl.last_block = coding->mode & CODING_MODE_LAST_BLOCK;
dst_bytes = 1024;
ccl_driver (&ccl, charbuf, destination_charbuf,
- charbuf_end - charbuf, dst_bytes);
+ charbuf_end - charbuf, dst_bytes, charset_list);
charbuf += ccl.consumed;
if (multibytep)
for (i = 0; i < ccl.produced; i++)
valids = Fmake_string (make_number (256), make_number (0));
for (tail = val; !NILP (tail); tail = Fcdr (tail))
{
+ int from, to;
+
val = Fcar (tail);
if (INTEGERP (val))
- ASET (valids, XINT (val), make_number (1));
+ {
+ from = to = XINT (val);
+ if (from < 0 || from > 255)
+ args_out_of_range_3 (val, make_number (0), make_number (255));
+ }
else
{
- int from, to;
-
CHECK_CONS (val);
CHECK_NUMBER (XCAR (val));
CHECK_NUMBER (XCDR (val));
from = XINT (XCAR (val));
+ if (from < 0 || from > 255)
+ args_out_of_range_3 (XCAR (val),
+ make_number (0), make_number (255));
to = XINT (XCDR (val));
- for (i = from; i <= to; i++)
- ASET (valids, i, make_number (1));
+ if (to < from || to > 255)
+ args_out_of_range_3 (XCDR (val),
+ XCAR (val), make_number (255));
}
+ for (i = from; i <= to; i++)
+ XSTRING (valids)->data[i] = 1;
}
ASET (attrs, coding_attr_ccl_valids, valids);