This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Complete display of LC_MONETARY


crncystr and conversion_rate where missing, the latter because wordarray
elements were ignored.

Andreas.

	* locale/programs/locale.c (show_info): Decode wordarray elements.
	* locale/categories.def (LC_MONETARY): Add element for
	_NL_MONETARY_CRNCYSTR.
---
 locale/categories.def    |  1 +
 locale/programs/locale.c | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/locale/categories.def b/locale/categories.def
index 8c25378..e1172e9 100644
--- a/locale/categories.def
+++ b/locale/categories.def
@@ -156,6 +156,7 @@ DEFINE_CATEGORY
   DEFINE_ELEMENT (N_SEP_BY_SPACE,                      "n_sep_by_space",         std, byte, 0, 2)
   DEFINE_ELEMENT (P_SIGN_POSN,                         "p_sign_posn",            std, byte, 0, 4)
   DEFINE_ELEMENT (N_SIGN_POSN,                         "n_sign_posn",            std, byte, 0, 4)
+  DEFINE_ELEMENT (_NL_MONETARY_CRNCYSTR,               "crncystr",               std, string)
   DEFINE_ELEMENT (__INT_P_CS_PRECEDES,                 "int_p_cs_precedes",      std, byte, 0, 1)
   DEFINE_ELEMENT (__INT_P_SEP_BY_SPACE,                "int_p_sep_by_space",     std, byte, 0, 2)
   DEFINE_ELEMENT (__INT_N_CS_PRECEDES,                 "int_n_cs_precedes",      std, byte, 0, 1)
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 4f8734c..3d5c71e 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -927,6 +927,24 @@ show_info (const char *name)
 	    printf ("%d\n", val.word);
 	  }
 	  break;
+	case wordarray:
+	  {
+	    int first = 1;
+	    union { unsigned int *wordarray; char *string; } val;
+	    int cnt;
+
+	    val.string = nl_langinfo (item->item_id);
+	    if (show_keyword_name)
+	      printf ("%s=", item->name);
+
+	    for (cnt = 0; cnt < item->max; ++cnt)
+	      {
+		printf ("%s%d", first ? "" : ";", val.wordarray[cnt]);
+		first = 0;
+	      }
+	    putchar ('\n');
+	  }
+	  break;
 	case wstring:
 	case wstringarray:
 	case wstringlist:
-- 
1.8.4.3

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]