[PATCH] manual: document wcwidth and wcswidth [BZ #33740]
Andreas K. Huettel
dilfridge@gentoo.org
Wed Jul 15 11:35:10 GMT 2026
Am Mittwoch, 15. Juli 2026, 00:30:28 Japanische Normalzeit schrieb Nikola Arlotti:
> This patch documents functions wcwidth and wcswidth, solving bug
> #33740. CC'ing Arjun so he can add it to his stats for the next
> glibc contribution workshop ;)
Pure documentation enhancement.
Can still go in the release once it has a RB.
>
> Signed-off-by: Nikola Arlotti <nikola.arlotti@gmail.com>
>
> ---
> manual/ctype.texi | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/manual/ctype.texi b/manual/ctype.texi
> index d09249c6cf..0eeb3f77de 100644
> --- a/manual/ctype.texi
> +++ b/manual/ctype.texi
> @@ -380,6 +380,30 @@ by a successful call to @code{wctype}.
> This function is declared in @file{wctype.h}.
> @end deftypefun
>
> +@deftypefun int wcwidth (wchar_t @var{wc})
> +@standards{POSIX, wchar.h}
> +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}}
> +This function returns the number of collumns needed to represent
> +the wide character @var{wc}. If @var{wc} is a printable wide character,
> +the value is 0 or higher. If @var{wc} is a null-wide character (L'\0'),
> +the value is 0. Otherwise, this function returns -1.
> +
> +@pindex wchar.h
> +This function is declared in @file{wchar.h}.
> +@end deftypefun
> +
> +@deftypefun int wcswidth (const wchar_t @var{*s}, size_t @var{n})
> +@standards{POSIX, wchar.h}
> +@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}}
> +This function returns the number of collumns needed to represent
> +the wide character string pointed to by @var{*s}, but at most
> +@var{n} wide characters. If a nonprintable wide character occurs
> +among these characters, this function returns -1.
> +
> +@pindex wchar.h
> +This function is declared in @file{wchar.h}.
> +@end deftypefun
> +
> To make it easier to use the commonly-used classification functions,
> they are defined in the C library. There is no need to use
> @code{wctype} if the property string is one of the known character
>
--
PD Dr. Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer
(council, comrel, toolchain, base-system, perl, libreoffice)
https://wiki.gentoo.org/wiki/User:Dilfridge
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 870 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20260715/610620f9/attachment.sig>
More information about the Libc-alpha
mailing list