/* Formatting a monetary value according to the given locale.
- Copyright (C) 1996-2014 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
#define _NL_CURRENT(category, item) \
(current->values[_NL_ITEM_INDEX (item)].string)
-extern int __printf_fp (FILE *, const struct printf_info *,
- const void *const *);
-libc_hidden_proto (__printf_fp)
-/* This function determines the number of digit groups in the output.
- The definition is in printf_fp.c. */
-extern unsigned int __guess_grouping (unsigned int intdig_max,
- const char *grouping, wchar_t sepchar);
-
/* We have to overcome some problems with this implementation. On the
one hand the strfmon() function is specified in XPG4 and of course
too. Some of the information contradicts the information which can
be specified in format string. */
ssize_t
-__vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format,
+__vstrfmon_l (char *s, size_t maxsize, locale_t loc, const char *format,
va_list ap)
{
struct __locale_data *current = loc->__locales[LC_MONETARY];
union
{
double dbl;
- __long_double_t ldbl;
+ long double ldbl;
}
fpnum;
int int_format;
extra characters this means. */
if (group && left_prec != -1)
left_prec += __guess_grouping (left_prec,
- _NL_CURRENT (LC_MONETARY, MON_GROUPING),
- *_NL_CURRENT (LC_MONETARY,
- MON_THOUSANDS_SEP));
+ _NL_CURRENT (LC_MONETARY, MON_GROUPING));
/* Now it's time to get the value. */
if (is_long_double == 1)
#ifdef _IO_MTSAFE_IO
f._sbf._f._lock = NULL;
#endif
- _IO_init (&f._sbf._f, 0);
+ _IO_init_internal (&f._sbf._f, 0);
_IO_JUMPS (&f._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&f, dest, (s + maxsize) - dest, dest);
/* We clear the last available byte so we can find out whether
info.extra = 1; /* This means use values from LC_MONETARY. */
ptr = &fpnum;
- done = __printf_fp (&f._sbf._f, &info, &ptr);
+ done = __printf_fp_l (&f._sbf._f, loc, &info, &ptr);
if (done < 0)
return -1;
}
ssize_t
-___strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
+___strfmon_l (char *s, size_t maxsize, locale_t loc, const char *format, ...)
{
va_list ap;