comparison src/file-coding.c @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 576fb035e263
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
64 } *fcd; 64 } *fcd;
65 65
66 static const struct lrecord_description fcd_description_1[] = { 66 static const struct lrecord_description fcd_description_1[] = {
67 { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, coding_category_system), CODING_CATEGORY_LAST + 1 }, 67 { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, coding_category_system), CODING_CATEGORY_LAST + 1 },
68 #ifdef MULE 68 #ifdef MULE
69 { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, ucs_to_mule_table), 65536 }, 69 { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, ucs_to_mule_table), countof (fcd->ucs_to_mule_table) },
70 #endif 70 #endif
71 { XD_END } 71 { XD_END }
72 }; 72 };
73 73
74 static const struct struct_description fcd_description = { 74 static const struct struct_description fcd_description = {
174 #endif /* MULE */ 174 #endif /* MULE */
175 EXFUN (Fcopy_coding_system, 2); 175 EXFUN (Fcopy_coding_system, 2);
176 #ifdef MULE 176 #ifdef MULE
177 struct detection_state; 177 struct detection_state;
178 static int detect_coding_sjis (struct detection_state *st, 178 static int detect_coding_sjis (struct detection_state *st,
179 CONST unsigned char *src, 179 const unsigned char *src,
180 unsigned int n); 180 unsigned int n);
181 static void decode_coding_sjis (Lstream *decoding, 181 static void decode_coding_sjis (Lstream *decoding,
182 CONST unsigned char *src, 182 const unsigned char *src,
183 unsigned_char_dynarr *dst, 183 unsigned_char_dynarr *dst,
184 unsigned int n); 184 unsigned int n);
185 static void encode_coding_sjis (Lstream *encoding, 185 static void encode_coding_sjis (Lstream *encoding,
186 CONST unsigned char *src, 186 const unsigned char *src,
187 unsigned_char_dynarr *dst, 187 unsigned_char_dynarr *dst,
188 unsigned int n); 188 unsigned int n);
189 static int detect_coding_big5 (struct detection_state *st, 189 static int detect_coding_big5 (struct detection_state *st,
190 CONST unsigned char *src, 190 const unsigned char *src,
191 unsigned int n); 191 unsigned int n);
192 static void decode_coding_big5 (Lstream *decoding, 192 static void decode_coding_big5 (Lstream *decoding,
193 CONST unsigned char *src, 193 const unsigned char *src,
194 unsigned_char_dynarr *dst, unsigned int n); 194 unsigned_char_dynarr *dst, unsigned int n);
195 static void encode_coding_big5 (Lstream *encoding, 195 static void encode_coding_big5 (Lstream *encoding,
196 CONST unsigned char *src, 196 const unsigned char *src,
197 unsigned_char_dynarr *dst, unsigned int n); 197 unsigned_char_dynarr *dst, unsigned int n);
198 static int detect_coding_ucs4 (struct detection_state *st, 198 static int detect_coding_ucs4 (struct detection_state *st,
199 CONST unsigned char *src, 199 const unsigned char *src,
200 unsigned int n); 200 unsigned int n);
201 static void decode_coding_ucs4 (Lstream *decoding, 201 static void decode_coding_ucs4 (Lstream *decoding,
202 CONST unsigned char *src, 202 const unsigned char *src,
203 unsigned_char_dynarr *dst, unsigned int n); 203 unsigned_char_dynarr *dst, unsigned int n);
204 static void encode_coding_ucs4 (Lstream *encoding, 204 static void encode_coding_ucs4 (Lstream *encoding,
205 CONST unsigned char *src, 205 const unsigned char *src,
206 unsigned_char_dynarr *dst, unsigned int n); 206 unsigned_char_dynarr *dst, unsigned int n);
207 static int detect_coding_utf8 (struct detection_state *st, 207 static int detect_coding_utf8 (struct detection_state *st,
208 CONST unsigned char *src, 208 const unsigned char *src,
209 unsigned int n); 209 unsigned int n);
210 static void decode_coding_utf8 (Lstream *decoding, 210 static void decode_coding_utf8 (Lstream *decoding,
211 CONST unsigned char *src, 211 const unsigned char *src,
212 unsigned_char_dynarr *dst, unsigned int n); 212 unsigned_char_dynarr *dst, unsigned int n);
213 static void encode_coding_utf8 (Lstream *encoding, 213 static void encode_coding_utf8 (Lstream *encoding,
214 CONST unsigned char *src, 214 const unsigned char *src,
215 unsigned_char_dynarr *dst, unsigned int n); 215 unsigned_char_dynarr *dst, unsigned int n);
216 static int postprocess_iso2022_mask (int mask); 216 static int postprocess_iso2022_mask (int mask);
217 static void reset_iso2022 (Lisp_Object coding_system, 217 static void reset_iso2022 (Lisp_Object coding_system,
218 struct iso2022_decoder *iso); 218 struct iso2022_decoder *iso);
219 static int detect_coding_iso2022 (struct detection_state *st, 219 static int detect_coding_iso2022 (struct detection_state *st,
220 CONST unsigned char *src, 220 const unsigned char *src,
221 unsigned int n); 221 unsigned int n);
222 static void decode_coding_iso2022 (Lstream *decoding, 222 static void decode_coding_iso2022 (Lstream *decoding,
223 CONST unsigned char *src, 223 const unsigned char *src,
224 unsigned_char_dynarr *dst, unsigned int n); 224 unsigned_char_dynarr *dst, unsigned int n);
225 static void encode_coding_iso2022 (Lstream *encoding, 225 static void encode_coding_iso2022 (Lstream *encoding,
226 CONST unsigned char *src, 226 const unsigned char *src,
227 unsigned_char_dynarr *dst, unsigned int n); 227 unsigned_char_dynarr *dst, unsigned int n);
228 #endif /* MULE */ 228 #endif /* MULE */
229 static void decode_coding_no_conversion (Lstream *decoding, 229 static void decode_coding_no_conversion (Lstream *decoding,
230 CONST unsigned char *src, 230 const unsigned char *src,
231 unsigned_char_dynarr *dst, 231 unsigned_char_dynarr *dst,
232 unsigned int n); 232 unsigned int n);
233 static void encode_coding_no_conversion (Lstream *encoding, 233 static void encode_coding_no_conversion (Lstream *encoding,
234 CONST unsigned char *src, 234 const unsigned char *src,
235 unsigned_char_dynarr *dst, 235 unsigned_char_dynarr *dst,
236 unsigned int n); 236 unsigned int n);
237 static void mule_decode (Lstream *decoding, CONST unsigned char *src, 237 static void mule_decode (Lstream *decoding, const unsigned char *src,
238 unsigned_char_dynarr *dst, unsigned int n); 238 unsigned_char_dynarr *dst, unsigned int n);
239 static void mule_encode (Lstream *encoding, CONST unsigned char *src, 239 static void mule_encode (Lstream *encoding, const unsigned char *src,
240 unsigned_char_dynarr *dst, unsigned int n); 240 unsigned_char_dynarr *dst, unsigned int n);
241 241
242 typedef struct codesys_prop codesys_prop; 242 typedef struct codesys_prop codesys_prop;
243 struct codesys_prop 243 struct codesys_prop
244 { 244 {
730 'iso2022 730 'iso2022
731 Any ISO2022-compliant encoding. Among other things, this includes 731 Any ISO2022-compliant encoding. Among other things, this includes
732 JIS (the Japanese encoding commonly used for e-mail), EUC (the 732 JIS (the Japanese encoding commonly used for e-mail), EUC (the
733 standard Unix encoding for Japanese and other languages), and 733 standard Unix encoding for Japanese and other languages), and
734 Compound Text (the encoding used in X11). You can specify more 734 Compound Text (the encoding used in X11). You can specify more
735 specific information about the conversion with the FLAGS argument. 735 specific information about the conversion with the PROPS argument.
736 'big5 736 'big5
737 Big5 (the encoding commonly used for Taiwanese). 737 Big5 (the encoding commonly used for Taiwanese).
738 'ccl 738 'ccl
739 The conversion is performed using a user-written pseudo-code 739 The conversion is performed using a user-written pseudo-code
740 program. CCL (Code Conversion Language) is the name of this 740 program. CCL (Code Conversion Language) is the name of this
880 CCL program used for encoding (converting to external format). 880 CCL program used for encoding (converting to external format).
881 */ 881 */
882 (name, type, doc_string, props)) 882 (name, type, doc_string, props))
883 { 883 {
884 Lisp_Coding_System *codesys; 884 Lisp_Coding_System *codesys;
885 Lisp_Object rest, key, value;
886 enum coding_system_type ty; 885 enum coding_system_type ty;
887 int need_to_setup_eol_systems = 1; 886 int need_to_setup_eol_systems = 1;
888 887
889 /* Convert type to constant */ 888 /* Convert type to constant */
890 if (NILP (type) || EQ (type, Qundecided)) 889 if (NILP (type) || EQ (type, Qundecided))
912 doc_string = build_string (""); 911 doc_string = build_string ("");
913 else 912 else
914 CHECK_STRING (doc_string); 913 CHECK_STRING (doc_string);
915 CODING_SYSTEM_DOC_STRING (codesys) = doc_string; 914 CODING_SYSTEM_DOC_STRING (codesys) = doc_string;
916 915
917 EXTERNAL_PROPERTY_LIST_LOOP (rest, key, value, props) 916 {
918 { 917 EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, props)
919 if (EQ (key, Qmnemonic)) 918 {
920 { 919 if (EQ (key, Qmnemonic))
921 if (!NILP (value)) 920 {
922 CHECK_STRING (value); 921 if (!NILP (value))
923 CODING_SYSTEM_MNEMONIC (codesys) = value; 922 CHECK_STRING (value);
924 } 923 CODING_SYSTEM_MNEMONIC (codesys) = value;
925 924 }
926 else if (EQ (key, Qeol_type)) 925
927 { 926 else if (EQ (key, Qeol_type))
928 need_to_setup_eol_systems = NILP (value); 927 {
929 if (EQ (value, Qt)) 928 need_to_setup_eol_systems = NILP (value);
930 value = Qnil; 929 if (EQ (value, Qt))
931 CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value); 930 value = Qnil;
932 } 931 CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value);
933 932 }
934 else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value; 933
935 else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value; 934 else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value;
935 else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value;
936 #ifdef MULE 936 #ifdef MULE
937 else if (ty == CODESYS_ISO2022) 937 else if (ty == CODESYS_ISO2022)
938 { 938 {
939 #define FROB_INITIAL_CHARSET(charset_num) \ 939 #define FROB_INITIAL_CHARSET(charset_num) \
940 CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, charset_num) = \ 940 CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, charset_num) = \
941 ((EQ (value, Qt) || EQ (value, Qnil)) ? value : Fget_charset (value)) 941 ((EQ (value, Qt) || EQ (value, Qnil)) ? value : Fget_charset (value))
942 942
943 if (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0); 943 if (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0);
944 else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1); 944 else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1);
945 else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2); 945 else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2);
946 else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3); 946 else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3);
947 947
948 #define FROB_FORCE_CHARSET(charset_num) \ 948 #define FROB_FORCE_CHARSET(charset_num) \
949 CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (codesys, charset_num) = !NILP (value) 949 CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (codesys, charset_num) = !NILP (value)
950 950
951 else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0); 951 else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0);
952 else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1); 952 else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1);
953 else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2); 953 else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2);
954 else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3); 954 else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3);
955 955
956 #define FROB_BOOLEAN_PROPERTY(prop) \ 956 #define FROB_BOOLEAN_PROPERTY(prop) \
957 CODING_SYSTEM_ISO2022_##prop (codesys) = !NILP (value) 957 CODING_SYSTEM_ISO2022_##prop (codesys) = !NILP (value)
958 958
959 else if (EQ (key, Qshort)) FROB_BOOLEAN_PROPERTY (SHORT); 959 else if (EQ (key, Qshort)) FROB_BOOLEAN_PROPERTY (SHORT);
960 else if (EQ (key, Qno_ascii_eol)) FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL); 960 else if (EQ (key, Qno_ascii_eol)) FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL);
961 else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL); 961 else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL);
962 else if (EQ (key, Qseven)) FROB_BOOLEAN_PROPERTY (SEVEN); 962 else if (EQ (key, Qseven)) FROB_BOOLEAN_PROPERTY (SEVEN);
963 else if (EQ (key, Qlock_shift)) FROB_BOOLEAN_PROPERTY (LOCK_SHIFT); 963 else if (EQ (key, Qlock_shift)) FROB_BOOLEAN_PROPERTY (LOCK_SHIFT);
964 else if (EQ (key, Qno_iso6429)) FROB_BOOLEAN_PROPERTY (NO_ISO6429); 964 else if (EQ (key, Qno_iso6429)) FROB_BOOLEAN_PROPERTY (NO_ISO6429);
965 else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED); 965 else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED);
966 966
967 else if (EQ (key, Qinput_charset_conversion)) 967 else if (EQ (key, Qinput_charset_conversion))
968 { 968 {
969 codesys->iso2022.input_conv = 969 codesys->iso2022.input_conv =
970 Dynarr_new (charset_conversion_spec); 970 Dynarr_new (charset_conversion_spec);
971 parse_charset_conversion_specs (codesys->iso2022.input_conv, 971 parse_charset_conversion_specs (codesys->iso2022.input_conv,
972 value); 972 value);
973 } 973 }
974 else if (EQ (key, Qoutput_charset_conversion)) 974 else if (EQ (key, Qoutput_charset_conversion))
975 { 975 {
976 codesys->iso2022.output_conv = 976 codesys->iso2022.output_conv =
977 Dynarr_new (charset_conversion_spec); 977 Dynarr_new (charset_conversion_spec);
978 parse_charset_conversion_specs (codesys->iso2022.output_conv, 978 parse_charset_conversion_specs (codesys->iso2022.output_conv,
979 value); 979 value);
980 } 980 }
981 else 981 else
982 signal_simple_error ("Unrecognized property", key); 982 signal_simple_error ("Unrecognized property", key);
983 } 983 }
984 else if (EQ (type, Qccl)) 984 else if (EQ (type, Qccl))
985 { 985 {
986 if (EQ (key, Qdecode)) 986 if (EQ (key, Qdecode))
987 { 987 {
988 CHECK_VECTOR (value); 988 CHECK_VECTOR (value);
989 CODING_SYSTEM_CCL_DECODE (codesys) = value; 989 CODING_SYSTEM_CCL_DECODE (codesys) = value;
990 } 990 }
991 else if (EQ (key, Qencode)) 991 else if (EQ (key, Qencode))
992 { 992 {
993 CHECK_VECTOR (value); 993 CHECK_VECTOR (value);
994 CODING_SYSTEM_CCL_ENCODE (codesys) = value; 994 CODING_SYSTEM_CCL_ENCODE (codesys) = value;
995 } 995 }
996 else 996 else
997 signal_simple_error ("Unrecognized property", key); 997 signal_simple_error ("Unrecognized property", key);
998 } 998 }
999 #endif /* MULE */ 999 #endif /* MULE */
1000 else 1000 else
1001 signal_simple_error ("Unrecognized property", key); 1001 signal_simple_error ("Unrecognized property", key);
1002 } 1002 }
1003 }
1003 1004
1004 if (need_to_setup_eol_systems) 1005 if (need_to_setup_eol_systems)
1005 setup_eol_coding_systems (codesys); 1006 setup_eol_coding_systems (codesys);
1006 1007
1007 { 1008 {
1069 Lisp_Object aliasee = Fgethash (alias, Vcoding_system_hash_table, Qnil); 1070 Lisp_Object aliasee = Fgethash (alias, Vcoding_system_hash_table, Qnil);
1070 if (SYMBOLP (aliasee)) 1071 if (SYMBOLP (aliasee))
1071 return aliasee; 1072 return aliasee;
1072 else 1073 else
1073 signal_simple_error ("Symbol is not a coding system alias", alias); 1074 signal_simple_error ("Symbol is not a coding system alias", alias);
1075 return Qnil; /* To keep the compiler happy */
1074 } 1076 }
1075 1077
1076 static Lisp_Object 1078 static Lisp_Object
1077 append_suffix_to_symbol (Lisp_Object symbol, const char *ascii_string) 1079 append_suffix_to_symbol (Lisp_Object symbol, const char *ascii_string)
1078 { 1080 {
1215 { 1217 {
1216 case EOL_AUTODETECT: return coding_system; 1218 case EOL_AUTODETECT: return coding_system;
1217 case EOL_LF: new_coding_system = CODING_SYSTEM_EOL_LF (cs); break; 1219 case EOL_LF: new_coding_system = CODING_SYSTEM_EOL_LF (cs); break;
1218 case EOL_CR: new_coding_system = CODING_SYSTEM_EOL_CR (cs); break; 1220 case EOL_CR: new_coding_system = CODING_SYSTEM_EOL_CR (cs); break;
1219 case EOL_CRLF: new_coding_system = CODING_SYSTEM_EOL_CRLF (cs); break; 1221 case EOL_CRLF: new_coding_system = CODING_SYSTEM_EOL_CRLF (cs); break;
1220 default: abort (); 1222 default: abort (); return Qnil;
1221 } 1223 }
1222 1224
1223 return NILP (new_coding_system) ? coding_system : new_coding_system; 1225 return NILP (new_coding_system) ? coding_system : new_coding_system;
1224 } 1226 }
1225 1227
1624 technical interviews */ 1626 technical interviews */
1625 return (mask & (mask - 1)) == 0; 1627 return (mask & (mask - 1)) == 0;
1626 } 1628 }
1627 1629
1628 static eol_type_t 1630 static eol_type_t
1629 detect_eol_type (struct detection_state *st, CONST unsigned char *src, 1631 detect_eol_type (struct detection_state *st, const unsigned char *src,
1630 unsigned int n) 1632 unsigned int n)
1631 { 1633 {
1632 int c; 1634 int c;
1633 1635
1634 while (n--) 1636 while (n--)
1669 is present in st->mask 1671 is present in st->mask
1670 1 == definitive answers are here for both st->eol_type and st->mask 1672 1 == definitive answers are here for both st->eol_type and st->mask
1671 */ 1673 */
1672 1674
1673 static int 1675 static int
1674 detect_coding_type (struct detection_state *st, CONST Extbyte *src, 1676 detect_coding_type (struct detection_state *st, const Extbyte *src,
1675 unsigned int n, int just_do_eol) 1677 unsigned int n, int just_do_eol)
1676 { 1678 {
1677 int c; 1679 int c;
1678 1680
1679 if (st->eol_type == EOL_AUTODETECT) 1681 if (st->eol_type == EOL_AUTODETECT)
2107 }; 2109 };
2108 2110
2109 static ssize_t decoding_reader (Lstream *stream, 2111 static ssize_t decoding_reader (Lstream *stream,
2110 unsigned char *data, size_t size); 2112 unsigned char *data, size_t size);
2111 static ssize_t decoding_writer (Lstream *stream, 2113 static ssize_t decoding_writer (Lstream *stream,
2112 CONST unsigned char *data, size_t size); 2114 const unsigned char *data, size_t size);
2113 static int decoding_rewinder (Lstream *stream); 2115 static int decoding_rewinder (Lstream *stream);
2114 static int decoding_seekable_p (Lstream *stream); 2116 static int decoding_seekable_p (Lstream *stream);
2115 static int decoding_flusher (Lstream *stream); 2117 static int decoding_flusher (Lstream *stream);
2116 static int decoding_closer (Lstream *stream); 2118 static int decoding_closer (Lstream *stream);
2117 2119
2202 else 2204 else
2203 return data - orig_data; 2205 return data - orig_data;
2204 } 2206 }
2205 2207
2206 static ssize_t 2208 static ssize_t
2207 decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) 2209 decoding_writer (Lstream *stream, const unsigned char *data, size_t size)
2208 { 2210 {
2209 struct decoding_stream *str = DECODING_STREAM_DATA (stream); 2211 struct decoding_stream *str = DECODING_STREAM_DATA (stream);
2210 ssize_t retval; 2212 ssize_t retval;
2211 2213
2212 /* Decode all our data into the runoff, and then attempt to write 2214 /* Decode all our data into the runoff, and then attempt to write
2237 { 2239 {
2238 setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_DECODE (str->codesys)); 2240 setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_DECODE (str->codesys));
2239 } 2241 }
2240 str->counter = 0; 2242 str->counter = 0;
2241 #endif /* MULE */ 2243 #endif /* MULE */
2244 if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT
2245 || CODING_SYSTEM_EOL_TYPE (str->codesys) == EOL_AUTODETECT)
2246 {
2247 xzero (str->decst);
2248 str->decst.eol_type = EOL_AUTODETECT;
2249 str->decst.mask = ~0;
2250 }
2242 str->flags = str->ch = 0; 2251 str->flags = str->ch = 0;
2243 } 2252 }
2244 2253
2245 static int 2254 static int
2246 decoding_rewinder (Lstream *stream) 2255 decoding_rewinder (Lstream *stream)
2312 stream for reading using a non-fully-specified coding system and 2321 stream for reading using a non-fully-specified coding system and
2313 a non-seekable input stream. */ 2322 a non-seekable input stream. */
2314 2323
2315 static Lisp_Object 2324 static Lisp_Object
2316 make_decoding_stream_1 (Lstream *stream, Lisp_Object codesys, 2325 make_decoding_stream_1 (Lstream *stream, Lisp_Object codesys,
2317 CONST char *mode) 2326 const char *mode)
2318 { 2327 {
2319 Lstream *lstr = Lstream_new (lstream_decoding, mode); 2328 Lstream *lstr = Lstream_new (lstream_decoding, mode);
2320 struct decoding_stream *str = DECODING_STREAM_DATA (lstr); 2329 struct decoding_stream *str = DECODING_STREAM_DATA (lstr);
2321 Lisp_Object obj; 2330 Lisp_Object obj;
2322 2331
2355 written to that stream; that is handled in decoding_reader() 2364 written to that stream; that is handled in decoding_reader()
2356 or decoding_writer(). This allows the same functions to 2365 or decoding_writer(). This allows the same functions to
2357 be used for both reading and writing. */ 2366 be used for both reading and writing. */
2358 2367
2359 static void 2368 static void
2360 mule_decode (Lstream *decoding, CONST unsigned char *src, 2369 mule_decode (Lstream *decoding, const unsigned char *src,
2361 unsigned_char_dynarr *dst, unsigned int n) 2370 unsigned_char_dynarr *dst, unsigned int n)
2362 { 2371 {
2363 struct decoding_stream *str = DECODING_STREAM_DATA (decoding); 2372 struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
2364 2373
2365 /* If necessary, do encoding-detection now. We do this when 2374 /* If necessary, do encoding-detection now. We do this when
2561 struct ccl_program ccl; 2570 struct ccl_program ccl;
2562 #endif /* MULE */ 2571 #endif /* MULE */
2563 }; 2572 };
2564 2573
2565 static ssize_t encoding_reader (Lstream *stream, unsigned char *data, size_t size); 2574 static ssize_t encoding_reader (Lstream *stream, unsigned char *data, size_t size);
2566 static ssize_t encoding_writer (Lstream *stream, CONST unsigned char *data, 2575 static ssize_t encoding_writer (Lstream *stream, const unsigned char *data,
2567 size_t size); 2576 size_t size);
2568 static int encoding_rewinder (Lstream *stream); 2577 static int encoding_rewinder (Lstream *stream);
2569 static int encoding_seekable_p (Lstream *stream); 2578 static int encoding_seekable_p (Lstream *stream);
2570 static int encoding_flusher (Lstream *stream); 2579 static int encoding_flusher (Lstream *stream);
2571 static int encoding_closer (Lstream *stream); 2580 static int encoding_closer (Lstream *stream);
2657 else 2666 else
2658 return data - orig_data; 2667 return data - orig_data;
2659 } 2668 }
2660 2669
2661 static ssize_t 2670 static ssize_t
2662 encoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) 2671 encoding_writer (Lstream *stream, const unsigned char *data, size_t size)
2663 { 2672 {
2664 struct encoding_stream *str = ENCODING_STREAM_DATA (stream); 2673 struct encoding_stream *str = ENCODING_STREAM_DATA (stream);
2665 ssize_t retval; 2674 ssize_t retval;
2666 2675
2667 /* Encode all our data into the runoff, and then attempt to write 2676 /* Encode all our data into the runoff, and then attempt to write
2768 reset_encoding_stream (str); 2777 reset_encoding_stream (str);
2769 } 2778 }
2770 2779
2771 static Lisp_Object 2780 static Lisp_Object
2772 make_encoding_stream_1 (Lstream *stream, Lisp_Object codesys, 2781 make_encoding_stream_1 (Lstream *stream, Lisp_Object codesys,
2773 CONST char *mode) 2782 const char *mode)
2774 { 2783 {
2775 Lstream *lstr = Lstream_new (lstream_encoding, mode); 2784 Lstream *lstr = Lstream_new (lstream_encoding, mode);
2776 struct encoding_stream *str = ENCODING_STREAM_DATA (lstr); 2785 struct encoding_stream *str = ENCODING_STREAM_DATA (lstr);
2777 Lisp_Object obj; 2786 Lisp_Object obj;
2778 2787
2799 /* Convert N bytes of internally-formatted data stored in SRC to an 2808 /* Convert N bytes of internally-formatted data stored in SRC to an
2800 external format, according to the encoding stream ENCODING. 2809 external format, according to the encoding stream ENCODING.
2801 Store the encoded data into DST. */ 2810 Store the encoded data into DST. */
2802 2811
2803 static void 2812 static void
2804 mule_encode (Lstream *encoding, CONST unsigned char *src, 2813 mule_encode (Lstream *encoding, const unsigned char *src,
2805 unsigned_char_dynarr *dst, unsigned int n) 2814 unsigned_char_dynarr *dst, unsigned int n)
2806 { 2815 {
2807 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); 2816 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
2808 2817
2809 switch (CODING_SYSTEM_TYPE (str->codesys)) 2818 switch (CODING_SYSTEM_TYPE (str->codesys))
2946 2955
2947 #define BYTE_SJIS_KATAKANA_P(c) \ 2956 #define BYTE_SJIS_KATAKANA_P(c) \
2948 ((c) >= 0xA1 && (c) <= 0xDF) 2957 ((c) >= 0xA1 && (c) <= 0xDF)
2949 2958
2950 static int 2959 static int
2951 detect_coding_sjis (struct detection_state *st, CONST unsigned char *src, 2960 detect_coding_sjis (struct detection_state *st, const unsigned char *src,
2952 unsigned int n) 2961 unsigned int n)
2953 { 2962 {
2954 int c; 2963 int c;
2955 2964
2956 while (n--) 2965 while (n--)
2971 } 2980 }
2972 2981
2973 /* Convert Shift-JIS data to internal format. */ 2982 /* Convert Shift-JIS data to internal format. */
2974 2983
2975 static void 2984 static void
2976 decode_coding_sjis (Lstream *decoding, CONST unsigned char *src, 2985 decode_coding_sjis (Lstream *decoding, const unsigned char *src,
2977 unsigned_char_dynarr *dst, unsigned int n) 2986 unsigned_char_dynarr *dst, unsigned int n)
2978 { 2987 {
2979 unsigned char c; 2988 unsigned char c;
2980 struct decoding_stream *str = DECODING_STREAM_DATA (decoding); 2989 struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
2981 unsigned int flags = str->flags; 2990 unsigned int flags = str->flags;
3028 } 3037 }
3029 3038
3030 /* Convert internally-formatted data to Shift-JIS. */ 3039 /* Convert internally-formatted data to Shift-JIS. */
3031 3040
3032 static void 3041 static void
3033 encode_coding_sjis (Lstream *encoding, CONST unsigned char *src, 3042 encode_coding_sjis (Lstream *encoding, const unsigned char *src,
3034 unsigned_char_dynarr *dst, unsigned int n) 3043 unsigned_char_dynarr *dst, unsigned int n)
3035 { 3044 {
3036 unsigned char c; 3045 unsigned char c;
3037 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); 3046 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
3038 unsigned int flags = str->flags; 3047 unsigned int flags = str->flags;
3232 b2 = I % BIG5_SAME_ROW; \ 3241 b2 = I % BIG5_SAME_ROW; \
3233 b2 += b2 < 0x3F ? 0x40 : 0x62; \ 3242 b2 += b2 < 0x3F ? 0x40 : 0x62; \
3234 } while (0) 3243 } while (0)
3235 3244
3236 static int 3245 static int
3237 detect_coding_big5 (struct detection_state *st, CONST unsigned char *src, 3246 detect_coding_big5 (struct detection_state *st, const unsigned char *src,
3238 unsigned int n) 3247 unsigned int n)
3239 { 3248 {
3240 int c; 3249 int c;
3241 3250
3242 while (n--) 3251 while (n--)
3258 } 3267 }
3259 3268
3260 /* Convert Big5 data to internal format. */ 3269 /* Convert Big5 data to internal format. */
3261 3270
3262 static void 3271 static void
3263 decode_coding_big5 (Lstream *decoding, CONST unsigned char *src, 3272 decode_coding_big5 (Lstream *decoding, const unsigned char *src,
3264 unsigned_char_dynarr *dst, unsigned int n) 3273 unsigned_char_dynarr *dst, unsigned int n)
3265 { 3274 {
3266 unsigned char c; 3275 unsigned char c;
3267 struct decoding_stream *str = DECODING_STREAM_DATA (decoding); 3276 struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
3268 unsigned int flags = str->flags; 3277 unsigned int flags = str->flags;
3308 } 3317 }
3309 3318
3310 /* Convert internally-formatted data to Big5. */ 3319 /* Convert internally-formatted data to Big5. */
3311 3320
3312 static void 3321 static void
3313 encode_coding_big5 (Lstream *encoding, CONST unsigned char *src, 3322 encode_coding_big5 (Lstream *encoding, const unsigned char *src,
3314 unsigned_char_dynarr *dst, unsigned int n) 3323 unsigned_char_dynarr *dst, unsigned int n)
3315 { 3324 {
3316 unsigned char c; 3325 unsigned char c;
3317 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); 3326 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
3318 unsigned int flags = str->flags; 3327 unsigned int flags = str->flags;
3433 3442
3434 Return T on success, NIL on failure. 3443 Return T on success, NIL on failure.
3435 */ 3444 */
3436 (code, character)) 3445 (code, character))
3437 { 3446 {
3438 unsigned int c; 3447 size_t c;
3439 3448
3440 CHECK_CHAR (character); 3449 CHECK_CHAR (character);
3441 CHECK_INT (code); 3450 CHECK_NATNUM (code);
3442 c = XINT (code); 3451 c = XINT (code);
3443 3452
3444 if (c < sizeof (fcd->ucs_to_mule_table)) 3453 if (c < countof (fcd->ucs_to_mule_table))
3445 { 3454 {
3446 fcd->ucs_to_mule_table[c] = character; 3455 fcd->ucs_to_mule_table[c] = character;
3447 return Qt; 3456 return Qt;
3448 } 3457 }
3449 else 3458 else
3451 } 3460 }
3452 3461
3453 static Lisp_Object 3462 static Lisp_Object
3454 ucs_to_char (unsigned long code) 3463 ucs_to_char (unsigned long code)
3455 { 3464 {
3456 if (code < sizeof (fcd->ucs_to_mule_table)) 3465 if (code < countof (fcd->ucs_to_mule_table))
3457 { 3466 {
3458 return fcd->ucs_to_mule_table[code]; 3467 return fcd->ucs_to_mule_table[code];
3459 } 3468 }
3460 else if ((0xe00000 <= code) && (code <= 0xe00000 + 94 * 94 * 14)) 3469 else if ((0xe00000 <= code) && (code <= 0xe00000 + 94 * 94 * 14))
3461 { 3470 {
3575 Dynarr_add (dst, (code >> 8) & 255); 3584 Dynarr_add (dst, (code >> 8) & 255);
3576 Dynarr_add (dst, code & 255); 3585 Dynarr_add (dst, code & 255);
3577 } 3586 }
3578 3587
3579 static int 3588 static int
3580 detect_coding_ucs4 (struct detection_state *st, CONST unsigned char *src, 3589 detect_coding_ucs4 (struct detection_state *st, const unsigned char *src,
3581 unsigned int n) 3590 unsigned int n)
3582 { 3591 {
3583 while (n--) 3592 while (n--)
3584 { 3593 {
3585 int c = *src++; 3594 int c = *src++;
3600 } 3609 }
3601 return CODING_CATEGORY_UCS4_MASK; 3610 return CODING_CATEGORY_UCS4_MASK;
3602 } 3611 }
3603 3612
3604 static void 3613 static void
3605 decode_coding_ucs4 (Lstream *decoding, CONST unsigned char *src, 3614 decode_coding_ucs4 (Lstream *decoding, const unsigned char *src,
3606 unsigned_char_dynarr *dst, unsigned int n) 3615 unsigned_char_dynarr *dst, unsigned int n)
3607 { 3616 {
3608 struct decoding_stream *str = DECODING_STREAM_DATA (decoding); 3617 struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
3609 unsigned int flags = str->flags; 3618 unsigned int flags = str->flags;
3610 unsigned int ch = str->ch; 3619 unsigned int ch = str->ch;
3636 str->ch = ch; 3645 str->ch = ch;
3637 str->counter = counter; 3646 str->counter = counter;
3638 } 3647 }
3639 3648
3640 static void 3649 static void
3641 encode_coding_ucs4 (Lstream *encoding, CONST unsigned char *src, 3650 encode_coding_ucs4 (Lstream *encoding, const unsigned char *src,
3642 unsigned_char_dynarr *dst, unsigned int n) 3651 unsigned_char_dynarr *dst, unsigned int n)
3643 { 3652 {
3644 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); 3653 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
3645 unsigned int flags = str->flags; 3654 unsigned int flags = str->flags;
3646 unsigned int ch = str->ch; 3655 unsigned int ch = str->ch;
3649 3658
3650 #ifdef ENABLE_COMPOSITE_CHARS 3659 #ifdef ENABLE_COMPOSITE_CHARS
3651 /* flags for handling composite chars. We do a little switcharoo 3660 /* flags for handling composite chars. We do a little switcharoo
3652 on the source while we're outputting the composite char. */ 3661 on the source while we're outputting the composite char. */
3653 unsigned int saved_n = 0; 3662 unsigned int saved_n = 0;
3654 CONST unsigned char *saved_src = NULL; 3663 const unsigned char *saved_src = NULL;
3655 int in_composite = 0; 3664 int in_composite = 0;
3656 3665
3657 back_to_square_n: 3666 back_to_square_n:
3658 #endif 3667 #endif
3659 3668
3775 /************************************************************************/ 3784 /************************************************************************/
3776 /* UTF-8 methods */ 3785 /* UTF-8 methods */
3777 /************************************************************************/ 3786 /************************************************************************/
3778 3787
3779 static int 3788 static int
3780 detect_coding_utf8 (struct detection_state *st, CONST unsigned char *src, 3789 detect_coding_utf8 (struct detection_state *st, const unsigned char *src,
3781 unsigned int n) 3790 unsigned int n)
3782 { 3791 {
3783 while (n--) 3792 while (n--)
3784 { 3793 {
3785 unsigned char c = *src++; 3794 unsigned char c = *src++;
3810 } 3819 }
3811 return CODING_CATEGORY_UTF8_MASK; 3820 return CODING_CATEGORY_UTF8_MASK;
3812 } 3821 }
3813 3822
3814 static void 3823 static void
3815 decode_coding_utf8 (Lstream *decoding, CONST unsigned char *src, 3824 decode_coding_utf8 (Lstream *decoding, const unsigned char *src,
3816 unsigned_char_dynarr *dst, unsigned int n) 3825 unsigned_char_dynarr *dst, unsigned int n)
3817 { 3826 {
3818 struct decoding_stream *str = DECODING_STREAM_DATA (decoding); 3827 struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
3819 unsigned int flags = str->flags; 3828 unsigned int flags = str->flags;
3820 unsigned int ch = str->ch; 3829 unsigned int ch = str->ch;
3924 Dynarr_add (dst, (code & 0x3f) | 0x80); 3933 Dynarr_add (dst, (code & 0x3f) | 0x80);
3925 } 3934 }
3926 } 3935 }
3927 3936
3928 static void 3937 static void
3929 encode_coding_utf8 (Lstream *encoding, CONST unsigned char *src, 3938 encode_coding_utf8 (Lstream *encoding, const unsigned char *src,
3930 unsigned_char_dynarr *dst, unsigned int n) 3939 unsigned_char_dynarr *dst, unsigned int n)
3931 { 3940 {
3932 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); 3941 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
3933 unsigned int flags = str->flags; 3942 unsigned int flags = str->flags;
3934 unsigned int ch = str->ch; 3943 unsigned int ch = str->ch;
3938 3947
3939 #ifdef ENABLE_COMPOSITE_CHARS 3948 #ifdef ENABLE_COMPOSITE_CHARS
3940 /* flags for handling composite chars. We do a little switcharoo 3949 /* flags for handling composite chars. We do a little switcharoo
3941 on the source while we're outputting the composite char. */ 3950 on the source while we're outputting the composite char. */
3942 unsigned int saved_n = 0; 3951 unsigned int saved_n = 0;
3943 CONST unsigned char *saved_src = NULL; 3952 const unsigned char *saved_src = NULL;
3944 int in_composite = 0; 3953 int in_composite = 0;
3945 3954
3946 back_to_square_n: 3955 back_to_square_n:
3947 #endif /* ENABLE_COMPOSITE_CHARS */ 3956 #endif /* ENABLE_COMPOSITE_CHARS */
3948 3957
4547 } 4556 }
4548 else 4557 else
4549 { 4558 {
4550 /* Can this ever be reached? -slb */ 4559 /* Can this ever be reached? -slb */
4551 abort(); 4560 abort();
4561 return 0;
4552 } 4562 }
4553 4563
4554 cs = CHARSET_BY_ATTRIBUTES (type, c, 4564 cs = CHARSET_BY_ATTRIBUTES (type, c,
4555 *flags & CODING_STATE_R2L ? 4565 *flags & CODING_STATE_R2L ?
4556 CHARSET_RIGHT_TO_LEFT : 4566 CHARSET_RIGHT_TO_LEFT :
4642 iso->switched_dir_and_no_valid_charset_yet = 0; 4652 iso->switched_dir_and_no_valid_charset_yet = 0;
4643 return 1; 4653 return 1;
4644 } 4654 }
4645 4655
4646 static int 4656 static int
4647 detect_coding_iso2022 (struct detection_state *st, CONST unsigned char *src, 4657 detect_coding_iso2022 (struct detection_state *st, const unsigned char *src,
4648 unsigned int n) 4658 unsigned int n)
4649 { 4659 {
4650 int mask; 4660 int mask;
4651 4661
4652 /* #### There are serious deficiencies in the recognition mechanism 4662 /* #### There are serious deficiencies in the recognition mechanism
4833 } 4843 }
4834 4844
4835 /* Convert ISO2022-format data to internal format. */ 4845 /* Convert ISO2022-format data to internal format. */
4836 4846
4837 static void 4847 static void
4838 decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src, 4848 decode_coding_iso2022 (Lstream *decoding, const unsigned char *src,
4839 unsigned_char_dynarr *dst, unsigned int n) 4849 unsigned_char_dynarr *dst, unsigned int n)
4840 { 4850 {
4841 struct decoding_stream *str = DECODING_STREAM_DATA (decoding); 4851 struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
4842 unsigned int flags = str->flags; 4852 unsigned int flags = str->flags;
4843 unsigned int ch = str->ch; 4853 unsigned int ch = str->ch;
5074 5084
5075 static void 5085 static void
5076 iso2022_designate (Lisp_Object charset, unsigned char reg, 5086 iso2022_designate (Lisp_Object charset, unsigned char reg,
5077 struct encoding_stream *str, unsigned_char_dynarr *dst) 5087 struct encoding_stream *str, unsigned_char_dynarr *dst)
5078 { 5088 {
5079 static CONST char inter94[] = "()*+"; 5089 static const char inter94[] = "()*+";
5080 static CONST char inter96[] = ",-./"; 5090 static const char inter96[] = ",-./";
5081 unsigned int type; 5091 unsigned int type;
5082 unsigned char final; 5092 unsigned char final;
5083 Lisp_Object old_charset = str->iso2022.charset[reg]; 5093 Lisp_Object old_charset = str->iso2022.charset[reg];
5084 5094
5085 str->iso2022.charset[reg] = charset; 5095 str->iso2022.charset[reg] = charset;
5159 } 5169 }
5160 5170
5161 /* Convert internally-formatted data to ISO2022 format. */ 5171 /* Convert internally-formatted data to ISO2022 format. */
5162 5172
5163 static void 5173 static void
5164 encode_coding_iso2022 (Lstream *encoding, CONST unsigned char *src, 5174 encode_coding_iso2022 (Lstream *encoding, const unsigned char *src,
5165 unsigned_char_dynarr *dst, unsigned int n) 5175 unsigned_char_dynarr *dst, unsigned int n)
5166 { 5176 {
5167 unsigned char charmask, c; 5177 unsigned char charmask, c;
5168 unsigned char char_boundary; 5178 unsigned char char_boundary;
5169 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); 5179 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
5177 5187
5178 #ifdef ENABLE_COMPOSITE_CHARS 5188 #ifdef ENABLE_COMPOSITE_CHARS
5179 /* flags for handling composite chars. We do a little switcharoo 5189 /* flags for handling composite chars. We do a little switcharoo
5180 on the source while we're outputting the composite char. */ 5190 on the source while we're outputting the composite char. */
5181 unsigned int saved_n = 0; 5191 unsigned int saved_n = 0;
5182 CONST unsigned char *saved_src = NULL; 5192 const unsigned char *saved_src = NULL;
5183 int in_composite = 0; 5193 int in_composite = 0;
5184 #endif /* ENABLE_COMPOSITE_CHARS */ 5194 #endif /* ENABLE_COMPOSITE_CHARS */
5185 5195
5186 char_boundary = str->iso2022.current_char_boundary; 5196 char_boundary = str->iso2022.current_char_boundary;
5187 charset = str->iso2022.current_charset; 5197 charset = str->iso2022.current_charset;
5468 5478
5469 /* This is used when reading in "binary" files -- i.e. files that may 5479 /* This is used when reading in "binary" files -- i.e. files that may
5470 contain all 256 possible byte values and that are not to be 5480 contain all 256 possible byte values and that are not to be
5471 interpreted as being in any particular decoding. */ 5481 interpreted as being in any particular decoding. */
5472 static void 5482 static void
5473 decode_coding_no_conversion (Lstream *decoding, CONST unsigned char *src, 5483 decode_coding_no_conversion (Lstream *decoding, const unsigned char *src,
5474 unsigned_char_dynarr *dst, unsigned int n) 5484 unsigned_char_dynarr *dst, unsigned int n)
5475 { 5485 {
5476 unsigned char c; 5486 unsigned char c;
5477 struct decoding_stream *str = DECODING_STREAM_DATA (decoding); 5487 struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
5478 unsigned int flags = str->flags; 5488 unsigned int flags = str->flags;
5493 str->flags = flags; 5503 str->flags = flags;
5494 str->ch = ch; 5504 str->ch = ch;
5495 } 5505 }
5496 5506
5497 static void 5507 static void
5498 encode_coding_no_conversion (Lstream *encoding, CONST unsigned char *src, 5508 encode_coding_no_conversion (Lstream *encoding, const unsigned char *src,
5499 unsigned_char_dynarr *dst, unsigned int n) 5509 unsigned_char_dynarr *dst, unsigned int n)
5500 { 5510 {
5501 unsigned char c; 5511 unsigned char c;
5502 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); 5512 struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
5503 unsigned int flags = str->flags; 5513 unsigned int flags = str->flags;
5555 /************************************************************************/ 5565 /************************************************************************/
5556 5566
5557 void 5567 void
5558 syms_of_file_coding (void) 5568 syms_of_file_coding (void)
5559 { 5569 {
5560 deferror (&Qcoding_system_error, "coding-system-error", 5570 INIT_LRECORD_IMPLEMENTATION (coding_system);
5561 "Coding-system error", Qio_error); 5571
5572 DEFERROR_STANDARD (Qcoding_system_error, Qio_error);
5562 5573
5563 DEFSUBR (Fcoding_system_p); 5574 DEFSUBR (Fcoding_system_p);
5564 DEFSUBR (Ffind_coding_system); 5575 DEFSUBR (Ffind_coding_system);
5565 DEFSUBR (Fget_coding_system); 5576 DEFSUBR (Fget_coding_system);
5566 DEFSUBR (Fcoding_system_list); 5577 DEFSUBR (Fcoding_system_list);
5823 fcd->coding_category_system[CODING_CATEGORY_NO_CONVERSION] = 5834 fcd->coding_category_system[CODING_CATEGORY_NO_CONVERSION] =
5824 Fget_coding_system (Qraw_text); 5835 Fget_coding_system (Qraw_text);
5825 5836
5826 #ifdef MULE 5837 #ifdef MULE
5827 { 5838 {
5828 unsigned int i; 5839 size_t i;
5829 5840
5830 for (i = 0; i < 65536; i++) 5841 for (i = 0; i < countof (fcd->ucs_to_mule_table); i++)
5831 fcd->ucs_to_mule_table[i] = Qnil; 5842 fcd->ucs_to_mule_table[i] = Qnil;
5832 } 5843 }
5833 staticpro (&mule_to_ucs_table); 5844 staticpro (&mule_to_ucs_table);
5834 mule_to_ucs_table = Fmake_char_table(Qgeneric); 5845 mule_to_ucs_table = Fmake_char_table(Qgeneric);
5835 #endif /* MULE */ 5846 #endif /* MULE */