X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fchartab.h;h=e6d637b2ea964019dcab5617b903e99048654122;hb=49177a93dff4f349cb9c5474a32e0bc2720cf86b;hp=ca710259211c34a4b7ed225fe30bc2449efedf5d;hpb=2779fcb5d524d6b7de5a6ef9ebfd6662433a4a07;p=chise%2Fxemacs-chise.git diff --git a/src/chartab.h b/src/chartab.h index ca71025..e6d637b2 100644 --- a/src/chartab.h +++ b/src/chartab.h @@ -1,7 +1,7 @@ /* Declarations having to do with Mule char tables. Copyright (C) 1992 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1999,2000,2001 MORIOKA Tomohiko + Copyright (C) 1999,2000,2001,2002 MORIOKA Tomohiko This file is part of XEmacs. @@ -31,11 +31,17 @@ Boston, MA 02111-1307, USA. */ #ifdef UTF2000 +#ifdef HAVE_DATABASE +#include "database.h" +#endif + EXFUN (Fmake_char, 3); EXFUN (Fdecode_char, 3); EXFUN (Fput_char_attribute, 3); +EXFUN (Ffind_char, 1); + /************************************************************************/ /* Char-ID Tables */ @@ -161,6 +167,9 @@ struct Lisp_Char_Table #ifdef UTF2000 Lisp_Object table; Lisp_Object default_value; + Lisp_Object name; + Lisp_Object db; + unsigned char unloaded; #else Lisp_Object ascii[NUM_ASCII_CHARS]; @@ -217,6 +226,12 @@ DECLARE_LRECORD (char_table, Lisp_Char_Table); #ifdef UTF2000 +#define CHAR_TABLE_NAME(ct) ((ct)->name) +#define XCHAR_TABLE_NAME(ct) CHAR_TABLE_NAME (XCHAR_TABLE (ct)) + +#define CHAR_TABLE_UNLOADED(ct) ((ct)->unloaded) +#define XCHAR_TABLE_UNLOADED(ct) CHAR_TABLE_UNLOADED (XCHAR_TABLE (ct)) + INLINE_HEADER Lisp_Object CHAR_TABLE_VALUE_UNSAFE (Lisp_Char_Table *ct, Emchar ch); INLINE_HEADER Lisp_Object @@ -314,24 +329,6 @@ extern Lisp_Object Vall_syntax_tables; #ifdef UTF2000 -INLINE_HEADER Lisp_Object get_char_id_table (Lisp_Char_Table* cit, Emchar ch); -INLINE_HEADER Lisp_Object -get_char_id_table (Lisp_Char_Table* cit, Emchar ch) -{ - Lisp_Object val = get_byte_table (get_byte_table - (get_byte_table - (get_byte_table - (cit->table, - (unsigned char)(ch >> 24)), - (unsigned char) (ch >> 16)), - (unsigned char) (ch >> 8)), - (unsigned char) ch); - if (UNBOUNDP (val)) - return cit->default_value; - else - return val; -} - INLINE_HEADER void put_char_id_table_0 (Lisp_Char_Table* cit, Emchar code, Lisp_Object value); INLINE_HEADER void @@ -350,6 +347,51 @@ put_char_id_table_0 (Lisp_Char_Table* cit, Emchar code, Lisp_Object value) cit->table = put_byte_table (table1, (unsigned char)(code >> 24), table2); } +#ifdef HAVE_DATABASE +extern Lisp_Object Qsystem_char_id; + +Lisp_Object +char_attribute_system_db_file (Lisp_Object key_type, Lisp_Object attribute, + int writing_mode); + +Lisp_Object load_char_attribute_maybe (Lisp_Char_Table* cit, Emchar ch); +#endif + +INLINE_HEADER Lisp_Object +get_char_id_table_0 (Lisp_Char_Table* cit, Emchar ch); +INLINE_HEADER Lisp_Object +get_char_id_table_0 (Lisp_Char_Table* cit, Emchar ch) +{ + return get_byte_table (get_byte_table + (get_byte_table + (get_byte_table + (cit->table, + (unsigned char)(ch >> 24)), + (unsigned char) (ch >> 16)), + (unsigned char) (ch >> 8)), + (unsigned char) ch); +} + +INLINE_HEADER Lisp_Object +get_char_id_table (Lisp_Char_Table* cit, Emchar ch); +INLINE_HEADER Lisp_Object +get_char_id_table (Lisp_Char_Table* cit, Emchar ch) +{ + Lisp_Object val = get_char_id_table_0 (cit, ch); + +#ifdef HAVE_DATABASE + if (EQ (val, Qunloaded)) + { + val = load_char_attribute_maybe (cit, ch); + put_char_id_table_0 (cit, ch, val); + } +#endif + if (UNBOUNDP (val)) + return cit->default_value; + else + return val; +} + void decode_char_table_range (Lisp_Object range, struct chartab_range *outrange);