diff options
| author | Karoly Lorentey | 2005-01-06 15:05:01 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-01-06 15:05:01 +0000 |
| commit | fd41924555942f6c3c1e12400ab313717a3818cd (patch) | |
| tree | 8d9e405d68e8f6f1d420b35094f150af44518971 /src/coding.c | |
| parent | 0feecea9fb7079a2c1fbfee32a992449a22cf478 (diff) | |
| parent | 553fd77e2511cdc4d1b45933f237c724ee72c3b9 (diff) | |
| download | emacs-fd41924555942f6c3c1e12400ab313717a3818cd.tar.gz emacs-fd41924555942f6c3c1e12400ab313717a3818cd.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-753
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-754
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-755
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-756
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-757
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-81
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-82
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-279
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 68 |
1 files changed, 39 insertions, 29 deletions
diff --git a/src/coding.c b/src/coding.c index ce78af7d8d3..a4adf767f36 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -147,7 +147,8 @@ detect_coding_emacs_mule (src, src_end, multibytep) | |||
| 147 | static void | 147 | static void |
| 148 | decode_coding_XXX (coding, source, destination, src_bytes, dst_bytes) | 148 | decode_coding_XXX (coding, source, destination, src_bytes, dst_bytes) |
| 149 | struct coding_system *coding; | 149 | struct coding_system *coding; |
| 150 | unsigned char *source, *destination; | 150 | const unsigned char *source; |
| 151 | unsigned char *destination; | ||
| 151 | int src_bytes, dst_bytes; | 152 | int src_bytes, dst_bytes; |
| 152 | { | 153 | { |
| 153 | ... | 154 | ... |
| @@ -796,12 +797,13 @@ static INLINE int | |||
| 796 | decode_composition_emacs_mule (coding, src, src_end, | 797 | decode_composition_emacs_mule (coding, src, src_end, |
| 797 | destination, dst_end, dst_bytes) | 798 | destination, dst_end, dst_bytes) |
| 798 | struct coding_system *coding; | 799 | struct coding_system *coding; |
| 799 | unsigned char *src, *src_end, **destination, *dst_end; | 800 | const unsigned char *src, *src_end; |
| 801 | unsigned char **destination, *dst_end; | ||
| 800 | int dst_bytes; | 802 | int dst_bytes; |
| 801 | { | 803 | { |
| 802 | unsigned char *dst = *destination; | 804 | unsigned char *dst = *destination; |
| 803 | int method, data_len, nchars; | 805 | int method, data_len, nchars; |
| 804 | unsigned char *src_base = src++; | 806 | const unsigned char *src_base = src++; |
| 805 | /* Store components of composition. */ | 807 | /* Store components of composition. */ |
| 806 | int component[COMPOSITION_DATA_MAX_BUNCH_LENGTH]; | 808 | int component[COMPOSITION_DATA_MAX_BUNCH_LENGTH]; |
| 807 | int ncomponent; | 809 | int ncomponent; |
| @@ -942,23 +944,25 @@ decode_composition_emacs_mule (coding, src, src_end, | |||
| 942 | static void | 944 | static void |
| 943 | decode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes) | 945 | decode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes) |
| 944 | struct coding_system *coding; | 946 | struct coding_system *coding; |
| 945 | unsigned char *source, *destination; | 947 | const unsigned char *source; |
| 948 | unsigned char *destination; | ||
| 946 | int src_bytes, dst_bytes; | 949 | int src_bytes, dst_bytes; |
| 947 | { | 950 | { |
| 948 | unsigned char *src = source; | 951 | const unsigned char *src = source; |
| 949 | unsigned char *src_end = source + src_bytes; | 952 | const unsigned char *src_end = source + src_bytes; |
| 950 | unsigned char *dst = destination; | 953 | unsigned char *dst = destination; |
| 951 | unsigned char *dst_end = destination + dst_bytes; | 954 | unsigned char *dst_end = destination + dst_bytes; |
| 952 | /* SRC_BASE remembers the start position in source in each loop. | 955 | /* SRC_BASE remembers the start position in source in each loop. |
| 953 | The loop will be exited when there's not enough source code, or | 956 | The loop will be exited when there's not enough source code, or |
| 954 | when there's not enough destination area to produce a | 957 | when there's not enough destination area to produce a |
| 955 | character. */ | 958 | character. */ |
| 956 | unsigned char *src_base; | 959 | const unsigned char *src_base; |
| 957 | 960 | ||
| 958 | coding->produced_char = 0; | 961 | coding->produced_char = 0; |
| 959 | while ((src_base = src) < src_end) | 962 | while ((src_base = src) < src_end) |
| 960 | { | 963 | { |
| 961 | unsigned char tmp[MAX_MULTIBYTE_LENGTH], *p; | 964 | unsigned char tmp[MAX_MULTIBYTE_LENGTH]; |
| 965 | const unsigned char *p; | ||
| 962 | int bytes; | 966 | int bytes; |
| 963 | 967 | ||
| 964 | if (*src == '\r') | 968 | if (*src == '\r') |
| @@ -1112,14 +1116,15 @@ static void encode_eol P_ ((struct coding_system *, const unsigned char *, | |||
| 1112 | static void | 1116 | static void |
| 1113 | encode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes) | 1117 | encode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes) |
| 1114 | struct coding_system *coding; | 1118 | struct coding_system *coding; |
| 1115 | unsigned char *source, *destination; | 1119 | const unsigned char *source; |
| 1120 | unsigned char *destination; | ||
| 1116 | int src_bytes, dst_bytes; | 1121 | int src_bytes, dst_bytes; |
| 1117 | { | 1122 | { |
| 1118 | unsigned char *src = source; | 1123 | const unsigned char *src = source; |
| 1119 | unsigned char *src_end = source + src_bytes; | 1124 | const unsigned char *src_end = source + src_bytes; |
| 1120 | unsigned char *dst = destination; | 1125 | unsigned char *dst = destination; |
| 1121 | unsigned char *dst_end = destination + dst_bytes; | 1126 | unsigned char *dst_end = destination + dst_bytes; |
| 1122 | unsigned char *src_base; | 1127 | const unsigned char *src_base; |
| 1123 | int c; | 1128 | int c; |
| 1124 | int char_offset; | 1129 | int char_offset; |
| 1125 | int *data; | 1130 | int *data; |
| @@ -1806,11 +1811,12 @@ coding_allocate_composition_data (coding, char_offset) | |||
| 1806 | static void | 1811 | static void |
| 1807 | decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) | 1812 | decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) |
| 1808 | struct coding_system *coding; | 1813 | struct coding_system *coding; |
| 1809 | unsigned char *source, *destination; | 1814 | const unsigned char *source; |
| 1815 | unsigned char *destination; | ||
| 1810 | int src_bytes, dst_bytes; | 1816 | int src_bytes, dst_bytes; |
| 1811 | { | 1817 | { |
| 1812 | unsigned char *src = source; | 1818 | const unsigned char *src = source; |
| 1813 | unsigned char *src_end = source + src_bytes; | 1819 | const unsigned char *src_end = source + src_bytes; |
| 1814 | unsigned char *dst = destination; | 1820 | unsigned char *dst = destination; |
| 1815 | unsigned char *dst_end = destination + dst_bytes; | 1821 | unsigned char *dst_end = destination + dst_bytes; |
| 1816 | /* Charsets invoked to graphic plane 0 and 1 respectively. */ | 1822 | /* Charsets invoked to graphic plane 0 and 1 respectively. */ |
| @@ -1821,7 +1827,7 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) | |||
| 1821 | (within macro ONE_MORE_BYTE), or when there's not enough | 1827 | (within macro ONE_MORE_BYTE), or when there's not enough |
| 1822 | destination area to produce a character (within macro | 1828 | destination area to produce a character (within macro |
| 1823 | EMIT_CHAR). */ | 1829 | EMIT_CHAR). */ |
| 1824 | unsigned char *src_base; | 1830 | const unsigned char *src_base; |
| 1825 | int c, charset; | 1831 | int c, charset; |
| 1826 | Lisp_Object translation_table; | 1832 | Lisp_Object translation_table; |
| 1827 | Lisp_Object safe_chars; | 1833 | Lisp_Object safe_chars; |
| @@ -2592,7 +2598,8 @@ static unsigned char * | |||
| 2592 | encode_designation_at_bol (coding, translation_table, src, src_end, dst) | 2598 | encode_designation_at_bol (coding, translation_table, src, src_end, dst) |
| 2593 | struct coding_system *coding; | 2599 | struct coding_system *coding; |
| 2594 | Lisp_Object translation_table; | 2600 | Lisp_Object translation_table; |
| 2595 | unsigned char *src, *src_end, *dst; | 2601 | const unsigned char *src, *src_end; |
| 2602 | unsigned char *dst; | ||
| 2596 | { | 2603 | { |
| 2597 | int charset, c, found = 0, reg; | 2604 | int charset, c, found = 0, reg; |
| 2598 | /* Table of charsets to be designated to each graphic register. */ | 2605 | /* Table of charsets to be designated to each graphic register. */ |
| @@ -2633,11 +2640,12 @@ encode_designation_at_bol (coding, translation_table, src, src_end, dst) | |||
| 2633 | static void | 2640 | static void |
| 2634 | encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) | 2641 | encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) |
| 2635 | struct coding_system *coding; | 2642 | struct coding_system *coding; |
| 2636 | unsigned char *source, *destination; | 2643 | const unsigned char *source; |
| 2644 | unsigned char *destination; | ||
| 2637 | int src_bytes, dst_bytes; | 2645 | int src_bytes, dst_bytes; |
| 2638 | { | 2646 | { |
| 2639 | unsigned char *src = source; | 2647 | const unsigned char *src = source; |
| 2640 | unsigned char *src_end = source + src_bytes; | 2648 | const unsigned char *src_end = source + src_bytes; |
| 2641 | unsigned char *dst = destination; | 2649 | unsigned char *dst = destination; |
| 2642 | unsigned char *dst_end = destination + dst_bytes; | 2650 | unsigned char *dst_end = destination + dst_bytes; |
| 2643 | /* Since the maximum bytes produced by each loop is 20, we subtract 19 | 2651 | /* Since the maximum bytes produced by each loop is 20, we subtract 19 |
| @@ -2649,7 +2657,7 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes) | |||
| 2649 | analyze multi-byte codes (within macro ONE_MORE_CHAR), or when | 2657 | analyze multi-byte codes (within macro ONE_MORE_CHAR), or when |
| 2650 | there's not enough destination area to produce encoded codes | 2658 | there's not enough destination area to produce encoded codes |
| 2651 | (within macro EMIT_BYTES). */ | 2659 | (within macro EMIT_BYTES). */ |
| 2652 | unsigned char *src_base; | 2660 | const unsigned char *src_base; |
| 2653 | int c; | 2661 | int c; |
| 2654 | Lisp_Object translation_table; | 2662 | Lisp_Object translation_table; |
| 2655 | Lisp_Object safe_chars; | 2663 | Lisp_Object safe_chars; |
| @@ -3043,12 +3051,13 @@ static void | |||
| 3043 | decode_coding_sjis_big5 (coding, source, destination, | 3051 | decode_coding_sjis_big5 (coding, source, destination, |
| 3044 | src_bytes, dst_bytes, sjis_p) | 3052 | src_bytes, dst_bytes, sjis_p) |
| 3045 | struct coding_system *coding; | 3053 | struct coding_system *coding; |
| 3046 | unsigned char *source, *destination; | 3054 | const unsigned char *source; |
| 3055 | unsigned char *destination; | ||
| 3047 | int src_bytes, dst_bytes; | 3056 | int src_bytes, dst_bytes; |
| 3048 | int sjis_p; | 3057 | int sjis_p; |
| 3049 | { | 3058 | { |
| 3050 | unsigned char *src = source; | 3059 | const unsigned char *src = source; |
| 3051 | unsigned char *src_end = source + src_bytes; | 3060 | const unsigned char *src_end = source + src_bytes; |
| 3052 | unsigned char *dst = destination; | 3061 | unsigned char *dst = destination; |
| 3053 | unsigned char *dst_end = destination + dst_bytes; | 3062 | unsigned char *dst_end = destination + dst_bytes; |
| 3054 | /* SRC_BASE remembers the start position in source in each loop. | 3063 | /* SRC_BASE remembers the start position in source in each loop. |
| @@ -3056,7 +3065,7 @@ decode_coding_sjis_big5 (coding, source, destination, | |||
| 3056 | (within macro ONE_MORE_BYTE), or when there's not enough | 3065 | (within macro ONE_MORE_BYTE), or when there's not enough |
| 3057 | destination area to produce a character (within macro | 3066 | destination area to produce a character (within macro |
| 3058 | EMIT_CHAR). */ | 3067 | EMIT_CHAR). */ |
| 3059 | unsigned char *src_base; | 3068 | const unsigned char *src_base; |
| 3060 | Lisp_Object translation_table; | 3069 | Lisp_Object translation_table; |
| 3061 | 3070 | ||
| 3062 | if (NILP (Venable_character_translation)) | 3071 | if (NILP (Venable_character_translation)) |
| @@ -3316,12 +3325,13 @@ detect_coding_ccl (src, src_end, multibytep) | |||
| 3316 | static void | 3325 | static void |
| 3317 | decode_eol (coding, source, destination, src_bytes, dst_bytes) | 3326 | decode_eol (coding, source, destination, src_bytes, dst_bytes) |
| 3318 | struct coding_system *coding; | 3327 | struct coding_system *coding; |
| 3319 | unsigned char *source, *destination; | 3328 | const unsigned char *source; |
| 3329 | unsigned char *destination; | ||
| 3320 | int src_bytes, dst_bytes; | 3330 | int src_bytes, dst_bytes; |
| 3321 | { | 3331 | { |
| 3322 | unsigned char *src = source; | 3332 | const unsigned char *src = source; |
| 3323 | unsigned char *dst = destination; | 3333 | unsigned char *dst = destination; |
| 3324 | unsigned char *src_end = src + src_bytes; | 3334 | const unsigned char *src_end = src + src_bytes; |
| 3325 | unsigned char *dst_end = dst + dst_bytes; | 3335 | unsigned char *dst_end = dst + dst_bytes; |
| 3326 | Lisp_Object translation_table; | 3336 | Lisp_Object translation_table; |
| 3327 | /* SRC_BASE remembers the start position in source in each loop. | 3337 | /* SRC_BASE remembers the start position in source in each loop. |
| @@ -3329,7 +3339,7 @@ decode_eol (coding, source, destination, src_bytes, dst_bytes) | |||
| 3329 | (within macro ONE_MORE_BYTE), or when there's not enough | 3339 | (within macro ONE_MORE_BYTE), or when there's not enough |
| 3330 | destination area to produce a character (within macro | 3340 | destination area to produce a character (within macro |
| 3331 | EMIT_CHAR). */ | 3341 | EMIT_CHAR). */ |
| 3332 | unsigned char *src_base; | 3342 | const unsigned char *src_base; |
| 3333 | int c; | 3343 | int c; |
| 3334 | 3344 | ||
| 3335 | translation_table = Qnil; | 3345 | translation_table = Qnil; |