Add more locale-specific functions to the relevant man pages and

Makefiles:
- libc/stdtime/strftime.3
- libc/stdtime/strptime.3
- libc/stdlib/strfmon.3

Reviewed by:	theraven
Approved by:	gabor (mentor)
This commit is contained in:
Isabell Long 2012-06-25 21:51:40 +00:00
parent 4c1ab22d15
commit 3f19323a07
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=237573
5 changed files with 46 additions and 3 deletions

View File

@ -42,6 +42,7 @@ MLINKS+=rand.3 rand_r.3 rand.3 srand.3 rand.3 sranddev.3
MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \
random.3 srandomdev.3
MLINKS+=radixsort.3 sradixsort.3
MLINKS+=strfmon.3 strfmon_l.3
MLINKS+=strtod.3 strtof.3 strtod.3 strtold.3
MLINKS+=strtol.3 strtoll.3 strtol.3 strtoq.3 strtol.3 strtoimax.3
MLINKS+=strtoul.3 strtoull.3 strtoul.3 strtouq.3 strtoul.3 strtoumax.3

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 12, 2002
.Dd June 25, 2012
.Dt STRFMON 3
.Os
.Sh NAME
@ -36,6 +36,8 @@
.In monetary.h
.Ft ssize_t
.Fn strfmon "char * restrict s" "size_t maxsize" "const char * restrict format" "..."
.Ft ssize_t
.Fn strfmon_l "char * restrict s" "size_t maxsize" "locale_t loc" "const char * restrict format" "..."
.Sh DESCRIPTION
The
.Fn strfmon
@ -47,6 +49,12 @@ No more than
.Fa maxsize
bytes are placed into the array.
.Pp
The
.Fn strfmon_l
function does the same as
.Fn strfmon
but takes an explicit locale rather than using the current locale.
.Pp
The format string is composed of zero or more directives:
ordinary characters (not
.Cm % ) ,
@ -129,6 +137,11 @@ 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 ERRORS
The
.Fn strfmon
@ -149,6 +162,10 @@ The
function
conforms to
.St -p1003.1-2001 .
The
.Fn strfmon_l
function conforms to
.St -p1003.1-2008 .
.Sh AUTHORS
.An -nosplit
The

View File

@ -18,4 +18,6 @@ MLINKS+=ctime.3 asctime.3 ctime.3 difftime.3 ctime.3 gmtime.3 \
ctime.3 localtime.3 ctime.3 mktime.3 ctime.3 timegm.3 \
ctime.3 ctime_r.3 ctime.3 localtime_r.3 ctime.3 gmtime_r.3 \
ctime.3 asctime_r.3
MLINKS+=strftime.3 strftime_l.3
MLINKS+=strptime.3 strptime_l.3
MLINKS+=time2posix.3 posix2time.3

View File

@ -32,7 +32,7 @@
.\" @(#)strftime.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
.Dd November 4, 2004
.Dd June 25, 2012
.Dt STRFTIME 3
.Os
.Sh NAME
@ -49,6 +49,8 @@
.Fa "const char * restrict format"
.Fa "const struct tm * restrict timeptr"
.Fc
.Ft size_t
.Fn strftime_l "char *restrict buf" "size_t maxsize" "const char * restrict format" "const struct tm *restrict timeptr" "locale_t loc"
.Sh DESCRIPTION
The
.Fn strftime
@ -58,6 +60,11 @@ into the buffer
.Fa buf
according to the string pointed to by
.Fa format .
The function
.Fn strftime_l
does the same as
.Fn strftime
but takes an explicit locale rather than using the current locale.
.Pp
The
.Fa format
@ -268,6 +275,10 @@ The peculiar week number and year in the replacements of
and
.Ql \&%V
are defined in ISO 8601: 1988.
The
.Fn strftime_l
function conforms to
.St -p1003.1-2008 .
.Sh BUGS
There is no conversion specification for the phase of the moon.
.Pp

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\" "
.Dd January 4, 2003
.Dd June 25, 2012
.Dt STRPTIME 3
.Os
.Sh NAME
@ -41,6 +41,10 @@
.Fa "const char * restrict format"
.Fa "struct tm * restrict timeptr"
.Fc
.In time.h
.In xlocale.h
.Ft char *
.Fn strptime_l "const char * restrict buf" "const char * restrict format" "struct tm * restrict timeptr" "locale_t loc"
.Sh DESCRIPTION
The
.Fn strptime
@ -53,6 +57,11 @@ and fills in the elements of the structure pointed to by
The resulting values will be relative to the local time zone.
Thus, it can be considered the reverse operation of
.Xr strftime 3 .
The
.Fn strptime_l
function does the same as
.Fn strptime ,
but takes an explicit locale rather than using the current locale.
.Pp
The
.Fa format
@ -104,6 +113,9 @@ that has not been required to satisfy the specified conversions in
It returns
.Dv NULL
if one of the conversions failed.
.Fn strptime_l
returns the same values as
.Fn strptime .
.Sh SEE ALSO
.Xr date 1 ,
.Xr scanf 3 ,