Module Name: src
Committed By: wiz
Date: Mon Sep 9 18:55:26 UTC 2024
Modified Files:
src/lib/libc/locale: mbsrtowcs.3 wcsrtombs.3
Log Message:
SYNOPSIS fixes, uppercase NUL and NULL
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/locale/mbsrtowcs.3
cvs rdiff -u -r1.15 -r1.16 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.14 src/lib/libc/locale/mbsrtowcs.3:1.15
--- src/lib/libc/locale/mbsrtowcs.3:1.14 Mon Sep 9 14:21:37 2024
+++ src/lib/libc/locale/mbsrtowcs.3 Mon Sep 9 18:55:26 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: mbsrtowcs.3,v 1.14 2024/09/09 14:21:37 uwe Exp $
+.\" $NetBSD: mbsrtowcs.3,v 1.15 2024/09/09 18:55:26 wiz Exp $
.\"
.\" Copyright (c)2002 Citrus Project,
.\" All rights reserved.
@@ -29,7 +29,7 @@
.Os
.\" ----------------------------------------------------------------------
.Sh NAME
-.Nm mbsrtowcs
+.Nm mbsrtowcs ,
.Nm mbsrntowcs
.Nd converts a multibyte character string to a wide-character string \
(restartable)
@@ -71,8 +71,8 @@ array pointed to by
The conversion stops due to the following reasons:
.Bl -bullet
.It
-The conversion reaches a nul byte.
-In this case, the nul byte is also converted.
+The conversion reaches a NUL byte.
+In this case, the NUL byte is also converted.
.It
The
.Fn mbsrtowcs
@@ -90,18 +90,18 @@ is continuously called.
After conversion,
if
.Fa pwcs
-is not a null pointer,
+is not a NULL pointer,
the pointer object pointed to by
.Fa s
-is a null pointer
-.Pq if the conversion is stopped due to reaching a nul byte
+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
-is not a null pointer and the conversion is stopped due to reaching
-a nul byte, the
+is not a NULL pointer and the conversion is stopped due to reaching
+a NUL byte, the
.Fn mbsrtowcs
places the state object pointed to by
.Fa ps
@@ -163,7 +163,7 @@ functions return:
The value returned is the number of elements stored in the array
pointed to by
.Fa pwcs ,
-except for a terminating nul wide character (if any).
+except for a terminating NUL wide character (if any).
If
.Fa pwcs
is not
@@ -172,11 +172,11 @@ and the value returned is equal to
.Fa n ,
the wide-character string pointed to by
.Fa pwcs
-is not nul-terminated.
+is not NUL-terminated.
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.
+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 Li "(size_t)-1"
The array indirectly pointed to by
.Fa s
Index: src/lib/libc/locale/wcsrtombs.3
diff -u src/lib/libc/locale/wcsrtombs.3:1.15 src/lib/libc/locale/wcsrtombs.3:1.16
--- src/lib/libc/locale/wcsrtombs.3:1.15 Mon Sep 9 14:21:37 2024
+++ src/lib/libc/locale/wcsrtombs.3 Mon Sep 9 18:55:26 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: wcsrtombs.3,v 1.15 2024/09/09 14:21:37 uwe Exp $
+.\" $NetBSD: wcsrtombs.3,v 1.16 2024/09/09 18:55:26 wiz Exp $
.\"
.\" Copyright (c)2002 Citrus Project,
.\" All rights reserved.
@@ -29,7 +29,8 @@
.Os
.\" ----------------------------------------------------------------------
.Sh NAME
-.Nm wcsrtombs, wcsnrtombs
+.Nm wcsrtombs ,
+.Nm wcsnrtombs
.Nd converts a wide-character string to a multibyte character string \
(restartable)
.\" ----------------------------------------------------------------------
@@ -60,7 +61,7 @@
.Sh DESCRIPTION
The
.Fn wcsrtombs
-function converts the nul-terminated wide-character string indirectly
+function converts the NUL-terminated wide-character string indirectly
pointed to by
.Fa pwcs
to the corresponding multibyte character string,
@@ -69,8 +70,8 @@ and stores it in the array pointed to by
The conversion stops due to the following reasons:
.Bl -bullet
.It
-The conversion reaches a nul wide character.
-In this case, the nul wide character is also converted.
+The conversion reaches a NUL wide character.
+In this case, the NUL wide character is also converted.
.It
The
.Fn wcsrtombs
@@ -91,23 +92,23 @@ will not be affected.
After conversion,
if
.Fa s
-is not a null pointer, the pointer object pointed to by
+is not a NULL pointer, the pointer object pointed to by
.Fa pwcs
-is a null pointer
-.Pq if the conversion is stopped due to reaching a nul wide character
+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
-is not a null pointer and the conversion is stopped due to reaching
-a nul wide character,
+is not a NULL pointer and the conversion is stopped due to reaching
+a NUL wide character,
.Fn wcsrtombs
places the state object pointed to by
.Fa ps
to an initial state after the conversion is taken place.
.Pp
-The behaviour of
+The behavior of
.Fn wcsrtombs
is affected by the
.Dv LC_CTYPE
@@ -120,7 +121,7 @@ These are the special cases:
returns the number of bytes to store the whole multibyte character string
corresponding to the wide-character string pointed to by
.Fa pwcs ,
-not including the terminating nul byte.
+not including the terminating NUL byte.
In this case,
.Fa n
is ignored.
@@ -160,19 +161,19 @@ functions return:
.It Li 0 , No or positive
Number of bytes stored in the array pointed to by
.Fa s ,
-except for a nul byte.
+except for a NUL byte.
There are no cases that the value returned is greater than
.Fa n
.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.
+will not be NUL-terminated.
.It Li "(size_t)-1"
.Fa pwcs
points to a string containing an invalid wide character.