Module Name: src Committed By: uwe Date: Mon Sep 9 14:21:37 UTC 2024
Modified Files: src/lib/libc/locale: mbsrtowcs.3 wcsrtombs.3 Log Message: mbsnrtowcs(3), wcsnrtombs(3): brush ip markup To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/locale/mbsrtowcs.3 cvs rdiff -u -r1.14 -r1.15 src/lib/libc/locale/wcsrtombs.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/locale/mbsrtowcs.3 diff -u src/lib/libc/locale/mbsrtowcs.3:1.13 src/lib/libc/locale/mbsrtowcs.3:1.14 --- src/lib/libc/locale/mbsrtowcs.3:1.13 Mon Sep 9 11:30:05 2024 +++ src/lib/libc/locale/mbsrtowcs.3 Mon Sep 9 14:21:37 2024 @@ -1,4 +1,4 @@ -.\" $NetBSD: mbsrtowcs.3,v 1.13 2024/09/09 11:30:05 riastradh Exp $ +.\" $NetBSD: mbsrtowcs.3,v 1.14 2024/09/09 14:21:37 uwe Exp $ .\" .\" Copyright (c)2002 Citrus Project, .\" All rights reserved. @@ -38,13 +38,26 @@ .Lb libc .\" ---------------------------------------------------------------------- .Sh SYNOPSIS +. .In wchar.h +. .Ft size_t -.Fn mbsrtowcs "wchar_t * restrict pwcs" "const char ** restrict s" "size_t n" \ -"mbstate_t * restrict ps" -.Fn mbsnrtowcs "wchar_t * restrict pwcs" "const char ** restrict s" \ -"size_t nmc" "size_t n" \ -"mbstate_t * restrict ps" +.Fo mbsrtowcs +.Fa "wchar_t * restrict pwcs" +.Fa "const char ** restrict s" +.Fa "size_t n" +.Fa "mbstate_t * restrict ps" +.Fc +. +.Ft size_t +.Fo mbsnrtowcs +.Fa "wchar_t * restrict pwcs" +.Fa "const char ** restrict s" +.Fa "size_t nmc" +.Fa "size_t n" +.Fa "mbstate_t * restrict ps" +.Fc +. .\" ---------------------------------------------------------------------- .Sh DESCRIPTION The @@ -80,9 +93,10 @@ if is not a null pointer, the pointer object pointed to by .Fa s -is a null pointer (if the conversion is stopped due to reaching a -nul byte) or the first byte of the character just after the last -character converted. +is a null pointer +.Pq if the conversion is stopped due to reaching a nul byte +or the first byte of the character just after the last character +converted. .Pp If .Fa pwcs @@ -100,10 +114,12 @@ is affected by the category of the current locale. .Pp These are the special cases: -.Bl -tag -width 012345678901 -.It "s == NULL || *s == NULL" +.Bl -tag -width Li +. +.It Li "s == NULL || *s == NULL" Undefined (may cause the program to crash). -.It "pwcs == NULL" +. +.It Li "pwcs == NULL" The conversion has taken place, but the resulting wide-character string was discarded. In this case, the pointer object pointed to by @@ -111,7 +127,8 @@ In this case, the pointer object pointed is not modified and .Fa n is ignored. -.It "ps == NULL" +. +.It Li "ps == NULL" The .Fn mbsrtowcs uses its own internal state object to keep the conversion state, @@ -141,8 +158,8 @@ The and .Fn mbsnrtowcs functions return: -.Bl -tag -width 012345678901 -.It 0 or positive +.Bl -tag -width Li +.It Li 0 , No or positive The value returned is the number of elements stored in the array pointed to by .Fa pwcs , @@ -160,7 +177,7 @@ If .Fa pwcs is a null pointer, the value returned is the number of elements to contain the whole string converted, except for a terminating nul wide character. -.It (size_t)-1 +.It Li "(size_t)-1" The array indirectly pointed to by .Fa s contains a byte sequence forming invalid character. Index: src/lib/libc/locale/wcsrtombs.3 diff -u src/lib/libc/locale/wcsrtombs.3:1.14 src/lib/libc/locale/wcsrtombs.3:1.15 --- src/lib/libc/locale/wcsrtombs.3:1.14 Mon Sep 9 11:30:05 2024 +++ src/lib/libc/locale/wcsrtombs.3 Mon Sep 9 14:21:37 2024 @@ -1,4 +1,4 @@ -.\" $NetBSD: wcsrtombs.3,v 1.14 2024/09/09 11:30:05 riastradh Exp $ +.\" $NetBSD: wcsrtombs.3,v 1.15 2024/09/09 14:21:37 uwe Exp $ .\" .\" Copyright (c)2002 Citrus Project, .\" All rights reserved. @@ -37,13 +37,25 @@ .Lb libc .\" ---------------------------------------------------------------------- .Sh SYNOPSIS +. .In wchar.h +. .Ft size_t -.Fn wcsrtombs "char * restrict s" "const wchar_t ** restrict pwcs" \ -"size_t n" "mbstate_t * restrict ps" +.Fo wcsrtombs +.Fa "char * restrict s" +.Fa "const wchar_t ** restrict pwcs" +.Fa "size_t n" "mbstate_t * restrict ps" +.Fc +. .Ft size_t -.Fn wcsnrtombs "char * restrict s" "const wchar_t ** restrict pwcs" \ -"size_t nwc" "size_t n" "mbstat_t * restrict ps" +.Fo wcsnrtombs +.Fa "char * restrict s" +.Fa "const wchar_t ** restrict pwcs" +.Fa "size_t nwc" +.Fa "size_t n" +.Fa "mbstat_t * restrict ps" +.Fc +. .\" ---------------------------------------------------------------------- .Sh DESCRIPTION The @@ -81,9 +93,10 @@ if .Fa s is not a null pointer, the pointer object pointed to by .Fa pwcs -is a null pointer (if the conversion is stopped due to reaching a -nul wide character) or the first byte of the character just after -the last character converted. +is a null pointer +.Pq if the conversion is stopped due to reaching a nul wide character +or points to the first byte of the character just after the last +character converted. .Pp If .Fa s @@ -101,8 +114,8 @@ is affected by the category of the current locale. .Pp These are the special cases: -.Bl -tag -width 012345678901 -.It "s == NULL" +.Bl -tag -width Li +.It Li "s == NULL" .Fn wcsrtombs returns the number of bytes to store the whole multibyte character string corresponding to the wide-character string pointed to by @@ -111,9 +124,9 @@ not including the terminating nul byte. In this case, .Fa n is ignored. -.It "pwcs == NULL || *pwcs == NULL" +.It Li "pwcs == NULL || *pwcs == NULL" Undefined (may cause the program to crash). -.It "ps == NULL" +.It Li "ps == NULL" .Fn wcsrtombs uses its own internal state object to keep the conversion state, instead of @@ -143,22 +156,24 @@ The and .Fn wcsnrtombs functions return: -.Bl -tag -width 012345678901 -.It 0 or positive +.Bl -tag -width Li +.It Li 0 , No or positive Number of bytes stored in the array pointed to by .Fa s , except for a nul byte. There are no cases that the value returned is greater than .Fa n -(unless +.Po +unless .Fa s -is a null pointer). +is a null pointer +.Pc . If the return value is equal to .Fa n , the string pointed to by .Fa s will not be nul-terminated. -.It (size_t)-1 +.It Li "(size_t)-1" .Fa pwcs points to a string containing an invalid wide character. The @@ -180,7 +195,9 @@ functions may fail with the following er points to a string containing an invalid wide character. .It Bq Er EINVAL .Fa ps -points to an invalid or uninitialized mbstate_t object. +points to an invalid or uninitialized +.Vt mbstate_t +object. .El .\" ---------------------------------------------------------------------- .Sh SEE ALSO