}
+Lisp_Object Vcharacter_attribute_table;
+
+DEFUN ("char-attribute-alist", Fchar_attribute_alist, 1, 1, 0, /*
+Return the alist of attributes of CHARACTER.
+*/
+ (character))
+{
+ return get_char_code_table (XCHAR (character), Vcharacter_attribute_table);
+}
+
+DEFUN ("get-char-attribute", Fget_char_attribute, 2, 2, 0, /*
+Return the value of CHARACTER's ATTRIBUTE.
+*/
+ (character, attribute))
+{
+ Lisp_Object ret
+ = get_char_code_table (XCHAR (character), Vcharacter_attribute_table);
+
+ if (EQ (ret, Qnil))
+ return Qnil;
+
+ return Fcdr (Fassq (attribute, ret));
+}
+
+DEFUN ("put-char-attribute", Fput_char_attribute, 3, 3, 0, /*
+Store CHARACTER's ATTRIBUTE with VALUE.
+*/
+ (character, attribute, value))
+{
+ Emchar char_code = XCHAR (character);
+ Lisp_Object ret
+ = get_char_code_table (char_code, Vcharacter_attribute_table);
+ Lisp_Object cell = Fassq (attribute, ret);
+
+ if (EQ (cell, Qnil))
+ ret = Fcons (Fcons (attribute, value), ret);
+ else
+ Fsetcdr (cell, value);
+ put_char_code_table (char_code, ret, Vcharacter_attribute_table);
+ return ret;
+}
+
+
Lisp_Object Vutf_2000_version;
#endif
Lisp_Object Vcharset_hash_table;
+#ifdef UTF2000
+static Charset_ID next_allocated_leading_byte;
+#else
static Charset_ID next_allocated_1_byte_leading_byte;
static Charset_ID next_allocated_2_byte_leading_byte;
+#endif
/* Composite characters are characters constructed by overstriking two
or more regular characters.
{
Charset_ID lb;
+#ifdef UTF2000
+ if (next_allocated_leading_byte > MAX_LEADING_BYTE_PRIVATE)
+ lb = 0;
+ else
+ lb = next_allocated_leading_byte++;
+#else
if (dimension == 1)
{
if (next_allocated_1_byte_leading_byte > MAX_LEADING_BYTE_PRIVATE_1)
else
lb = next_allocated_2_byte_leading_byte++;
}
+#endif
if (!lb)
signal_simple_error
error
("Character set already defined for this DIMENSION/CHARS/FINAL combo");
-#ifdef UTF2000
- if (dimension == 1)
- {
- if (chars == 94)
- {
- /* id = CHARSET_ID_OFFSET_94 + final; */
- id = get_unallocated_leading_byte (dimension);
- }
- else if (chars == 96)
- {
- id = get_unallocated_leading_byte (dimension);
- }
- else
- {
- abort ();
- }
- }
- else if (dimension == 2)
- {
- if (chars == 94)
- {
- id = get_unallocated_leading_byte (dimension);
- }
- else if (chars == 96)
- {
- id = get_unallocated_leading_byte (dimension);
- }
- else
- {
- abort ();
- }
- }
- else
- {
- abort ();
- }
- if (final)
- {
- if (chars == 94)
- byte_offset = 33;
- else if (chars == 96)
- byte_offset = 32;
- }
-#else
id = get_unallocated_leading_byte (dimension);
-#endif
if (NILP (doc_string))
doc_string = build_string ("");
Lisp_Object c = XVECTOR_DATA(table)[i];
if (CHARP (c))
- put_char_code_table (XCHAR (c),
- make_int (i + CHARSET_BYTE_OFFSET (cs)),
- CHARSET_ENCODING_TABLE(cs));
+ {
+ put_char_code_table (XCHAR (c),
+ make_int (i + CHARSET_BYTE_OFFSET (cs)),
+ CHARSET_ENCODING_TABLE(cs));
+ Fput_char_attribute (c, charset,
+ list1
+ (make_int (i + CHARSET_BYTE_OFFSET (cs))));
+ }
}
break;
case 2:
Lisp_Object c = XVECTOR_DATA(v)[j];
if (CHARP (c))
- put_char_code_table
- (XCHAR (c),
- make_int (( (i + CHARSET_BYTE_OFFSET (cs)) << 8)
- | (j + CHARSET_BYTE_OFFSET (cs))),
- CHARSET_ENCODING_TABLE(cs));
+ {
+ put_char_code_table
+ (XCHAR (c),
+ make_int (( (i + CHARSET_BYTE_OFFSET (cs)) << 8)
+ | (j + CHARSET_BYTE_OFFSET (cs))),
+ CHARSET_ENCODING_TABLE(cs));
+ Fput_char_attribute (c, charset,
+ list2
+ (make_int
+ (i + CHARSET_BYTE_OFFSET (cs)),
+ make_int
+ (j + CHARSET_BYTE_OFFSET (cs))));
+ }
}
}
else if (CHARP (v))
- put_char_code_table (XCHAR (v),
- make_int (i + CHARSET_BYTE_OFFSET (cs)),
- CHARSET_ENCODING_TABLE(cs));
+ {
+ put_char_code_table (XCHAR (v),
+ make_int (i + CHARSET_BYTE_OFFSET (cs)),
+ CHARSET_ENCODING_TABLE(cs));
+ Fput_char_attribute (v, charset,
+ list1
+ (make_int (i + CHARSET_BYTE_OFFSET (cs))));
+ }
}
break;
}
DEFSUBR (Fset_charset_ccl_program);
DEFSUBR (Fset_charset_registry);
#ifdef UTF2000
+ DEFSUBR (Fchar_attribute_alist);
+ DEFSUBR (Fget_char_attribute);
+ DEFSUBR (Fput_char_attribute);
DEFSUBR (Fcharset_mapping_table);
DEFSUBR (Fset_charset_mapping_table);
#endif
charset_by_attributes[i][j][k] = Qnil;
#endif
- next_allocated_1_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_1;
#ifdef UTF2000
- next_allocated_2_byte_leading_byte = LEADING_BYTE_CHINESE_BIG5_2 + 1;
+ next_allocated_leading_byte = MIN_LEADING_BYTE_PRIVATE;
#else
+ next_allocated_1_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_1;
next_allocated_2_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_2;
#endif
#endif
#ifdef UTF2000
- Vutf_2000_version = build_string("0.8 (Kami)");
+ Vutf_2000_version = build_string("0.10 (Yao)");
DEFVAR_LISP ("utf-2000-version", &Vutf_2000_version /*
Version number of UTF-2000.
*/ );
+ staticpro (&Vcharacter_attribute_table);
+ Vcharacter_attribute_table = make_char_code_table (Qnil);
+
Vdefault_coded_charset_priority_list = Qnil;
DEFVAR_LISP ("default-coded-charset-priority-list",
&Vdefault_coded_charset_priority_list /*
-Default order of preferred coded-character-set.
+Default order of preferred coded-character-sets.
*/ );
#endif
}