[v2,01/14] 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_arginfo_table, __printf_function_table,
__printf_va_arg_table, __register_printf_specifier to
include/printf.h.
---
v2: More identifiers moved, and stdio-common/printf-parse.h updated.
include/printf.h | 8 ++++++++
stdio-common/printf-parse.h | 6 ------
stdio-common/printf-prs.c | 1 +
stdio-common/reg-printf.c | 7 -------
stdio-common/vfprintf-internal.c | 1 -
5 files changed, 9 insertions(+), 14 deletions(-)
Comments
On Mai 23 2022, Florian Weimer via Libc-alpha wrote:
> Add __printf_arginfo_table, __printf_function_table,
> __printf_va_arg_table, __register_printf_specifier to
> include/printf.h.
Ok.
@@ -12,6 +12,14 @@
# ifndef _ISOMAC
+/* Internal interfaces for registered specifiers. */
+extern printf_arginfo_size_function **__printf_arginfo_table attribute_hidden;
+extern printf_function **__printf_function_table attribute_hidden;
+extern printf_va_arg_function **__printf_va_arg_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. */
@@ -97,12 +97,6 @@ read_int (const UCHAR_T * *pstr)
#endif
-/* These are defined in reg-printf.c. */
-extern printf_arginfo_size_function **__printf_arginfo_table attribute_hidden;
-extern printf_function **__printf_function_table attribute_hidden;
-extern printf_va_arg_function **__printf_va_arg_table attribute_hidden;
-
-
/* Find the next spec in FORMAT, or the end of the string. Returns
a pointer into FORMAT, to a '%' or a '\0'. */
__extern_always_inline const unsigned char *
@@ -21,6 +21,7 @@
#include <string.h>
#include <wchar.h>
#include <sys/param.h>
+#include <printf.h>
#include "../locale/localeinfo.h"
@@ -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