From: nisikimi Date: Fri, 16 Apr 2004 05:48:12 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: withdl~297 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=2cd5031d51800f2e3133e0ee6728e11a6146264b;p=m17n%2Fm17n-lib.git *** empty log message *** --- diff --git a/src/locale.c b/src/locale.c index 7981ab3..1a1d253 100644 --- a/src/locale.c +++ b/src/locale.c @@ -27,7 +27,7 @@ The m17n library represents locale related information as objects of type #MLocale. */ -/***oldja +/***ja @addtogroup m17nLocale @brief ¥í¥±¡¼¥ë¥ª¥Ö¥¸¥§¥¯¥È¤È¤½¤ì¤Ë´Ø¤¹¤ë API @@ -313,22 +313,22 @@ mlocale__fini () /*=*/ /***en The symbol whose name is "language". */ -/***oldja ¥·¥ó¥Ü¥ë "language" */ +/***ja "language" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë. */ MSymbol Mlanguage; /*=*/ /***en The symbol whose name is "territory". */ -/***oldja ¥·¥ó¥Ü¥ë "territory" */ +/***ja "territory" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë. */ MSymbol Mterritory; /*=*/ /***en The symbol whose name is "modifier". */ -/***oldja ¥·¥ó¥Ü¥ë "modifier" */ +/***ja "modifier" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë. */ MSymbol Mmodifier; /*=*/ /***en The symbol whose name is "codeset". */ -/***oldja ¥·¥ó¥Ü¥ë "codeset" */ +/***ja "codeset" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë. */ MSymbol Mcodeset; /*=*/ @@ -338,7 +338,7 @@ MSymbol Mcodeset; The mlocale_set () function sets or query a part of the current locale. The part is specified by $CATEGORY which must be a valid - first argument to setlocale (). + first argument to setlocale (). If $LOCALE is not NULL, the locale of the specified part is set to $LOCALE. If $LOCALE is not supported by the system, the current @@ -354,17 +354,27 @@ MSymbol Mcodeset; Otherwise, it returns NULL. */ -/***oldja +/***ja @brief ¸½ºß¤Î¥í¥±¡¼¥ë¤òÀßÄꤹ¤ë. - ´Ø¿ô mlocale_set () ¤Ï $LOCALE_NAME ¤ò¸½ºß¤Î¥í¥±¡¼¥ë¤È¤¹¤ë¡£¤³¤Î´Ø - ¿ô¤Ï¥·¥¹¥Æ¥à´Ø¿ô setlocale () ¤ò¸Æ¤Ó¡¢³°ÉôÊÑ¿ô @c - mlocale_current ¤òÀßÄꤹ¤ë¡£ + ´Ø¿ô mlocale_set () ¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î°ìÉô¤òÀßÄꤷ¤¿¤êÌ䤤¹ç¤ï¤»¤¿ + ¤ê¤¹¤ë¡£¤³¤³¤Ç°ìÉô¤È¤Ï $CATEGORY ¤Ç»ØÄꤵ¤ì¡¢setlocale () + ¤ÎÍ­¸ú¤ÊÂè°ì°ú¿ô¤È¤Ê¤ë¤â¤Î¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ - @return - ¥·¥¹¥Æ¥à¤¬ $LOCALE_NAME ¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤Ê¤é¤Ð mlocale_set () ¤Ï 0 - ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼ - ¥É¤òÀßÄꤹ¤ë¡£ */ + $LOCALE ¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢»ØÄꤷ¤¿Éôʬ¤Î¥í¥±¡¼¥ë¤¬$LOCALE ¤ËÀßÄê + ¤µ¤ì¤ë¡£ $LOCALE ¤¬¥·¥¹¥Æ¥à¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ÀßÄê¤Ï¹Ô¤ï + ¤ì¤º¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤ÏÊѤï¤é¤Ê¤¤¡£ + + $LOCALE ¤¬ NULL ¤Ê¤é¤Ð¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î»ØÄꤷ¤¿Éôʬ¤òÌ䤤¹ç¤ï¤»¤ë¡£ + + @return + + ¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤¹¤ì¤Ð¡¢mlocale_set () ¤Ï¥í¥±¡¼¥ë¤ËÂбþ¤¹¤ë opaque + ¥í¥±¡¼¥ë¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¡£¥í¥±¡¼¥ë¤Î̾Á°¤Ï´Ø¿ô mlocale_get_prop + () ¤Ë¤è¤Ã¤ÆÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + + ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£ + */ /*** @errors @@ -421,13 +431,12 @@ mlocale_set (int category, const char *name) $KEY of local $LOCALE. $KEY must be #Mname, #Mlanguage, #Mterritory, #Mcodeset, #Mmodifier, or #Mcoding. */ -/***oldja - @brief ¥í¥±¡¼¥ë¤Î¥×¥í¥Ñ¥Æ¥£ÃͤòÆÀ¤ë +/***ja + @brief ¥í¥±¡¼¥ë¥×¥í¥Ñ¥Æ¥£¤ÎÃͤòÆÀ¤ë ´Ø¿ô mlocale_get_prop () ¤Ï¡¢¥í¥±¡¼¥ë $LOCALE ¤Î $KEY ¥×¥í¥Ñ¥Æ¥£¤Î - ÃͤòÊÖ¤¹¡£ $KEY ¤Ï #Mname ¡¢ #Mlanguage ¡¢ #Mterritory ¡¢ - #Mcodeset ¡¢ #Mmodifier ¤â¤·¤¯¤Ï #Mcoding ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê - ¤¤¡£ */ + ÃͤòÊÖ¤¹¡£ $KEY ¤Ï #Mname, #Mlanguage, #Mterritory, #Mcodeset, + #Mmodifier, #Mcoding ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ */ MSymbol mlocale_get_prop (MLocale *locale, MSymbol key) @@ -449,7 +458,7 @@ mlocale_get_prop (MLocale *locale, MSymbol key) /*=*/ /***en - @brief Format date and time + @brief Format date and time. The mtext_ftime () function formats the broken-down time $TM according to the format specification $FORMAT and append the @@ -461,7 +470,19 @@ mlocale_get_prop (MLocale *locale, MSymbol key) @seealso strftime () +*/ +/***ja + @brief ÆüÉդȻþ´Ö¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ë. + + ´Ø¿ô mtext_ftime () ¤Ï»þ¹ï¥Ç¡¼¥¿ (broken-down time) $TM ¤ò$FORMAT + ¤Ç»ØÄꤵ¤ì¤¿·Á¼°¤ËÀ¶½ñ¤·¡¢·ë²Ì¤òM-text $MT ¤ËÉղ乤롣¥Õ¥©¡¼¥Þ¥Ã + ¥È¤Ï NULL ¤Ç¤Ê¤±¤ì¤Ð ¥í¥±¡¼¥ë $LOCALE ¤Ë¡¢¤Þ¤¿¤Ï¸½ºß¤Î¥í¥±¡¼¥ë + (LC_TIME) ¤Ë½¾¤¦¡£ + + °ú¿ô $TM ¤È $FORMAT ¤Î°ÕÌ£¤Ï strftime () ¤Î¾ì¹ç¤ÈƱ¤¸¡£ + @seealso + strftime () */ int @@ -520,16 +541,26 @@ mtext_ftime (MText *mt, const char *format, const struct tm *tm, /*=*/ /***en - @brief Get an environment variable + @brief Get an environment variable. - The mtext_getenv () function searches the environment list for a - string that matches the string pointed to by $NAME. + The mtext_getenv () function searches the environment variable + list for a string that matches the string pointed to by $NAME. If there is a match, the function decodes the value according to the current locale (LC_CTYPE) into an M-text, and return that M-text. If there is no match, the function returns NULL. */ +/***ja + @brief ´Ä¶­ÊÑ¿ô¤òÆÀ¤ë. + + ´Ø¿ô mtext_getenv () ¤Ï $NAME ¤Ç»Ø¤µ¤ì¤ëʸ»úÎó¤È¹çÃפ¹¤ëʸ»úÎó¤ò + ´Ä¶­ÊÑ¿ô¤Î¥ê¥¹¥ÈÃ椫¤éõ¤¹¡£ + + ¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÃͤò¸½ºß¤Î¥í¥±¡¼¥ë(LC_CTYPE) ¤Ë½¾¤Ã¤Æ + M-text ¤Ë¥Ç¥³¡¼¥É¤·¡¢¤½¤ÎM-text ¤òÊÖ¤¹¡£ + + ¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð¡¢NULL ¤òÊÖ¤¹¡£ */ MText * mtext_getenv (const char *name) @@ -546,14 +577,25 @@ mtext_getenv (const char *name) /***en @brief Change or add an environment variable. - The mtext_putenv () function adds or changed the value of - environment variables according to M-text $MT. It simply calls - the function putenv with an argument generated by encoding $MT - according to the current locale (LC_CTYPE). + The mtext_putenv () function changes or adds the value of + environment variables according to M-text $MT. It calls the + function putenv with an argument generated by encoding + $MT according to the current locale (LC_CTYPE). @return This function returns zero on success, or -1 if an error occurs. */ +/***ja + @brief ´Ä¶­ÊÑ¿ô¤òÊѹ¹¡¿Äɲ乤ë. + + ´Ø¿ô mtext_putenv () ¤Ï M-text $MT ¤Ë½¾¤Ã¤Æ¡¢´Ä¶­ÊÑ¿ô¤ÎÃͤòÊѹ¹¤· + ¤¿¤êÄɲä·¤¿¤ê¤¹¤ë¡£¤³¤Î´Ø¿ô¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë(LC_CTYPE) ¤Ë½¾¤Ã¤Æ + $MT ¤ò¥¨¥ó¥³¡¼¥É¤·¡¢¤½¤ì¤ò°ú¿ô¤È¤·¤Æ´Ø¿ô putenv ¤ò¸Æ¤Ö¡£ + + @return + ¤³¤Î´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤ò¡¢¥¨¥é¡¼¤¬µ¯¤³¤ì¤Ð -1 ¤òÊÖ¤¹¡£ + */ + int mtext_putenv (MText *mt) @@ -585,6 +627,17 @@ mtext_putenv (MText *mt) cached in the M-texts as a text property. So, the second call of this function with $MT1 or $MT2 finishes faster than the first call. */ +/***ja + @brief ¸½ºß¤Î¥í¥±¡¼¥ë¤òÍѤ¤¤Æ£²¤Ä¤Î M-text ¤òÈæ³Ó¤¹¤ë. + + ´Ø¿ô mtext_coll () ¤Ï£²¤Ä¤Î M-text $MT1 ¤È $MT2 ¤òÈæ³Ó¤¹¤ë¡£Ìá¤êÃÍ + ¤ÏÉé¤ÎÀ°¿ôÃÍ, 0, Àµ¤ÎÀ°¿ôÃͤΤ¤¤º¤ì¤«¤Ç¤¢¤ê¡¢¤½¤ì¤¾¤ì$MT1 ¤¬ $MT2 + ¤è¤ê¾®¤µ¤¤¡¢Æ±¤¸¡¢Â礭¤¤¾ì¹ç¤ËÁêÅö¤¹¤ë¡£Èæ³Ó¤Ï¸½ºß¤Î¥í¥±¡¼¥ë + (LC_COLLATE) ¤Ë´ð¤Å¤¤¤Æ¹Ô¤ï¤ì¤ë¡£ + + ¤³¤Î´Ø¿ô¤Ï M-text ¤Î¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤È¤·¤Æ¼«Æ°Åª¤Ë¥­¥ã¥Ã¥·¥å¤µ¤ì + ¤ë¾ðÊó¤òÍøÍѤ¹¤ë¤Î¤Ç¡¢£²ÅÙÌܰʹߤÎƱ¤¸Èæ³Ó¤Ï£±ÅÙÌܤè¤ê®¤¯¼Â¹Ô¤µ¤ì + ¤ë¡£ */ int mtext_coll (MText *mt1, MText *mt2)