From: nisikimi Date: Tue, 20 Apr 2004 08:05:41 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: withdl~285 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5194d37d1408f24197628efa5d6fbd29c634c0ff;p=m17n%2Fm17n-lib.git *** empty log message *** --- diff --git a/src/plist.c b/src/plist.c index 6146006..a07dde2 100644 --- a/src/plist.c +++ b/src/plist.c @@ -33,6 +33,18 @@ If the key of a property is a @e managing @e key, its @e value is a @e managed @e object. A property list itself is a managed objects. */ +/***ja + @addtogroup m17nPlist + + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¥ª¥Ö¥¸¥§¥¯¥È¤È¤½¤ì¤Ë´Ø¤¹¤ë API . + + @e ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È (¤Þ¤¿¤Ï @e plist) ¤Ï 0 °Ê¾å¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥ê¥¹ + ¥È¤Ç¤¢¤ë¡£¥×¥í¥Ñ¥Æ¥£¤Ï @e ¥­¡¼ ¤È @e Ãͤ«¤é¤Ê¤ë¡£¥­¡¼¤Ï¥·¥ó¥Ü¥ë¤Ç + ¤¢¤ê¡¢ÃÍ¤Ï (void *) ¤Ë¥­¥ã¥¹¥È¤Ç¤­¤ë¤â¤Î¤Ê¤é¤Ð²¿¤Ç¤âÎɤ¤¡£ + + ¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤¬ @e ´ÉÍý¥­¡¼ ¤Ê¤é¤Ð¡¢¤½¤Î @e ÃÍ ¤Ï@e ´ÉÍý²¼ + ¥ª¥Ö¥¸¥§¥¯¥È ¤Ç¤¢¤ë¡£¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¼«ÂΤâ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢ + ¤ë¡£ */ /*=*/ @@ -721,7 +733,12 @@ mplist__serialize (MText *mt, MPlist *plist) @brief Symbol whose name is "integer". The symbol @c Minteger has the name "integer". A value - of a plist whose key is @c Minteger must be an integer. */ + of a property whose key is @c Minteger must be an integer. */ +/***ja + @brief "integer" ¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë. + + ¥·¥ó¥Ü¥ë @c Minteger ¤Ï "integer" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£¥­¡¼¤¬ + @c Minteger ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ÎÃͤÏÀ°¿ôÃͤǤʤ¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ */ MSymbol Minteger; /*=*/ @@ -730,8 +747,14 @@ MSymbol Minteger; @brief Symbol whose name is "plist". The symbol @c Mplist has the name "plist". It is a - managing key. A value of a plist whose key is @c Mplist must be a - plist. */ + managing key. A value of a property whose key is @c Mplist must + be a plist. */ +/***ja + @brief "plist" ¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë. + + ¥·¥ó¥Ü¥ë @c Mplist ¤Ï "plist" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£¤³¤ì¤Ï´É + Íý¥­¡¼¤Ç¤¢¤ë¡£¥­¡¼¤¬ @c Mplist ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ÎÃÍ¤Ï plist ¤Ç¤Ê¤¯ + ¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ */ MSymbol Mplist; /*=*/ @@ -740,18 +763,18 @@ MSymbol Mplist; @brief Symbol whose name is "mtext". The symbol @c Mtext has the name "mtext". It is a - managing key. A value of a plist whose key is @c Mtext must be an + managing key. A value of a property whose key is @c Mtext must be an M-text. */ -/***oldja +/***ja @brief "text" ¤ò̾Á°¤È¤·¤Æ»ý¤Ä¥·¥ó¥Ü¥ë - ÄêµÁºÑ¤ß¥·¥ó¥Ü¥ë @c Mtext ¤Ï "text" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä´ÉÍý - ¥­¡¼¤Ç¤¢¤ë¡£ */ + ¥·¥ó¥Ü¥ë @c Mtext ¤Ï "text" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä´ÉÍý¥­¡¼¤Ç¤¢ + ¤ë¡£¥­¡¼¤¬ @c Mtext ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ÎÃÍ¤Ï M-text ¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê + ¤¤¡£ */ MSymbol Mtext; - /*=*/ /***en @brief Create a property list object. @@ -764,6 +787,17 @@ MSymbol Mtext; @errors This function never fails. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¥ª¥Ö¥¸¥§¥¯¥È¤òºî¤ë. + + ´Ø¿ô mplist () ¤ÏŤµ 0 ¤Î¿·¤·¤¯ºî¤é¤ì¤¿¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¥ª¥Ö¥¸¥§¥¯ + ¥È¤òÊÖ¤¹¡£ + + @returns + ¤³¤Î´Ø¿ô¤Ï¿·¤·¤¯ºî¤é¤ì¤¿¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¡£ + + @errors + ¤³¤Î´Ø¿ô¤Ï·è¤·¤Æ¼ºÇÔ¤·¤Ê¤¤¡£ */ MPlist * mplist () @@ -776,17 +810,28 @@ mplist () /*=*/ /***en - @brief Copy a plist. + @brief Copy a property list. - The mplist_copy () function copies $PLIST. In the copy, the - values are the same as those of $PLIST. + The mplist_copy () function copies property list $PLIST. In the + copy, the values are the same as those of $PLIST. @return This function returns a newly created plist which is a copy of - $PLIST. */ -/*** + $PLIST. + @errors This function never fails. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤ò¥³¥Ô¡¼¤¹¤ë. + + ´Ø¿ô mplist_copy () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤ò¥³¥Ô¡¼¤¹¤ë¡£¥³¥Ô¡¼¤Î¤¹¤Ù¤Æ¤Î + Ãͤϥ³¥Ô¡¼¸µ $PLIST ¤ÎÃͤÈƱ¤¸¤Ç¤¢¤ë¡£ + + @return + ¤³¤Î´Ø¿ô¤Ï¿·¤·¤¯ºî¤é¤ì¤¿¡¢$PLIST ¤Î¥³¥Ô¡¼¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤òÊÖ¤¹¡£ + + @errors + ¤³¤Î´Ø¿ô¤Ï·è¤·¤Æ¼ºÇÔ¤·¤Ê¤¤¡£ */ MPlist * mplist_copy (MPlist *plist) @@ -801,9 +846,9 @@ mplist_copy (MPlist *plist) /*=*/ /***en - @brief Set the value of a property in a property list object. + @brief Set the value of a property in a property list. - The mplist_put () function searches property list object $PLIST + The mplist_put () function searches property list $PLIST from the beginning for a property whose key is $KEY. If such a property is found, its value is changed to $VALUE. Otherwise, a new property whose key is $KEY and value is $VALUE is appended at @@ -818,6 +863,22 @@ mplist_copy (MPlist *plist) If the operation was successful, mplist_put () returns a sublist of $PLIST whose first element is the just modified or added one. Otherwise, it returns @c NULL. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥ÈÃæ¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÀßÄꤹ¤ë. + + ´Ø¿ô mplist_put () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤ò»Ï¤á¤«¤éõ¤·¤Æ¡¢¥­¡¼ + ¤¬ $KEY ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ò¸«¤Ä¤±¤ë¡£¸«¤Ä¤«¤ì¤Ð¡¢¤½¤ÎÃͤò $VALUE ¤Ë + Êѹ¹¤¹¤ë¡£¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð¡¢¥­¡¼¤¬ $KEY ¤ÇÃͤ¬ $VALUE ¤Ç¤¢¤ë¿·¤·¤¤ + ¥×¥í¥Ñ¥Æ¥£¤¬$PLIST ¤ÎËöÈø¤ËÄɲ䵤ì¤ë¡£$KEY ¤È $VAL ¤ËÂФ¹¤ëÀ©¸Â¤Ë + ¤Ä¤¤¤Æ¤Ï¡¢mplist_add () ¤ÎÀâÌÀ¤ò»²¾È¡£ + + $KEY ¤¬´ÉÍý¥­¡¼¤Ê¤é¤Ð¡¢$VAL ¤Ï´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + ¤³¤Î¾ì¹ç¡¢¸Å¤¤Ãͤλ²¾È¿ô¤Ï @c NULL ¤Ç¤Ê¤±¤ì¤Ð 1 ¸º¤é¤µ¤ì¡¢$VAL ¤Î + »²¾È¿ô¤Ï 1 Áý¤ä¤µ¤ì¤ë¡£ + + @return + ½èÍý¤¬À®¸ù¤¹¤ì¤Ð mplist_put () ¤ÏÊѹ¹¤µ¤ì¤¿¤«Äɲ䵤줿Í×ÁǤ«¤é»Ï + ¤Þ¤ë $PLIST ¤ÎÉôʬ¥ê¥¹¥È¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤¹¡£ */ MPlist * mplist_put (MPlist *plist, MSymbol key, void *val) @@ -838,9 +899,9 @@ mplist_put (MPlist *plist, MSymbol key, void *val) /*=*/ /***en - @brief Get the value of a property in a property list object. + @brief Get the value of a property in a property list. - The mplist_get () function searches property list object $PLIST + The mplist_get () function searches property list $PLIST from the beginning for a property whose key is $KEY. If such a property is found, a pointer to its value is returned as the type of (void *). If not found, @c NULL is returned. @@ -850,6 +911,17 @@ mplist_put (MPlist *plist, MSymbol key, void *val) where a property is found and its value is @c NULL. In case that these two cases must be distinguished, use the mplist_find_by_key () function. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥ÈÃæ¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë. + + ´Ø¿ô mplist_get () ¤Ï¡¢¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤ò»Ï¤á¤«¤éõ¤·¤Æ¡¢ + ¥­¡¼¤¬ $KEY ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ò¸«¤Ä¤±¤ë¡£¸«¤Ä¤«¤ì¤Ð¡¢¤½¤ÎÃͤؤΥݥ¤ + ¥ó¥¿¤ò (void *) ·¿¤ÇÊÖ¤¹¡£¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤¹¡£ + + @c NULL ¤¬Ê֤俺ݤˤÏÆó¤Ä¤Î²ÄǽÀ­¤¬¤¢¤ë:¾åµ­¤Î¤è¤¦¤Ë¥×¥í¥Ñ¥Æ¥£¤¬ + ¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤È¡¢¥×¥í¥Ñ¥Æ¥£¤¬¸«¤Ä¤«¤ê¡¢¤½¤ÎÃͤ¬ @c NULL ¤Ç + ¤¢¤ë¾ì¹ç¤Ç¤¢¤ë¡£¤³¤ì¤é¤ò¶èÊ̤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë¤Ï´Ø¿ô + mplist_find_by_key () ¤ò»È¤¦¤³¤È¡£ */ /*** @seealso @@ -865,11 +937,11 @@ mplist_get (MPlist *plist, MSymbol key) /*=*/ /***en - @brief Add a property at the end of a property list object. + @brief Add a property at the end of a property list. - The mplist_add () function appends at the end of $PLIST a property - whose key is $KEY and value is $VAL. $KEY can be any symbol - other than @c Mnil. + The mplist_add () function appends at the end of property list + $PLIST a property whose key is $KEY and value is $VAL. $KEY can + be any symbol other than @c Mnil. If $KEY is a managing key, $VAL must be a managed object. In this case, the reference count of $VAL is incremented by one. @@ -878,6 +950,19 @@ mplist_get (MPlist *plist, MSymbol key) If the operation was successful, mplist_add () returns a sublist of $PLIST whose first element is the just added one. Otherwise, it returns @c NULL. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥ÈËöÈø¤Ë¥×¥í¥Ñ¥Æ¥£¤òÄɲ乤ë. + + ´Ø¿ô mplist_add () ¤Ï¡¢¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤ÎËöÈø¤Ë¥­¡¼¤¬ $KEY + ¤ÇÃͤ¬ $VAL ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤òÄɲ乤롣$KEY ¤Ï¡¢@c Mnil °Ê³°¤ÎǤ + °Õ¤Î¥·¥ó¥Ü¥ë¤Ç¤è¤¤¡£ + + $KEY ¤¬´ÉÍý¥­¡¼¤Ê¤é¤Ð¡¢$VAL ¤Ï´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + ¤³¤Î¾ì¹ç¡¢$VAL ¤Î»²¾È¿ô¤Ï 1 Áý¤ä¤µ¤ì¤ë¡£ + + @return + ½èÍý¤¬À®¸ù¤¹¤ì¤Ð mplist_add () ¤ÏÄɲ䵤줿Í×ÁǤ«¤é»Ï¤Þ¤ë $PLIST + ¤ÎÉôʬ¥ê¥¹¥È¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤¹¡£ */ MPlist * mplist_add (MPlist *plist, MSymbol key, void *val) @@ -896,10 +981,10 @@ mplist_add (MPlist *plist, MSymbol key, void *val) /*=*/ /***en - @brief Push a property to a property list object. + @brief Push a property to a property list. - The mplist_push () function pushes at the top of $PLIST a - property whose key is $KEY and value si $VAL. + The mplist_push () function pushes at the top of property list + $PLIST a property whose key is $KEY and value is $VAL. If $KEY is a managing key, $VAL must be a managed object. In this case, the reference count of $VAL is incremented by one. @@ -907,6 +992,18 @@ mplist_add (MPlist *plist, MSymbol key, void *val) @return If the operation was successful, this function returns $PLIST. Otherwise, it returns @c NULL. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò¥×¥Ã¥·¥å¤¹¤ë. + + ´Ø¿ô mplist_push () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤Î¾å¤Ë¤Ë¥­¡¼¤¬ $KEY + ¤ÇÃͤ¬ $VAL ¤Ç¤¢¤ë¥ª¥Ö¥¸¥§¥¯¥È¤ò¥×¥Ã¥·¥å¤¹¤ë¡£ + + $KEY ¤¬´ÉÍý¥­¡¼¤Ê¤é¤Ð¡¢$VAL ¤Ï´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + ¤³¤Î¾ì¹ç¡¢$VAL ¤Î»²¾È¿ô¤Ï 1 Áý¤ä¤µ¤ì¤ë¡£ + + @return + ½èÍý¤¬À®¸ù¤¹¤ì¤Ð¤³¤Î´Ø¿ô¤Ï $PLIST ¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð@c NULL ¤ò + ÊÖ¤¹¡£ */ MPlist * mplist_push (MPlist *plist, MSymbol key, void *val) @@ -930,15 +1027,25 @@ mplist_push (MPlist *plist, MSymbol key, void *val) /*=*/ /***en - @brief Pop a property from a property list object. + @brief Pop a property from a property list. - The mplist_pop () function pops the topmost property from $PLIST. - As a result, the key and value of $PLIST becomes those of the next - of $PLIST. + The mplist_pop () function pops the topmost property from property + list $PLIST. As a result, the key and value of $PLIST becomes + those of the next of $PLIST. @return If the operation was successful, this function return the value of the just popped property. Otherwise, it returns @c NULL. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò¥Ý¥Ã¥×¤¹¤ë. + + The mplist_pop () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤«¤éºÇ¾å°Ì¤Î¥×¥í¥Ñ¥Æ¥£ + ¤ò¥Ý¥Ã¥×¤¹¤ë¡£·ë²Ì¤È¤·¤Æ $PLIST ¤Î¥­¡¼¤ÈÃÍ¤Ï $PLIST ¤Î¼¡¤Î¤â¤Î¤Î¥­¡¼ + ¤ÈÃͤˤʤ롣 + + @return + ½èÍý¤ËÀ®¸ù¤¹¤ì¤Ð¡¢¤³¤Î´Ø¿ô¤Ï¥Ý¥Ã¥×¤µ¤ì¤¿¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÊÖ¤¹¡£¤½¤¦ + ¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤¹¡£ */ void * mplist_pop (MPlist *plist) @@ -965,15 +1072,25 @@ mplist_pop (MPlist *plist) /*=*/ /***en - @brief Find a property of a specific key in a property list object. + @brief Find a property of a specific key in a property list. - The mplist_find_by_key () function searches property list object + The mplist_find_by_key () function searches property list $PLIST from the beginning for a property whose key is $KEY. If such a property is found, a sublist of $PLIST whose first element is the found one is returned. Otherwise, @c NULL is returned. - If $KEY is Mnil, it returns the last a sublist of $PLIST whose + If $KEY is @c Mnil, it returns a sublist of $PLIST whose first element is the last one of $PLIST. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥ÈÃ椫¤é»ØÄê¤Î¥­¡¼¤ò»ý¤Ä¥ª¥Ö¥¸¥§¥¯¥È¤òõ¤¹. + + ´Ø¿ô mplist_find_by_key () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤ò»Ï¤á¤«¤éõ + ¤·¤Æ¡¢¥­¡¼¤¬ $KEY ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ò¸«¤Ä¤±¤ë¡£¸«¤Ä¤«¤ì¤Ð¡¢¤½¤Î¥×¥í + ¥Ñ¥Æ¥£¤«¤é»Ï¤Þ¤ë $PLIST ¤ÎÉôʬ¥ê¥¹¥È¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð@c NULL + ¤òÊÖ¤¹¡£ + + $KEY ¤¬ @c Mnil ¤Ê¤é¤Ð¡¢$PLIST ¤ÎºÇ¸å¤ÎÍ×ÁǤ«¤é»Ï¤Þ¤ëÉôʬ¥ê¥¹¥È¤ò + ÊÖ¤¹¡£ */ MPlist * mplist_find_by_key (MPlist *plist, MSymbol key) @@ -986,12 +1103,19 @@ mplist_find_by_key (MPlist *plist, MSymbol key) /*=*/ /***en - @brief Find a property of a specific value in a property list object. + @brief Find a property of a specific value in a property list. - The mplist_find_by_value () function searches property list object - $PLIST from the beginning for a property whose value is $VAL. If - such a property is found, a sublist of $PLIST whose first element - is the found one is returned. Otherwise, @c NULL is returned. */ + The mplist_find_by_value () function searches property list $PLIST + from the beginning for a property whose value is $VAL. If such a + property is found, a sublist of $PLIST whose first element is the + found one is returned. Otherwise, @c NULL is returned. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥ÈÃ椫¤é»ØÄê¤ÎÃͤò»ý¤Ä¥ª¥Ö¥¸¥§¥¯¥È¤òõ¤¹. + + ´Ø¿ô mplist_find_by_value () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤ò»Ï¤á¤«¤é + õ¤·¤Æ¡¢Ãͤ¬ $VAL ¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤ò¸«¤Ä¤±¤ë¡£¸«¤Ä¤«¤ì¤Ð¡¢¤½¤Î¥×¥í + ¥Ñ¥Æ¥£¤«¤é»Ï¤Þ¤ë $PLIST ¤ÎÉôʬ¥ê¥¹¥È¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð@c NULL + ¤òÊÖ¤¹¡£ */ MPlist * mplist_find_by_value (MPlist *plist, void *val) @@ -1007,11 +1131,17 @@ mplist_find_by_value (MPlist *plist, void *val) /*=*/ /***en - @brief Return the next sublist of a plist. + @brief Return the next sublist of a property list. The mplist_next () function returns a pointer to the sublist of - $PLIST, which begins at the second element in $PLIST. If the + property list $PLIST, which begins at the second element in $PLIST. If the length of $PLIST is zero, it returns @c NULL. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Î¼¡¤ÎÉôʬ¥ê¥¹¥È¤òÊÖ¤¹. + + ´Ø¿ô mplist_next () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤Î£²ÈÖÌÜ + ¤ÎÍ×ÁǤ«¤é»Ï¤Þ¤ëÉôʬ¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£$PLIST ¤ÎŤµ¤¬ 0 ¤Ê + ¤é¤Ð @c NULL ¤òÊÖ¤¹¡£ */ MPlist * mplist_next (MPlist *plist) @@ -1022,16 +1152,26 @@ mplist_next (MPlist *plist) /*=*/ /***en - @brief Set the first property in a property list object. + @brief Set the first property in a property list. The mplist_set () function sets the key and value of the first - property in property list object $PLIST to $KEY and $VALUE, - respectively. See the documentation of mplist_add () for the - restriction on $KEY and $VAL. + property in property list $PLIST to $KEY and $VALUE, respectively. + See the documentation of mplist_add () for the restriction on $KEY + and $VAL. @return If the operation was successful, mplist_set () returns $PLIST. Otherwise, it returns @c NULL. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥ÈºÇ½é¤Î¥×¥í¥Ñ¥Æ¥£¤òÀßÄꤹ¤ë¡£ + + ´Ø¿ô mplist_set () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤ÎºÇ½é¤Î¥×¥í¥Ñ¥Æ¥£¤Î + ¥­¡¼¤ÈÃͤò¤½¤ì¤¾¤ì $KEY ¤È $VALUE ¤ËÀßÄꤹ¤ë¡£$KEY ¤È $VAL ¤ËÂФ¹ + ¤ëÀ©¸Â¤Ë¤Ä¤¤¤Æ¤Ï¡¢mplist_add () ¤ÎÀâÌÀ¤ò»²¾È¡£ + + @return + ½èÍý¤ËÀ®¸ù¤¹¤ì¤Ð mplist_set () ¤Ï $PLIST ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð + @c NULL ¤òÊÖ¤¹¡£ */ MPlist * mplist_set (MPlist *plist, MSymbol key, void * val) @@ -1064,10 +1204,15 @@ mplist_set (MPlist *plist, MSymbol key, void * val) /*=*/ /***en - @brief Return the length of a plist. + @brief Return the length of a property list. The mplist_length () function returns the number of properties in - property list object $PLIST. */ + property list $PLIST. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤ÎŤµ¤òÊÖ¤¹. + + ´Ø¿ô mplist_length () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST Ãæ¤Î¥×¥í¥Ñ¥Æ¥£¤Î¿ô + ¤òÊÖ¤¹¡£ */ int mplist_length (MPlist *plist) @@ -1081,11 +1226,17 @@ mplist_length (MPlist *plist) /*=*/ /***en - @brief Return the key of the first property in a property list object. + @brief Return the key of the first property in a property list. The mplist_key () function returns the key of the first property - in property list object $PLIST. If the length of $PLIST is zero, + in property list $PLIST. If the length of $PLIST is zero, it returns @c Mnil. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥ÈÃæ¤ÎºÇ½é¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤òÊÖ¤¹. + + ´Ø¿ô mplist_key () ¤Ï¡¢¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST Ãæ¤ÎºÇ + ½é¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤òÊÖ¤¹¡£$PLIST ¤ÎŤµ¤¬ 0 ¤Ê¤é¤Ð¡¢ @c Mnil ¤ò + ÊÖ¤¹¡£ */ MSymbol mplist_key (MPlist *plist) @@ -1096,11 +1247,17 @@ mplist_key (MPlist *plist) /*=*/ /***en - @brief Return the value of the first property in a property list object. + @brief Return the value of the first property in a property list. The mplist_value () function returns the value of the first - property in property list object $PLIST. If the length of $PLIST + property in property list $PLIST. If the length of $PLIST is zero, it returns @c NULL. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥ÈÃæ¤ÎºÇ½é¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤òÊÖ¤¹. + + ´Ø¿ô mplist_value () ¤Ï¡¢¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST Ãæ¤Î + ºÇ½é¤Î¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÊÖ¤¹¡£$PLIST ¤ÎŤµ¤¬ 0 ¤Ê¤é¤Ð¡¢ @c Mnil ¤ò + ÊÖ¤¹¡£ */ void * mplist_value (MPlist *plist) @@ -1109,7 +1266,7 @@ mplist_value (MPlist *plist) } /***en - @brief Generate a plist by deserializaing an M-text. + @brief Generate a property list by deserializaing an M-text. The mplist_deserialize () function parses M-text $MT and returns a property list. @@ -1127,13 +1284,38 @@ mplist_value (MPlist *plist) M-TEXT ::= '"' character-sequence '"' - Each kind of @c ELEMENT is assigned one of these keys: - @c Msymbol, @c Minteger, @c Mtext, @c Mplist + Each alternatives of @c ELEMENT is assigned one of these keys: @c + Msymbol, @c Minteger, @c Mtext, @c Mplist In an ascii-character-sequence, a backslush (\) is used as the escape character, which means that, for instance, "abc\ def" produces a symbol whose name is of length seven with the fourth character being a space. */ +/***ja + @brief M-text ¤ò¥Ç¥·¥ê¥¢¥é¥¤¥º¤·¤Æ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤òºî¤ë. + + ´Ø¿ô mplist_deserialize () ¤Ï M-text $MT ¤ò²òÀϤ·¤Æ¥×¥í¥Ñ¥Æ¥£¥ê¥¹ + ¥È¤òÊÖ¤¹¡£ + + $MT ¤Î¥·¥ó¥¿¥Ã¥¯¥¹¤Ï°Ê²¼¤ÎÄ̤ꡣ + + MT ::= '(' ELEMENT * ')' + + ELEMENT ::= SYMBOL | INTEGER | M-TEXT | PLIST + + SYMBOL ::= ¥¢¥¹¥­¡¼Ê¸»úÎó + + INTEGER ::= '-' ? [ '0' | .. | '9' ]+ + | '0x' [ '0' | .. | '9' | 'A' | .. | 'F' | 'a' | .. | 'f' ]+ + + M-TEXT ::= '"' character-sequence '"' + + @c ELEMENT ¤Î³ÆÁªÂò»è¤Ï¥­¡¼¡§@c Msymbol, @c Minteger, @ c Mtext, + @c Mplist ¤Î¤¤¤º¤ì¤«¤ò³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¡£ + + ¥¢¥¹¥­¡¼Ê¸»úÎóÆâ¤Ç¤Ï¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\) ¤¬¥¨¥¹¥±¡¼¥×ʸ»ú¤È¤·¤Æ + ÍѤ¤¤é¤ì¤ë¡£¤¿¤È¤¨¤Ð "abc\ def" ¤Ï£´Ê¸»úÌܤ¬¶õÇòʸ»ú¤Ç¤¢ + ¤êŤµ¤¬£·¤Ç¤¢¤ë»ý¤Ä̾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤òÀ¸À®¤¹¤ë¡£ */ MPlist * mplist_deserialize (MText *mt) @@ -1153,15 +1335,23 @@ mplist_deserialize (MText *mt) /*** @{ */ /***en - @brief Dump a plist. + @brief Dump a property list. - The mdebug_dump_plist () function prints $PLIST in a human - readable way to the stderr. $INDENT specifies how many columns to - indent the lines but the first one. + The mdebug_dump_plist () function prints a property list $PLIST in + a human readable way to the stderr. $INDENT specifies how many + columns to indent the lines but the first one. @return This function returns $PLIST. */ +/***ja + @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤ò¥À¥ó¥×¤¹¤ë. + + ´Ø¿ô mdebug_dump_plist () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È @PLIST ¤ò stderr ¤Ë¿Í + ´Ö¤Ë²ÄÆÉ¤Ê ·Á¤Ç°õºþ¤¹¤ë¡£ $UNDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ + ¤ë¡£ + @return + ¤³¤Î´Ø¿ô¤Ï $PLIST ¤òÊÖ¤¹¡£ */ MPlist * mdebug_dump_plist (MPlist *plist, int indent) {