diff options
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 511 |
1 files changed, 207 insertions, 304 deletions
diff --git a/src/coding.c b/src/coding.c index 6435fa1ddb1..989fd70b497 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -154,9 +154,8 @@ STRUCT CODING_SYSTEM | |||
| 154 | 154 | ||
| 155 | #if 0 | 155 | #if 0 |
| 156 | static int | 156 | static int |
| 157 | detect_coding_XXX (coding, detect_info) | 157 | detect_coding_XXX (struct coding_system *coding, |
| 158 | struct coding_system *coding; | 158 | struct coding_detection_info *detect_info) |
| 159 | struct coding_detection_info *detect_info; | ||
| 160 | { | 159 | { |
| 161 | const unsigned char *src = coding->source; | 160 | const unsigned char *src = coding->source; |
| 162 | const unsigned char *src_end = coding->source + coding->src_bytes; | 161 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -203,8 +202,7 @@ detect_coding_XXX (coding, detect_info) | |||
| 203 | 202 | ||
| 204 | #if 0 | 203 | #if 0 |
| 205 | static void | 204 | static void |
| 206 | decode_coding_XXXX (coding) | 205 | decode_coding_XXXX (struct coding_system *coding) |
| 207 | struct coding_system *coding; | ||
| 208 | { | 206 | { |
| 209 | const unsigned char *src = coding->source + coding->consumed; | 207 | const unsigned char *src = coding->source + coding->consumed; |
| 210 | const unsigned char *src_end = coding->source + coding->src_bytes; | 208 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -261,8 +259,7 @@ decode_coding_XXXX (coding) | |||
| 261 | Below is a template of these functions. */ | 259 | Below is a template of these functions. */ |
| 262 | #if 0 | 260 | #if 0 |
| 263 | static void | 261 | static void |
| 264 | encode_coding_XXX (coding) | 262 | encode_coding_XXX (struct coding_system *coding) |
| 265 | struct coding_system *coding; | ||
| 266 | { | 263 | { |
| 267 | int multibytep = coding->dst_multibyte; | 264 | int multibytep = coding->dst_multibyte; |
| 268 | int *charbuf = coding->charbuf; | 265 | int *charbuf = coding->charbuf; |
| @@ -896,80 +893,80 @@ static struct coding_system coding_categories[coding_category_max]; | |||
| 896 | 893 | ||
| 897 | 894 | ||
| 898 | /* Prototypes for static functions. */ | 895 | /* Prototypes for static functions. */ |
| 899 | static void record_conversion_result P_ ((struct coding_system *coding, | 896 | static void record_conversion_result (struct coding_system *coding, |
| 900 | enum coding_result_code result)); | 897 | enum coding_result_code result); |
| 901 | static int detect_coding_utf_8 P_ ((struct coding_system *, | 898 | static int detect_coding_utf_8 (struct coding_system *, |
| 902 | struct coding_detection_info *info)); | 899 | struct coding_detection_info *info); |
| 903 | static void decode_coding_utf_8 P_ ((struct coding_system *)); | 900 | static void decode_coding_utf_8 (struct coding_system *); |
| 904 | static int encode_coding_utf_8 P_ ((struct coding_system *)); | 901 | static int encode_coding_utf_8 (struct coding_system *); |
| 905 | 902 | ||
| 906 | static int detect_coding_utf_16 P_ ((struct coding_system *, | 903 | static int detect_coding_utf_16 (struct coding_system *, |
| 907 | struct coding_detection_info *info)); | 904 | struct coding_detection_info *info); |
| 908 | static void decode_coding_utf_16 P_ ((struct coding_system *)); | 905 | static void decode_coding_utf_16 (struct coding_system *); |
| 909 | static int encode_coding_utf_16 P_ ((struct coding_system *)); | 906 | static int encode_coding_utf_16 (struct coding_system *); |
| 910 | 907 | ||
| 911 | static int detect_coding_iso_2022 P_ ((struct coding_system *, | 908 | static int detect_coding_iso_2022 (struct coding_system *, |
| 912 | struct coding_detection_info *info)); | 909 | struct coding_detection_info *info); |
| 913 | static void decode_coding_iso_2022 P_ ((struct coding_system *)); | 910 | static void decode_coding_iso_2022 (struct coding_system *); |
| 914 | static int encode_coding_iso_2022 P_ ((struct coding_system *)); | 911 | static int encode_coding_iso_2022 (struct coding_system *); |
| 915 | 912 | ||
| 916 | static int detect_coding_emacs_mule P_ ((struct coding_system *, | 913 | static int detect_coding_emacs_mule (struct coding_system *, |
| 917 | struct coding_detection_info *info)); | 914 | struct coding_detection_info *info); |
| 918 | static void decode_coding_emacs_mule P_ ((struct coding_system *)); | 915 | static void decode_coding_emacs_mule (struct coding_system *); |
| 919 | static int encode_coding_emacs_mule P_ ((struct coding_system *)); | 916 | static int encode_coding_emacs_mule (struct coding_system *); |
| 920 | 917 | ||
| 921 | static int detect_coding_sjis P_ ((struct coding_system *, | 918 | static int detect_coding_sjis (struct coding_system *, |
| 922 | struct coding_detection_info *info)); | 919 | struct coding_detection_info *info); |
| 923 | static void decode_coding_sjis P_ ((struct coding_system *)); | 920 | static void decode_coding_sjis (struct coding_system *); |
| 924 | static int encode_coding_sjis P_ ((struct coding_system *)); | 921 | static int encode_coding_sjis (struct coding_system *); |
| 925 | 922 | ||
| 926 | static int detect_coding_big5 P_ ((struct coding_system *, | 923 | static int detect_coding_big5 (struct coding_system *, |
| 927 | struct coding_detection_info *info)); | 924 | struct coding_detection_info *info); |
| 928 | static void decode_coding_big5 P_ ((struct coding_system *)); | 925 | static void decode_coding_big5 (struct coding_system *); |
| 929 | static int encode_coding_big5 P_ ((struct coding_system *)); | 926 | static int encode_coding_big5 (struct coding_system *); |
| 930 | 927 | ||
| 931 | static int detect_coding_ccl P_ ((struct coding_system *, | 928 | static int detect_coding_ccl (struct coding_system *, |
| 932 | struct coding_detection_info *info)); | 929 | struct coding_detection_info *info); |
| 933 | static void decode_coding_ccl P_ ((struct coding_system *)); | 930 | static void decode_coding_ccl (struct coding_system *); |
| 934 | static int encode_coding_ccl P_ ((struct coding_system *)); | 931 | static int encode_coding_ccl (struct coding_system *); |
| 935 | 932 | ||
| 936 | static void decode_coding_raw_text P_ ((struct coding_system *)); | 933 | static void decode_coding_raw_text (struct coding_system *); |
| 937 | static int encode_coding_raw_text P_ ((struct coding_system *)); | 934 | static int encode_coding_raw_text (struct coding_system *); |
| 938 | 935 | ||
| 939 | static void coding_set_source P_ ((struct coding_system *)); | 936 | static void coding_set_source (struct coding_system *); |
| 940 | static void coding_set_destination P_ ((struct coding_system *)); | 937 | static void coding_set_destination (struct coding_system *); |
| 941 | static void coding_alloc_by_realloc P_ ((struct coding_system *, EMACS_INT)); | 938 | static void coding_alloc_by_realloc (struct coding_system *, EMACS_INT); |
| 942 | static void coding_alloc_by_making_gap P_ ((struct coding_system *, | 939 | static void coding_alloc_by_making_gap (struct coding_system *, |
| 943 | EMACS_INT, EMACS_INT)); | 940 | EMACS_INT, EMACS_INT); |
| 944 | static unsigned char *alloc_destination P_ ((struct coding_system *, | 941 | static unsigned char *alloc_destination (struct coding_system *, |
| 945 | EMACS_INT, unsigned char *)); | 942 | EMACS_INT, unsigned char *); |
| 946 | static void setup_iso_safe_charsets P_ ((Lisp_Object)); | 943 | static void setup_iso_safe_charsets (Lisp_Object); |
| 947 | static unsigned char *encode_designation_at_bol P_ ((struct coding_system *, | 944 | static unsigned char *encode_designation_at_bol (struct coding_system *, |
| 948 | int *, int *, | 945 | int *, int *, |
| 949 | unsigned char *)); | 946 | unsigned char *); |
| 950 | static int detect_eol P_ ((const unsigned char *, | 947 | static int detect_eol (const unsigned char *, |
| 951 | EMACS_INT, enum coding_category)); | 948 | EMACS_INT, enum coding_category); |
| 952 | static Lisp_Object adjust_coding_eol_type P_ ((struct coding_system *, int)); | 949 | static Lisp_Object adjust_coding_eol_type (struct coding_system *, int); |
| 953 | static void decode_eol P_ ((struct coding_system *)); | 950 | static void decode_eol (struct coding_system *); |
| 954 | static Lisp_Object get_translation_table P_ ((Lisp_Object, int, int *)); | 951 | static Lisp_Object get_translation_table (Lisp_Object, int, int *); |
| 955 | static Lisp_Object get_translation P_ ((Lisp_Object, int *, int *)); | 952 | static Lisp_Object get_translation (Lisp_Object, int *, int *); |
| 956 | static int produce_chars P_ ((struct coding_system *, Lisp_Object, int)); | 953 | static int produce_chars (struct coding_system *, Lisp_Object, int); |
| 957 | static INLINE void produce_charset P_ ((struct coding_system *, int *, | 954 | static INLINE void produce_charset (struct coding_system *, int *, |
| 958 | EMACS_INT)); | 955 | EMACS_INT); |
| 959 | static void produce_annotation P_ ((struct coding_system *, EMACS_INT)); | 956 | static void produce_annotation (struct coding_system *, EMACS_INT); |
| 960 | static int decode_coding P_ ((struct coding_system *)); | 957 | static int decode_coding (struct coding_system *); |
| 961 | static INLINE int *handle_composition_annotation P_ ((EMACS_INT, EMACS_INT, | 958 | static INLINE int *handle_composition_annotation (EMACS_INT, EMACS_INT, |
| 962 | struct coding_system *, | 959 | struct coding_system *, |
| 963 | int *, EMACS_INT *)); | 960 | int *, EMACS_INT *); |
| 964 | static INLINE int *handle_charset_annotation P_ ((EMACS_INT, EMACS_INT, | 961 | static INLINE int *handle_charset_annotation (EMACS_INT, EMACS_INT, |
| 965 | struct coding_system *, | 962 | struct coding_system *, |
| 966 | int *, EMACS_INT *)); | 963 | int *, EMACS_INT *); |
| 967 | static void consume_chars P_ ((struct coding_system *, Lisp_Object, int)); | 964 | static void consume_chars (struct coding_system *, Lisp_Object, int); |
| 968 | static int encode_coding P_ ((struct coding_system *)); | 965 | static int encode_coding (struct coding_system *); |
| 969 | static Lisp_Object make_conversion_work_buffer P_ ((int)); | 966 | static Lisp_Object make_conversion_work_buffer (int); |
| 970 | static Lisp_Object code_conversion_restore P_ ((Lisp_Object)); | 967 | static Lisp_Object code_conversion_restore (Lisp_Object); |
| 971 | static INLINE int char_encodable_p P_ ((int, Lisp_Object)); | 968 | static INLINE int char_encodable_p (int, Lisp_Object); |
| 972 | static Lisp_Object make_subsidiaries P_ ((Lisp_Object)); | 969 | static Lisp_Object make_subsidiaries (Lisp_Object); |
| 973 | 970 | ||
| 974 | static void | 971 | static void |
| 975 | record_conversion_result (struct coding_system *coding, | 972 | record_conversion_result (struct coding_system *coding, |
| @@ -1106,8 +1103,7 @@ record_conversion_result (struct coding_system *coding, | |||
| 1106 | 1103 | ||
| 1107 | 1104 | ||
| 1108 | static void | 1105 | static void |
| 1109 | coding_set_source (coding) | 1106 | coding_set_source (struct coding_system *coding) |
| 1110 | struct coding_system *coding; | ||
| 1111 | { | 1107 | { |
| 1112 | if (BUFFERP (coding->src_object)) | 1108 | if (BUFFERP (coding->src_object)) |
| 1113 | { | 1109 | { |
| @@ -1129,8 +1125,7 @@ coding_set_source (coding) | |||
| 1129 | } | 1125 | } |
| 1130 | 1126 | ||
| 1131 | static void | 1127 | static void |
| 1132 | coding_set_destination (coding) | 1128 | coding_set_destination (struct coding_system *coding) |
| 1133 | struct coding_system *coding; | ||
| 1134 | { | 1129 | { |
| 1135 | if (BUFFERP (coding->dst_object)) | 1130 | if (BUFFERP (coding->dst_object)) |
| 1136 | { | 1131 | { |
| @@ -1159,9 +1154,7 @@ coding_set_destination (coding) | |||
| 1159 | 1154 | ||
| 1160 | 1155 | ||
| 1161 | static void | 1156 | static void |
| 1162 | coding_alloc_by_realloc (coding, bytes) | 1157 | coding_alloc_by_realloc (struct coding_system *coding, EMACS_INT bytes) |
| 1163 | struct coding_system *coding; | ||
| 1164 | EMACS_INT bytes; | ||
| 1165 | { | 1158 | { |
| 1166 | coding->destination = (unsigned char *) xrealloc (coding->destination, | 1159 | coding->destination = (unsigned char *) xrealloc (coding->destination, |
| 1167 | coding->dst_bytes + bytes); | 1160 | coding->dst_bytes + bytes); |
| @@ -1169,9 +1162,8 @@ coding_alloc_by_realloc (coding, bytes) | |||
| 1169 | } | 1162 | } |
| 1170 | 1163 | ||
| 1171 | static void | 1164 | static void |
| 1172 | coding_alloc_by_making_gap (coding, gap_head_used, bytes) | 1165 | coding_alloc_by_making_gap (struct coding_system *coding, |
| 1173 | struct coding_system *coding; | 1166 | EMACS_INT gap_head_used, EMACS_INT bytes) |
| 1174 | EMACS_INT gap_head_used, bytes; | ||
| 1175 | { | 1167 | { |
| 1176 | if (EQ (coding->src_object, coding->dst_object)) | 1168 | if (EQ (coding->src_object, coding->dst_object)) |
| 1177 | { | 1169 | { |
| @@ -1200,10 +1192,8 @@ coding_alloc_by_making_gap (coding, gap_head_used, bytes) | |||
| 1200 | 1192 | ||
| 1201 | 1193 | ||
| 1202 | static unsigned char * | 1194 | static unsigned char * |
| 1203 | alloc_destination (coding, nbytes, dst) | 1195 | alloc_destination (struct coding_system *coding, EMACS_INT nbytes, |
| 1204 | struct coding_system *coding; | 1196 | unsigned char *dst) |
| 1205 | EMACS_INT nbytes; | ||
| 1206 | unsigned char *dst; | ||
| 1207 | { | 1197 | { |
| 1208 | EMACS_INT offset = dst - coding->destination; | 1198 | EMACS_INT offset = dst - coding->destination; |
| 1209 | 1199 | ||
| @@ -1301,9 +1291,8 @@ alloc_destination (coding, nbytes, dst) | |||
| 1301 | #define UTF_8_BOM_3 0xBF | 1291 | #define UTF_8_BOM_3 0xBF |
| 1302 | 1292 | ||
| 1303 | static int | 1293 | static int |
| 1304 | detect_coding_utf_8 (coding, detect_info) | 1294 | detect_coding_utf_8 (struct coding_system *coding, |
| 1305 | struct coding_system *coding; | 1295 | struct coding_detection_info *detect_info) |
| 1306 | struct coding_detection_info *detect_info; | ||
| 1307 | { | 1296 | { |
| 1308 | const unsigned char *src = coding->source, *src_base; | 1297 | const unsigned char *src = coding->source, *src_base; |
| 1309 | const unsigned char *src_end = coding->source + coding->src_bytes; | 1298 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -1386,8 +1375,7 @@ detect_coding_utf_8 (coding, detect_info) | |||
| 1386 | 1375 | ||
| 1387 | 1376 | ||
| 1388 | static void | 1377 | static void |
| 1389 | decode_coding_utf_8 (coding) | 1378 | decode_coding_utf_8 (struct coding_system *coding) |
| 1390 | struct coding_system *coding; | ||
| 1391 | { | 1379 | { |
| 1392 | const unsigned char *src = coding->source + coding->consumed; | 1380 | const unsigned char *src = coding->source + coding->consumed; |
| 1393 | const unsigned char *src_end = coding->source + coding->src_bytes; | 1381 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -1435,8 +1423,6 @@ decode_coding_utf_8 (coding) | |||
| 1435 | } | 1423 | } |
| 1436 | CODING_UTF_8_BOM (coding) = utf_without_bom; | 1424 | CODING_UTF_8_BOM (coding) = utf_without_bom; |
| 1437 | 1425 | ||
| 1438 | |||
| 1439 | |||
| 1440 | while (1) | 1426 | while (1) |
| 1441 | { | 1427 | { |
| 1442 | int c, c1, c2, c3, c4, c5; | 1428 | int c, c1, c2, c3, c4, c5; |
| @@ -1459,7 +1445,7 @@ decode_coding_utf_8 (coding) | |||
| 1459 | { | 1445 | { |
| 1460 | c = - c1; | 1446 | c = - c1; |
| 1461 | } | 1447 | } |
| 1462 | else if (UTF_8_1_OCTET_P(c1)) | 1448 | else if (UTF_8_1_OCTET_P (c1)) |
| 1463 | { | 1449 | { |
| 1464 | if (eol_crlf && c1 == '\r') | 1450 | if (eol_crlf && c1 == '\r') |
| 1465 | ONE_MORE_BYTE (byte_after_cr); | 1451 | ONE_MORE_BYTE (byte_after_cr); |
| @@ -1543,8 +1529,7 @@ decode_coding_utf_8 (coding) | |||
| 1543 | 1529 | ||
| 1544 | 1530 | ||
| 1545 | static int | 1531 | static int |
| 1546 | encode_coding_utf_8 (coding) | 1532 | encode_coding_utf_8 (struct coding_system *coding) |
| 1547 | struct coding_system *coding; | ||
| 1548 | { | 1533 | { |
| 1549 | int multibytep = coding->dst_multibyte; | 1534 | int multibytep = coding->dst_multibyte; |
| 1550 | int *charbuf = coding->charbuf; | 1535 | int *charbuf = coding->charbuf; |
| @@ -1623,9 +1608,8 @@ encode_coding_utf_8 (coding) | |||
| 1623 | 1608 | ||
| 1624 | 1609 | ||
| 1625 | static int | 1610 | static int |
| 1626 | detect_coding_utf_16 (coding, detect_info) | 1611 | detect_coding_utf_16 (struct coding_system *coding, |
| 1627 | struct coding_system *coding; | 1612 | struct coding_detection_info *detect_info) |
| 1628 | struct coding_detection_info *detect_info; | ||
| 1629 | { | 1613 | { |
| 1630 | const unsigned char *src = coding->source, *src_base = src; | 1614 | const unsigned char *src = coding->source, *src_base = src; |
| 1631 | const unsigned char *src_end = coding->source + coding->src_bytes; | 1615 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -1708,8 +1692,7 @@ detect_coding_utf_16 (coding, detect_info) | |||
| 1708 | } | 1692 | } |
| 1709 | 1693 | ||
| 1710 | static void | 1694 | static void |
| 1711 | decode_coding_utf_16 (coding) | 1695 | decode_coding_utf_16 (struct coding_system *coding) |
| 1712 | struct coding_system *coding; | ||
| 1713 | { | 1696 | { |
| 1714 | const unsigned char *src = coding->source + coding->consumed; | 1697 | const unsigned char *src = coding->source + coding->consumed; |
| 1715 | const unsigned char *src_end = coding->source + coding->src_bytes; | 1698 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -1837,8 +1820,7 @@ decode_coding_utf_16 (coding) | |||
| 1837 | } | 1820 | } |
| 1838 | 1821 | ||
| 1839 | static int | 1822 | static int |
| 1840 | encode_coding_utf_16 (coding) | 1823 | encode_coding_utf_16 (struct coding_system *coding) |
| 1841 | struct coding_system *coding; | ||
| 1842 | { | 1824 | { |
| 1843 | int multibytep = coding->dst_multibyte; | 1825 | int multibytep = coding->dst_multibyte; |
| 1844 | int *charbuf = coding->charbuf; | 1826 | int *charbuf = coding->charbuf; |
| @@ -1979,9 +1961,8 @@ char emacs_mule_bytes[256]; | |||
| 1979 | else return 0. */ | 1961 | else return 0. */ |
| 1980 | 1962 | ||
| 1981 | static int | 1963 | static int |
| 1982 | detect_coding_emacs_mule (coding, detect_info) | 1964 | detect_coding_emacs_mule (struct coding_system *coding, |
| 1983 | struct coding_system *coding; | 1965 | struct coding_detection_info *detect_info) |
| 1984 | struct coding_detection_info *detect_info; | ||
| 1985 | { | 1966 | { |
| 1986 | const unsigned char *src = coding->source, *src_base; | 1967 | const unsigned char *src = coding->source, *src_base; |
| 1987 | const unsigned char *src_end = coding->source + coding->src_bytes; | 1968 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -2069,11 +2050,9 @@ detect_coding_emacs_mule (coding, detect_info) | |||
| 2069 | -1. If SRC is too short, return -2. */ | 2050 | -1. If SRC is too short, return -2. */ |
| 2070 | 2051 | ||
| 2071 | int | 2052 | int |
| 2072 | emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) | 2053 | emacs_mule_char (struct coding_system *coding, const unsigned char *src, |
| 2073 | struct coding_system *coding; | 2054 | int *nbytes, int *nchars, int *id, |
| 2074 | const unsigned char *src; | 2055 | struct composition_status *cmp_status) |
| 2075 | int *nbytes, *nchars, *id; | ||
| 2076 | struct composition_status *cmp_status; | ||
| 2077 | { | 2056 | { |
| 2078 | const unsigned char *src_end = coding->source + coding->src_bytes; | 2057 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| 2079 | const unsigned char *src_base = src; | 2058 | const unsigned char *src_base = src; |
| @@ -2210,7 +2189,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) | |||
| 2210 | (3) alt&rule composition: 0x80 0xF5 BYTES CHARS | ALT RULE ... ALT CHAR ... | 2189 | (3) alt&rule composition: 0x80 0xF5 BYTES CHARS | ALT RULE ... ALT CHAR ... |
| 2211 | 2190 | ||
| 2212 | and these old form: | 2191 | and these old form: |
| 2213 | 2192 | ||
| 2214 | (4) relative composition: 0x80 | MSEQ ... MSEQ | 2193 | (4) relative composition: 0x80 | MSEQ ... MSEQ |
| 2215 | (5) rulebase composition: 0x80 0xFF | MSEQ MRULE ... MSEQ | 2194 | (5) rulebase composition: 0x80 0xFF | MSEQ MRULE ... MSEQ |
| 2216 | 2195 | ||
| @@ -2391,9 +2370,8 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) | |||
| 2391 | 2370 | ||
| 2392 | 2371 | ||
| 2393 | static int | 2372 | static int |
| 2394 | emacs_mule_finish_composition (charbuf, cmp_status) | 2373 | emacs_mule_finish_composition (int *charbuf, |
| 2395 | int *charbuf; | 2374 | struct composition_status *cmp_status) |
| 2396 | struct composition_status *cmp_status; | ||
| 2397 | { | 2375 | { |
| 2398 | int idx = - cmp_status->length; | 2376 | int idx = - cmp_status->length; |
| 2399 | int new_chars; | 2377 | int new_chars; |
| @@ -2448,8 +2426,7 @@ emacs_mule_finish_composition (charbuf, cmp_status) | |||
| 2448 | 2426 | ||
| 2449 | 2427 | ||
| 2450 | static void | 2428 | static void |
| 2451 | decode_coding_emacs_mule (coding) | 2429 | decode_coding_emacs_mule (struct coding_system *coding) |
| 2452 | struct coding_system *coding; | ||
| 2453 | { | 2430 | { |
| 2454 | const unsigned char *src = coding->source + coding->consumed; | 2431 | const unsigned char *src = coding->source + coding->consumed; |
| 2455 | const unsigned char *src_end = coding->source + coding->src_bytes; | 2432 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -2713,8 +2690,7 @@ decode_coding_emacs_mule (coding) | |||
| 2713 | 2690 | ||
| 2714 | 2691 | ||
| 2715 | static int | 2692 | static int |
| 2716 | encode_coding_emacs_mule (coding) | 2693 | encode_coding_emacs_mule (struct coding_system *coding) |
| 2717 | struct coding_system *coding; | ||
| 2718 | { | 2694 | { |
| 2719 | int multibytep = coding->dst_multibyte; | 2695 | int multibytep = coding->dst_multibyte; |
| 2720 | int *charbuf = coding->charbuf; | 2696 | int *charbuf = coding->charbuf; |
| @@ -3007,8 +2983,7 @@ enum iso_code_class_type iso_code_class[256]; | |||
| 3007 | (CODING_ISO_INITIAL (&coding_categories[category], 1) >= 0) | 2983 | (CODING_ISO_INITIAL (&coding_categories[category], 1) >= 0) |
| 3008 | 2984 | ||
| 3009 | static void | 2985 | static void |
| 3010 | setup_iso_safe_charsets (attrs) | 2986 | setup_iso_safe_charsets (Lisp_Object attrs) |
| 3011 | Lisp_Object attrs; | ||
| 3012 | { | 2987 | { |
| 3013 | Lisp_Object charset_list, safe_charsets; | 2988 | Lisp_Object charset_list, safe_charsets; |
| 3014 | Lisp_Object request; | 2989 | Lisp_Object request; |
| @@ -3076,9 +3051,8 @@ setup_iso_safe_charsets (attrs) | |||
| 3076 | If it is, return 1, else return 0. */ | 3051 | If it is, return 1, else return 0. */ |
| 3077 | 3052 | ||
| 3078 | static int | 3053 | static int |
| 3079 | detect_coding_iso_2022 (coding, detect_info) | 3054 | detect_coding_iso_2022 (struct coding_system *coding, |
| 3080 | struct coding_system *coding; | 3055 | struct coding_detection_info *detect_info) |
| 3081 | struct coding_detection_info *detect_info; | ||
| 3082 | { | 3056 | { |
| 3083 | const unsigned char *src = coding->source, *src_base = src; | 3057 | const unsigned char *src = coding->source, *src_base = src; |
| 3084 | const unsigned char *src_end = coding->source + coding->src_bytes; | 3058 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -3442,12 +3416,10 @@ detect_coding_iso_2022 (coding, detect_info) | |||
| 3442 | 3416 | ||
| 3443 | /* Finish the current composition as invalid. */ | 3417 | /* Finish the current composition as invalid. */ |
| 3444 | 3418 | ||
| 3445 | static int finish_composition P_ ((int *, struct composition_status *)); | 3419 | static int finish_composition (int *, struct composition_status *); |
| 3446 | 3420 | ||
| 3447 | static int | 3421 | static int |
| 3448 | finish_composition (charbuf, cmp_status) | 3422 | finish_composition (int *charbuf, struct composition_status *cmp_status) |
| 3449 | int *charbuf; | ||
| 3450 | struct composition_status *cmp_status; | ||
| 3451 | { | 3423 | { |
| 3452 | int idx = - cmp_status->length; | 3424 | int idx = - cmp_status->length; |
| 3453 | int new_chars; | 3425 | int new_chars; |
| @@ -3584,8 +3556,7 @@ finish_composition (charbuf, cmp_status) | |||
| 3584 | /* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */ | 3556 | /* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */ |
| 3585 | 3557 | ||
| 3586 | static void | 3558 | static void |
| 3587 | decode_coding_iso_2022 (coding) | 3559 | decode_coding_iso_2022 (struct coding_system *coding) |
| 3588 | struct coding_system *coding; | ||
| 3589 | { | 3560 | { |
| 3590 | const unsigned char *src = coding->source + coding->consumed; | 3561 | const unsigned char *src = coding->source + coding->consumed; |
| 3591 | const unsigned char *src_end = coding->source + coding->src_bytes; | 3562 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -4317,7 +4288,7 @@ decode_coding_iso_2022 (coding) | |||
| 4317 | 4288 | ||
| 4318 | #define ENCODE_ISO_CHARACTER(charset, c) \ | 4289 | #define ENCODE_ISO_CHARACTER(charset, c) \ |
| 4319 | do { \ | 4290 | do { \ |
| 4320 | int code = ENCODE_CHAR ((charset),(c)); \ | 4291 | int code = ENCODE_CHAR ((charset), (c)); \ |
| 4321 | \ | 4292 | \ |
| 4322 | if (CHARSET_DIMENSION (charset) == 1) \ | 4293 | if (CHARSET_DIMENSION (charset) == 1) \ |
| 4323 | ENCODE_ISO_CHARACTER_DIMENSION1 ((charset), code); \ | 4294 | ENCODE_ISO_CHARACTER_DIMENSION1 ((charset), code); \ |
| @@ -4331,11 +4302,9 @@ decode_coding_iso_2022 (coding) | |||
| 4331 | Return new DST. */ | 4302 | Return new DST. */ |
| 4332 | 4303 | ||
| 4333 | unsigned char * | 4304 | unsigned char * |
| 4334 | encode_invocation_designation (charset, coding, dst, p_nchars) | 4305 | encode_invocation_designation (struct charset *charset, |
| 4335 | struct charset *charset; | 4306 | struct coding_system *coding, |
| 4336 | struct coding_system *coding; | 4307 | unsigned char *dst, int *p_nchars) |
| 4337 | unsigned char *dst; | ||
| 4338 | int *p_nchars; | ||
| 4339 | { | 4308 | { |
| 4340 | int multibytep = coding->dst_multibyte; | 4309 | int multibytep = coding->dst_multibyte; |
| 4341 | int produced_chars = *p_nchars; | 4310 | int produced_chars = *p_nchars; |
| @@ -4447,10 +4416,8 @@ encode_invocation_designation (charset, coding, dst, p_nchars) | |||
| 4447 | find all the necessary designations. */ | 4416 | find all the necessary designations. */ |
| 4448 | 4417 | ||
| 4449 | static unsigned char * | 4418 | static unsigned char * |
| 4450 | encode_designation_at_bol (coding, charbuf, charbuf_end, dst) | 4419 | encode_designation_at_bol (struct coding_system *coding, int *charbuf, |
| 4451 | struct coding_system *coding; | 4420 | int *charbuf_end, unsigned char *dst) |
| 4452 | int *charbuf, *charbuf_end; | ||
| 4453 | unsigned char *dst; | ||
| 4454 | { | 4421 | { |
| 4455 | struct charset *charset; | 4422 | struct charset *charset; |
| 4456 | /* Table of charsets to be designated to each graphic register. */ | 4423 | /* Table of charsets to be designated to each graphic register. */ |
| @@ -4500,8 +4467,7 @@ encode_designation_at_bol (coding, charbuf, charbuf_end, dst) | |||
| 4500 | /* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */ | 4467 | /* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */ |
| 4501 | 4468 | ||
| 4502 | static int | 4469 | static int |
| 4503 | encode_coding_iso_2022 (coding) | 4470 | encode_coding_iso_2022 (struct coding_system *coding) |
| 4504 | struct coding_system *coding; | ||
| 4505 | { | 4471 | { |
| 4506 | int multibytep = coding->dst_multibyte; | 4472 | int multibytep = coding->dst_multibyte; |
| 4507 | int *charbuf = coding->charbuf; | 4473 | int *charbuf = coding->charbuf; |
| @@ -4691,9 +4657,8 @@ encode_coding_iso_2022 (coding) | |||
| 4691 | CATEGORY_MASK_SJIS, else return 0. */ | 4657 | CATEGORY_MASK_SJIS, else return 0. */ |
| 4692 | 4658 | ||
| 4693 | static int | 4659 | static int |
| 4694 | detect_coding_sjis (coding, detect_info) | 4660 | detect_coding_sjis (struct coding_system *coding, |
| 4695 | struct coding_system *coding; | 4661 | struct coding_detection_info *detect_info) |
| 4696 | struct coding_detection_info *detect_info; | ||
| 4697 | { | 4662 | { |
| 4698 | const unsigned char *src = coding->source, *src_base; | 4663 | const unsigned char *src = coding->source, *src_base; |
| 4699 | const unsigned char *src_end = coding->source + coding->src_bytes; | 4664 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -4749,9 +4714,8 @@ detect_coding_sjis (coding, detect_info) | |||
| 4749 | CATEGORY_MASK_BIG5, else return 0. */ | 4714 | CATEGORY_MASK_BIG5, else return 0. */ |
| 4750 | 4715 | ||
| 4751 | static int | 4716 | static int |
| 4752 | detect_coding_big5 (coding, detect_info) | 4717 | detect_coding_big5 (struct coding_system *coding, |
| 4753 | struct coding_system *coding; | 4718 | struct coding_detection_info *detect_info) |
| 4754 | struct coding_detection_info *detect_info; | ||
| 4755 | { | 4719 | { |
| 4756 | const unsigned char *src = coding->source, *src_base; | 4720 | const unsigned char *src = coding->source, *src_base; |
| 4757 | const unsigned char *src_end = coding->source + coding->src_bytes; | 4721 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -4797,8 +4761,7 @@ detect_coding_big5 (coding, detect_info) | |||
| 4797 | If SJIS_P is 1, decode SJIS text, else decode BIG5 test. */ | 4761 | If SJIS_P is 1, decode SJIS text, else decode BIG5 test. */ |
| 4798 | 4762 | ||
| 4799 | static void | 4763 | static void |
| 4800 | decode_coding_sjis (coding) | 4764 | decode_coding_sjis (struct coding_system *coding) |
| 4801 | struct coding_system *coding; | ||
| 4802 | { | 4765 | { |
| 4803 | const unsigned char *src = coding->source + coding->consumed; | 4766 | const unsigned char *src = coding->source + coding->consumed; |
| 4804 | const unsigned char *src_end = coding->source + coding->src_bytes; | 4767 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -4916,8 +4879,7 @@ decode_coding_sjis (coding) | |||
| 4916 | } | 4879 | } |
| 4917 | 4880 | ||
| 4918 | static void | 4881 | static void |
| 4919 | decode_coding_big5 (coding) | 4882 | decode_coding_big5 (struct coding_system *coding) |
| 4920 | struct coding_system *coding; | ||
| 4921 | { | 4883 | { |
| 4922 | const unsigned char *src = coding->source + coding->consumed; | 4884 | const unsigned char *src = coding->source + coding->consumed; |
| 4923 | const unsigned char *src_end = coding->source + coding->src_bytes; | 4885 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -5021,8 +4983,7 @@ decode_coding_big5 (coding) | |||
| 5021 | SJIS text, else encode BIG5 text. */ | 4983 | SJIS text, else encode BIG5 text. */ |
| 5022 | 4984 | ||
| 5023 | static int | 4985 | static int |
| 5024 | encode_coding_sjis (coding) | 4986 | encode_coding_sjis (struct coding_system *coding) |
| 5025 | struct coding_system *coding; | ||
| 5026 | { | 4987 | { |
| 5027 | int multibytep = coding->dst_multibyte; | 4988 | int multibytep = coding->dst_multibyte; |
| 5028 | int *charbuf = coding->charbuf; | 4989 | int *charbuf = coding->charbuf; |
| @@ -5114,8 +5075,7 @@ encode_coding_sjis (coding) | |||
| 5114 | } | 5075 | } |
| 5115 | 5076 | ||
| 5116 | static int | 5077 | static int |
| 5117 | encode_coding_big5 (coding) | 5078 | encode_coding_big5 (struct coding_system *coding) |
| 5118 | struct coding_system *coding; | ||
| 5119 | { | 5079 | { |
| 5120 | int multibytep = coding->dst_multibyte; | 5080 | int multibytep = coding->dst_multibyte; |
| 5121 | int *charbuf = coding->charbuf; | 5081 | int *charbuf = coding->charbuf; |
| @@ -5193,9 +5153,8 @@ encode_coding_big5 (coding) | |||
| 5193 | CATEGORY_MASK_CCL, else return 0. */ | 5153 | CATEGORY_MASK_CCL, else return 0. */ |
| 5194 | 5154 | ||
| 5195 | static int | 5155 | static int |
| 5196 | detect_coding_ccl (coding, detect_info) | 5156 | detect_coding_ccl (struct coding_system *coding, |
| 5197 | struct coding_system *coding; | 5157 | struct coding_detection_info *detect_info) |
| 5198 | struct coding_detection_info *detect_info; | ||
| 5199 | { | 5158 | { |
| 5200 | const unsigned char *src = coding->source, *src_base; | 5159 | const unsigned char *src = coding->source, *src_base; |
| 5201 | const unsigned char *src_end = coding->source + coding->src_bytes; | 5160 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -5234,8 +5193,7 @@ detect_coding_ccl (coding, detect_info) | |||
| 5234 | } | 5193 | } |
| 5235 | 5194 | ||
| 5236 | static void | 5195 | static void |
| 5237 | decode_coding_ccl (coding) | 5196 | decode_coding_ccl (struct coding_system *coding) |
| 5238 | struct coding_system *coding; | ||
| 5239 | { | 5197 | { |
| 5240 | const unsigned char *src = coding->source + coding->consumed; | 5198 | const unsigned char *src = coding->source + coding->consumed; |
| 5241 | const unsigned char *src_end = coding->source + coding->src_bytes; | 5199 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -5304,8 +5262,7 @@ decode_coding_ccl (coding) | |||
| 5304 | } | 5262 | } |
| 5305 | 5263 | ||
| 5306 | static int | 5264 | static int |
| 5307 | encode_coding_ccl (coding) | 5265 | encode_coding_ccl (struct coding_system *coding) |
| 5308 | struct coding_system *coding; | ||
| 5309 | { | 5266 | { |
| 5310 | struct ccl_program *ccl = &coding->spec.ccl->ccl; | 5267 | struct ccl_program *ccl = &coding->spec.ccl->ccl; |
| 5311 | int multibytep = coding->dst_multibyte; | 5268 | int multibytep = coding->dst_multibyte; |
| @@ -5374,8 +5331,7 @@ encode_coding_ccl (coding) | |||
| 5374 | /* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */ | 5331 | /* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */ |
| 5375 | 5332 | ||
| 5376 | static void | 5333 | static void |
| 5377 | decode_coding_raw_text (coding) | 5334 | decode_coding_raw_text (struct coding_system *coding) |
| 5378 | struct coding_system *coding; | ||
| 5379 | { | 5335 | { |
| 5380 | int eol_crlf = | 5336 | int eol_crlf = |
| 5381 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); | 5337 | !inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos); |
| @@ -5394,8 +5350,7 @@ decode_coding_raw_text (coding) | |||
| 5394 | } | 5350 | } |
| 5395 | 5351 | ||
| 5396 | static int | 5352 | static int |
| 5397 | encode_coding_raw_text (coding) | 5353 | encode_coding_raw_text (struct coding_system *coding) |
| 5398 | struct coding_system *coding; | ||
| 5399 | { | 5354 | { |
| 5400 | int multibytep = coding->dst_multibyte; | 5355 | int multibytep = coding->dst_multibyte; |
| 5401 | int *charbuf = coding->charbuf; | 5356 | int *charbuf = coding->charbuf; |
| @@ -5478,9 +5433,8 @@ encode_coding_raw_text (coding) | |||
| 5478 | is, return 1, else return 0. */ | 5433 | is, return 1, else return 0. */ |
| 5479 | 5434 | ||
| 5480 | static int | 5435 | static int |
| 5481 | detect_coding_charset (coding, detect_info) | 5436 | detect_coding_charset (struct coding_system *coding, |
| 5482 | struct coding_system *coding; | 5437 | struct coding_detection_info *detect_info) |
| 5483 | struct coding_detection_info *detect_info; | ||
| 5484 | { | 5438 | { |
| 5485 | const unsigned char *src = coding->source, *src_base; | 5439 | const unsigned char *src = coding->source, *src_base; |
| 5486 | const unsigned char *src_end = coding->source + coding->src_bytes; | 5440 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -5582,8 +5536,7 @@ detect_coding_charset (coding, detect_info) | |||
| 5582 | } | 5536 | } |
| 5583 | 5537 | ||
| 5584 | static void | 5538 | static void |
| 5585 | decode_coding_charset (coding) | 5539 | decode_coding_charset (struct coding_system *coding) |
| 5586 | struct coding_system *coding; | ||
| 5587 | { | 5540 | { |
| 5588 | const unsigned char *src = coding->source + coding->consumed; | 5541 | const unsigned char *src = coding->source + coding->consumed; |
| 5589 | const unsigned char *src_end = coding->source + coding->src_bytes; | 5542 | const unsigned char *src_end = coding->source + coding->src_bytes; |
| @@ -5711,8 +5664,7 @@ decode_coding_charset (coding) | |||
| 5711 | } | 5664 | } |
| 5712 | 5665 | ||
| 5713 | static int | 5666 | static int |
| 5714 | encode_coding_charset (coding) | 5667 | encode_coding_charset (struct coding_system *coding) |
| 5715 | struct coding_system *coding; | ||
| 5716 | { | 5668 | { |
| 5717 | int multibytep = coding->dst_multibyte; | 5669 | int multibytep = coding->dst_multibyte; |
| 5718 | int *charbuf = coding->charbuf; | 5670 | int *charbuf = coding->charbuf; |
| @@ -5782,9 +5734,7 @@ encode_coding_charset (coding) | |||
| 5782 | CODING_SYSTEM is invalid, signal an error. */ | 5734 | CODING_SYSTEM is invalid, signal an error. */ |
| 5783 | 5735 | ||
| 5784 | void | 5736 | void |
| 5785 | setup_coding_system (coding_system, coding) | 5737 | setup_coding_system (Lisp_Object coding_system, struct coding_system *coding) |
| 5786 | Lisp_Object coding_system; | ||
| 5787 | struct coding_system *coding; | ||
| 5788 | { | 5738 | { |
| 5789 | Lisp_Object attrs; | 5739 | Lisp_Object attrs; |
| 5790 | Lisp_Object eol_type; | 5740 | Lisp_Object eol_type; |
| @@ -5987,8 +5937,7 @@ setup_coding_system (coding_system, coding) | |||
| 5987 | /* Return a list of charsets supported by CODING. */ | 5937 | /* Return a list of charsets supported by CODING. */ |
| 5988 | 5938 | ||
| 5989 | Lisp_Object | 5939 | Lisp_Object |
| 5990 | coding_charset_list (coding) | 5940 | coding_charset_list (struct coding_system *coding) |
| 5991 | struct coding_system *coding; | ||
| 5992 | { | 5941 | { |
| 5993 | Lisp_Object attrs, charset_list; | 5942 | Lisp_Object attrs, charset_list; |
| 5994 | 5943 | ||
| @@ -6011,8 +5960,7 @@ coding_charset_list (coding) | |||
| 6011 | /* Return a list of charsets supported by CODING-SYSTEM. */ | 5960 | /* Return a list of charsets supported by CODING-SYSTEM. */ |
| 6012 | 5961 | ||
| 6013 | Lisp_Object | 5962 | Lisp_Object |
| 6014 | coding_system_charset_list (coding_system) | 5963 | coding_system_charset_list (Lisp_Object coding_system) |
| 6015 | Lisp_Object coding_system; | ||
| 6016 | { | 5964 | { |
| 6017 | int id; | 5965 | int id; |
| 6018 | Lisp_Object attrs, charset_list; | 5966 | Lisp_Object attrs, charset_list; |
| @@ -6045,8 +5993,7 @@ coding_system_charset_list (coding_system) | |||
| 6045 | eol_type as CODING-SYSTEM. */ | 5993 | eol_type as CODING-SYSTEM. */ |
| 6046 | 5994 | ||
| 6047 | Lisp_Object | 5995 | Lisp_Object |
| 6048 | raw_text_coding_system (coding_system) | 5996 | raw_text_coding_system (Lisp_Object coding_system) |
| 6049 | Lisp_Object coding_system; | ||
| 6050 | { | 5997 | { |
| 6051 | Lisp_Object spec, attrs; | 5998 | Lisp_Object spec, attrs; |
| 6052 | Lisp_Object eol_type, raw_text_eol_type; | 5999 | Lisp_Object eol_type, raw_text_eol_type; |
| @@ -6077,8 +6024,7 @@ raw_text_coding_system (coding_system) | |||
| 6077 | (system_eol_type). */ | 6024 | (system_eol_type). */ |
| 6078 | 6025 | ||
| 6079 | Lisp_Object | 6026 | Lisp_Object |
| 6080 | coding_inherit_eol_type (coding_system, parent) | 6027 | coding_inherit_eol_type (Lisp_Object coding_system, Lisp_Object parent) |
| 6081 | Lisp_Object coding_system, parent; | ||
| 6082 | { | 6028 | { |
| 6083 | Lisp_Object spec, eol_type; | 6029 | Lisp_Object spec, eol_type; |
| 6084 | 6030 | ||
| @@ -6233,10 +6179,8 @@ coding_inherit_eol_type (coding_system, parent) | |||
| 6233 | #define MAX_EOL_CHECK_COUNT 3 | 6179 | #define MAX_EOL_CHECK_COUNT 3 |
| 6234 | 6180 | ||
| 6235 | static int | 6181 | static int |
| 6236 | detect_eol (source, src_bytes, category) | 6182 | detect_eol (const unsigned char *source, EMACS_INT src_bytes, |
| 6237 | const unsigned char *source; | 6183 | enum coding_category category) |
| 6238 | EMACS_INT src_bytes; | ||
| 6239 | enum coding_category category; | ||
| 6240 | { | 6184 | { |
| 6241 | const unsigned char *src = source, *src_end = src + src_bytes; | 6185 | const unsigned char *src = source, *src_end = src + src_bytes; |
| 6242 | unsigned char c; | 6186 | unsigned char c; |
| @@ -6334,9 +6278,7 @@ detect_eol (source, src_bytes, category) | |||
| 6334 | 6278 | ||
| 6335 | 6279 | ||
| 6336 | static Lisp_Object | 6280 | static Lisp_Object |
| 6337 | adjust_coding_eol_type (coding, eol_seen) | 6281 | adjust_coding_eol_type (struct coding_system *coding, int eol_seen) |
| 6338 | struct coding_system *coding; | ||
| 6339 | int eol_seen; | ||
| 6340 | { | 6282 | { |
| 6341 | Lisp_Object eol_type; | 6283 | Lisp_Object eol_type; |
| 6342 | 6284 | ||
| @@ -6364,8 +6306,7 @@ adjust_coding_eol_type (coding, eol_seen) | |||
| 6364 | system. */ | 6306 | system. */ |
| 6365 | 6307 | ||
| 6366 | void | 6308 | void |
| 6367 | detect_coding (coding) | 6309 | detect_coding (struct coding_system *coding) |
| 6368 | struct coding_system *coding; | ||
| 6369 | { | 6310 | { |
| 6370 | const unsigned char *src, *src_end; | 6311 | const unsigned char *src, *src_end; |
| 6371 | int saved_mode = coding->mode; | 6312 | int saved_mode = coding->mode; |
| @@ -6544,8 +6485,7 @@ detect_coding (coding) | |||
| 6544 | 6485 | ||
| 6545 | 6486 | ||
| 6546 | static void | 6487 | static void |
| 6547 | decode_eol (coding) | 6488 | decode_eol (struct coding_system *coding) |
| 6548 | struct coding_system *coding; | ||
| 6549 | { | 6489 | { |
| 6550 | Lisp_Object eol_type; | 6490 | Lisp_Object eol_type; |
| 6551 | unsigned char *p, *pbeg, *pend; | 6491 | unsigned char *p, *pbeg, *pend; |
| @@ -6610,7 +6550,7 @@ decode_eol (coding) | |||
| 6610 | for (p = pend - 2; p >= pbeg; p--) | 6550 | for (p = pend - 2; p >= pbeg; p--) |
| 6611 | if (*p == '\r') | 6551 | if (*p == '\r') |
| 6612 | { | 6552 | { |
| 6613 | safe_bcopy ((char *) (p + 1), (char *) p, pend-- - p - 1); | 6553 | memmove (p, p + 1, pend-- - p - 1); |
| 6614 | n++; | 6554 | n++; |
| 6615 | } | 6555 | } |
| 6616 | } | 6556 | } |
| @@ -6647,9 +6587,7 @@ decode_eol (coding) | |||
| 6647 | decoding (ENCODEP is zero). */ | 6587 | decoding (ENCODEP is zero). */ |
| 6648 | 6588 | ||
| 6649 | static Lisp_Object | 6589 | static Lisp_Object |
| 6650 | get_translation_table (attrs, encodep, max_lookup) | 6590 | get_translation_table (Lisp_Object attrs, int encodep, int *max_lookup) |
| 6651 | Lisp_Object attrs; | ||
| 6652 | int encodep, *max_lookup; | ||
| 6653 | { | 6591 | { |
| 6654 | Lisp_Object standard, translation_table; | 6592 | Lisp_Object standard, translation_table; |
| 6655 | Lisp_Object val; | 6593 | Lisp_Object val; |
| @@ -6751,9 +6689,7 @@ get_translation_table (attrs, encodep, max_lookup) | |||
| 6751 | If BUF is too short to lookup characters in FROM, return Qt. */ | 6689 | If BUF is too short to lookup characters in FROM, return Qt. */ |
| 6752 | 6690 | ||
| 6753 | static Lisp_Object | 6691 | static Lisp_Object |
| 6754 | get_translation (trans, buf, buf_end) | 6692 | get_translation (Lisp_Object trans, int *buf, int *buf_end) |
| 6755 | Lisp_Object trans; | ||
| 6756 | int *buf, *buf_end; | ||
| 6757 | { | 6693 | { |
| 6758 | 6694 | ||
| 6759 | if (INTEGERP (trans)) | 6695 | if (INTEGERP (trans)) |
| @@ -6780,10 +6716,8 @@ get_translation (trans, buf, buf_end) | |||
| 6780 | 6716 | ||
| 6781 | 6717 | ||
| 6782 | static int | 6718 | static int |
| 6783 | produce_chars (coding, translation_table, last_block) | 6719 | produce_chars (struct coding_system *coding, Lisp_Object translation_table, |
| 6784 | struct coding_system *coding; | 6720 | int last_block) |
| 6785 | Lisp_Object translation_table; | ||
| 6786 | int last_block; | ||
| 6787 | { | 6721 | { |
| 6788 | unsigned char *dst = coding->destination + coding->produced; | 6722 | unsigned char *dst = coding->destination + coding->produced; |
| 6789 | unsigned char *dst_end = coding->destination + coding->dst_bytes; | 6723 | unsigned char *dst_end = coding->destination + coding->dst_bytes; |
| @@ -6981,10 +6915,7 @@ produce_chars (coding, translation_table, last_block) | |||
| 6981 | */ | 6915 | */ |
| 6982 | 6916 | ||
| 6983 | static INLINE void | 6917 | static INLINE void |
| 6984 | produce_composition (coding, charbuf, pos) | 6918 | produce_composition (struct coding_system *coding, int *charbuf, EMACS_INT pos) |
| 6985 | struct coding_system *coding; | ||
| 6986 | int *charbuf; | ||
| 6987 | EMACS_INT pos; | ||
| 6988 | { | 6919 | { |
| 6989 | int len; | 6920 | int len; |
| 6990 | EMACS_INT to; | 6921 | EMACS_INT to; |
| @@ -7028,10 +6959,7 @@ produce_composition (coding, charbuf, pos) | |||
| 7028 | */ | 6959 | */ |
| 7029 | 6960 | ||
| 7030 | static INLINE void | 6961 | static INLINE void |
| 7031 | produce_charset (coding, charbuf, pos) | 6962 | produce_charset (struct coding_system *coding, int *charbuf, EMACS_INT pos) |
| 7032 | struct coding_system *coding; | ||
| 7033 | int *charbuf; | ||
| 7034 | EMACS_INT pos; | ||
| 7035 | { | 6963 | { |
| 7036 | EMACS_INT from = pos - charbuf[2]; | 6964 | EMACS_INT from = pos - charbuf[2]; |
| 7037 | struct charset *charset = CHARSET_FROM_ID (charbuf[3]); | 6965 | struct charset *charset = CHARSET_FROM_ID (charbuf[3]); |
| @@ -7066,9 +6994,7 @@ produce_charset (coding, charbuf, pos) | |||
| 7066 | 6994 | ||
| 7067 | 6995 | ||
| 7068 | static void | 6996 | static void |
| 7069 | produce_annotation (coding, pos) | 6997 | produce_annotation (struct coding_system *coding, EMACS_INT pos) |
| 7070 | struct coding_system *coding; | ||
| 7071 | EMACS_INT pos; | ||
| 7072 | { | 6998 | { |
| 7073 | int *charbuf = coding->charbuf; | 6999 | int *charbuf = coding->charbuf; |
| 7074 | int *charbuf_end = charbuf + coding->charbuf_used; | 7000 | int *charbuf_end = charbuf + coding->charbuf_used; |
| @@ -7123,8 +7049,7 @@ produce_annotation (coding, pos) | |||
| 7123 | */ | 7049 | */ |
| 7124 | 7050 | ||
| 7125 | static int | 7051 | static int |
| 7126 | decode_coding (coding) | 7052 | decode_coding (struct coding_system *coding) |
| 7127 | struct coding_system *coding; | ||
| 7128 | { | 7053 | { |
| 7129 | Lisp_Object attrs; | 7054 | Lisp_Object attrs; |
| 7130 | Lisp_Object undo_list; | 7055 | Lisp_Object undo_list; |
| @@ -7262,11 +7187,9 @@ decode_coding (coding) | |||
| 7262 | return BUF. */ | 7187 | return BUF. */ |
| 7263 | 7188 | ||
| 7264 | static INLINE int * | 7189 | static INLINE int * |
| 7265 | handle_composition_annotation (pos, limit, coding, buf, stop) | 7190 | handle_composition_annotation (EMACS_INT pos, EMACS_INT limit, |
| 7266 | EMACS_INT pos, limit; | 7191 | struct coding_system *coding, int *buf, |
| 7267 | struct coding_system *coding; | 7192 | EMACS_INT *stop) |
| 7268 | int *buf; | ||
| 7269 | EMACS_INT *stop; | ||
| 7270 | { | 7193 | { |
| 7271 | EMACS_INT start, end; | 7194 | EMACS_INT start, end; |
| 7272 | Lisp_Object prop; | 7195 | Lisp_Object prop; |
| @@ -7347,11 +7270,9 @@ handle_composition_annotation (pos, limit, coding, buf, stop) | |||
| 7347 | property value is non-nil (limiting by LIMIT), and return BUF. */ | 7270 | property value is non-nil (limiting by LIMIT), and return BUF. */ |
| 7348 | 7271 | ||
| 7349 | static INLINE int * | 7272 | static INLINE int * |
| 7350 | handle_charset_annotation (pos, limit, coding, buf, stop) | 7273 | handle_charset_annotation (EMACS_INT pos, EMACS_INT limit, |
| 7351 | EMACS_INT pos, limit; | 7274 | struct coding_system *coding, int *buf, |
| 7352 | struct coding_system *coding; | 7275 | EMACS_INT *stop) |
| 7353 | int *buf; | ||
| 7354 | EMACS_INT *stop; | ||
| 7355 | { | 7276 | { |
| 7356 | Lisp_Object val, next; | 7277 | Lisp_Object val, next; |
| 7357 | int id; | 7278 | int id; |
| @@ -7371,10 +7292,8 @@ handle_charset_annotation (pos, limit, coding, buf, stop) | |||
| 7371 | 7292 | ||
| 7372 | 7293 | ||
| 7373 | static void | 7294 | static void |
| 7374 | consume_chars (coding, translation_table, max_lookup) | 7295 | consume_chars (struct coding_system *coding, Lisp_Object translation_table, |
| 7375 | struct coding_system *coding; | 7296 | int max_lookup) |
| 7376 | Lisp_Object translation_table; | ||
| 7377 | int max_lookup; | ||
| 7378 | { | 7297 | { |
| 7379 | int *buf = coding->charbuf; | 7298 | int *buf = coding->charbuf; |
| 7380 | int *buf_end = coding->charbuf + coding->charbuf_size; | 7299 | int *buf_end = coding->charbuf + coding->charbuf_size; |
| @@ -7530,8 +7449,7 @@ consume_chars (coding, translation_table, max_lookup) | |||
| 7530 | memory area specified by CODING->destination. */ | 7449 | memory area specified by CODING->destination. */ |
| 7531 | 7450 | ||
| 7532 | static int | 7451 | static int |
| 7533 | encode_coding (coding) | 7452 | encode_coding (struct coding_system *coding) |
| 7534 | struct coding_system *coding; | ||
| 7535 | { | 7453 | { |
| 7536 | Lisp_Object attrs; | 7454 | Lisp_Object attrs; |
| 7537 | Lisp_Object translation_table; | 7455 | Lisp_Object translation_table; |
| @@ -7595,8 +7513,7 @@ static int reused_workbuf_in_use; | |||
| 7595 | multibyteness of returning buffer. */ | 7513 | multibyteness of returning buffer. */ |
| 7596 | 7514 | ||
| 7597 | static Lisp_Object | 7515 | static Lisp_Object |
| 7598 | make_conversion_work_buffer (multibyte) | 7516 | make_conversion_work_buffer (int multibyte) |
| 7599 | int multibyte; | ||
| 7600 | { | 7517 | { |
| 7601 | Lisp_Object name, workbuf; | 7518 | Lisp_Object name, workbuf; |
| 7602 | struct buffer *current; | 7519 | struct buffer *current; |
| @@ -7628,8 +7545,7 @@ make_conversion_work_buffer (multibyte) | |||
| 7628 | 7545 | ||
| 7629 | 7546 | ||
| 7630 | static Lisp_Object | 7547 | static Lisp_Object |
| 7631 | code_conversion_restore (arg) | 7548 | code_conversion_restore (Lisp_Object arg) |
| 7632 | Lisp_Object arg; | ||
| 7633 | { | 7549 | { |
| 7634 | Lisp_Object current, workbuf; | 7550 | Lisp_Object current, workbuf; |
| 7635 | struct gcpro gcpro1; | 7551 | struct gcpro gcpro1; |
| @@ -7650,8 +7566,7 @@ code_conversion_restore (arg) | |||
| 7650 | } | 7566 | } |
| 7651 | 7567 | ||
| 7652 | Lisp_Object | 7568 | Lisp_Object |
| 7653 | code_conversion_save (with_work_buf, multibyte) | 7569 | code_conversion_save (int with_work_buf, int multibyte) |
| 7654 | int with_work_buf, multibyte; | ||
| 7655 | { | 7570 | { |
| 7656 | Lisp_Object workbuf = Qnil; | 7571 | Lisp_Object workbuf = Qnil; |
| 7657 | 7572 | ||
| @@ -7663,11 +7578,10 @@ code_conversion_save (with_work_buf, multibyte) | |||
| 7663 | } | 7578 | } |
| 7664 | 7579 | ||
| 7665 | int | 7580 | int |
| 7666 | decode_coding_gap (coding, chars, bytes) | 7581 | decode_coding_gap (struct coding_system *coding, |
| 7667 | struct coding_system *coding; | 7582 | EMACS_INT chars, EMACS_INT bytes) |
| 7668 | EMACS_INT chars, bytes; | ||
| 7669 | { | 7583 | { |
| 7670 | int count = specpdl_ptr - specpdl; | 7584 | int count = SPECPDL_INDEX (); |
| 7671 | Lisp_Object attrs; | 7585 | Lisp_Object attrs; |
| 7672 | 7586 | ||
| 7673 | code_conversion_save (0, 0); | 7587 | code_conversion_save (0, 0); |
| @@ -7710,11 +7624,10 @@ decode_coding_gap (coding, chars, bytes) | |||
| 7710 | } | 7624 | } |
| 7711 | 7625 | ||
| 7712 | int | 7626 | int |
| 7713 | encode_coding_gap (coding, chars, bytes) | 7627 | encode_coding_gap (struct coding_system *coding, |
| 7714 | struct coding_system *coding; | 7628 | EMACS_INT chars, EMACS_INT bytes) |
| 7715 | EMACS_INT chars, bytes; | ||
| 7716 | { | 7629 | { |
| 7717 | int count = specpdl_ptr - specpdl; | 7630 | int count = SPECPDL_INDEX (); |
| 7718 | 7631 | ||
| 7719 | code_conversion_save (0, 0); | 7632 | code_conversion_save (0, 0); |
| 7720 | 7633 | ||
| @@ -7765,14 +7678,13 @@ encode_coding_gap (coding, chars, bytes) | |||
| 7765 | */ | 7678 | */ |
| 7766 | 7679 | ||
| 7767 | void | 7680 | void |
| 7768 | decode_coding_object (coding, src_object, from, from_byte, to, to_byte, | 7681 | decode_coding_object (struct coding_system *coding, |
| 7769 | dst_object) | 7682 | Lisp_Object src_object, |
| 7770 | struct coding_system *coding; | 7683 | EMACS_INT from, EMACS_INT from_byte, |
| 7771 | Lisp_Object src_object; | 7684 | EMACS_INT to, EMACS_INT to_byte, |
| 7772 | EMACS_INT from, from_byte, to, to_byte; | 7685 | Lisp_Object dst_object) |
| 7773 | Lisp_Object dst_object; | ||
| 7774 | { | 7686 | { |
| 7775 | int count = specpdl_ptr - specpdl; | 7687 | int count = SPECPDL_INDEX (); |
| 7776 | unsigned char *destination; | 7688 | unsigned char *destination; |
| 7777 | EMACS_INT dst_bytes; | 7689 | EMACS_INT dst_bytes; |
| 7778 | EMACS_INT chars = to - from; | 7690 | EMACS_INT chars = to - from; |
| @@ -7902,7 +7814,7 @@ decode_coding_object (coding, src_object, from, from_byte, to, to_byte, | |||
| 7902 | } | 7814 | } |
| 7903 | if (BEGV < GPT && GPT < BEGV + coding->produced_char) | 7815 | if (BEGV < GPT && GPT < BEGV + coding->produced_char) |
| 7904 | move_gap_both (BEGV, BEGV_BYTE); | 7816 | move_gap_both (BEGV, BEGV_BYTE); |
| 7905 | bcopy (BEGV_ADDR, destination, coding->produced); | 7817 | memcpy (destination, BEGV_ADDR, coding->produced); |
| 7906 | coding->destination = destination; | 7818 | coding->destination = destination; |
| 7907 | } | 7819 | } |
| 7908 | } | 7820 | } |
| @@ -7956,14 +7868,13 @@ decode_coding_object (coding, src_object, from, from_byte, to, to_byte, | |||
| 7956 | 7868 | ||
| 7957 | 7869 | ||
| 7958 | void | 7870 | void |
| 7959 | encode_coding_object (coding, src_object, from, from_byte, to, to_byte, | 7871 | encode_coding_object (struct coding_system *coding, |
| 7960 | dst_object) | 7872 | Lisp_Object src_object, |
| 7961 | struct coding_system *coding; | 7873 | EMACS_INT from, EMACS_INT from_byte, |
| 7962 | Lisp_Object src_object; | 7874 | EMACS_INT to, EMACS_INT to_byte, |
| 7963 | EMACS_INT from, from_byte, to, to_byte; | 7875 | Lisp_Object dst_object) |
| 7964 | Lisp_Object dst_object; | ||
| 7965 | { | 7876 | { |
| 7966 | int count = specpdl_ptr - specpdl; | 7877 | int count = SPECPDL_INDEX (); |
| 7967 | EMACS_INT chars = to - from; | 7878 | EMACS_INT chars = to - from; |
| 7968 | EMACS_INT bytes = to_byte - from_byte; | 7879 | EMACS_INT bytes = to_byte - from_byte; |
| 7969 | Lisp_Object attrs; | 7880 | Lisp_Object attrs; |
| @@ -8165,7 +8076,7 @@ encode_coding_object (coding, src_object, from, from_byte, to, to_byte, | |||
| 8165 | 8076 | ||
| 8166 | 8077 | ||
| 8167 | Lisp_Object | 8078 | Lisp_Object |
| 8168 | preferred_coding_system () | 8079 | preferred_coding_system (void) |
| 8169 | { | 8080 | { |
| 8170 | int id = coding_categories[coding_priorities[0]].id; | 8081 | int id = coding_categories[coding_priorities[0]].id; |
| 8171 | 8082 | ||
| @@ -8269,13 +8180,10 @@ function `define-coding-system'. */) | |||
| 8269 | detect only text-format. */ | 8180 | detect only text-format. */ |
| 8270 | 8181 | ||
| 8271 | Lisp_Object | 8182 | Lisp_Object |
| 8272 | detect_coding_system (src, src_chars, src_bytes, highest, multibytep, | 8183 | detect_coding_system (const unsigned char *src, |
| 8273 | coding_system) | 8184 | EMACS_INT src_chars, EMACS_INT src_bytes, |
| 8274 | const unsigned char *src; | 8185 | int highest, int multibytep, |
| 8275 | EMACS_INT src_chars, src_bytes; | 8186 | Lisp_Object coding_system) |
| 8276 | int highest; | ||
| 8277 | int multibytep; | ||
| 8278 | Lisp_Object coding_system; | ||
| 8279 | { | 8187 | { |
| 8280 | const unsigned char *src_end = src + src_bytes; | 8188 | const unsigned char *src_end = src + src_bytes; |
| 8281 | Lisp_Object attrs, eol_type; | 8189 | Lisp_Object attrs, eol_type; |
| @@ -8643,9 +8551,7 @@ highest priority. */) | |||
| 8643 | 8551 | ||
| 8644 | 8552 | ||
| 8645 | static INLINE int | 8553 | static INLINE int |
| 8646 | char_encodable_p (c, attrs) | 8554 | char_encodable_p (int c, Lisp_Object attrs) |
| 8647 | int c; | ||
| 8648 | Lisp_Object attrs; | ||
| 8649 | { | 8555 | { |
| 8650 | Lisp_Object tail; | 8556 | Lisp_Object tail; |
| 8651 | struct charset *charset; | 8557 | struct charset *charset; |
| @@ -9031,9 +8937,9 @@ is nil. */) | |||
| 9031 | 8937 | ||
| 9032 | 8938 | ||
| 9033 | Lisp_Object | 8939 | Lisp_Object |
| 9034 | code_convert_region (start, end, coding_system, dst_object, encodep, norecord) | 8940 | code_convert_region (Lisp_Object start, Lisp_Object end, |
| 9035 | Lisp_Object start, end, coding_system, dst_object; | 8941 | Lisp_Object coding_system, Lisp_Object dst_object, |
| 9036 | int encodep, norecord; | 8942 | int encodep, int norecord) |
| 9037 | { | 8943 | { |
| 9038 | struct coding_system coding; | 8944 | struct coding_system coding; |
| 9039 | EMACS_INT from, from_byte, to, to_byte; | 8945 | EMACS_INT from, from_byte, to, to_byte; |
| @@ -9172,9 +9078,8 @@ code_convert_string (string, coding_system, dst_object, | |||
| 9172 | ENCODE_FILE, thus we ignore character composition. */ | 9078 | ENCODE_FILE, thus we ignore character composition. */ |
| 9173 | 9079 | ||
| 9174 | Lisp_Object | 9080 | Lisp_Object |
| 9175 | code_convert_string_norecord (string, coding_system, encodep) | 9081 | code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system, |
| 9176 | Lisp_Object string, coding_system; | 9082 | int encodep) |
| 9177 | int encodep; | ||
| 9178 | { | 9083 | { |
| 9179 | return code_convert_string (string, coding_system, Qt, encodep, 0, 1); | 9084 | return code_convert_string (string, coding_system, Qt, encodep, 0, 1); |
| 9180 | } | 9085 | } |
| @@ -9577,7 +9482,7 @@ usage: (set-coding-system-priority &rest coding-systems) */) | |||
| 9577 | int changed[coding_category_max]; | 9482 | int changed[coding_category_max]; |
| 9578 | enum coding_category priorities[coding_category_max]; | 9483 | enum coding_category priorities[coding_category_max]; |
| 9579 | 9484 | ||
| 9580 | bzero (changed, sizeof changed); | 9485 | memset (changed, 0, sizeof changed); |
| 9581 | 9486 | ||
| 9582 | for (i = j = 0; i < nargs; i++) | 9487 | for (i = j = 0; i < nargs; i++) |
| 9583 | { | 9488 | { |
| @@ -9612,7 +9517,7 @@ usage: (set-coding-system-priority &rest coding-systems) */) | |||
| 9612 | priorities[i] = coding_priorities[j]; | 9517 | priorities[i] = coding_priorities[j]; |
| 9613 | } | 9518 | } |
| 9614 | 9519 | ||
| 9615 | bcopy (priorities, coding_priorities, sizeof priorities); | 9520 | memcpy (coding_priorities, priorities, sizeof priorities); |
| 9616 | 9521 | ||
| 9617 | /* Update `coding-category-list'. */ | 9522 | /* Update `coding-category-list'. */ |
| 9618 | Vcoding_category_list = Qnil; | 9523 | Vcoding_category_list = Qnil; |
| @@ -9656,19 +9561,18 @@ HIGHESTP non-nil means just return the highest priority one. */) | |||
| 9656 | static const char *const suffixes[] = { "-unix", "-dos", "-mac" }; | 9561 | static const char *const suffixes[] = { "-unix", "-dos", "-mac" }; |
| 9657 | 9562 | ||
| 9658 | static Lisp_Object | 9563 | static Lisp_Object |
| 9659 | make_subsidiaries (base) | 9564 | make_subsidiaries (Lisp_Object base) |
| 9660 | Lisp_Object base; | ||
| 9661 | { | 9565 | { |
| 9662 | Lisp_Object subsidiaries; | 9566 | Lisp_Object subsidiaries; |
| 9663 | int base_name_len = SBYTES (SYMBOL_NAME (base)); | 9567 | int base_name_len = SBYTES (SYMBOL_NAME (base)); |
| 9664 | char *buf = (char *) alloca (base_name_len + 6); | 9568 | char *buf = (char *) alloca (base_name_len + 6); |
| 9665 | int i; | 9569 | int i; |
| 9666 | 9570 | ||
| 9667 | bcopy (SDATA (SYMBOL_NAME (base)), buf, base_name_len); | 9571 | memcpy (buf, SDATA (SYMBOL_NAME (base)), base_name_len); |
| 9668 | subsidiaries = Fmake_vector (make_number (3), Qnil); | 9572 | subsidiaries = Fmake_vector (make_number (3), Qnil); |
| 9669 | for (i = 0; i < 3; i++) | 9573 | for (i = 0; i < 3; i++) |
| 9670 | { | 9574 | { |
| 9671 | bcopy (suffixes[i], buf + base_name_len, strlen (suffixes[i]) + 1); | 9575 | memcpy (buf + base_name_len, suffixes[i], strlen (suffixes[i]) + 1); |
| 9672 | ASET (subsidiaries, i, intern (buf)); | 9576 | ASET (subsidiaries, i, intern (buf)); |
| 9673 | } | 9577 | } |
| 9674 | return subsidiaries; | 9578 | return subsidiaries; |
| @@ -10210,7 +10114,7 @@ usage: (define-coding-system-internal ...) */) | |||
| 10210 | DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put, | 10114 | DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put, |
| 10211 | 3, 3, 0, | 10115 | 3, 3, 0, |
| 10212 | doc: /* Change value in CODING-SYSTEM's property list PROP to VAL. */) | 10116 | doc: /* Change value in CODING-SYSTEM's property list PROP to VAL. */) |
| 10213 | (coding_system, prop, val) | 10117 | (coding_system, prop, val) |
| 10214 | Lisp_Object coding_system, prop, val; | 10118 | Lisp_Object coding_system, prop, val; |
| 10215 | { | 10119 | { |
| 10216 | Lisp_Object spec, attrs; | 10120 | Lisp_Object spec, attrs; |
| @@ -10308,7 +10212,7 @@ DEFUN ("coding-system-base", Fcoding_system_base, Scoding_system_base, | |||
| 10308 | 1, 1, 0, | 10212 | 1, 1, 0, |
| 10309 | doc: /* Return the base of CODING-SYSTEM. | 10213 | doc: /* Return the base of CODING-SYSTEM. |
| 10310 | Any alias or subsidiary coding system is not a base coding system. */) | 10214 | Any alias or subsidiary coding system is not a base coding system. */) |
| 10311 | (coding_system) | 10215 | (coding_system) |
| 10312 | Lisp_Object coding_system; | 10216 | Lisp_Object coding_system; |
| 10313 | { | 10217 | { |
| 10314 | Lisp_Object spec, attrs; | 10218 | Lisp_Object spec, attrs; |
| @@ -10385,7 +10289,7 @@ coding system whose eol-type is N. */) | |||
| 10385 | /*** 9. Post-amble ***/ | 10289 | /*** 9. Post-amble ***/ |
| 10386 | 10290 | ||
| 10387 | void | 10291 | void |
| 10388 | init_coding_once () | 10292 | init_coding_once (void) |
| 10389 | { | 10293 | { |
| 10390 | int i; | 10294 | int i; |
| 10391 | 10295 | ||
| @@ -10427,7 +10331,7 @@ init_coding_once () | |||
| 10427 | #ifdef emacs | 10331 | #ifdef emacs |
| 10428 | 10332 | ||
| 10429 | void | 10333 | void |
| 10430 | syms_of_coding () | 10334 | syms_of_coding (void) |
| 10431 | { | 10335 | { |
| 10432 | staticpro (&Vcoding_system_hash_table); | 10336 | staticpro (&Vcoding_system_hash_table); |
| 10433 | { | 10337 | { |
| @@ -10968,7 +10872,7 @@ character."); | |||
| 10968 | for (i = 0; i < coding_category_max; i++) | 10872 | for (i = 0; i < coding_category_max; i++) |
| 10969 | Fset (AREF (Vcoding_category_table, i), Qno_conversion); | 10873 | Fset (AREF (Vcoding_category_table, i), Qno_conversion); |
| 10970 | } | 10874 | } |
| 10971 | #if defined (MSDOS) || defined (WINDOWSNT) | 10875 | #if defined (DOS_NT) |
| 10972 | system_eol_type = Qdos; | 10876 | system_eol_type = Qdos; |
| 10973 | #else | 10877 | #else |
| 10974 | system_eol_type = Qunix; | 10878 | system_eol_type = Qunix; |
| @@ -10977,8 +10881,7 @@ character."); | |||
| 10977 | } | 10881 | } |
| 10978 | 10882 | ||
| 10979 | char * | 10883 | char * |
| 10980 | emacs_strerror (error_number) | 10884 | emacs_strerror (int error_number) |
| 10981 | int error_number; | ||
| 10982 | { | 10885 | { |
| 10983 | char *str; | 10886 | char *str; |
| 10984 | 10887 | ||