summaryrefslogtreecommitdiffstats
path: root/newlib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/locale/nl_langinfo.c15
-rw-r--r--newlib/libc/locale/timelocal.c28
-rw-r--r--newlib/libc/locale/timelocal.h5
3 files changed, 37 insertions, 11 deletions
diff --git a/newlib/libc/locale/nl_langinfo.c b/newlib/libc/locale/nl_langinfo.c
index 8e8856de7..2f47c8735 100644
--- a/newlib/libc/locale/nl_langinfo.c
+++ b/newlib/libc/locale/nl_langinfo.c
@@ -175,24 +175,19 @@ _DEFUN(nl_langinfo, (item),
ret = (char*) __get_current_time_locale()->mon[_REL(ABMON_1)];
break;
case ERA:
- /* XXX: need to be implemented */
- ret = "";
+ ret = (char*) __get_current_time_locale()->era;
break;
case ERA_D_FMT:
- /* XXX: need to be implemented */
- ret = "";
+ ret = (char*) __get_current_time_locale()->era_d_fmt;
break;
case ERA_D_T_FMT:
- /* XXX: need to be implemented */
- ret = "";
+ ret = (char*) __get_current_time_locale()->era_d_t_fmt;
break;
case ERA_T_FMT:
- /* XXX: need to be implemented */
- ret = "";
+ ret = (char*) __get_current_time_locale()->era_t_fmt;
break;
case ALT_DIGITS:
- /* XXX: need to be implemented */
- ret = "";
+ ret = (char*) __get_current_time_locale()->alt_digits;
break;
case RADIXCHAR:
ret = (char*) __get_current_numeric_locale()->decimal_point;
diff --git a/newlib/libc/locale/timelocal.c b/newlib/libc/locale/timelocal.c
index 17b9a2350..4c0f50c76 100644
--- a/newlib/libc/locale/timelocal.c
+++ b/newlib/libc/locale/timelocal.c
@@ -92,7 +92,33 @@ static const struct lc_time_T _C_time_locale = {
/* ampm_fmt
* To determine 12-hour clock format time (empty, if N/A)
*/
- "%I:%M:%S %p"
+ "%I:%M:%S %p",
+
+ /* era
+ * Era. This and the following entries are used if the alternative
+ * date format is specified in strftime
+ */
+ "",
+
+ /* era_d_fmt
+ * Era date format used with the %Ex
+ */
+ "",
+
+ /* era_d_t_fmt
+ * Era date/time format (%Ec)
+ */
+ "",
+
+ /* era_t_fmt
+ * Era time format (%EX)
+ */
+ "",
+
+ /* alt_digits
+ * Alternate digits used if %O format prefix is specified
+ */
+ ""
};
struct lc_time_T *
diff --git a/newlib/libc/locale/timelocal.h b/newlib/libc/locale/timelocal.h
index e232a7304..80f72b66e 100644
--- a/newlib/libc/locale/timelocal.h
+++ b/newlib/libc/locale/timelocal.h
@@ -50,6 +50,11 @@ struct lc_time_T {
const char *alt_month[12];
const char *md_order;
const char *ampm_fmt;
+ const char *era;
+ const char *era_d_fmt;
+ const char *era_d_t_fmt;
+ const char *era_t_fmt;
+ const char *alt_digits;
};
struct lc_time_T *__get_current_time_locale(void);