[09/26] stdio-common: Add printf specifier registry to <printf.h>
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
Commit Message
Add __printf_function_table, __register_printf_specifier to
include/printf.h, where they belong.
---
include/printf.h | 6 ++++++
stdio-common/reg-printf.c | 7 -------
stdio-common/vfprintf-internal.c | 1 -
3 files changed, 6 insertions(+), 8 deletions(-)
Comments
On 17/03/2022 16:29, Florian Weimer via Libc-alpha wrote:
> Add __printf_function_table, __register_printf_specifier to
> include/printf.h, where they belong.
> ---
> include/printf.h | 6 ++++++
> stdio-common/reg-printf.c | 7 -------
> stdio-common/vfprintf-internal.c | 1 -
> 3 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/include/printf.h b/include/printf.h
> index 0ed6e87387..e1ac20807b 100644
> --- a/include/printf.h
> +++ b/include/printf.h
> @@ -12,6 +12,12 @@
>
> # ifndef _ISOMAC
>
> +/* Internal interfaces for registered specifiers. */
> +extern printf_function **__printf_function_table attribute_hidden;
> +int __register_printf_specifier (int, printf_function,
> + printf_arginfo_size_function);
> +libc_hidden_proto (__register_printf_specifier)
> +
> #include <bits/types/locale_t.h>
>
> /* Now define the internal interfaces. */
The __printf_function_table prototype is still present at
stdio-common/printf-parse.h. Maybe either move __printf_arginfo_table and
__printf_va_arg_table, or remove __printf_function_table from printf.h.
> diff --git a/stdio-common/reg-printf.c b/stdio-common/reg-printf.c
> index 400b99d2f6..5f4c6a24c2 100644
> --- a/stdio-common/reg-printf.c
> +++ b/stdio-common/reg-printf.c
> @@ -30,13 +30,6 @@ printf_function **__printf_function_table attribute_hidden;
>
> __libc_lock_define_initialized (static, lock)
>
> -int __register_printf_specifier (int, printf_function,
> - printf_arginfo_size_function);
> -libc_hidden_proto (__register_printf_specifier)
> -int __register_printf_function (int, printf_function,
> - printf_arginfo_function);
> -
> -
> /* Register FUNC to be called to format SPEC specifiers. */
> int
> __register_printf_specifier (int spec, printf_function converter,
Ok.
> diff --git a/stdio-common/vfprintf-internal.c b/stdio-common/vfprintf-internal.c
> index 1986c4bdb5..f8aa2fdafb 100644
> --- a/stdio-common/vfprintf-internal.c
> +++ b/stdio-common/vfprintf-internal.c
> @@ -1379,7 +1379,6 @@ printf_positional (FILE *s, const CHAR_T *format, int readonly_format,
> /* Process format specifiers. */
> while (1)
> {
> - extern printf_function **__printf_function_table;
> int function_done;
>
> if (spec <= UCHAR_MAX
Ok.
@@ -12,6 +12,12 @@
# ifndef _ISOMAC
+/* Internal interfaces for registered specifiers. */
+extern printf_function **__printf_function_table attribute_hidden;
+int __register_printf_specifier (int, printf_function,
+ printf_arginfo_size_function);
+libc_hidden_proto (__register_printf_specifier)
+
#include <bits/types/locale_t.h>
/* Now define the internal interfaces. */
@@ -30,13 +30,6 @@ printf_function **__printf_function_table attribute_hidden;
__libc_lock_define_initialized (static, lock)
-int __register_printf_specifier (int, printf_function,
- printf_arginfo_size_function);
-libc_hidden_proto (__register_printf_specifier)
-int __register_printf_function (int, printf_function,
- printf_arginfo_function);
-
-
/* Register FUNC to be called to format SPEC specifiers. */
int
__register_printf_specifier (int spec, printf_function converter,
@@ -1379,7 +1379,6 @@ printf_positional (FILE *s, const CHAR_T *format, int readonly_format,
/* Process format specifiers. */
while (1)
{
- extern printf_function **__printf_function_table;
int function_done;
if (spec <= UCHAR_MAX