6 const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *tm, locale_t loc);
8 size_t __wcsftime_l(wchar_t *restrict s, size_t n, const wchar_t *restrict f, const struct tm *restrict tm, locale_t loc)
28 if ((plus = (*f == '+'))) f++;
29 width = wcstoul(f, &p, 10);
30 if (*p == 'C' || *p == 'F' || *p == 'G' || *p == 'Y') {
31 if (!width && p!=f) width = 1;
36 if (*f == 'E' || *f == 'O') f++;
37 t_mb = __strftime_fmt_1(&buf, &k, *f, tm, loc);
39 k = mbstowcs(wbuf, t_mb, sizeof wbuf / sizeof *wbuf);
40 if (k == (size_t)-1) return 0;
43 for (; *t=='+' || *t=='-' || (*t=='0'&&t[1]); t++, k--);
45 if (plus && tm->tm_year >= 10000-1900)
47 else if (tm->tm_year < -1900)
51 for (; width > k && l < n; width--)
54 if (k >= n-l) k = n-l;
65 size_t wcsftime(wchar_t *restrict wcs, size_t n, const wchar_t *restrict f, const struct tm *restrict tm)
67 return __wcsftime_l(wcs, n, f, tm, 0);
70 weak_alias(__wcsftime_l, wcsftime_l);