diff options
author | Florian Weimer <fweimer@redhat.com> | 2022-12-19 18:56:54 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2022-12-19 18:56:54 +0100 |
commit | 46378560e056300623364669de2405a7182b064f (patch) | |
tree | 98bd283ccb2c61f13ce17751ea80afaefe881524 /include | |
parent | c7bf2e99cafbd8970f81c38d6f32842cc7846421 (diff) | |
download | glibc-46378560e056300623364669de2405a7182b064f.tar.gz glibc-46378560e056300623364669de2405a7182b064f.tar.xz glibc-46378560e056300623364669de2405a7182b064f.zip |
stdio-common: Add __translated_number_width
This function will be used to compute the width of a number after i18n digit translation. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/printf.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/printf.h b/include/printf.h index 8f064149d3..5127a45f9b 100644 --- a/include/printf.h +++ b/include/printf.h @@ -53,7 +53,18 @@ int __wprintf_function_invoke (void *, printf_function callback, #include <bits/types/locale_t.h> -/* Now define the internal interfaces. */ +/* Returns the width (as for printf, in bytes) of the converted ASCII + number in the characters in the range [FIRST, LAST). The range + must only contain ASCII digits. The caller is responsible for + avoiding overflow. + + This function is used during non-wide digit translation. Wide + digit translate produces one wide character per ASCII digit, + so the width is simply LAST - FIRST. */ +int __translated_number_width (locale_t loc, + const char *first, const char *last) + attribute_hidden; + extern int __printf_fphex (FILE *, const struct printf_info *, const void *const *) attribute_hidden; extern int __printf_fp (FILE *, const struct printf_info *, |