public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] stdio-common: Add printf specifier registry to <printf.h>
@ 2022-05-24  6:51 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2022-05-24  6:51 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=800d535504c06f16726f2add8602ee9a36baf808

commit 800d535504c06f16726f2add8602ee9a36baf808
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue May 24 08:03:11 2022 +0200

    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.

Diff:
---
 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(-)

diff --git a/include/printf.h b/include/printf.h
index 0ed6e87387..fb0b71fa4c 100644
--- a/include/printf.h
+++ b/include/printf.h
@@ -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.  */
diff --git a/stdio-common/printf-parse.h b/stdio-common/printf-parse.h
index de0f289c1f..362cce1ead 100644
--- a/stdio-common/printf-parse.h
+++ b/stdio-common/printf-parse.h
@@ -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 *
diff --git a/stdio-common/printf-prs.c b/stdio-common/printf-prs.c
index 55d1c471d7..f2fb9182b8 100644
--- a/stdio-common/printf-prs.c
+++ b/stdio-common/printf-prs.c
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <wchar.h>
 #include <sys/param.h>
+#include <printf.h>
 
 #include "../locale/localeinfo.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,
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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-24  6:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24  6:51 [glibc] stdio-common: Add printf specifier registry to <printf.h> Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).