summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdtime
diff options
context:
space:
mode:
authorissyl0 <issyl0@FreeBSD.org>2012-06-25 21:51:40 +0000
committerissyl0 <issyl0@FreeBSD.org>2012-06-25 21:51:40 +0000
commit478b5e520236430c6ebf8f7b026cb28fff8edf22 (patch)
tree469f56aa3d590a5b285eb421c3b4076c542f5210 /lib/libc/stdtime
parent18c656b8addc34061ae22ae4baea59fa147ce9a1 (diff)
downloadFreeBSD-src-478b5e520236430c6ebf8f7b026cb28fff8edf22.zip
FreeBSD-src-478b5e520236430c6ebf8f7b026cb28fff8edf22.tar.gz
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)
Diffstat (limited to 'lib/libc/stdtime')
-rw-r--r--lib/libc/stdtime/Makefile.inc2
-rw-r--r--lib/libc/stdtime/strftime.313
-rw-r--r--lib/libc/stdtime/strptime.314
3 files changed, 27 insertions, 2 deletions
diff --git a/lib/libc/stdtime/Makefile.inc b/lib/libc/stdtime/Makefile.inc
index a039bc9..0cc038a 100644
--- a/lib/libc/stdtime/Makefile.inc
+++ b/lib/libc/stdtime/Makefile.inc
@@ -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
diff --git a/lib/libc/stdtime/strftime.3 b/lib/libc/stdtime/strftime.3
index d5cdd7d..0ed023b 100644
--- a/lib/libc/stdtime/strftime.3
+++ b/lib/libc/stdtime/strftime.3
@@ -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
diff --git a/lib/libc/stdtime/strptime.3 b/lib/libc/stdtime/strptime.3
index 763696b..34d2b79 100644
--- a/lib/libc/stdtime/strptime.3
+++ b/lib/libc/stdtime/strptime.3
@@ -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 ,
OpenPOWER on IntegriCloud