Print this page
2964 need POSIX 2008 locale object support

@@ -1,10 +1,15 @@
 /*
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2001, 2003 Alexey Zelkin <phantom@FreeBSD.org>
  * All rights reserved.
  *
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ * Portions of this software were developed by David Chisnall
+ * under sponsorship from the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.

@@ -37,19 +42,19 @@
 #include "lmonetary.h"
 #include "timelocal.h"
 
 #define _REL(BASE) ((int)item-BASE)
 
-#define MONETARY        (__get_current_monetary_locale())
+#define MONETARY        (__get_current_monetary_locale(loc))
 #define TIME            (__get_current_time_locale())
-#define MESSAGES        (__get_current_messages_locale())
+#define MESSAGES        (__get_current_messages_locale(loc))    /* XXX */
 #define NUMERIC         (__get_current_numeric_locale())
 
 #pragma weak _nl_langinfo = nl_langinfo
 
 char *
-nl_langinfo(nl_item item)
+nl_langinfo_l(nl_item item, locale_t loc)
 {
         char *ret, *s, *cs;
         static char *csym = NULL;
 
         switch (item) {

@@ -192,5 +197,11 @@
         default:
                 ret = "";
         }
         return (ret);
 }
+
+char *
+nl_langinfo(nl_item item)
+{
+        return (nl_langinfo_l(item, __get_locale()));
+}