summaryrefslogtreecommitdiff
path: root/static/freebsd/man3/offsetof.3 4.html
blob: 99b78ff5f56c108177e91dfe4f5f324f41d81c93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<table class="head">
  <tr>
    <td class="head-ltitle">OFFSETOF(3)</td>
    <td class="head-vol">Library Functions Manual</td>
    <td class="head-rtitle">OFFSETOF(3)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">offsetof</code> &#x2014; <span class="Nd">offset
    of a structure member</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
    &lt;<a class="In">stddef.h</a>&gt;</code></p>
<p class="Pp"><var class="Ft">size_t</var>
  <br/>
  <code class="Fn">offsetof</code>(<var class="Fa" style="white-space: nowrap;">type</var>,
    <var class="Fa" style="white-space: nowrap;">member</var>);</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The
    <a class="permalink" href="#offsetof"><code class="Fn" id="offsetof">offsetof</code></a>()
    macro expands to an integer constant expression of type
    <var class="Ft">size_t</var> and yields the offset, in bytes, of the field
    <var class="Ar">member</var> from the start of the structure
    <var class="Ar">type</var>.</p>
<p class="Pp">A compiler error will result if <var class="Ar">member</var> is
    not aligned to a byte boundary (i.e. it is a bit-field).</p>
</section>
<section class="Sh">
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
<p class="Pp">The <code class="Fn">offsetof</code>() macro conforms to
    <span class="St">ANSI X3.159-1989
  (&#x201C;ANSI&#x00A0;C89&#x201D;)</span>.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">February 18, 2010</td>
    <td class="foot-os">FreeBSD 15.0</td>
  </tr>
</table>