From a07a4d51f8ef012b0377228c913e16e39dc679ff Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 1 Sep 2005 13:09:43 +0000 Subject: [PATCH] (mchar_get_prop_table): New function. --- src/character.c | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/src/character.c b/src/character.c index 4769c61..4f3642b 100644 --- a/src/character.c +++ b/src/character.c @@ -140,8 +140,8 @@ mchar__fini (void) /* External API */ -/*** @addtogroup m17nCharacter */ -/*** @{ */ +/*** @addtogroup m17nCharacter + @{ */ /*=*/ #ifdef FOR_DOXYGEN @@ -160,16 +160,15 @@ mchar__fini (void) #endif /* FOR_DOXYGEN */ /***en - @ingroup m17nCharacter @name Variables: Keys of character properties These symbols are used as keys of character properties. */ /***ja - @name ÊÑ¿ô: ʸ»ú¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼ + @ingroup m17nCharacter + @name ÊÑ¿ô: ʸ»ú¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼ - ¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Ïʸ»ú¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤Æ»È¤ï¤ì¤ë¡£*/ -/*=*/ + ¤³¤ì¤é¤Î¥·¥ó¥Ü¥ë¤Ïʸ»ú¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤È¤·¤Æ»È¤ï¤ì¤ë¡£*/ /*** @{ */ /***en @@ -503,6 +502,42 @@ mchar_put_prop (int c, MSymbol key, void *val) return mchartable_set (record->table, c, val); } +/*=*/ + +/***en + @brief Get the char-table for a character property. + + The mchar_get_prop_table () function returns a char-table that + contains the character property whose key is $KEY. If $TYPE is + not null, this function store the type of the property in the + place pointed by $TYPE. See mchar_define_property () for types of + character property. + + @return + If $KEY is a valid character property key, return a char-table. + Otherwise retun NULL. */ + + +MCharTable * +mchar_get_prop_table (MSymbol key, MSymbol *type) +{ + MCharPropRecord *record; + + record = mplist_get (char_prop_list, key); + if (! record) + return NULL; + if (record->mdb) + { + record->table = (*mdatabase__loader) (record->mdb); + if (! record->table) + MERROR (MERROR_DB, NULL); + record->mdb = NULL; + } + if (type) + *type = record->type; + return record->table; +} + /*** @} */ /* -- 1.7.10.4