>From a8a414323e3c8c5a386d1a32b4c07d0efe753ba7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 3 Oct 2026 23:08:43 -0400 Subject: [PATCH 09/10] move the digit grouper interface to locale_impl.h this is in preparation for reworking strfmon to use it. --- src/internal/locale_impl.h | 9 +++++++++ src/stdio/vfprintf.c | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/internal/locale_impl.h b/src/internal/locale_impl.h index 191f916b..0f49e99d 100644 --- a/src/internal/locale_impl.h +++ b/src/internal/locale_impl.h @@ -32,6 +32,13 @@ struct __locale_struct { struct lconv *lconv; }; +struct digit_grouper { + const char *g; + int pos; + int rep; + int rem; +}; + extern hidden volatile int __locale_lock[1]; extern hidden const struct __locale_map __c_dot_utf8; @@ -41,6 +48,8 @@ extern hidden const struct __locale_struct __c_dot_utf8_locale; hidden const struct __locale_map *__get_locale(int, const char *); hidden void __lconv_expand(locale_t); hidden int __radixpt(locale_t); +hidden int __count_groupings(struct digit_grouper *, int, const char *); +hidden char *__expand_grouping(char *, char *, struct digit_grouper *, const char *, size_t); hidden const char *__loc_lookup(const unsigned char *, const unsigned char *, const int *, const int *); hidden const char *__mo_lookup(const void *, size_t, const char *); hidden int __loc_is_allocated(locale_t); diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index 097b7619..b2a59441 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -172,13 +172,6 @@ static char *fmt_u(uintmax_t x, char *s) return s; } -struct digit_grouper { - const char *g; - int pos; - int rep; - int rem; -}; - int __count_groupings(struct digit_grouper *dg, int l, const char *g) { int i, cnt = 0; -- 2.21.0