international currency locale rules as per POSIX.1-2008
authorpelikan <pelikan@openbsd.org>
Mon, 14 Jul 2014 07:22:06 +0000 (07:22 +0000)
committerpelikan <pelikan@openbsd.org>
Mon, 14 Jul 2014 07:22:06 +0000 (07:22 +0000)
required for libc++

ok guenther afresh1

gnu/usr.bin/perl/ext/POSIX/POSIX.xs
gnu/usr.bin/perl/ext/POSIX/lib/POSIX.pod
gnu/usr.bin/perl/ext/POSIX/t/posix.t
include/locale.h
lib/libc/locale/_def_monetary.c
lib/libc/locale/localeconv.c
lib/libc/locale/setlocale.3
sys/sys/localedef.h

index 745cc90..fa1ff5d 100644 (file)
@@ -505,6 +505,12 @@ const struct lconv_offset lconv_integers[] = {
     {"n_sep_by_space",    offsetof(struct lconv, n_sep_by_space)},
     {"p_sign_posn",       offsetof(struct lconv, p_sign_posn)},
     {"n_sign_posn",       offsetof(struct lconv, n_sign_posn)},
+    {"int_p_cs_precedes",      offsetof(struct lconv, int_p_cs_precedes)},
+    {"int_p_sep_by_space",     offsetof(struct lconv, int_p_sep_by_space)},
+    {"int_n_cs_precedes",      offsetof(struct lconv, int_n_cs_precedes)},
+    {"int_n_sep_by_space",     offsetof(struct lconv, int_n_sep_by_space)},
+    {"int_p_sign_posn",                offsetof(struct lconv, int_p_sign_posn)},
+    {"int_n_sign_posn",                offsetof(struct lconv, int_n_sign_posn)},
     {NULL, 0}
 };
 
index 7141b87..5271a21 100644 (file)
@@ -752,6 +752,12 @@ Here is how to query the database for the B<de> (Deutsch or German) locale.
                n_sep_by_space
                p_sign_posn
                n_sign_posn
+               int_p_cs_precedes
+               int_p_sep_by_space
+               int_n_cs_precedes
+               int_n_sep_by_space
+               int_p_sign_posn
+               int_n_sign_posn
        ))
        {
                printf qq(%s: "%s",\n), $property, $lconv->{$property};
index 88fe2ca..d706447 100644 (file)
@@ -331,7 +331,9 @@ SKIP: {
     }
 
     foreach (qw(int_frac_digits frac_digits p_cs_precedes p_sep_by_space
-               n_cs_precedes n_sep_by_space p_sign_posn n_sign_posn)) {
+               n_cs_precedes n_sep_by_space p_sign_posn n_sign_posn
+               int_p_cs_precedes int_p_sep_by_space int_n_cs_precedes
+               int_n_sep_by_space int_p_sign_posn int_n_sign_posn)) {
     SKIP: {
            skip("localeconv has no result for $_", 1)
                unless exists $conv->{$_};
index 80f82b6..3ce65c5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: locale.h,v 1.8 2011/07/03 18:51:01 jsg Exp $  */
+/*     $OpenBSD: locale.h,v 1.9 2014/07/14 07:22:07 pelikan Exp $      */
 /*     $NetBSD: locale.h,v 1.6 1994/10/26 00:56:02 cgd Exp $   */
 
 /*
@@ -54,6 +54,12 @@ struct lconv {
        char    n_sep_by_space;
        char    p_sign_posn;
        char    n_sign_posn;
+       char    int_p_cs_precedes;
+       char    int_p_sep_by_space;
+       char    int_n_cs_precedes;
+       char    int_n_sep_by_space;
+       char    int_p_sign_posn;
+       char    int_n_sign_posn;
 };
 
 #ifndef NULL
index aa92c75..c050020 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: _def_monetary.c,v 1.4 2005/08/08 08:05:35 espie Exp $ */
+/*     $OpenBSD: _def_monetary.c,v 1.5 2014/07/14 07:22:07 pelikan Exp $ */
 /*
  * Written by J.T. Conklin <jtc@netbsd.org>.
  * Public domain.
@@ -19,12 +19,20 @@ const _MonetaryLocale _DefaultMonetaryLocale =
        "",
        CHAR_MAX,
        CHAR_MAX,
+
+       CHAR_MAX,       /* local p_cs_precedes */
+       CHAR_MAX,
+       CHAR_MAX,
+       CHAR_MAX,
+       CHAR_MAX,
+       CHAR_MAX,
+
+       CHAR_MAX,       /* intl p_cs_precedes */
        CHAR_MAX,
        CHAR_MAX,
        CHAR_MAX,
        CHAR_MAX,
        CHAR_MAX,
-       CHAR_MAX
 };
 
 const _MonetaryLocale *_CurrentMonetaryLocale = &_DefaultMonetaryLocale;
index 989eb4b..8421fa3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: localeconv.c,v 1.5 2005/08/08 08:05:35 espie Exp $ */
+/*     $OpenBSD: localeconv.c,v 1.6 2014/07/14 07:22:07 pelikan Exp $ */
 /*
  * Written by J.T. Conklin <jtc@netbsd.org>.
  * Public domain.
@@ -44,6 +44,12 @@ localeconv(void)
        ret.n_sep_by_space      = _CurrentMonetaryLocale->n_sep_by_space;
        ret.p_sign_posn         = _CurrentMonetaryLocale->p_sign_posn;
        ret.n_sign_posn         = _CurrentMonetaryLocale->n_sign_posn;
+       ret.int_p_cs_precedes   = _CurrentMonetaryLocale->int_p_cs_precedes;
+       ret.int_p_sep_by_space  = _CurrentMonetaryLocale->int_p_sep_by_space;
+       ret.int_n_cs_precedes   = _CurrentMonetaryLocale->int_n_cs_precedes;
+       ret.int_n_sep_by_space  = _CurrentMonetaryLocale->int_n_sep_by_space;
+       ret.int_p_sign_posn     = _CurrentMonetaryLocale->int_p_sign_posn;
+       ret.int_n_sign_posn     = _CurrentMonetaryLocale->int_n_sign_posn;
        __mlocale_changed = 0;
     }
 
index b570f19..6836da5 100644 (file)
@@ -1,4 +1,4 @@
-.\"    $OpenBSD: setlocale.3,v 1.14 2013/06/05 03:39:22 tedu Exp $
+.\"    $OpenBSD: setlocale.3,v 1.15 2014/07/14 07:22:07 pelikan Exp $
 .\"    $NetBSD: setlocale.3,v 1.3 1997/07/14 23:19:47 kleink Exp $
 .\"
 .\" Copyright (c) 1993
@@ -33,7 +33,7 @@
 .\"
 .\"    @(#)setlocale.3 8.1 (Berkeley) 6/9/93
 .\"
-.Dd $Mdocdate: June 5 2013 $
+.Dd $Mdocdate: July 14 2014 $
 .Dt SETLOCALE 3
 .Os
 .Sh NAME
@@ -150,6 +150,12 @@ struct lconv {
        char    n_sep_by_space;
        char    p_sign_posn;
        char    n_sign_posn;
+       char    int_p_cs_precedes;
+       char    int_p_sep_by_space;
+       char    int_n_cs_precedes;
+       char    int_n_sep_by_space;
+       char    int_p_sign_posn;
+       char    int_n_sign_posn;
 };
 .Ed
 .Pp
@@ -236,6 +242,30 @@ Just after
 Like
 .Fa p_sign_posn
 but for negative currency values.
+.It Fa int_p_cs_precedes
+Like
+.Fa p_cs_precedes
+but for the international symbol.
+.It Fa int_n_cs_precedes
+Like
+.Fa n_cs_precedes
+but for the international symbol.
+.It Fa int_p_sep_by_space
+Like
+.Fa p_sep_by_space
+but for the international symbol.
+.It Fa int_n_sep_by_space
+Like
+.Fa n_sep_by_space
+but for the international symbol.
+.It Fa int_p_sign_posn
+Like
+.Fa p_sign_posn
+but for the international symbol.
+.It Fa int_n_sign_posn
+Like
+.Fa n_sign_posn
+but for the international symbol.
 .El
 .Pp
 Unless mentioned above,
index b6b5eb1..af45025 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: localedef.h,v 1.3 1996/04/21 22:31:47 deraadt Exp $   */
+/*     $OpenBSD: localedef.h,v 1.4 2014/07/14 07:22:07 pelikan Exp $   */
 /*     $NetBSD: localedef.h,v 1.4 1996/04/09 20:55:31 cgd Exp $        */
 
 /*
@@ -66,6 +66,12 @@ typedef struct
        char n_sep_by_space;
        char p_sign_posn;
        char n_sign_posn;
+       char int_p_cs_precedes;
+       char int_p_sep_by_space;
+       char int_n_cs_precedes;
+       char int_n_sep_by_space;
+       char int_p_sign_posn;
+       char int_n_sign_posn;
 } _MonetaryLocale;
 
 extern const _MonetaryLocale *_CurrentMonetaryLocale;