comparison src/coding.c @ 93877:62d97ebb13a9

* coding.c (detect_coding_emacs_mule) (Ffind_operation_coding_system): Fix typo.
author Michael Albinus <michael.albinus@gmx.de>
date Tue, 08 Apr 2008 20:17:44 +0000
parents ac4d127a841a
children c16046e21b90
comparison
equal deleted inserted replaced
93876:414bac225d14 93877:62d97ebb13a9
898 static INLINE void produce_charset P_ ((struct coding_system *, int *, 898 static INLINE void produce_charset P_ ((struct coding_system *, int *,
899 EMACS_INT)); 899 EMACS_INT));
900 static void produce_annotation P_ ((struct coding_system *, EMACS_INT)); 900 static void produce_annotation P_ ((struct coding_system *, EMACS_INT));
901 static int decode_coding P_ ((struct coding_system *)); 901 static int decode_coding P_ ((struct coding_system *));
902 static INLINE int *handle_composition_annotation P_ ((EMACS_INT, EMACS_INT, 902 static INLINE int *handle_composition_annotation P_ ((EMACS_INT, EMACS_INT,
903 struct coding_system *, 903 struct coding_system *,
904 int *, EMACS_INT *)); 904 int *, EMACS_INT *));
905 static INLINE int *handle_charset_annotation P_ ((EMACS_INT, EMACS_INT, 905 static INLINE int *handle_charset_annotation P_ ((EMACS_INT, EMACS_INT,
906 struct coding_system *, 906 struct coding_system *,
907 int *, EMACS_INT *)); 907 int *, EMACS_INT *));
908 static void consume_chars P_ ((struct coding_system *, Lisp_Object, int)); 908 static void consume_chars P_ ((struct coding_system *, Lisp_Object, int));
1959 if (c == 0x80) 1959 if (c == 0x80)
1960 { 1960 {
1961 /* Perhaps the start of composite character. We simple skip 1961 /* Perhaps the start of composite character. We simple skip
1962 it because analyzing it is too heavy for detecting. But, 1962 it because analyzing it is too heavy for detecting. But,
1963 at least, we check that the composite character 1963 at least, we check that the composite character
1964 constitues of more than 4 bytes. */ 1964 constitutes of more than 4 bytes. */
1965 const unsigned char *src_base; 1965 const unsigned char *src_base;
1966 1966
1967 repeat: 1967 repeat:
1968 src_base = src; 1968 src_base = src;
1969 do 1969 do
4750 EMIT_ONE_BYTE (destination_charbuf[i] & 0xFF); 4750 EMIT_ONE_BYTE (destination_charbuf[i] & 0xFF);
4751 } 4751 }
4752 else 4752 else
4753 { 4753 {
4754 ASSURE_DESTINATION (ccl.produced); 4754 ASSURE_DESTINATION (ccl.produced);
4755 for (i = 0; i < ccl.produced; i++) 4755 for (i = 0; i < ccl.produced; i++)
4756 *dst++ = destination_charbuf[i] & 0xFF; 4756 *dst++ = destination_charbuf[i] & 0xFF;
4757 produced_chars += ccl.produced; 4757 produced_chars += ccl.produced;
4758 } 4758 }
4759 charbuf += ccl.consumed; 4759 charbuf += ccl.consumed;
4760 if (ccl.status == CCL_STAT_QUIT 4760 if (ccl.status == CCL_STAT_QUIT
4939 for (idx = 1; idx < dim; idx++) 4939 for (idx = 1; idx < dim; idx++)
4940 { 4940 {
4941 if (src == src_end) 4941 if (src == src_end)
4942 goto too_short; 4942 goto too_short;
4943 ONE_MORE_BYTE (c); 4943 ONE_MORE_BYTE (c);
4944 if (c < charset->code_space[(dim - 1 - idx) * 2] 4944 if (c < charset->code_space[(dim - 1 - idx) * 2]
4945 || c > charset->code_space[(dim - 1 - idx) * 2 + 1]) 4945 || c > charset->code_space[(dim - 1 - idx) * 2 + 1])
4946 break; 4946 break;
4947 } 4947 }
4948 if (idx < dim) 4948 if (idx < dim)
4949 break; 4949 break;
5807 category = coding_category_utf_16_be; 5807 category = coding_category_utf_16_be;
5808 } 5808 }
5809 break; 5809 break;
5810 } 5810 }
5811 } 5811 }
5812 5812
5813 if (i < coding_category_raw_text) 5813 if (i < coding_category_raw_text)
5814 setup_coding_system (CODING_ID_NAME (this->id), coding); 5814 setup_coding_system (CODING_ID_NAME (this->id), coding);
5815 else if (null_byte_found) 5815 else if (null_byte_found)
5816 setup_coding_system (Qno_conversion, coding); 5816 setup_coding_system (Qno_conversion, coding);
5817 else if ((detect_info.rejected & CATEGORY_MASK_ANY) 5817 else if ((detect_info.rejected & CATEGORY_MASK_ANY)
5853 decode_eol (coding) 5853 decode_eol (coding)
5854 struct coding_system *coding; 5854 struct coding_system *coding;
5855 { 5855 {
5856 Lisp_Object eol_type; 5856 Lisp_Object eol_type;
5857 unsigned char *p, *pbeg, *pend; 5857 unsigned char *p, *pbeg, *pend;
5858 5858
5859 eol_type = CODING_ID_EOL_TYPE (coding->id); 5859 eol_type = CODING_ID_EOL_TYPE (coding->id);
5860 if (EQ (eol_type, Qunix)) 5860 if (EQ (eol_type, Qunix))
5861 return; 5861 return;
5862 5862
5863 if (NILP (coding->dst_object)) 5863 if (NILP (coding->dst_object))
6876 if (NILP (Vcode_conversion_reused_workbuf)) 6876 if (NILP (Vcode_conversion_reused_workbuf))
6877 Vcode_conversion_reused_workbuf = workbuf; 6877 Vcode_conversion_reused_workbuf = workbuf;
6878 } 6878 }
6879 current = current_buffer; 6879 current = current_buffer;
6880 set_buffer_internal (XBUFFER (workbuf)); 6880 set_buffer_internal (XBUFFER (workbuf));
6881 Ferase_buffer (); 6881 Ferase_buffer ();
6882 current_buffer->undo_list = Qt; 6882 current_buffer->undo_list = Qt;
6883 current_buffer->enable_multibyte_characters = multibyte ? Qt : Qnil; 6883 current_buffer->enable_multibyte_characters = multibyte ? Qt : Qnil;
6884 set_buffer_internal (current); 6884 set_buffer_internal (current);
6885 return workbuf; 6885 return workbuf;
6886 } 6886 }
8721 if (nargs < 2) 8721 if (nargs < 2)
8722 error ("Too few arguments"); 8722 error ("Too few arguments");
8723 operation = args[0]; 8723 operation = args[0];
8724 if (!SYMBOLP (operation) 8724 if (!SYMBOLP (operation)
8725 || !INTEGERP (target_idx = Fget (operation, Qtarget_idx))) 8725 || !INTEGERP (target_idx = Fget (operation, Qtarget_idx)))
8726 error ("Invalid first arguement"); 8726 error ("Invalid first argument");
8727 if (nargs < 1 + XINT (target_idx)) 8727 if (nargs < 1 + XINT (target_idx))
8728 error ("Too few arguments for operation: %s", 8728 error ("Too few arguments for operation: %s",
8729 SDATA (SYMBOL_NAME (operation))); 8729 SDATA (SYMBOL_NAME (operation)));
8730 target = args[XINT (target_idx) + 1]; 8730 target = args[XINT (target_idx) + 1];
8731 if (!(STRINGP (target) 8731 if (!(STRINGP (target)
9340 CODING_ATTR_CATEGORY (attrs) = make_number (category); 9340 CODING_ATTR_CATEGORY (attrs) = make_number (category);
9341 CODING_ATTR_PLIST (attrs) 9341 CODING_ATTR_PLIST (attrs)
9342 = Fcons (QCcategory, Fcons (AREF (Vcoding_category_table, category), 9342 = Fcons (QCcategory, Fcons (AREF (Vcoding_category_table, category),
9343 CODING_ATTR_PLIST (attrs))); 9343 CODING_ATTR_PLIST (attrs)));
9344 CODING_ATTR_PLIST (attrs) 9344 CODING_ATTR_PLIST (attrs)
9345 = Fcons (QCascii_compatible_p, 9345 = Fcons (QCascii_compatible_p,
9346 Fcons (CODING_ATTR_ASCII_COMPAT (attrs), 9346 Fcons (CODING_ATTR_ASCII_COMPAT (attrs),
9347 CODING_ATTR_PLIST (attrs))); 9347 CODING_ATTR_PLIST (attrs)));
9348 9348
9349 eol_type = args[coding_arg_eol_type]; 9349 eol_type = args[coding_arg_eol_type];
9350 if (! NILP (eol_type) 9350 if (! NILP (eol_type)