Add to git.
[c2lib.git] / doc / vector_get.3.html
1 <html>
2 <head>
3 <meta name="generator" content="groff -Thtml, see www.gnu.org">
4 <meta name="Content-Style" content="text/css">
5 <title>vector_get</title>
6 </head>
7 <body>
8
9 <h1 align=center>vector_get</h1>
10 <a href="#NAME">NAME</a><br>
11 <a href="#SYNOPSIS">SYNOPSIS</a><br>
12 <a href="#DESCRIPTION">DESCRIPTION</a><br>
13 <a href="#AUTHOR">AUTHOR</a><br>
14 <a href="#LICENSE">LICENSE</a><br>
15 <a href="#VERSION">VERSION</a><br>
16
17 <hr>
18 <!-- Creator     : groff version 1.17.2 -->
19 <!-- CreationDate: Fri May  3 14:58:58 2002 -->
20 <a name="NAME"></a>
21 <h2>NAME</h2>
22 <table width="100%" border=0 rules="none" frame="void"
23        cols="2" cellspacing="0" cellpadding="0">
24 <tr valign="top" align="left">
25 <td width="10%"></td><td width="90%">
26 vector_get, _vector_get, vector_get_ptr, _vector_get_ptr - array-style indexing for vectors</td></table>
27 <a name="SYNOPSIS"></a>
28 <h2>SYNOPSIS</h2>
29
30 <table width="100%" border=0 rules="none" frame="void"
31        cols="2" cellspacing="0" cellpadding="0">
32 <tr valign="top" align="left">
33 <td width="10%"></td><td width="90%">
34 <pre><b>#include &lt;vector.h&gt;
35
36 #define vector_get(v,i,obj) _vector_get((v),(i),&amp;(obj))
37 void _vector_get (vector, int i, void *ptr);
38 #define vector_get_ptr(v,i,ptr) (ptr) =((typeof (ptr))_vector_get_ptr((v),(i)))
39 const void *_vector_get_ptr (vector, int i);
40 </b></pre></td></table>
41 <a name="DESCRIPTION"></a>
42 <h2>DESCRIPTION</h2>
43
44 <table width="100%" border=0 rules="none" frame="void"
45        cols="2" cellspacing="0" cellpadding="0">
46 <tr valign="top" align="left">
47 <td width="10%"></td><td width="90%">
48 <b>vector_get</b> copies the element at index <b>v[i]</b>
49 into local variable <b>obj</b>. The vector is
50 unaffected.</td></table>
51
52 <table width="100%" border=0 rules="none" frame="void"
53        cols="2" cellspacing="0" cellpadding="0">
54 <tr valign="top" align="left">
55 <td width="10%"></td><td width="90%">
56 <b>_vector_get</b> copies the element into the memory
57 pointed to by <b>ptr</b>. If <b>ptr</b> is <b>NULL</b> then
58 the effect is simply to check that element <b>v[i]</b>
59 exists.</td></table>
60
61 <table width="100%" border=0 rules="none" frame="void"
62        cols="2" cellspacing="0" cellpadding="0">
63 <tr valign="top" align="left">
64 <td width="10%"></td><td width="90%">
65 <b>vector_get_ptr</b> and <b>_vector_get_ptr</b> are used to
66 get a pointer to an element in the vector. This pointer
67 actually points to the vector's internal data array. It is
68 only valid as long as the user does not cause the internal
69 data array to be reallocated or moved - typically this can
70 happen when the user performs some operation which inserts
71 more elements into the array.</td></table>
72
73 <table width="100%" border=0 rules="none" frame="void"
74        cols="2" cellspacing="0" cellpadding="0">
75 <tr valign="top" align="left">
76 <td width="10%"></td><td width="90%">
77 Array indexes are checked. An attempt to access an
78 out-of-bounds element will result in a call to
79 <b>abort(3)</b>.</td></table>
80 <a name="AUTHOR"></a>
81 <h2>AUTHOR</h2>
82
83 <table width="100%" border=0 rules="none" frame="void"
84        cols="2" cellspacing="0" cellpadding="0">
85 <tr valign="top" align="left">
86 <td width="10%"></td><td width="90%">
87 Richard Jones &lt;rich@annexia.org&gt;</td></table>
88 <a name="LICENSE"></a>
89 <h2>LICENSE</h2>
90
91 <table width="100%" border=0 rules="none" frame="void"
92        cols="2" cellspacing="0" cellpadding="0">
93 <tr valign="top" align="left">
94 <td width="10%"></td><td width="90%">
95 GNU LGPL (see http://www.gnu.org/)</td></table>
96 <a name="VERSION"></a>
97 <h2>VERSION</h2>
98
99 <table width="100%" border=0 rules="none" frame="void"
100        cols="2" cellspacing="0" cellpadding="0">
101 <tr valign="top" align="left">
102 <td width="10%"></td><td width="90%">
103 c2lib-1.2.13</td></table>
104 <hr>
105 </body>
106 </html>