From: handa Date: Thu, 1 Sep 2005 13:09:43 +0000 (+0000) Subject: (mchar_get_prop_table): New function. X-Git-Tag: REL-1-3-0~216 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a07a4d51f8ef012b0377228c913e16e39dc679ff;p=m17n%2Fm17n-lib.git (mchar_get_prop_table): New function. --- 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; +} + /*** @} */ /*