Mercurial > emacs
comparison src/charset.c @ 21514:fa9ff387d260
Fix -Wimplicit warnings.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Tue, 14 Apr 1998 12:25:56 +0000 |
parents | 4c0b4a1025cd |
children | 9b26f9300d41 |
comparison
equal
deleted
inserted
replaced
21513:984881b316fc | 21514:fa9ff387d260 |
---|---|
171 character is set to the address ACTUAL_LEN. | 171 character is set to the address ACTUAL_LEN. |
172 | 172 |
173 Use macro `STRING_CHAR (STR, LEN)' instead of calling this function | 173 Use macro `STRING_CHAR (STR, LEN)' instead of calling this function |
174 directly if STR can hold an ASCII character. */ | 174 directly if STR can hold an ASCII character. */ |
175 | 175 |
176 int | |
176 string_to_non_ascii_char (str, len, actual_len) | 177 string_to_non_ascii_char (str, len, actual_len) |
177 const unsigned char *str; | 178 const unsigned char *str; |
178 int len, *actual_len; | 179 int len, *actual_len; |
179 { | 180 { |
180 int charset; | 181 int charset; |
235 a character. If valid, charset and position codes of the character | 236 a character. If valid, charset and position codes of the character |
236 is set at *CHARSET, *C1, and *C2, and return 0. If not valid, | 237 is set at *CHARSET, *C1, and *C2, and return 0. If not valid, |
237 return -1. This should be used only in the macro SPLIT_STRING | 238 return -1. This should be used only in the macro SPLIT_STRING |
238 which checks range of STR in advance. */ | 239 which checks range of STR in advance. */ |
239 | 240 |
241 int | |
240 split_non_ascii_string (str, len, charset, c1, c2) | 242 split_non_ascii_string (str, len, charset, c1, c2) |
241 register const unsigned char *str; | 243 register const unsigned char *str; |
242 register unsigned char *c1, *c2; | 244 register unsigned char *c1, *c2; |
243 register int len, *charset; | 245 register int len, *charset; |
244 { | 246 { |
272 } | 274 } |
273 | 275 |
274 /* Return a character unified with C (or a character made of CHARSET, | 276 /* Return a character unified with C (or a character made of CHARSET, |
275 C1, and C2) in unification table TABLE. If no unification is found | 277 C1, and C2) in unification table TABLE. If no unification is found |
276 in TABLE, return C. */ | 278 in TABLE, return C. */ |
279 int | |
277 unify_char (table, c, charset, c1, c2) | 280 unify_char (table, c, charset, c1, c2) |
278 Lisp_Object table; | 281 Lisp_Object table; |
279 int c, charset, c1, c2; | 282 int c, charset, c1, c2; |
280 { | 283 { |
281 Lisp_Object ch; | 284 Lisp_Object ch; |
306 /* Convert the unibyte character C to multibyte based on | 309 /* Convert the unibyte character C to multibyte based on |
307 Vnonascii_translate_table or nonascii_insert_offset. If they can't | 310 Vnonascii_translate_table or nonascii_insert_offset. If they can't |
308 convert C to a valid multibyte character, convert it based on | 311 convert C to a valid multibyte character, convert it based on |
309 DEFAULT_NONASCII_INSERT_OFFSET which makes C a Latin-1 character. */ | 312 DEFAULT_NONASCII_INSERT_OFFSET which makes C a Latin-1 character. */ |
310 | 313 |
314 int | |
311 unibyte_char_to_multibyte (c) | 315 unibyte_char_to_multibyte (c) |
312 int c; | 316 int c; |
313 { | 317 { |
314 if (c >= 0240 && c < 0400) | 318 if (c >= 0240 && c < 0400) |
315 { | 319 { |
1608 | 1612 |
1609 return make_string_from_bytes (buf, 1, i); | 1613 return make_string_from_bytes (buf, 1, i); |
1610 } | 1614 } |
1611 | 1615 |
1612 | 1616 |
1617 int | |
1613 charset_id_internal (charset_name) | 1618 charset_id_internal (charset_name) |
1614 char *charset_name; | 1619 char *charset_name; |
1615 { | 1620 { |
1616 Lisp_Object val = Fget (intern (charset_name), Qcharset); | 1621 Lisp_Object val = Fget (intern (charset_name), Qcharset); |
1617 | 1622 |
1633 charset_big5_1 = charset_id_internal ("chinese-big5-1"); | 1638 charset_big5_1 = charset_id_internal ("chinese-big5-1"); |
1634 charset_big5_2 = charset_id_internal ("chinese-big5-2"); | 1639 charset_big5_2 = charset_id_internal ("chinese-big5-2"); |
1635 return Qnil; | 1640 return Qnil; |
1636 } | 1641 } |
1637 | 1642 |
1643 void | |
1638 init_charset_once () | 1644 init_charset_once () |
1639 { | 1645 { |
1640 int i, j, k; | 1646 int i, j, k; |
1641 | 1647 |
1642 staticpro (&Vcharset_table); | 1648 staticpro (&Vcharset_table); |
1687 WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_22) = 2; | 1693 WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_22) = 2; |
1688 } | 1694 } |
1689 | 1695 |
1690 #ifdef emacs | 1696 #ifdef emacs |
1691 | 1697 |
1698 void | |
1692 syms_of_charset () | 1699 syms_of_charset () |
1693 { | 1700 { |
1694 Qascii = intern ("ascii"); | 1701 Qascii = intern ("ascii"); |
1695 staticpro (&Qascii); | 1702 staticpro (&Qascii); |
1696 | 1703 |