]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdlib/strfmon_l.c
hurd: Fix build
[thirdparty/glibc.git] / stdlib / strfmon_l.c
index 71bb5bd386876740b04b99c37e2fcce3ba874264..cd3796ced9805dbe57d26713f16555d5bc77058d 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -84,7 +76,7 @@ extern unsigned int __guess_grouping (unsigned int intdig_max,
    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];
@@ -103,7 +95,7 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format,
       union
       {
        double dbl;
-       __long_double_t ldbl;
+       long double ldbl;
       }
       fpnum;
       int int_format;
@@ -327,9 +319,7 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *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)
@@ -515,7 +505,7 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format,
 #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
@@ -532,7 +522,7 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format,
       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;
 
@@ -612,7 +602,7 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format,
 }
 
 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;