--- strfmon.3.orig 2008-04-05 20:02:08.000000000 -0700 +++ strfmon.3 2008-04-05 20:05:49.000000000 -0700 @@ -30,25 +30,49 @@ .Dt STRFMON 3 .Os .Sh NAME -.Nm strfmon +.Nm strfmon , +.Nm strfmon_l .Nd convert monetary value to string -.Sh LIBRARY -.Lb libc +.\" .Sh LIBRARY +.\" .Lb libc .Sh SYNOPSIS .In monetary.h .Ft ssize_t -.Fn strfmon "char * restrict s" "size_t maxsize" "const char * restrict format" "..." +.Fo strfmon +.Fa "char *restrict s" +.Fa "size_t maxsize" +.Fa "const char *restrict format" +.Fa "..." +.Fc +.In monetary.h +.In xlocale.h +.Ft ssize_t +.Fo strfmon_l +.Fa "char *restrict s" +.Fa "size_t maxsize" +.Fa "locale_t loc" +.Fa "const char *restrict format" +.Fa "..." +.Fc .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 .Fa maxsize bytes are placed into the array. .Pp +While the +.Fn strfmon +function uses the current locale, the +.Fn strfmon_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. +.Pp The format string is composed of zero or more directives: ordinary characters (not .Cm % ) , @@ -116,9 +140,9 @@ .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 NULL -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 @@ -144,7 +168,8 @@ Not enough memory for temporary buffers. .El .Sh SEE ALSO -.Xr localeconv 3 +.Xr localeconv 3 , +.Xr xlocale 3 .Sh STANDARDS The .Fn strfmon