1 /* *printf* family compatibility routines for IEEE double as long double
2 Copyright (C) 2006-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Jakub Jelinek <jakub@cygnus.com>, 2006.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <https://www.gnu.org/licenses/>. */
20 /* This file may define some of the deprecated scanf variants. */
22 #undef __GLIBC_USE_DEPRECATED_SCANF
23 #define __GLIBC_USE_DEPRECATED_SCANF 1
30 #include <libio/strfile.h>
35 #include <locale/localeinfo.h>
36 #include <sys/syslog.h>
37 #include <libc-lock.h>
39 #include "nldbl-compat.h"
41 libc_hidden_proto (__nldbl_vsscanf
)
42 libc_hidden_proto (__nldbl_vfscanf
)
43 libc_hidden_proto (__nldbl_vfwscanf
)
44 libc_hidden_proto (__nldbl_vswscanf
)
45 libc_hidden_proto (__nldbl___isoc99_vsscanf
)
46 libc_hidden_proto (__nldbl___isoc99_vfscanf
)
47 libc_hidden_proto (__nldbl___isoc99_vswscanf
)
48 libc_hidden_proto (__nldbl___isoc99_vfwscanf
)
50 /* Compatibility with IEEE double as long double.
51 IEEE quad long double is used by default for most programs, so
52 we don't need to split this into one file per function for the
53 sake of statically linked programs. */
56 attribute_compat_text_section
57 __nldbl___asprintf (char **string_ptr
, const char *fmt
, ...)
63 ret
= __vasprintf_internal (string_ptr
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
68 weak_alias (__nldbl___asprintf
, __nldbl_asprintf
)
71 attribute_compat_text_section
72 __nldbl_dprintf (int d
, const char *fmt
, ...)
78 ret
= __vdprintf_internal (d
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
85 attribute_compat_text_section
86 __nldbl_fprintf (FILE *stream
, const char *fmt
, ...)
92 ret
= __vfprintf_internal (stream
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
97 weak_alias (__nldbl_fprintf
, __nldbl__IO_fprintf
)
100 attribute_compat_text_section weak_function
101 __nldbl_fwprintf (FILE *stream
, const wchar_t *fmt
, ...)
107 ret
= __vfwprintf_internal (stream
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
114 attribute_compat_text_section
115 __nldbl_printf (const char *fmt
, ...)
121 ret
= __vfprintf_internal (stdout
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
126 strong_alias (__nldbl_printf
, __nldbl__IO_printf
)
129 attribute_compat_text_section
130 __nldbl_sprintf (char *s
, const char *fmt
, ...)
136 ret
= __vsprintf_internal (s
, -1, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
141 strong_alias (__nldbl_sprintf
, __nldbl__IO_sprintf
)
144 attribute_compat_text_section
145 __nldbl_vfprintf (FILE *s
, const char *fmt
, va_list ap
)
147 return __vfprintf_internal (s
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
149 strong_alias (__nldbl_vfprintf
, __nldbl__IO_vfprintf
)
152 attribute_compat_text_section
153 __nldbl___vsprintf (char *string
, const char *fmt
, va_list ap
)
155 return __vsprintf_internal (string
, -1, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
157 strong_alias (__nldbl___vsprintf
, __nldbl__IO_vsprintf
)
158 weak_alias (__nldbl___vsprintf
, __nldbl_vsprintf
)
161 attribute_compat_text_section
162 __nldbl_obstack_vprintf (struct obstack
*obstack
, const char *fmt
,
165 return __obstack_vprintf_internal (obstack
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
169 attribute_compat_text_section
170 __nldbl_obstack_printf (struct obstack
*obstack
, const char *fmt
, ...)
175 ret
= __obstack_vprintf_internal (obstack
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
181 attribute_compat_text_section weak_function
182 __nldbl_snprintf (char *s
, size_t maxlen
, const char *fmt
, ...)
188 ret
= __vsnprintf_internal (s
, maxlen
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
195 attribute_compat_text_section
196 __nldbl_swprintf (wchar_t *s
, size_t n
, const wchar_t *fmt
, ...)
202 ret
= __vswprintf_internal (s
, n
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
209 attribute_compat_text_section weak_function
210 __nldbl_vasprintf (char **result_ptr
, const char *fmt
, va_list ap
)
212 return __vasprintf_internal (result_ptr
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
216 attribute_compat_text_section
217 __nldbl_vdprintf (int d
, const char *fmt
, va_list ap
)
219 return __vdprintf_internal (d
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
223 attribute_compat_text_section weak_function
224 __nldbl_vfwprintf (FILE *s
, const wchar_t *fmt
, va_list ap
)
226 return __vfwprintf_internal (s
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
230 attribute_compat_text_section
231 __nldbl_vprintf (const char *fmt
, va_list ap
)
233 return __vfprintf_internal (stdout
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
237 attribute_compat_text_section
238 __nldbl_vsnprintf (char *string
, size_t maxlen
, const char *fmt
,
241 return __vsnprintf_internal (string
, maxlen
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
243 weak_alias (__nldbl_vsnprintf
, __nldbl___vsnprintf
)
246 attribute_compat_text_section weak_function
247 __nldbl_vswprintf (wchar_t *string
, size_t maxlen
, const wchar_t *fmt
,
250 return __vswprintf_internal (string
, maxlen
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
254 attribute_compat_text_section
255 __nldbl_vwprintf (const wchar_t *fmt
, va_list ap
)
257 return __vfwprintf_internal (stdout
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
261 attribute_compat_text_section
262 __nldbl_wprintf (const wchar_t *fmt
, ...)
268 ret
= __vfwprintf_internal (stdout
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
274 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_29)
276 attribute_compat_text_section
277 __nldbl__IO_vfscanf (FILE *s
, const char *fmt
, va_list ap
, int *errp
)
279 int ret
= __vfscanf_internal (s
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
280 if (__glibc_unlikely (errp
!= 0))
287 attribute_compat_text_section
288 __nldbl___vfscanf (FILE *s
, const char *fmt
, va_list ap
)
290 return __vfscanf_internal (s
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
292 weak_alias (__nldbl___vfscanf
, __nldbl_vfscanf
)
293 libc_hidden_def (__nldbl_vfscanf
)
296 attribute_compat_text_section
297 __nldbl_sscanf (const char *s
, const char *fmt
, ...)
300 FILE *f
= _IO_strfile_read (&sf
, s
);
305 ret
= __vfscanf_internal (f
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
310 strong_alias (__nldbl_sscanf
, __nldbl__IO_sscanf
)
313 attribute_compat_text_section
314 __nldbl___vsscanf (const char *s
, const char *fmt
, va_list ap
)
317 FILE *f
= _IO_strfile_read (&sf
, s
);
318 return __vfscanf_internal (f
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
320 weak_alias (__nldbl___vsscanf
, __nldbl_vsscanf
)
321 libc_hidden_def (__nldbl_vsscanf
)
324 attribute_compat_text_section weak_function
325 __nldbl_vscanf (const char *fmt
, va_list ap
)
327 return __vfscanf_internal (stdin
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
331 attribute_compat_text_section
332 __nldbl_fscanf (FILE *stream
, const char *fmt
, ...)
338 ret
= __vfscanf_internal (stream
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
345 attribute_compat_text_section
346 __nldbl_scanf (const char *fmt
, ...)
352 ret
= __vfscanf_internal (stdin
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
359 attribute_compat_text_section
360 __nldbl_vfwscanf (FILE *s
, const wchar_t *fmt
, va_list ap
)
362 return __vfwscanf_internal (s
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
364 libc_hidden_def (__nldbl_vfwscanf
)
367 attribute_compat_text_section
368 __nldbl_swscanf (const wchar_t *s
, const wchar_t *fmt
, ...)
371 struct _IO_wide_data wd
;
372 FILE *f
= _IO_strfile_readw (&sf
, &wd
, s
);
377 ret
= __vfwscanf_internal (f
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
384 attribute_compat_text_section
385 __nldbl_vswscanf (const wchar_t *s
, const wchar_t *fmt
, va_list ap
)
388 struct _IO_wide_data wd
;
389 FILE *f
= _IO_strfile_readw (&sf
, &wd
, s
);
391 return __vfwscanf_internal (f
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
393 libc_hidden_def (__nldbl_vswscanf
)
396 attribute_compat_text_section weak_function
397 __nldbl_vwscanf (const wchar_t *fmt
, va_list ap
)
399 return __vfwscanf_internal (stdin
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
403 attribute_compat_text_section
404 __nldbl_fwscanf (FILE *stream
, const wchar_t *fmt
, ...)
410 ret
= __vfwscanf_internal (stream
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
417 attribute_compat_text_section
418 __nldbl_wscanf (const wchar_t *fmt
, ...)
424 ret
= __vfwscanf_internal (stdin
, fmt
, ap
, SCANF_LDBL_IS_DBL
);
431 attribute_compat_text_section
432 __nldbl___fprintf_chk (FILE *stream
, int flag
, const char *fmt
, ...)
436 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
438 mode
|= PRINTF_FORTIFY
;
441 ret
= __vfprintf_internal (stream
, fmt
, ap
, mode
);
448 attribute_compat_text_section
449 __nldbl___fwprintf_chk (FILE *stream
, int flag
, const wchar_t *fmt
, ...)
453 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
455 mode
|= PRINTF_FORTIFY
;
458 ret
= __vfwprintf_internal (stream
, fmt
, ap
, mode
);
465 attribute_compat_text_section
466 __nldbl___printf_chk (int flag
, const char *fmt
, ...)
470 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
472 mode
|= PRINTF_FORTIFY
;
475 ret
= __vfprintf_internal (stdout
, fmt
, ap
, mode
);
482 attribute_compat_text_section
483 __nldbl___snprintf_chk (char *s
, size_t maxlen
, int flag
, size_t slen
,
484 const char *fmt
, ...)
486 if (__glibc_unlikely (slen
< maxlen
))
491 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
493 mode
|= PRINTF_FORTIFY
;
496 ret
= __vsnprintf_internal (s
, maxlen
, fmt
, ap
, mode
);
503 attribute_compat_text_section
504 __nldbl___sprintf_chk (char *s
, int flag
, size_t slen
, const char *fmt
, ...)
511 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
513 mode
|= PRINTF_FORTIFY
;
516 ret
= __vsprintf_internal (s
, slen
, fmt
, ap
, mode
);
523 attribute_compat_text_section
524 __nldbl___swprintf_chk (wchar_t *s
, size_t maxlen
, int flag
, size_t slen
,
525 const wchar_t *fmt
, ...)
527 if (__glibc_unlikely (slen
< maxlen
))
532 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
534 mode
|= PRINTF_FORTIFY
;
537 ret
= __vswprintf_internal (s
, maxlen
, fmt
, ap
, mode
);
544 attribute_compat_text_section
545 __nldbl___vfprintf_chk (FILE *s
, int flag
, const char *fmt
, va_list ap
)
547 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
549 mode
|= PRINTF_FORTIFY
;
551 return __vfprintf_internal (s
, fmt
, ap
, mode
);
555 attribute_compat_text_section
556 __nldbl___vfwprintf_chk (FILE *s
, int flag
, const wchar_t *fmt
, va_list ap
)
558 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
560 mode
|= PRINTF_FORTIFY
;
562 return __vfwprintf_internal (s
, fmt
, ap
, mode
);
566 attribute_compat_text_section
567 __nldbl___vprintf_chk (int flag
, const char *fmt
, va_list ap
)
569 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
571 mode
|= PRINTF_FORTIFY
;
573 return __vfprintf_internal (stdout
, fmt
, ap
, mode
);
577 attribute_compat_text_section
578 __nldbl___vsnprintf_chk (char *string
, size_t maxlen
, int flag
, size_t slen
,
579 const char *fmt
, va_list ap
)
581 if (__glibc_unlikely (slen
< maxlen
))
584 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
586 mode
|= PRINTF_FORTIFY
;
588 return __vsnprintf_internal (string
, maxlen
, fmt
, ap
, mode
);
592 attribute_compat_text_section
593 __nldbl___vsprintf_chk (char *string
, int flag
, size_t slen
, const char *fmt
,
599 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
601 mode
|= PRINTF_FORTIFY
;
603 return __vsprintf_internal (string
, slen
, fmt
, ap
, mode
);
607 attribute_compat_text_section
608 __nldbl___vswprintf_chk (wchar_t *string
, size_t maxlen
, int flag
, size_t slen
,
609 const wchar_t *fmt
, va_list ap
)
611 if (__glibc_unlikely (slen
< maxlen
))
614 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
616 mode
|= PRINTF_FORTIFY
;
618 return __vswprintf_internal (string
, maxlen
, fmt
, ap
, mode
);
622 attribute_compat_text_section
623 __nldbl___vwprintf_chk (int flag
, const wchar_t *fmt
, va_list ap
)
625 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
627 mode
|= PRINTF_FORTIFY
;
629 return __vfwprintf_internal (stdout
, fmt
, ap
, mode
);
633 attribute_compat_text_section
634 __nldbl___wprintf_chk (int flag
, const wchar_t *fmt
, ...)
638 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
640 mode
|= PRINTF_FORTIFY
;
643 ret
= __vfwprintf_internal (stdout
, fmt
, ap
, mode
);
650 attribute_compat_text_section
651 __nldbl___vasprintf_chk (char **ptr
, int flag
, const char *fmt
, va_list ap
)
653 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
655 mode
|= PRINTF_FORTIFY
;
657 return __vasprintf_internal (ptr
, fmt
, ap
, mode
);
661 attribute_compat_text_section
662 __nldbl___asprintf_chk (char **ptr
, int flag
, const char *fmt
, ...)
666 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
668 mode
|= PRINTF_FORTIFY
;
671 ret
= __vasprintf_internal (ptr
, fmt
, ap
, mode
);
678 attribute_compat_text_section
679 __nldbl___vdprintf_chk (int d
, int flag
, const char *fmt
, va_list ap
)
681 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
683 mode
|= PRINTF_FORTIFY
;
685 return __vdprintf_internal (d
, fmt
, ap
, mode
);
689 attribute_compat_text_section
690 __nldbl___dprintf_chk (int d
, int flag
, const char *fmt
, ...)
694 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
696 mode
|= PRINTF_FORTIFY
;
699 ret
= __vdprintf_internal (d
, fmt
, ap
, mode
);
706 attribute_compat_text_section
707 __nldbl___obstack_vprintf_chk (struct obstack
*obstack
, int flag
,
708 const char *fmt
, va_list ap
)
710 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
712 mode
|= PRINTF_FORTIFY
;
714 return __obstack_vprintf_internal (obstack
, fmt
, ap
, mode
);
718 attribute_compat_text_section
719 __nldbl___obstack_printf_chk (struct obstack
*obstack
, int flag
,
720 const char *fmt
, ...)
724 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
726 mode
|= PRINTF_FORTIFY
;
729 ret
= __obstack_vprintf_internal (obstack
, fmt
, ap
, mode
);
735 extern __typeof (printf_size
) __printf_size
;
738 attribute_compat_text_section
739 __nldbl_printf_size (FILE *fp
, const struct printf_info
*info
,
740 const void *const *args
)
742 struct printf_info info_no_ldbl
= *info
;
744 info_no_ldbl
.is_long_double
= 0;
745 return __printf_size (fp
, &info_no_ldbl
, args
);
748 extern __typeof (__printf_fp
) ___printf_fp
;
751 attribute_compat_text_section
752 __nldbl___printf_fp (FILE *fp
, const struct printf_info
*info
,
753 const void *const *args
)
755 struct printf_info info_no_ldbl
= *info
;
757 info_no_ldbl
.is_long_double
= 0;
758 return ___printf_fp (fp
, &info_no_ldbl
, args
);
762 attribute_compat_text_section
763 __nldbl_strfmon (char *s
, size_t maxsize
, const char *format
, ...)
768 va_start (ap
, format
);
769 ret
= __vstrfmon_l_internal (s
, maxsize
, _NL_CURRENT_LOCALE
, format
, ap
,
770 STRFMON_LDBL_IS_DBL
);
776 attribute_compat_text_section
777 __nldbl___strfmon_l (char *s
, size_t maxsize
, locale_t loc
,
778 const char *format
, ...)
783 va_start (ap
, format
);
784 ret
= __vstrfmon_l_internal (s
, maxsize
, loc
, format
, ap
,
785 STRFMON_LDBL_IS_DBL
);
789 weak_alias (__nldbl___strfmon_l
, __nldbl_strfmon_l
)
792 attribute_compat_text_section
793 __nldbl___vstrfmon (char *s
, size_t maxsize
, const char *format
, va_list ap
)
795 return __vstrfmon_l_internal (s
, maxsize
, _NL_CURRENT_LOCALE
, format
, ap
,
796 STRFMON_LDBL_IS_DBL
);
800 attribute_compat_text_section
801 __nldbl___vstrfmon_l (char *s
, size_t maxsize
, locale_t loc
,
802 const char *format
, va_list ap
)
804 return __vstrfmon_l_internal (s
, maxsize
, loc
, format
, ap
,
805 STRFMON_LDBL_IS_DBL
);
809 attribute_compat_text_section
810 __nldbl_syslog (int pri
, const char *fmt
, ...)
814 __vsyslog_internal (pri
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
819 attribute_compat_text_section
820 __nldbl_vsyslog (int pri
, const char *fmt
, va_list ap
)
822 __vsyslog_internal (pri
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
826 attribute_compat_text_section
827 __nldbl___syslog_chk (int pri
, int flag
, const char *fmt
, ...)
830 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
832 mode
|= PRINTF_FORTIFY
;
835 __vsyslog_internal (pri
, fmt
, ap
, mode
);
840 attribute_compat_text_section
841 __nldbl___vsyslog_chk (int pri
, int flag
, const char *fmt
, va_list ap
)
843 unsigned int mode
= PRINTF_LDBL_IS_DBL
;
845 mode
|= PRINTF_FORTIFY
;
847 __vsyslog_internal (pri
, fmt
, ap
, mode
);
851 attribute_compat_text_section
852 __nldbl___isoc99_vfscanf (FILE *s
, const char *fmt
, va_list ap
)
854 return __vfscanf_internal (s
, fmt
, ap
, SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
856 libc_hidden_def (__nldbl___isoc99_vfscanf
)
859 attribute_compat_text_section
860 __nldbl___isoc99_sscanf (const char *s
, const char *fmt
, ...)
863 FILE *f
= _IO_strfile_read (&sf
, s
);
868 ret
= __vfscanf_internal (f
, fmt
, ap
, SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
875 attribute_compat_text_section
876 __nldbl___isoc99_vsscanf (const char *s
, const char *fmt
, va_list ap
)
879 FILE *f
= _IO_strfile_read (&sf
, s
);
881 return __vfscanf_internal (f
, fmt
, ap
, SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
883 libc_hidden_def (__nldbl___isoc99_vsscanf
)
886 attribute_compat_text_section
887 __nldbl___isoc99_vscanf (const char *fmt
, va_list ap
)
889 return __vfscanf_internal (stdin
, fmt
, ap
,
890 SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
894 attribute_compat_text_section
895 __nldbl___isoc99_fscanf (FILE *s
, const char *fmt
, ...)
901 ret
= __vfscanf_internal (s
, fmt
, ap
, SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
908 attribute_compat_text_section
909 __nldbl___isoc99_scanf (const char *fmt
, ...)
915 ret
= __vfscanf_internal (stdin
, fmt
, ap
,
916 SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
923 attribute_compat_text_section
924 __nldbl___isoc99_vfwscanf (FILE *s
, const wchar_t *fmt
, va_list ap
)
926 return __vfwscanf_internal (s
, fmt
, ap
, SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
928 libc_hidden_def (__nldbl___isoc99_vfwscanf
)
931 attribute_compat_text_section
932 __nldbl___isoc99_swscanf (const wchar_t *s
, const wchar_t *fmt
, ...)
935 struct _IO_wide_data wd
;
936 FILE *f
= _IO_strfile_readw (&sf
, &wd
, s
);
941 ret
= __vfwscanf_internal (f
, fmt
, ap
, SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
948 attribute_compat_text_section
949 __nldbl___isoc99_vswscanf (const wchar_t *s
, const wchar_t *fmt
, va_list ap
)
952 struct _IO_wide_data wd
;
953 FILE *f
= _IO_strfile_readw (&sf
, &wd
, s
);
955 return __vfwscanf_internal (f
, fmt
, ap
, SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
957 libc_hidden_def (__nldbl___isoc99_vswscanf
)
960 attribute_compat_text_section
961 __nldbl___isoc99_vwscanf (const wchar_t *fmt
, va_list ap
)
963 return __vfwscanf_internal (stdin
, fmt
, ap
,
964 SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
968 attribute_compat_text_section
969 __nldbl___isoc99_fwscanf (FILE *s
, const wchar_t *fmt
, ...)
975 ret
= __vfwscanf_internal (s
, fmt
, ap
, SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
982 attribute_compat_text_section
983 __nldbl___isoc99_wscanf (const wchar_t *fmt
, ...)
989 ret
= __vfwscanf_internal (stdin
, fmt
, ap
,
990 SCANF_LDBL_IS_DBL
| SCANF_ISOC99_A
);
997 __nldbl_argp_error (const struct argp_state
*state
, const char *fmt
, ...)
1001 __argp_error_internal (state
, fmt
, ap
, PRINTF_LDBL_IS_DBL
);
1006 __nldbl_argp_failure (const struct argp_state
*state
, int status
,
1007 int errnum
, const char *fmt
, ...)
1011 __argp_failure_internal (state
, status
, errnum
, fmt
, ap
,
1012 PRINTF_LDBL_IS_DBL
);
1016 #define VA_CALL(call) \
1019 va_start (ap, format); \
1020 call (format, ap, PRINTF_LDBL_IS_DBL); \
1025 __nldbl_err (int status
, const char *format
, ...)
1027 VA_CALL (__vwarn_internal
)
1032 __nldbl_errx (int status
, const char *format
, ...)
1034 VA_CALL (__vwarnx_internal
)
1039 __nldbl_verr (int status
, const char *format
, __gnuc_va_list ap
)
1041 __vwarn_internal (format
, ap
, PRINTF_LDBL_IS_DBL
);
1046 __nldbl_verrx (int status
, const char *format
, __gnuc_va_list ap
)
1048 __vwarnx_internal (format
, ap
, PRINTF_LDBL_IS_DBL
);
1053 __nldbl_warn (const char *format
, ...)
1055 VA_CALL (__vwarn_internal
)
1059 __nldbl_warnx (const char *format
, ...)
1061 VA_CALL (__vwarnx_internal
)
1065 __nldbl_vwarn (const char *format
, __gnuc_va_list ap
)
1067 __vwarn_internal (format
, ap
, PRINTF_LDBL_IS_DBL
);
1071 __nldbl_vwarnx (const char *format
, __gnuc_va_list ap
)
1073 __vwarnx_internal (format
, ap
, PRINTF_LDBL_IS_DBL
);
1077 __nldbl_error (int status
, int errnum
, const char *message
, ...)
1080 va_start (ap
, message
);
1081 __error_internal (status
, errnum
, message
, ap
, PRINTF_LDBL_IS_DBL
);
1086 __nldbl_error_at_line (int status
, int errnum
, const char *file_name
,
1087 unsigned int line_number
, const char *message
,
1091 va_start (ap
, message
);
1092 __error_at_line_internal (status
, errnum
, file_name
, line_number
,
1093 message
, ap
, PRINTF_LDBL_IS_DBL
);
1097 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
1098 compat_symbol (libc
, __nldbl__IO_printf
, _IO_printf
, GLIBC_2_0
);
1099 compat_symbol (libc
, __nldbl__IO_sprintf
, _IO_sprintf
, GLIBC_2_0
);
1100 compat_symbol (libc
, __nldbl__IO_vfprintf
, _IO_vfprintf
, GLIBC_2_0
);
1101 compat_symbol (libc
, __nldbl__IO_vsprintf
, _IO_vsprintf
, GLIBC_2_0
);
1102 compat_symbol (libc
, __nldbl_dprintf
, dprintf
, GLIBC_2_0
);
1103 compat_symbol (libc
, __nldbl_fprintf
, fprintf
, GLIBC_2_0
);
1104 compat_symbol (libc
, __nldbl_printf
, printf
, GLIBC_2_0
);
1105 compat_symbol (libc
, __nldbl_sprintf
, sprintf
, GLIBC_2_0
);
1106 compat_symbol (libc
, __nldbl_vfprintf
, vfprintf
, GLIBC_2_0
);
1107 compat_symbol (libc
, __nldbl_vprintf
, vprintf
, GLIBC_2_0
);
1108 compat_symbol (libc
, __nldbl__IO_fprintf
, _IO_fprintf
, GLIBC_2_0
);
1109 compat_symbol (libc
, __nldbl___vsnprintf
, __vsnprintf
, GLIBC_2_0
);
1110 compat_symbol (libc
, __nldbl_asprintf
, asprintf
, GLIBC_2_0
);
1111 compat_symbol (libc
, __nldbl_obstack_printf
, obstack_printf
, GLIBC_2_0
);
1112 compat_symbol (libc
, __nldbl_obstack_vprintf
, obstack_vprintf
, GLIBC_2_0
);
1113 compat_symbol (libc
, __nldbl_snprintf
, snprintf
, GLIBC_2_0
);
1114 compat_symbol (libc
, __nldbl_vasprintf
, vasprintf
, GLIBC_2_0
);
1115 compat_symbol (libc
, __nldbl_vdprintf
, vdprintf
, GLIBC_2_0
);
1116 compat_symbol (libc
, __nldbl_vsnprintf
, vsnprintf
, GLIBC_2_0
);
1117 compat_symbol (libc
, __nldbl_vsprintf
, vsprintf
, GLIBC_2_0
);
1118 compat_symbol (libc
, __nldbl__IO_sscanf
, _IO_sscanf
, GLIBC_2_0
);
1119 compat_symbol (libc
, __nldbl___vfscanf
, __vfscanf
, GLIBC_2_0
);
1120 compat_symbol (libc
, __nldbl___vsscanf
, __vsscanf
, GLIBC_2_0
);
1121 compat_symbol (libc
, __nldbl_fscanf
, fscanf
, GLIBC_2_0
);
1122 compat_symbol (libc
, __nldbl_scanf
, scanf
, GLIBC_2_0
);
1123 compat_symbol (libc
, __nldbl_sscanf
, sscanf
, GLIBC_2_0
);
1124 compat_symbol (libc
, __nldbl_vfscanf
, vfscanf
, GLIBC_2_0
);
1125 compat_symbol (libc
, __nldbl_vscanf
, vscanf
, GLIBC_2_0
);
1126 compat_symbol (libc
, __nldbl_vsscanf
, vsscanf
, GLIBC_2_0
);
1127 compat_symbol (libc
, __nldbl___printf_fp
, __printf_fp
, GLIBC_2_0
);
1128 compat_symbol (libc
, __nldbl_strfmon
, strfmon
, GLIBC_2_0
);
1129 compat_symbol (libc
, __nldbl_syslog
, syslog
, GLIBC_2_0
);
1130 compat_symbol (libc
, __nldbl_vsyslog
, vsyslog
, GLIBC_2_0
);
1131 /* This function is not in public headers, but was exported until
1132 version 2.29. For platforms that are newer than that, there's no
1133 need to expose the symbol. */
1134 # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_29)
1135 compat_symbol (libc
, __nldbl__IO_vfscanf
, _IO_vfscanf
, GLIBC_2_0
);
1138 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
1139 compat_symbol (libc
, __nldbl___asprintf
, __asprintf
, GLIBC_2_1
);
1140 compat_symbol (libc
, __nldbl_printf_size
, printf_size
, GLIBC_2_1
);
1141 compat_symbol (libc
, __nldbl___strfmon_l
, __strfmon_l
, GLIBC_2_1
);
1143 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_2)
1144 compat_symbol (libc
, __nldbl_swprintf
, swprintf
, GLIBC_2_2
);
1145 compat_symbol (libc
, __nldbl_vwprintf
, vwprintf
, GLIBC_2_2
);
1146 compat_symbol (libc
, __nldbl_wprintf
, wprintf
, GLIBC_2_2
);
1147 compat_symbol (libc
, __nldbl_fwprintf
, fwprintf
, GLIBC_2_2
);
1148 compat_symbol (libc
, __nldbl_vfwprintf
, vfwprintf
, GLIBC_2_2
);
1149 compat_symbol (libc
, __nldbl_vswprintf
, vswprintf
, GLIBC_2_2
);
1150 compat_symbol (libc
, __nldbl_fwscanf
, fwscanf
, GLIBC_2_2
);
1151 compat_symbol (libc
, __nldbl_swscanf
, swscanf
, GLIBC_2_2
);
1152 compat_symbol (libc
, __nldbl_vfwscanf
, vfwscanf
, GLIBC_2_2
);
1153 compat_symbol (libc
, __nldbl_vswscanf
, vswscanf
, GLIBC_2_2
);
1154 compat_symbol (libc
, __nldbl_vwscanf
, vwscanf
, GLIBC_2_2
);
1155 compat_symbol (libc
, __nldbl_wscanf
, wscanf
, GLIBC_2_2
);
1157 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3)
1158 compat_symbol (libc
, __nldbl_strfmon_l
, strfmon_l
, GLIBC_2_3
);
1160 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3_4)
1161 compat_symbol (libc
, __nldbl___sprintf_chk
, __sprintf_chk
, GLIBC_2_3_4
);
1162 compat_symbol (libc
, __nldbl___vsprintf_chk
, __vsprintf_chk
, GLIBC_2_3_4
);
1163 compat_symbol (libc
, __nldbl___snprintf_chk
, __snprintf_chk
, GLIBC_2_3_4
);
1164 compat_symbol (libc
, __nldbl___vsnprintf_chk
, __vsnprintf_chk
, GLIBC_2_3_4
);
1165 compat_symbol (libc
, __nldbl___printf_chk
, __printf_chk
, GLIBC_2_3_4
);
1166 compat_symbol (libc
, __nldbl___fprintf_chk
, __fprintf_chk
, GLIBC_2_3_4
);
1167 compat_symbol (libc
, __nldbl___vprintf_chk
, __vprintf_chk
, GLIBC_2_3_4
);
1168 compat_symbol (libc
, __nldbl___vfprintf_chk
, __vfprintf_chk
, GLIBC_2_3_4
);