Mercurial > emacs
comparison src/coding.c @ 109158:6175ebc3b6ce
* coding.c: Use SPECPDL_INDEX, DOS_NT.
| author | Juanma Barranquero <lekktu@gmail.com> |
|---|---|
| date | Wed, 07 Jul 2010 10:45:22 +0200 |
| parents | aec1143e8d85 |
| children | 3e9fdeb960d1 |
comparison
equal
deleted
inserted
replaced
| 109157:76b683a5339b | 109158:6175ebc3b6ce |
|---|---|
| 1445 ONE_MORE_BYTE (c1); | 1445 ONE_MORE_BYTE (c1); |
| 1446 if (c1 < 0) | 1446 if (c1 < 0) |
| 1447 { | 1447 { |
| 1448 c = - c1; | 1448 c = - c1; |
| 1449 } | 1449 } |
| 1450 else if (UTF_8_1_OCTET_P(c1)) | 1450 else if (UTF_8_1_OCTET_P (c1)) |
| 1451 { | 1451 { |
| 1452 if (eol_crlf && c1 == '\r') | 1452 if (eol_crlf && c1 == '\r') |
| 1453 ONE_MORE_BYTE (byte_after_cr); | 1453 ONE_MORE_BYTE (byte_after_cr); |
| 1454 c = c1; | 1454 c = c1; |
| 1455 } | 1455 } |
| 2185 (1) relative composition: 0x80 0xF2 BYTES CHARS | CHAR ... | 2185 (1) relative composition: 0x80 0xF2 BYTES CHARS | CHAR ... |
| 2186 (2) altchar composition: 0x80 0xF4 BYTES CHARS | ALT ... ALT CHAR ... | 2186 (2) altchar composition: 0x80 0xF4 BYTES CHARS | ALT ... ALT CHAR ... |
| 2187 (3) alt&rule composition: 0x80 0xF5 BYTES CHARS | ALT RULE ... ALT CHAR ... | 2187 (3) alt&rule composition: 0x80 0xF5 BYTES CHARS | ALT RULE ... ALT CHAR ... |
| 2188 | 2188 |
| 2189 and these old form: | 2189 and these old form: |
| 2190 | 2190 |
| 2191 (4) relative composition: 0x80 | MSEQ ... MSEQ | 2191 (4) relative composition: 0x80 | MSEQ ... MSEQ |
| 2192 (5) rulebase composition: 0x80 0xFF | MSEQ MRULE ... MSEQ | 2192 (5) rulebase composition: 0x80 0xFF | MSEQ MRULE ... MSEQ |
| 2193 | 2193 |
| 2194 When the starter 0x80 and the following header elements are found, | 2194 When the starter 0x80 and the following header elements are found, |
| 2195 this annotation header is produced. | 2195 this annotation header is produced. |
| 4282 } while (1) | 4282 } while (1) |
| 4283 | 4283 |
| 4284 | 4284 |
| 4285 #define ENCODE_ISO_CHARACTER(charset, c) \ | 4285 #define ENCODE_ISO_CHARACTER(charset, c) \ |
| 4286 do { \ | 4286 do { \ |
| 4287 int code = ENCODE_CHAR ((charset),(c)); \ | 4287 int code = ENCODE_CHAR ((charset), (c)); \ |
| 4288 \ | 4288 \ |
| 4289 if (CHARSET_DIMENSION (charset) == 1) \ | 4289 if (CHARSET_DIMENSION (charset) == 1) \ |
| 4290 ENCODE_ISO_CHARACTER_DIMENSION1 ((charset), code); \ | 4290 ENCODE_ISO_CHARACTER_DIMENSION1 ((charset), code); \ |
| 4291 else \ | 4291 else \ |
| 4292 ENCODE_ISO_CHARACTER_DIMENSION2 ((charset), code >> 8, code & 0xFF); \ | 4292 ENCODE_ISO_CHARACTER_DIMENSION2 ((charset), code >> 8, code & 0xFF); \ |
| 7560 } | 7560 } |
| 7561 | 7561 |
| 7562 int | 7562 int |
| 7563 decode_coding_gap (struct coding_system *coding, EMACS_INT chars, EMACS_INT bytes) | 7563 decode_coding_gap (struct coding_system *coding, EMACS_INT chars, EMACS_INT bytes) |
| 7564 { | 7564 { |
| 7565 int count = specpdl_ptr - specpdl; | 7565 int count = SPECPDL_INDEX (); |
| 7566 Lisp_Object attrs; | 7566 Lisp_Object attrs; |
| 7567 | 7567 |
| 7568 code_conversion_save (0, 0); | 7568 code_conversion_save (0, 0); |
| 7569 | 7569 |
| 7570 coding->src_object = Fcurrent_buffer (); | 7570 coding->src_object = Fcurrent_buffer (); |
| 7605 } | 7605 } |
| 7606 | 7606 |
| 7607 int | 7607 int |
| 7608 encode_coding_gap (struct coding_system *coding, EMACS_INT chars, EMACS_INT bytes) | 7608 encode_coding_gap (struct coding_system *coding, EMACS_INT chars, EMACS_INT bytes) |
| 7609 { | 7609 { |
| 7610 int count = specpdl_ptr - specpdl; | 7610 int count = SPECPDL_INDEX (); |
| 7611 | 7611 |
| 7612 code_conversion_save (0, 0); | 7612 code_conversion_save (0, 0); |
| 7613 | 7613 |
| 7614 coding->src_object = Fcurrent_buffer (); | 7614 coding->src_object = Fcurrent_buffer (); |
| 7615 coding->src_chars = chars; | 7615 coding->src_chars = chars; |
| 7663 struct coding_system *coding; | 7663 struct coding_system *coding; |
| 7664 Lisp_Object src_object; | 7664 Lisp_Object src_object; |
| 7665 EMACS_INT from, from_byte, to, to_byte; | 7665 EMACS_INT from, from_byte, to, to_byte; |
| 7666 Lisp_Object dst_object; | 7666 Lisp_Object dst_object; |
| 7667 { | 7667 { |
| 7668 int count = specpdl_ptr - specpdl; | 7668 int count = SPECPDL_INDEX (); |
| 7669 unsigned char *destination; | 7669 unsigned char *destination; |
| 7670 EMACS_INT dst_bytes; | 7670 EMACS_INT dst_bytes; |
| 7671 EMACS_INT chars = to - from; | 7671 EMACS_INT chars = to - from; |
| 7672 EMACS_INT bytes = to_byte - from_byte; | 7672 EMACS_INT bytes = to_byte - from_byte; |
| 7673 Lisp_Object attrs; | 7673 Lisp_Object attrs; |
| 7854 struct coding_system *coding; | 7854 struct coding_system *coding; |
| 7855 Lisp_Object src_object; | 7855 Lisp_Object src_object; |
| 7856 EMACS_INT from, from_byte, to, to_byte; | 7856 EMACS_INT from, from_byte, to, to_byte; |
| 7857 Lisp_Object dst_object; | 7857 Lisp_Object dst_object; |
| 7858 { | 7858 { |
| 7859 int count = specpdl_ptr - specpdl; | 7859 int count = SPECPDL_INDEX (); |
| 7860 EMACS_INT chars = to - from; | 7860 EMACS_INT chars = to - from; |
| 7861 EMACS_INT bytes = to_byte - from_byte; | 7861 EMACS_INT bytes = to_byte - from_byte; |
| 7862 Lisp_Object attrs; | 7862 Lisp_Object attrs; |
| 7863 int saved_pt = -1, saved_pt_byte; | 7863 int saved_pt = -1, saved_pt_byte; |
| 7864 int need_marker_adjustment = 0; | 7864 int need_marker_adjustment = 0; |
| 10852 int i; | 10852 int i; |
| 10853 | 10853 |
| 10854 for (i = 0; i < coding_category_max; i++) | 10854 for (i = 0; i < coding_category_max; i++) |
| 10855 Fset (AREF (Vcoding_category_table, i), Qno_conversion); | 10855 Fset (AREF (Vcoding_category_table, i), Qno_conversion); |
| 10856 } | 10856 } |
| 10857 #if defined (MSDOS) || defined (WINDOWSNT) | 10857 #if defined (DOS_NT) |
| 10858 system_eol_type = Qdos; | 10858 system_eol_type = Qdos; |
| 10859 #else | 10859 #else |
| 10860 system_eol_type = Qunix; | 10860 system_eol_type = Qunix; |
| 10861 #endif | 10861 #endif |
| 10862 staticpro (&system_eol_type); | 10862 staticpro (&system_eol_type); |
