Add a small summary parge for struct tm from <time.h>. Cf. timeval(3).

This commit is contained in:
jruoho 2011-04-12 08:22:48 +00:00
parent 95134ba1e2
commit 6b4c2634f4
3 changed files with 97 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.1613 2011/04/10 09:58:00 jruoho Exp $
# $NetBSD: mi,v 1.1614 2011/04/12 08:22:48 jruoho Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@ -8596,6 +8596,7 @@
./usr/share/man/cat3/timespecsub.0 comp-c-catman .cat
./usr/share/man/cat3/timeval.0 comp-c-catman .cat
./usr/share/man/cat3/timezone.0 comp-c-catman .cat
./usr/share/man/cat3/tm.0 comp-c-catman .cat
./usr/share/man/cat3/tmpfile.0 comp-c-catman .cat
./usr/share/man/cat3/tmpnam.0 comp-c-catman .cat
./usr/share/man/cat3/toascii.0 comp-c-catman .cat
@ -14603,6 +14604,7 @@
./usr/share/man/html3/timespecsub.html comp-c-htmlman html
./usr/share/man/html3/timeval.html comp-c-htmlman html
./usr/share/man/html3/timezone.html comp-c-htmlman html
./usr/share/man/html3/tm.html comp-c-htmlman html
./usr/share/man/html3/tmpfile.html comp-c-htmlman html
./usr/share/man/html3/tmpnam.html comp-c-htmlman html
./usr/share/man/html3/toascii.html comp-c-htmlman html
@ -20678,6 +20680,7 @@
./usr/share/man/man3/timespecsub.3 comp-c-man .man
./usr/share/man/man3/timeval.3 comp-c-man .man
./usr/share/man/man3/timezone.3 comp-c-man .man
./usr/share/man/man3/tm.3 comp-c-man .man
./usr/share/man/man3/tmpfile.3 comp-c-man .man
./usr/share/man/man3/tmpnam.3 comp-c-man .man
./usr/share/man/man3/toascii.3 comp-c-man .man

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.74 2011/04/10 09:58:01 jruoho Exp $
# $NetBSD: Makefile,v 1.75 2011/04/12 08:22:49 jruoho Exp $
# @(#)Makefile 8.2 (Berkeley) 12/13/93
MAN= _DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
@ -12,7 +12,7 @@ MAN= _DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
ilog2.3 intro.3 inttypes.3 iso646.3 \
makedev.3 offsetof.3 param.3 paths.3 queue.3 rbtree.3 sigevent.3 \
stdarg.3 stdbool.3 stddef.3 stdint.3 stdlib.3 sysexits.3 \
tgmath.3 timeradd.3 timeval.3 tree.3 typeof.3 types.3 \
tgmath.3 timeradd.3 timeval.3 tm.3 tree.3 typeof.3 types.3 \
unistd.3 varargs.3
USETBL= # used by queue.3

91
share/man/man3/tm.3 Normal file
View File

@ -0,0 +1,91 @@
.\" $NetBSD: tm.3,v 1.1 2011/04/12 08:22:49 jruoho Exp $
.\"
.\" Copyright (c) 2011 Jukka Ruohonen <jruohonen@iki.fi>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd April 12, 2011
.Dt TM 3
.Os
.Sh NAME
.Nm tm
.Nd time structure
.Sh SYNOPSIS
.In time.h
.Sh DESCRIPTION
The
.In time.h
header defines the following structure:
.Bd -literal -offset indent
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
long tm_gmtoff;
__aconst char *tm_zone;
};
.Ed
.Pp
The members are:
.Bl -column -offset indent \
"Member " "Months since January 1 " "Range "
.It Sy Member Ta Sy Represents Ta Sy Range
.It Va tm_sec Ta Seconds Ta [0, 61]
.It Va tm_min Ta Minutes Ta [0, 59]
.It Va tm_hour Ta Hours since midnight Ta [0, 23]
.It Va tm_mday Ta Day of the month Ta [1, 31]
.It Va tm_mon Ta Months since January Ta [0, 11]
.It Va tm_year Ta Years since 1900 Ta
.It Va tm_wday Ta Days since Sunday Ta [0, 6]
.It Va tm_yday Ta Days since January 1 Ta [0, 365]
.It Va tm_isdt Ta Positive if daylight savings Ta >= 0
.It Va tm_gmtoff Ta Offset from UTC in seconds Ta
.It Va tm_zone Ta Timezone abbreviation
.El
.Pp
The
.Vt tm
structure is used by various common library routines such as
.Xr mktime 3 ,
.Xr localtime 3 ,
and
.Xr strptime 3 .
All except
.Va tm_gmtoff
and
.Va tm_zone
are defined in
.St -p1003.1-2008 .
.Sh SEE ALSO
.Xr timeval 3
.Sh STANDARDS
The
.Vt tm
structure conforms to
.St -p1003.1-2008 .