nptl: Fix tst-cancel30 on sparc64
[glibc.git] / include / printf.h
blob2c998059d4341741d94c1bc1cf590fe25e751c57
1 #ifndef _PRINTF_H
3 /* Workaround PR90731 with GCC 9 when using ldbl redirects in C++. */
4 #include <bits/floatn.h>
5 #if defined __cplusplus && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
6 # if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3)
7 # pragma GCC system_header
8 # endif
9 #endif
11 #include <stdio-common/printf.h>
13 # ifndef _ISOMAC
15 /* Internal interfaces for registered specifiers. */
16 extern printf_arginfo_size_function **__printf_arginfo_table attribute_hidden;
17 extern printf_function **__printf_function_table attribute_hidden;
18 extern printf_va_arg_function **__printf_va_arg_table attribute_hidden;
19 int __register_printf_specifier (int, printf_function,
20 printf_arginfo_size_function);
21 libc_hidden_proto (__register_printf_specifier)
23 /* The various kinds of arguments that can be passed to printf. */
24 union printf_arg
26 wchar_t pa_wchar;
27 int pa_int;
28 long int pa_long_int;
29 long long int pa_long_long_int;
30 unsigned int pa_u_int;
31 unsigned long int pa_u_long_int;
32 unsigned long long int pa_u_long_long_int;
33 double pa_double;
34 long double pa_long_double;
35 #if __HAVE_FLOAT128_UNLIKE_LDBL
36 _Float128 pa_float128;
37 #endif
38 const char *pa_string;
39 const wchar_t *pa_wstring;
40 void *pa_pointer;
41 void *pa_user;
44 /* Invoke a registered printf callback. Called from vfprintf and vfwprintf. */
45 int __printf_function_invoke (void *, printf_function callback,
46 union printf_arg *args_value,
47 size_t ndata_args,
48 struct printf_info *info) attribute_hidden;
49 int __wprintf_function_invoke (void *, printf_function callback,
50 union printf_arg *args_value,
51 size_t ndata_args,
52 struct printf_info *info) attribute_hidden;
54 #include <bits/types/locale_t.h>
56 /* Returns the width (as for printf, in bytes) of the converted ASCII
57 number in the characters in the range [FIRST, LAST). The range
58 must only contain ASCII digits. The caller is responsible for
59 avoiding overflow.
61 This function is used during non-wide digit translation. Wide
62 digit translate produces one wide character per ASCII digit,
63 so the width is simply LAST - FIRST. */
64 int __translated_number_width (locale_t loc,
65 const char *first, const char *last)
66 attribute_hidden;
69 struct __printf_buffer;
70 void __printf_buffer (struct __printf_buffer *buf, const char *format,
71 va_list ap, unsigned int mode_flags);
72 struct __wprintf_buffer;
73 void __wprintf_buffer (struct __wprintf_buffer *buf, const wchar_t *format,
74 va_list ap, unsigned int mode_flags);
76 extern int __printf_fp (FILE *, const struct printf_info *,
77 const void *const *);
78 libc_hidden_proto (__printf_fp)
80 void __printf_fphex_l_buffer (struct __printf_buffer *, locale_t,
81 const struct printf_info *,
82 const void *const *) attribute_hidden;
83 void __printf_fp_l_buffer (struct __printf_buffer *, locale_t,
84 const struct printf_info *,
85 const void *const *) attribute_hidden;
86 struct __wprintf_buffer;
87 void __wprintf_fphex_l_buffer (struct __wprintf_buffer *, locale_t,
88 const struct printf_info *,
89 const void *const *) attribute_hidden;
90 void __wprintf_fp_l_buffer (struct __wprintf_buffer *, locale_t,
91 const struct printf_info *,
92 const void *const *) attribute_hidden;
94 # endif /* !_ISOMAC */
95 #endif