Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add offsetof(3) man page. From Thomas Pfaff via OpenBSD.
details: https://anonhg.NetBSD.org/src/rev/272e473ae812
branches: trunk
changeset: 752495:272e473ae812
user: wiz <wiz%NetBSD.org@localhost>
date: Sat Feb 27 22:04:37 2010 +0000
description:
Add offsetof(3) man page. From Thomas Pfaff via OpenBSD.
diffstat:
distrib/sets/lists/comp/mi | 5 +++-
share/man/man3/Makefile | 8 ++++--
share/man/man3/offsetof.3 | 48 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 57 insertions(+), 4 deletions(-)
diffs (102 lines):
diff -r 6b1d7d525f52 -r 272e473ae812 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi Sat Feb 27 21:15:54 2010 +0000
+++ b/distrib/sets/lists/comp/mi Sat Feb 27 22:04:37 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1394 2010/02/21 03:18:46 darran Exp $
+# $NetBSD: mi,v 1.1395 2010/02/27 22:04:37 wiz Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -7161,6 +7161,7 @@
./usr/share/man/cat3/ntohl.0 comp-c-catman .cat
./usr/share/man/cat3/ntohs.0 comp-c-catman .cat
./usr/share/man/cat3/offtime.0 comp-c-catman .cat
+./usr/share/man/cat3/offsetof.0 comp-c-catman .cat
./usr/share/man/cat3/opendir.0 comp-c-catman .cat
./usr/share/man/cat3/opendisk.0 comp-c-catman .cat
./usr/share/man/cat3/openlog.0 comp-c-catman .cat
@@ -12874,6 +12875,7 @@
./usr/share/man/html3/ntohl.html comp-c-htmlman html
./usr/share/man/html3/ntohs.html comp-c-htmlman html
./usr/share/man/html3/offtime.html comp-c-htmlman html
+./usr/share/man/html3/offsetof.html comp-c-htmlman html
./usr/share/man/html3/opendir.html comp-c-htmlman html
./usr/share/man/html3/opendisk.html comp-c-htmlman html
./usr/share/man/html3/openlog.html comp-c-htmlman html
@@ -18581,6 +18583,7 @@
./usr/share/man/man3/ntohl.3 comp-c-man .man
./usr/share/man/man3/ntohs.3 comp-c-man .man
./usr/share/man/man3/offtime.3 comp-c-man .man
+./usr/share/man/man3/offsetof.3 comp-c-man .man
./usr/share/man/man3/opendir.3 comp-c-man .man
./usr/share/man/man3/opendisk.3 comp-c-man .man
./usr/share/man/man3/openlog.3 comp-c-man .man
diff -r 6b1d7d525f52 -r 272e473ae812 share/man/man3/Makefile
--- a/share/man/man3/Makefile Sat Feb 27 21:15:54 2010 +0000
+++ b/share/man/man3/Makefile Sat Feb 27 22:04:37 2010 +0000
@@ -1,8 +1,10 @@
-# $NetBSD: Makefile,v 1.35 2010/01/24 22:21:34 njoly Exp $
+# $NetBSD: Makefile,v 1.36 2010/02/27 22:04:38 wiz Exp $
# @(#)Makefile 8.2 (Berkeley) 12/13/93
-MAN= _DIAGASSERT.3 CMSG_DATA.3 assert.3 bits.3 bitstring.3 dlfcn.3 end.3 \
- gcq.3 intro.3 queue.3 stdarg.3 sysexits.3 timeradd.3 tree.3 varargs.3
+MAN= _DIAGASSERT.3 CMSG_DATA.3 \
+ assert.3 bits.3 bitstring.3 dlfcn.3 end.3 \
+ gcq.3 intro.3 offsetof.3 queue.3 stdarg.3 sysexits.3 \
+ timeradd.3 tree.3 varargs.3
USETBL= # used by queue.3
diff -r 6b1d7d525f52 -r 272e473ae812 share/man/man3/offsetof.3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man3/offsetof.3 Sat Feb 27 22:04:37 2010 +0000
@@ -0,0 +1,48 @@
+.\" $NetBSD: offsetof.3,v 1.1 2010/02/27 22:04:38 wiz Exp $
+.\"
+.\" $OpenBSD: offsetof.3,v 1.2 2010/02/18 18:30:19 jmc Exp $
+.\"
+.\" Copyright (c) 2010 Thomas Pfaff <tpfaff%tp76.info@localhost>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.\"
+.Dd February 18, 2010
+.Dt OFFSETOF 3
+.Os
+.Sh NAME
+.Nm offsetof
+.Nd offset of a structure member
+.Sh SYNOPSIS
+.In stddef.h
+.Ft size_t
+.Fn offsetof "type" "member"
+.Sh DESCRIPTION
+The
+.Fn offsetof
+macro expands to an integer constant expression of type
+.Ft size_t
+and yields the offset,
+in bytes, of the field
+.Ar member
+from the start of the structure
+.Ar type .
+.Pp
+A compiler error will result if
+.Ar member
+is not aligned to a byte boundary (i.e. it is a bit-field).
+.Sh STANDARDS
+The
+.Fn offsetof
+macro conforms to
+.St -ansiC .
Home |
Main Index |
Thread Index |
Old Index