comparison src/coding.c @ 89545:4f394eed6ff2

(inhibit_pre_post_conversion): Removed (unused). (alloc_destination, produce_chars): Use EMACS_INT for byte/char counts. (coding_inherit_eol_type): Remove unused attrs. (detect_coding): Cast arg of detect_eol.
author Dave Love <fx@gnu.org>
date Mon, 29 Sep 2003 17:59:52 +0000
parents 040a08a2a879
children 12fbcfebb9ad
comparison
equal deleted inserted replaced
89544:36913565de8a 89545:4f394eed6ff2
398 /* Default coding systems used for process I/O. */ 398 /* Default coding systems used for process I/O. */
399 Lisp_Object Vdefault_process_coding_system; 399 Lisp_Object Vdefault_process_coding_system;
400 400
401 /* Char table for translating Quail and self-inserting input. */ 401 /* Char table for translating Quail and self-inserting input. */
402 Lisp_Object Vtranslation_table_for_input; 402 Lisp_Object Vtranslation_table_for_input;
403
404 /* Global flag to tell that we can't call post-read-conversion and
405 pre-write-conversion functions. Usually the value is zero, but it
406 is set to 1 temporarily while such functions are running. This is
407 to avoid infinite recursive call. */
408 static int inhibit_pre_post_conversion;
409 403
410 /* Two special coding systems. */ 404 /* Two special coding systems. */
411 Lisp_Object Vsjis_coding_system; 405 Lisp_Object Vsjis_coding_system;
412 Lisp_Object Vbig5_coding_system; 406 Lisp_Object Vbig5_coding_system;
413 407
970 964
971 965
972 static unsigned char * 966 static unsigned char *
973 alloc_destination (coding, nbytes, dst) 967 alloc_destination (coding, nbytes, dst)
974 struct coding_system *coding; 968 struct coding_system *coding;
975 int nbytes; 969 EMACS_INT nbytes;
976 unsigned char *dst; 970 unsigned char *dst;
977 { 971 {
978 EMACS_INT offset = dst - coding->destination; 972 EMACS_INT offset = dst - coding->destination;
979 973
980 if (BUFFERP (coding->dst_object)) 974 if (BUFFERP (coding->dst_object))
5016 5010
5017 Lisp_Object 5011 Lisp_Object
5018 coding_inherit_eol_type (coding_system, parent) 5012 coding_inherit_eol_type (coding_system, parent)
5019 Lisp_Object coding_system, parent; 5013 Lisp_Object coding_system, parent;
5020 { 5014 {
5021 Lisp_Object spec, attrs, eol_type; 5015 Lisp_Object spec, eol_type;
5022 5016
5023 if (NILP (coding_system)) 5017 if (NILP (coding_system))
5024 coding_system = Qraw_text; 5018 coding_system = Qraw_text;
5025 spec = CODING_SYSTEM_SPEC (coding_system); 5019 spec = CODING_SYSTEM_SPEC (coding_system);
5026 attrs = AREF (spec, 0);
5027 eol_type = AREF (spec, 2); 5020 eol_type = AREF (spec, 2);
5028 if (VECTORP (eol_type) 5021 if (VECTORP (eol_type)
5029 && ! NILP (parent)) 5022 && ! NILP (parent))
5030 { 5023 {
5031 Lisp_Object parent_spec; 5024 Lisp_Object parent_spec;
5369 case, we detct the EOL type after decoding. */ 5362 case, we detct the EOL type after decoding. */
5370 if (VECTORP (CODING_ID_EOL_TYPE (coding->id)) 5363 if (VECTORP (CODING_ID_EOL_TYPE (coding->id))
5371 && ! EQ (coding_type, Qccl)) 5364 && ! EQ (coding_type, Qccl))
5372 { 5365 {
5373 int eol_seen = detect_eol (coding->source, coding->src_bytes, 5366 int eol_seen = detect_eol (coding->source, coding->src_bytes,
5374 XINT (CODING_ATTR_CATEGORY (attrs))); 5367 (enum coding_category) XINT (CODING_ATTR_CATEGORY (attrs)));
5375 5368
5376 if (eol_seen != EOL_SEEN_NONE) 5369 if (eol_seen != EOL_SEEN_NONE)
5377 adjust_coding_eol_type (coding, eol_seen); 5370 adjust_coding_eol_type (coding, eol_seen);
5378 } 5371 }
5379 } 5372 }
5475 int produced_chars = 0; 5468 int produced_chars = 0;
5476 5469
5477 if (! coding->chars_at_source) 5470 if (! coding->chars_at_source)
5478 { 5471 {
5479 /* Characters are in coding->charbuf. */ 5472 /* Characters are in coding->charbuf. */
5480 int *buf = coding->charbuf; 5473 EMACS_INT *buf = coding->charbuf;
5481 int *buf_end = buf + coding->charbuf_used; 5474 EMACS_INT *buf_end = buf + coding->charbuf_used;
5482 unsigned char *adjusted_dst_end; 5475 unsigned char *adjusted_dst_end;
5483 5476
5484 if (BUFFERP (coding->src_object) 5477 if (BUFFERP (coding->src_object)
5485 && EQ (coding->src_object, coding->dst_object)) 5478 && EQ (coding->src_object, coding->dst_object))
5486 dst_end = ((unsigned char *) coding->source) + coding->consumed; 5479 dst_end = ((unsigned char *) coding->source) + coding->consumed;
8634 iso_code_class[ISO_CODE_SS2_7] = ISO_single_shift_2_7; 8627 iso_code_class[ISO_CODE_SS2_7] = ISO_single_shift_2_7;
8635 iso_code_class[ISO_CODE_ESC] = ISO_escape; 8628 iso_code_class[ISO_CODE_ESC] = ISO_escape;
8636 iso_code_class[ISO_CODE_SS2] = ISO_single_shift_2; 8629 iso_code_class[ISO_CODE_SS2] = ISO_single_shift_2;
8637 iso_code_class[ISO_CODE_SS3] = ISO_single_shift_3; 8630 iso_code_class[ISO_CODE_SS3] = ISO_single_shift_3;
8638 iso_code_class[ISO_CODE_CSI] = ISO_control_sequence_introducer; 8631 iso_code_class[ISO_CODE_CSI] = ISO_control_sequence_introducer;
8639
8640 inhibit_pre_post_conversion = 0;
8641 8632
8642 for (i = 0; i < 256; i++) 8633 for (i = 0; i < 256; i++)
8643 { 8634 {
8644 emacs_mule_bytes[i] = 1; 8635 emacs_mule_bytes[i] = 1;
8645 } 8636 }