comparison src/mule-charset.c @ 418:e804706bfb8c r21-2-17

Import from CVS: tag r21-2-17
author cvs
date Mon, 13 Aug 2007 11:23:13 +0200
parents ebe98a74bd68
children 41dbb7a9d5f2
comparison
equal deleted inserted replaced
417:43a18b32d56e 418:e804706bfb8c
1103 1103
1104 return XCHARSET_NAME (CHARSET_BY_LEADING_BYTE 1104 return XCHARSET_NAME (CHARSET_BY_LEADING_BYTE
1105 (CHAR_LEADING_BYTE (XCHAR (ch)))); 1105 (CHAR_LEADING_BYTE (XCHAR (ch))));
1106 } 1106 }
1107 1107
1108 DEFUN ("char-octet", Fchar_octet, 1, 2, 0, /* 1108 DEFUN ("split-char", Fsplit_char, 1, 1, 0, /*
1109 Return the octet numbered N (should be 0 or 1) of char CH. 1109 Return list of charset and one or two position-codes of CHAR.
1110 N defaults to 0 if omitted. 1110 */
1111 */ 1111 (character))
1112 (ch, n)) 1112 {
1113 { 1113 /* This function can GC */
1114 Lisp_Object charset; 1114 struct gcpro gcpro1, gcpro2;
1115 int c1, c2, int_n; 1115 Lisp_Object charset = Qnil;
1116 1116 Lisp_Object rc = Qnil;
1117 CHECK_CHAR_COERCE_INT (ch); 1117 int c1, c2;
1118 if (NILP (n)) 1118
1119 int_n = 0; 1119 GCPRO2 (charset, rc);
1120 CHECK_CHAR_COERCE_INT (character);
1121
1122 BREAKUP_CHAR (XCHAR (character), charset, c1, c2);
1123
1124 if (XCHARSET_DIMENSION (Fget_charset (charset)) == 2)
1125 {
1126 rc = list3 (XCHARSET_NAME (charset), make_int (c1), make_int (c2));
1127 }
1120 else 1128 else
1121 { 1129 {
1122 CHECK_INT (n); 1130 rc = list2 (XCHARSET_NAME (charset), make_int (c1));
1123 int_n = XINT (n);
1124 if (int_n != 0 && int_n != 1)
1125 signal_simple_error ("Octet number must be 0 or 1", n);
1126 } 1131 }
1127 BREAKUP_CHAR (XCHAR (ch), charset, c1, c2); 1132 UNGCPRO;
1128 return make_int (int_n == 0 ? c1 : c2); 1133
1134 return rc;
1129 } 1135 }
1130 1136
1131 1137
1132 #ifdef ENABLE_COMPOSITE_CHARS 1138 #ifdef ENABLE_COMPOSITE_CHARS
1133 /************************************************************************/ 1139 /************************************************************************/
1228 DEFSUBR (Fset_charset_ccl_program); 1234 DEFSUBR (Fset_charset_ccl_program);
1229 DEFSUBR (Fset_charset_registry); 1235 DEFSUBR (Fset_charset_registry);
1230 1236
1231 DEFSUBR (Fmake_char); 1237 DEFSUBR (Fmake_char);
1232 DEFSUBR (Fchar_charset); 1238 DEFSUBR (Fchar_charset);
1233 DEFSUBR (Fchar_octet); 1239 DEFSUBR (Fsplit_char);
1234 1240
1235 #ifdef ENABLE_COMPOSITE_CHARS 1241 #ifdef ENABLE_COMPOSITE_CHARS
1236 DEFSUBR (Fmake_composite_char); 1242 DEFSUBR (Fmake_composite_char);
1237 DEFSUBR (Fcomposite_char_string); 1243 DEFSUBR (Fcomposite_char_string);
1238 #endif 1244 #endif