1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

stdio-common: Add printf specifier registry to <printf.h>

Add  __printf_arginfo_table, __printf_function_table,
__printf_va_arg_table, __register_printf_specifier to
include/printf.h.
This commit is contained in:
Florian Weimer
2022-05-24 08:03:11 +02:00
parent 36c1dbaedd
commit 800d535504
5 changed files with 9 additions and 14 deletions

View File

@ -12,6 +12,14 @@
# ifndef _ISOMAC # 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> #include <bits/types/locale_t.h>
/* Now define the internal interfaces. */ /* Now define the internal interfaces. */

View File

@ -97,12 +97,6 @@ read_int (const UCHAR_T * *pstr)
#endif #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 /* Find the next spec in FORMAT, or the end of the string. Returns
a pointer into FORMAT, to a '%' or a '\0'. */ a pointer into FORMAT, to a '%' or a '\0'. */
__extern_always_inline const unsigned char * __extern_always_inline const unsigned char *

View File

@ -21,6 +21,7 @@
#include <string.h> #include <string.h>
#include <wchar.h> #include <wchar.h>
#include <sys/param.h> #include <sys/param.h>
#include <printf.h>
#include "../locale/localeinfo.h" #include "../locale/localeinfo.h"

View File

@ -30,13 +30,6 @@ printf_function **__printf_function_table attribute_hidden;
__libc_lock_define_initialized (static, lock) __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. */ /* Register FUNC to be called to format SPEC specifiers. */
int int
__register_printf_specifier (int spec, printf_function converter, __register_printf_specifier (int spec, printf_function converter,

View File

@ -1379,7 +1379,6 @@ printf_positional (FILE *s, const CHAR_T *format, int readonly_format,
/* Process format specifiers. */ /* Process format specifiers. */
while (1) while (1)
{ {
extern printf_function **__printf_function_table;
int function_done; int function_done;
if (spec <= UCHAR_MAX if (spec <= UCHAR_MAX