git: 59cc636d94a6 - main - strfmon(3): Wording improvements
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Jan 2023 09:03:25 UTC
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=59cc636d94a6c9b28147304fa59351224f801e92 commit 59cc636d94a6c9b28147304fa59351224f801e92 Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2022-11-08 20:53:17 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2023-01-25 09:02:55 +0000 strfmon(3): Wording improvements Use the same terminology as the other `_l` xlocale(3) functions. Reviewed by: kib MFC after: 1 week --- lib/libc/stdlib/strfmon.3 | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/libc/stdlib/strfmon.3 b/lib/libc/stdlib/strfmon.3 index 1ddfb77cb0ac..5c110a8987dc 100644 --- a/lib/libc/stdlib/strfmon.3 +++ b/lib/libc/stdlib/strfmon.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2022 +.Dd January 25, 2023 .Dt STRFMON 3 .Os .Sh NAME @@ -37,13 +37,15 @@ .In monetary.h .Ft ssize_t .Fn strfmon "char * restrict s" "size_t maxsize" "const char * restrict format" "..." +.In monetary.h +.In xlocale.h .Ft ssize_t .Fn strfmon_l "char * restrict s" "size_t maxsize" "locale_t loc" "const char * restrict format" "..." .Sh DESCRIPTION The .Fn strfmon function places characters into the array pointed to by -.Fa s +.Fa s , as controlled by the string pointed to by .Fa format . No more than @@ -52,9 +54,9 @@ bytes are placed into the array. .Pp The .Fn strfmon_l -function does the same as +function takes an explicit locale argument, whereas the .Fn strfmon -but takes an explicit locale rather than using the current locale. +function uses the current global or per-thread locale. .Pp The format string is composed of zero or more directives: ordinary characters (not @@ -129,12 +131,14 @@ character is written. .El .El .Sh RETURN VALUES -If the total number of resulting bytes including the terminating +If the total number of resulting bytes, including the terminating .Dv NUL -byte is not more than +byte, is not more than .Fa maxsize , .Fn strfmon -returns the number of bytes placed into the array pointed to by +and +.Fn strfmon_l +return the number of bytes placed into the array pointed to by .Fa s , not including the terminating .Dv NUL @@ -144,11 +148,6 @@ the contents of the array are indeterminate, and .Va errno is set to indicate the error. -.Pp -The -.Fn strfmon_l -function returns the same values as -.Fn strfmon . .Sh EXAMPLES The following example will format the value .Dq Li 1234567.89