Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/time Add documentation for asctime_r(), ctime_r(), ...



details:   https://anonhg.NetBSD.org/src/rev/5dfca71ad547
branches:  trunk
changeset: 472670:5dfca71ad547
user:      kleink <kleink%NetBSD.org@localhost>
date:      Tue May 04 15:34:50 1999 +0000

description:
Add documentation for asctime_r(), ctime_r(), gmtime_r() and localtime_r().

diffstat:

 lib/libc/time/Makefile.inc |  15 +++++++--
 lib/libc/time/ctime.3      |  72 +++++++++++++++++++++++++++++++++------------
 2 files changed, 64 insertions(+), 23 deletions(-)

diffs (146 lines):

diff -r 7bc63e65848b -r 5dfca71ad547 lib/libc/time/Makefile.inc
--- a/lib/libc/time/Makefile.inc        Tue May 04 15:11:42 1999 +0000
+++ b/lib/libc/time/Makefile.inc        Tue May 04 15:34:50 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.6 1998/07/28 20:26:01 mycroft Exp $
+#      $NetBSD: Makefile.inc,v 1.7 1999/05/04 15:34:50 kleink Exp $
 
 .PATH: ${.CURDIR}/time
 
@@ -6,6 +6,13 @@
 MAN+=  ctime.3 time2posix.3 tzfile.5 tzset.3 strftime.3 strptime.3
 CFLAGS+=-DALL_STATE
 
-MLINKS+=ctime.3 asctime.3 ctime.3 difftime.3 ctime.3 gmtime.3 \
-       ctime.3 localtime.3 ctime.3 mktime.3
-MLINKS+=tzset.3 tzsetwall.3
+MLINKS+=ctime.3 ctime_r.3      \
+       ctime.3 asctime.3       \
+       ctime.3 asctime_r.3     \
+       ctime.3 difftime.3      \
+       ctime.3 gmtime.3        \
+       ctime.3 gmtime_r.3      \
+       ctime.3 localtime.3     \
+       ctime.3 localtime_r.3   \
+       ctime.3 mktime.3        \
+       tzset.3 tzsetwall.3
diff -r 7bc63e65848b -r 5dfca71ad547 lib/libc/time/ctime.3
--- a/lib/libc/time/ctime.3     Tue May 04 15:11:42 1999 +0000
+++ b/lib/libc/time/ctime.3     Tue May 04 15:34:50 1999 +0000
@@ -1,35 +1,32 @@
-.\"    $NetBSD: ctime.3,v 1.14 1998/03/19 16:26:35 tv Exp $
+.\"    $NetBSD: ctime.3,v 1.15 1999/05/04 15:34:50 kleink Exp $
 .TH CTIME 3
 .SH NAME
-asctime, ctime, difftime, gmtime, localtime, mktime \- convert date and time to ASCII
+asctime, asctime_r, ctime, ctime_r, difftime, gmtime, gmtime_r, localtime, localtime_r, mktime \- convert date and time to ASCII
+.SH LIBRARY
+Standard C Library (libc, -lc)
 .SH SYNOPSIS
 .nf
 .B #include <time.h>
 .PP
 .B extern char *tzname[2];
 .PP
-.B void tzset()
-.PP
-.B #include <sys/types.h>
+.B void tzset();
 .PP
-.B char *ctime(clock)
-.B const time_t *clock;
+.B char *ctime(const time_t *clock);
+.B char *ctime_r(const time_t *clock, char *buf);
 .PP
-.B double difftime(time1, time0)
-.B time_t time1;
-.B time_t time0;
+.B double difftime(time_t time1, time_t time0);
 .PP
-.B char *asctime(tm)
-.B const struct tm *tm;
-.PP
-.B struct tm *localtime(clock)
-.B const time_t *clock;
+.B char *asctime(const struct tm *tm);
+.B char *asctime_r(const struct tm *, char *buf);
 .PP
-.B struct tm *gmtime(clock)
-.B const time_t *clock;
+.B struct tm *localtime(const time_t *clock);
+.B struct tm *localtime_r(const time_t *clock, struct tm *result);
 .PP
-.B time_t mktime(tm)
-.B struct tm *tm;
+.B struct tm *gmtime(const time_t *clock);
+.B struct tm *gmtime_r(const time_t *clock, struct tm *result);
+.PP
+.B time_t mktime(struct tm *tm);
 .PP
 .fi
 .SH DESCRIPTION
@@ -49,6 +46,14 @@
 .br
 All the fields have constant width.
 .PP
+The
+.I ctime_r\^
+function provides the same functionality as
+.I ctime\^
+differing in that the caller must supply a buffer area
+.IR buf
+with a size of at least 26 bytes, in which the result is stored.
+.PP
 .IR Localtime\^
 and
 .I gmtime\^
@@ -70,6 +75,18 @@
 .I Gmtime\^
 converts to Coordinated Universal Time.
 .PP
+The
+.I gmtime_r\^
+and
+.I localtime_r\^
+functions provide the same functionality as
+.I gmtime\^
+and
+.I localtime\^
+differing in that the caller must supply a buffer area
+.IR result
+in which the result is stored.
+.PP
 .I Asctime\^
 converts a time value contained in a
 ``tm'' structure to a 26-character string,
@@ -77,6 +94,14 @@
 and returns a pointer
 to the string.
 .PP
+The
+.I asctime_r\^
+function provides the same functionality as
+.I asctime\^
+differing in that the caller must supply a buffer area
+.IR buf
+with a size of at least 26 bytes, in which the result is stored.
+.PP
 .I Mktime\^
 converts the broken-down time,
 expressed as local time,
@@ -211,6 +236,15 @@
 tzset()
 function conforms to
 IEEE Std1003.1-1988 (``POSIX'').
+The
+ctime_r(),
+asctime_r(),
+localtime_r()
+and
+gmtime_r()
+functions conform to
+IEEE Std1003.1c-1995 (``POSIX'').
+The
 .SH NOTES
 The return values point to static data;
 the data is overwritten by each call.



Home | Main Index | Thread Index | Old Index