*** empty log message ***
[m17n/m17n-lib.git] / src / locale.c
index 4fe79f1..05dbf46 100644 (file)
@@ -1,5 +1,5 @@
 /* locale.c -- locale module.
-   Copyright (C) 2003, 2004
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
@@ -86,34 +86,24 @@ MLocale *mlocale__messages, *mlocale__time;
 MLocale *mlocale_monetary, *mlocale_numeric, ;
 #endif
 
-/** Parse locale name NAME and return a newly created MLocale object.
-    If the locale is not supported by the system, return NULL.  */
+/** Parse locale name NAME and return a newly created MLocale object.  */
 
 static MLocale *
 make_locale (const char *name)
 {
-  char *current, *new, *str;
+  char *str;
   int len;
   MLocale *locale;
   char c;
 
-  str = setlocale (LC_CTYPE, NULL);
-  len = strlen (str) + 1;
-  current = alloca (len);
-  memcpy (current, str, len); 
-
-  if (! (new = setlocale (LC_CTYPE, name)))
-    return NULL;
-
-
   M17N_OBJECT (locale, NULL, MERROR_LOCALE);
-  locale->name = msymbol (new);
+  locale->name = msymbol (name);
   msymbol_put (locale->name, M_locale, (void *) locale);
   M17N_OBJECT_UNREF (locale);
 
-  len = strlen (new) + 1;
+  len = strlen (name) + 1;
   str = alloca (len);
-  memcpy (str, new, len);
+  memcpy (str, name, len);
 
   c = '\0';
   while (1)
@@ -162,8 +152,6 @@ make_locale (const char *name)
     }
   else
     locale->coding = Mcoding_us_ascii;
-
-  setlocale (LC_CTYPE, current);
   return locale;
 }
 
@@ -344,7 +332,6 @@ MSymbol Mcodeset;
     If the call is successful, mlocale_set () returns an opaque locale
     object that corresponds to the locale.  The name of the locale can
     be acquired by the function mlocale_get_prop ().
-
     Otherwise, it returns NULL.  */
 
 /***ja
@@ -363,7 +350,6 @@ MSymbol Mcodeset;
     ¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤¹¤ì¤Ð¡¢mlocale_set () ¤Ï¥í¥±¡¼¥ë¤ËÂбþ¤¹¤ë opaque 
     ¥í¥±¡¼¥ë¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¡£¥í¥±¡¼¥ë¤Î̾Á°¤Ï´Ø¿ô
     mlocale_get_prop () ¤Ë¤è¤Ã¤ÆÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
-
     ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£
      */
 
@@ -460,7 +446,7 @@ mlocale_get_prop (MLocale *locale, MSymbol key)
     of strftime ().
 
     @seealso
-    strftime ()
+    strftime ().
 */
 /***ja
     @brief ÆüÉդȻþ´Ö¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ë.
@@ -472,7 +458,7 @@ mlocale_get_prop (MLocale *locale, MSymbol key)
     °ú¿ô $TM ¤È $FORMAT ¤Î°ÕÌ£¤Ï strftime () ¤Î¾ì¹ç¤ÈƱ¤¸¡£
 
     @seealso
-    strftime ()
+    strftime ().
 */
 
 int