Tue, 26 Nov 2024 21:53:06 +0100
cxBufferFree() now calls cxBufferDestroy()
390 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
2 | <html xmlns="http://www.w3.org/1999/xhtml"> | |
3 | <head> | |
4 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> | |
5 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> | |
6 | <meta name="generator" content="Doxygen 1.8.13"/> | |
7 | <meta name="viewport" content="width=device-width, initial-scale=1"/> | |
8 | <title>ucx: /home/mike/workspace/c/ucx/src/ucx/array.h File Reference</title> | |
9 | <link href="tabs.css" rel="stylesheet" type="text/css"/> | |
10 | <script type="text/javascript" src="jquery.js"></script> | |
11 | <script type="text/javascript" src="dynsections.js"></script> | |
12 | <link href="search/search.css" rel="stylesheet" type="text/css"/> | |
13 | <script type="text/javascript" src="search/searchdata.js"></script> | |
14 | <script type="text/javascript" src="search/search.js"></script> | |
15 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> | |
16 | </head> | |
17 | <body> | |
18 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> | |
19 | <div id="titlearea"> | |
20 | <table cellspacing="0" cellpadding="0"> | |
21 | <tbody> | |
22 | <tr style="height: 56px;"> | |
23 | <td id="projectlogo"><img alt="Logo" src="uaplogo.png"/></td> | |
24 | <td id="projectalign" style="padding-left: 0.5em;"> | |
25 | <div id="projectname">ucx | |
26 | </div> | |
27 | <div id="projectbrief">UAP Common Extensions</div> | |
28 | </td> | |
29 | </tr> | |
30 | </tbody> | |
31 | </table> | |
32 | </div> | |
33 | <!-- end header part --> | |
34 | <!-- Generated by Doxygen 1.8.13 --> | |
35 | <script type="text/javascript"> | |
36 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); | |
37 | </script> | |
38 | <script type="text/javascript" src="menudata.js"></script> | |
39 | <script type="text/javascript" src="menu.js"></script> | |
40 | <script type="text/javascript"> | |
41 | $(function() { | |
42 | initMenu('',true,false,'search.php','Search'); | |
43 | $(document).ready(function() { init_search(); }); | |
44 | }); | |
45 | </script> | |
46 | <div id="main-nav"></div> | |
47 | <!-- window showing the filter options --> | |
48 | <div id="MSearchSelectWindow" | |
49 | onmouseover="return searchBox.OnSearchSelectShow()" | |
50 | onmouseout="return searchBox.OnSearchSelectHide()" | |
51 | onkeydown="return searchBox.OnSearchSelectKey(event)"> | |
52 | </div> | |
53 | ||
54 | <!-- iframe showing the search results (closed by default) --> | |
55 | <div id="MSearchResultsWindow"> | |
56 | <iframe src="javascript:void(0)" frameborder="0" | |
57 | name="MSearchResults" id="MSearchResults"> | |
58 | </iframe> | |
59 | </div> | |
60 | ||
61 | <div id="nav-path" class="navpath"> | |
62 | <ul> | |
63 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_69f4ea29401808fe6229564976cde3ce.html">ucx</a></li> </ul> | |
64 | </div> | |
65 | </div><!-- top --> | |
66 | <div class="header"> | |
67 | <div class="summary"> | |
68 | <a href="#nested-classes">Data Structures</a> | | |
69 | <a href="#define-members">Macros</a> | | |
70 | <a href="#func-members">Functions</a> </div> | |
71 | <div class="headertitle"> | |
72 | <div class="title">array.h File Reference</div> </div> | |
73 | </div><!--header--> | |
74 | <div class="contents"> | |
75 | ||
76 | <p>Dynamically allocated array implementation. | |
77 | <a href="#details">More...</a></p> | |
78 | <div class="textblock"><code>#include "<a class="el" href="ucx_8h_source.html">ucx.h</a>"</code><br /> | |
79 | <code>#include "<a class="el" href="allocator_8h_source.html">allocator.h</a>"</code><br /> | |
80 | </div> | |
81 | <p><a href="array_8h_source.html">Go to the source code of this file.</a></p> | |
82 | <table class="memberdecls"> | |
83 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> | |
84 | Data Structures</h2></td></tr> | |
85 | <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structUcxArray.html">UcxArray</a></td></tr> | |
86 | <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">UCX array type. <a href="structUcxArray.html#details">More...</a><br /></td></tr> | |
87 | <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> | |
88 | </table><table class="memberdecls"> | |
89 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> | |
90 | Macros</h2></td></tr> | |
91 | <tr class="memitem:a1d959c29af3125bdd37cde3a554e729c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a1d959c29af3125bdd37cde3a554e729c">ucx_array_util_set</a>(array, capacity, elmsize, idx, data)</td></tr> | |
92 | <tr class="memdesc:a1d959c29af3125bdd37cde3a554e729c"><td class="mdescLeft"> </td><td class="mdescRight">Sets an element in an arbitrary user defined array. <a href="#a1d959c29af3125bdd37cde3a554e729c">More...</a><br /></td></tr> | |
93 | <tr class="separator:a1d959c29af3125bdd37cde3a554e729c"><td class="memSeparator" colspan="2"> </td></tr> | |
94 | <tr class="memitem:a59a5b342965e790945f9c7a3f86b99f9"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a59a5b342965e790945f9c7a3f86b99f9">ucx_array_util_setptr</a>(array, capacity, idx, ptr)</td></tr> | |
95 | <tr class="memdesc:a59a5b342965e790945f9c7a3f86b99f9"><td class="mdescLeft"> </td><td class="mdescRight">Stores a pointer in an arbitrary user defined array. <a href="#a59a5b342965e790945f9c7a3f86b99f9">More...</a><br /></td></tr> | |
96 | <tr class="separator:a59a5b342965e790945f9c7a3f86b99f9"><td class="memSeparator" colspan="2"> </td></tr> | |
97 | </table><table class="memberdecls"> | |
98 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> | |
99 | Functions</h2></td></tr> | |
100 | <tr class="memitem:ad0a8d76980cf1c1910e64a245803fb9a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#ad0a8d76980cf1c1910e64a245803fb9a">ucx_array_util_set_a</a> (<a class="el" href="structUcxAllocator.html">UcxAllocator</a> *alloc, void **array, size_t *capacity, size_t elmsize, size_t idx, void *data)</td></tr> | |
101 | <tr class="memdesc:ad0a8d76980cf1c1910e64a245803fb9a"><td class="mdescLeft"> </td><td class="mdescRight">Sets an element in an arbitrary user defined array. <a href="#ad0a8d76980cf1c1910e64a245803fb9a">More...</a><br /></td></tr> | |
102 | <tr class="separator:ad0a8d76980cf1c1910e64a245803fb9a"><td class="memSeparator" colspan="2"> </td></tr> | |
103 | <tr class="memitem:ad708b333c0c1b02c998309a58ea65e31"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#ad708b333c0c1b02c998309a58ea65e31">ucx_array_util_setptr_a</a> (<a class="el" href="structUcxAllocator.html">UcxAllocator</a> *alloc, void **array, size_t *capacity, size_t idx, void *ptr)</td></tr> | |
104 | <tr class="memdesc:ad708b333c0c1b02c998309a58ea65e31"><td class="mdescLeft"> </td><td class="mdescRight">Stores a pointer in an arbitrary user defined array. <a href="#ad708b333c0c1b02c998309a58ea65e31">More...</a><br /></td></tr> | |
105 | <tr class="separator:ad708b333c0c1b02c998309a58ea65e31"><td class="memSeparator" colspan="2"> </td></tr> | |
106 | <tr class="memitem:a994a2fbf1c33a3833e2a70cd9a4352b7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structUcxArray.html">UcxArray</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a994a2fbf1c33a3833e2a70cd9a4352b7">ucx_array_new</a> (size_t capacity, size_t elemsize)</td></tr> | |
107 | <tr class="memdesc:a994a2fbf1c33a3833e2a70cd9a4352b7"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new UCX array with the given capacity and element size. <a href="#a994a2fbf1c33a3833e2a70cd9a4352b7">More...</a><br /></td></tr> | |
108 | <tr class="separator:a994a2fbf1c33a3833e2a70cd9a4352b7"><td class="memSeparator" colspan="2"> </td></tr> | |
109 | <tr class="memitem:a177170258c215eb2e4f5a32e59f0cb1b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structUcxArray.html">UcxArray</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a177170258c215eb2e4f5a32e59f0cb1b">ucx_array_new_a</a> (size_t capacity, size_t elemsize, <a class="el" href="structUcxAllocator.html">UcxAllocator</a> *allocator)</td></tr> | |
110 | <tr class="memdesc:a177170258c215eb2e4f5a32e59f0cb1b"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new UCX array using the specified allocator. <a href="#a177170258c215eb2e4f5a32e59f0cb1b">More...</a><br /></td></tr> | |
111 | <tr class="separator:a177170258c215eb2e4f5a32e59f0cb1b"><td class="memSeparator" colspan="2"> </td></tr> | |
112 | <tr class="memitem:ad921e85c28ffae32230777a53c5037e5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#ad921e85c28ffae32230777a53c5037e5">ucx_array_init</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, size_t capacity, size_t elemsize)</td></tr> | |
113 | <tr class="memdesc:ad921e85c28ffae32230777a53c5037e5"><td class="mdescLeft"> </td><td class="mdescRight">Initializes a UCX array structure with the given capacity and element size. <a href="#ad921e85c28ffae32230777a53c5037e5">More...</a><br /></td></tr> | |
114 | <tr class="separator:ad921e85c28ffae32230777a53c5037e5"><td class="memSeparator" colspan="2"> </td></tr> | |
115 | <tr class="memitem:a2451e61ebb15a7ba1c1319267ba75b8c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a2451e61ebb15a7ba1c1319267ba75b8c">ucx_array_init_a</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, size_t capacity, size_t elemsize, <a class="el" href="structUcxAllocator.html">UcxAllocator</a> *allocator)</td></tr> | |
116 | <tr class="memdesc:a2451e61ebb15a7ba1c1319267ba75b8c"><td class="mdescLeft"> </td><td class="mdescRight">Initializes a UCX array structure using the specified allocator. <a href="#a2451e61ebb15a7ba1c1319267ba75b8c">More...</a><br /></td></tr> | |
117 | <tr class="separator:a2451e61ebb15a7ba1c1319267ba75b8c"><td class="memSeparator" colspan="2"> </td></tr> | |
118 | <tr class="memitem:a4a8c273370e4a3a3e2624e364f5ab410"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a4a8c273370e4a3a3e2624e364f5ab410">ucx_array_clone</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *dest, <a class="el" href="structUcxArray.html">UcxArray</a> const *src)</td></tr> | |
119 | <tr class="memdesc:a4a8c273370e4a3a3e2624e364f5ab410"><td class="mdescLeft"> </td><td class="mdescRight">Creates an shallow copy of an array. <a href="#a4a8c273370e4a3a3e2624e364f5ab410">More...</a><br /></td></tr> | |
120 | <tr class="separator:a4a8c273370e4a3a3e2624e364f5ab410"><td class="memSeparator" colspan="2"> </td></tr> | |
121 | <tr class="memitem:a43292b448adb1741677aa8c578bcc201"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a43292b448adb1741677aa8c578bcc201">ucx_array_equals</a> (<a class="el" href="structUcxArray.html">UcxArray</a> const *array1, <a class="el" href="structUcxArray.html">UcxArray</a> const *array2, <a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791">cmp_func</a> cmpfnc, void *data)</td></tr> | |
122 | <tr class="memdesc:a43292b448adb1741677aa8c578bcc201"><td class="mdescLeft"> </td><td class="mdescRight">Compares two UCX arrays element-wise by using a compare function. <a href="#a43292b448adb1741677aa8c578bcc201">More...</a><br /></td></tr> | |
123 | <tr class="separator:a43292b448adb1741677aa8c578bcc201"><td class="memSeparator" colspan="2"> </td></tr> | |
124 | <tr class="memitem:a8e83681d8d5d8cddbf10f63ce5be4c10"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a8e83681d8d5d8cddbf10f63ce5be4c10">ucx_array_destroy</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array)</td></tr> | |
125 | <tr class="memdesc:a8e83681d8d5d8cddbf10f63ce5be4c10"><td class="mdescLeft"> </td><td class="mdescRight">Destroys the array. <a href="#a8e83681d8d5d8cddbf10f63ce5be4c10">More...</a><br /></td></tr> | |
126 | <tr class="separator:a8e83681d8d5d8cddbf10f63ce5be4c10"><td class="memSeparator" colspan="2"> </td></tr> | |
127 | <tr class="memitem:ac01ee914468a16f470bf3071fffbe438"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#ac01ee914468a16f470bf3071fffbe438">ucx_array_free</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array)</td></tr> | |
128 | <tr class="memdesc:ac01ee914468a16f470bf3071fffbe438"><td class="mdescLeft"> </td><td class="mdescRight">Destroys and frees the array. <a href="#ac01ee914468a16f470bf3071fffbe438">More...</a><br /></td></tr> | |
129 | <tr class="separator:ac01ee914468a16f470bf3071fffbe438"><td class="memSeparator" colspan="2"> </td></tr> | |
130 | <tr class="memitem:aea01731ad94ea73c0c8fb1d1b7a35fcf"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#aea01731ad94ea73c0c8fb1d1b7a35fcf">ucx_array_append_from</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, void *data, size_t count)</td></tr> | |
131 | <tr class="memdesc:aea01731ad94ea73c0c8fb1d1b7a35fcf"><td class="mdescLeft"> </td><td class="mdescRight">Inserts elements at the end of the array. <a href="#aea01731ad94ea73c0c8fb1d1b7a35fcf">More...</a><br /></td></tr> | |
132 | <tr class="separator:aea01731ad94ea73c0c8fb1d1b7a35fcf"><td class="memSeparator" colspan="2"> </td></tr> | |
133 | <tr class="memitem:a95b52acc2193b5c33cf0eaa4f2082477"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a95b52acc2193b5c33cf0eaa4f2082477">ucx_array_prepend_from</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, void *data, size_t count)</td></tr> | |
134 | <tr class="memdesc:a95b52acc2193b5c33cf0eaa4f2082477"><td class="mdescLeft"> </td><td class="mdescRight">Inserts elements at the beginning of the array. <a href="#a95b52acc2193b5c33cf0eaa4f2082477">More...</a><br /></td></tr> | |
135 | <tr class="separator:a95b52acc2193b5c33cf0eaa4f2082477"><td class="memSeparator" colspan="2"> </td></tr> | |
136 | <tr class="memitem:a1bb545d065358d265d80d815ba382a28"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a1bb545d065358d265d80d815ba382a28">ucx_array_set_from</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, size_t index, void *data, size_t count)</td></tr> | |
137 | <tr class="memdesc:a1bb545d065358d265d80d815ba382a28"><td class="mdescLeft"> </td><td class="mdescRight">Sets elements starting at the specified index. <a href="#a1bb545d065358d265d80d815ba382a28">More...</a><br /></td></tr> | |
138 | <tr class="separator:a1bb545d065358d265d80d815ba382a28"><td class="memSeparator" colspan="2"> </td></tr> | |
139 | <tr class="memitem:aa5a0bf3d3f0df6406beb0e569021cc28"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#aa5a0bf3d3f0df6406beb0e569021cc28">ucx_array_concat</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array1, const <a class="el" href="structUcxArray.html">UcxArray</a> *array2)</td></tr> | |
140 | <tr class="memdesc:aa5a0bf3d3f0df6406beb0e569021cc28"><td class="mdescLeft"> </td><td class="mdescRight">Concatenates two arrays. <a href="#aa5a0bf3d3f0df6406beb0e569021cc28">More...</a><br /></td></tr> | |
141 | <tr class="separator:aa5a0bf3d3f0df6406beb0e569021cc28"><td class="memSeparator" colspan="2"> </td></tr> | |
142 | <tr class="memitem:aa698085fd1a8b70d6b709999c51b49e8"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#aa698085fd1a8b70d6b709999c51b49e8">ucx_array_at</a> (<a class="el" href="structUcxArray.html">UcxArray</a> const *array, size_t index)</td></tr> | |
143 | <tr class="memdesc:aa698085fd1a8b70d6b709999c51b49e8"><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to the array element at the specified index. <a href="#aa698085fd1a8b70d6b709999c51b49e8">More...</a><br /></td></tr> | |
144 | <tr class="separator:aa698085fd1a8b70d6b709999c51b49e8"><td class="memSeparator" colspan="2"> </td></tr> | |
145 | <tr class="memitem:ae7bdbed94afee9b20b38b95e3ab470f0"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#ae7bdbed94afee9b20b38b95e3ab470f0">ucx_array_find</a> (<a class="el" href="structUcxArray.html">UcxArray</a> const *array, void *elem, <a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791">cmp_func</a> cmpfnc, void *data)</td></tr> | |
146 | <tr class="memdesc:ae7bdbed94afee9b20b38b95e3ab470f0"><td class="mdescLeft"> </td><td class="mdescRight">Returns the index of an element containing the specified data. <a href="#ae7bdbed94afee9b20b38b95e3ab470f0">More...</a><br /></td></tr> | |
147 | <tr class="separator:ae7bdbed94afee9b20b38b95e3ab470f0"><td class="memSeparator" colspan="2"> </td></tr> | |
148 | <tr class="memitem:a5241058cd2329147bc5b1593ae7e51dc"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a5241058cd2329147bc5b1593ae7e51dc">ucx_array_contains</a> (<a class="el" href="structUcxArray.html">UcxArray</a> const *array, void *elem, <a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791">cmp_func</a> cmpfnc, void *data)</td></tr> | |
149 | <tr class="memdesc:a5241058cd2329147bc5b1593ae7e51dc"><td class="mdescLeft"> </td><td class="mdescRight">Checks, if an array contains a specific element. <a href="#a5241058cd2329147bc5b1593ae7e51dc">More...</a><br /></td></tr> | |
150 | <tr class="separator:a5241058cd2329147bc5b1593ae7e51dc"><td class="memSeparator" colspan="2"> </td></tr> | |
151 | <tr class="memitem:add773514569b872a6624381b4b6af52c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#add773514569b872a6624381b4b6af52c">ucx_array_sort</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, <a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791">cmp_func</a> cmpfnc, void *data)</td></tr> | |
152 | <tr class="memdesc:add773514569b872a6624381b4b6af52c"><td class="mdescLeft"> </td><td class="mdescRight">Sorts a <a class="el" href="structUcxArray.html" title="UCX array type. ">UcxArray</a> with the best available sort algorithm. <a href="#add773514569b872a6624381b4b6af52c">More...</a><br /></td></tr> | |
153 | <tr class="separator:add773514569b872a6624381b4b6af52c"><td class="memSeparator" colspan="2"> </td></tr> | |
154 | <tr class="memitem:aa45eac6b697f83adac81c0860cf306b8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#aa45eac6b697f83adac81c0860cf306b8">ucx_array_remove</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, size_t index)</td></tr> | |
155 | <tr class="memdesc:aa45eac6b697f83adac81c0860cf306b8"><td class="mdescLeft"> </td><td class="mdescRight">Removes an element from the array. <a href="#aa45eac6b697f83adac81c0860cf306b8">More...</a><br /></td></tr> | |
156 | <tr class="separator:aa45eac6b697f83adac81c0860cf306b8"><td class="memSeparator" colspan="2"> </td></tr> | |
157 | <tr class="memitem:a548d81b07612bae3ba8c4c4b49104b8e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a548d81b07612bae3ba8c4c4b49104b8e">ucx_array_remove_fast</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, size_t index)</td></tr> | |
158 | <tr class="memdesc:a548d81b07612bae3ba8c4c4b49104b8e"><td class="mdescLeft"> </td><td class="mdescRight">Removes an element from the array. <a href="#a548d81b07612bae3ba8c4c4b49104b8e">More...</a><br /></td></tr> | |
159 | <tr class="separator:a548d81b07612bae3ba8c4c4b49104b8e"><td class="memSeparator" colspan="2"> </td></tr> | |
160 | <tr class="memitem:a2daf50e80aee9bccebee876a7efd2dfc"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a2daf50e80aee9bccebee876a7efd2dfc">ucx_array_shrink</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array)</td></tr> | |
161 | <tr class="memdesc:a2daf50e80aee9bccebee876a7efd2dfc"><td class="mdescLeft"> </td><td class="mdescRight">Shrinks the memory to exactly fit the contents. <a href="#a2daf50e80aee9bccebee876a7efd2dfc">More...</a><br /></td></tr> | |
162 | <tr class="separator:a2daf50e80aee9bccebee876a7efd2dfc"><td class="memSeparator" colspan="2"> </td></tr> | |
163 | <tr class="memitem:a27762e7c06a6c781015e3c8ceeee0ce3"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a27762e7c06a6c781015e3c8ceeee0ce3">ucx_array_resize</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, size_t capacity)</td></tr> | |
164 | <tr class="memdesc:a27762e7c06a6c781015e3c8ceeee0ce3"><td class="mdescLeft"> </td><td class="mdescRight">Sets the capacity of the array. <a href="#a27762e7c06a6c781015e3c8ceeee0ce3">More...</a><br /></td></tr> | |
165 | <tr class="separator:a27762e7c06a6c781015e3c8ceeee0ce3"><td class="memSeparator" colspan="2"> </td></tr> | |
166 | <tr class="memitem:a1c3bf8433c1de3c933f3854ab297fe1d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#a1c3bf8433c1de3c933f3854ab297fe1d">ucx_array_reserve</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, size_t capacity)</td></tr> | |
167 | <tr class="memdesc:a1c3bf8433c1de3c933f3854ab297fe1d"><td class="mdescLeft"> </td><td class="mdescRight">Resizes the array only, if the capacity is insufficient. <a href="#a1c3bf8433c1de3c933f3854ab297fe1d">More...</a><br /></td></tr> | |
168 | <tr class="separator:a1c3bf8433c1de3c933f3854ab297fe1d"><td class="memSeparator" colspan="2"> </td></tr> | |
169 | <tr class="memitem:ab0cbf243824aaebee48277315e03afce"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="array_8h.html#ab0cbf243824aaebee48277315e03afce">ucx_array_grow</a> (<a class="el" href="structUcxArray.html">UcxArray</a> *array, size_t count)</td></tr> | |
170 | <tr class="memdesc:ab0cbf243824aaebee48277315e03afce"><td class="mdescLeft"> </td><td class="mdescRight">Resizes the capacity, if the specified number of elements would not fit. <a href="#ab0cbf243824aaebee48277315e03afce">More...</a><br /></td></tr> | |
171 | <tr class="separator:ab0cbf243824aaebee48277315e03afce"><td class="memSeparator" colspan="2"> </td></tr> | |
172 | </table> | |
173 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> | |
174 | <div class="textblock"><p>Dynamically allocated array implementation. </p> | |
175 | <dl class="section author"><dt>Author</dt><dd>Mike Becker </dd> | |
176 | <dd> | |
177 | Olaf Wintermann </dd></dl> | |
178 | </div><h2 class="groupheader">Macro Definition Documentation</h2> | |
179 | <a id="a1d959c29af3125bdd37cde3a554e729c"></a> | |
180 | <h2 class="memtitle"><span class="permalink"><a href="#a1d959c29af3125bdd37cde3a554e729c">◆ </a></span>ucx_array_util_set</h2> | |
181 | ||
182 | <div class="memitem"> | |
183 | <div class="memproto"> | |
184 | <table class="memname"> | |
185 | <tr> | |
186 | <td class="memname">#define ucx_array_util_set</td> | |
187 | <td>(</td> | |
188 | <td class="paramtype"> </td> | |
189 | <td class="paramname">array, </td> | |
190 | </tr> | |
191 | <tr> | |
192 | <td class="paramkey"></td> | |
193 | <td></td> | |
194 | <td class="paramtype"> </td> | |
195 | <td class="paramname">capacity, </td> | |
196 | </tr> | |
197 | <tr> | |
198 | <td class="paramkey"></td> | |
199 | <td></td> | |
200 | <td class="paramtype"> </td> | |
201 | <td class="paramname">elmsize, </td> | |
202 | </tr> | |
203 | <tr> | |
204 | <td class="paramkey"></td> | |
205 | <td></td> | |
206 | <td class="paramtype"> </td> | |
207 | <td class="paramname">idx, </td> | |
208 | </tr> | |
209 | <tr> | |
210 | <td class="paramkey"></td> | |
211 | <td></td> | |
212 | <td class="paramtype"> </td> | |
213 | <td class="paramname">data </td> | |
214 | </tr> | |
215 | <tr> | |
216 | <td></td> | |
217 | <td>)</td> | |
218 | <td></td><td></td> | |
219 | </tr> | |
220 | </table> | |
221 | </div><div class="memdoc"> | |
222 | <b>Value:</b><div class="fragment"><div class="line"><a class="code" href="array_8h.html#ad0a8d76980cf1c1910e64a245803fb9a">ucx_array_util_set_a</a>(<a class="code" href="allocator_8h.html#a98d2f1b341118b7a0e341fda5d8b2ebf">ucx_default_allocator</a>(), (<span class="keywordtype">void</span>**)(array), capacity, \</div><div class="line"> elmsize, idx, data)</div><div class="ttc" id="array_8h_html_ad0a8d76980cf1c1910e64a245803fb9a"><div class="ttname"><a href="array_8h.html#ad0a8d76980cf1c1910e64a245803fb9a">ucx_array_util_set_a</a></div><div class="ttdeci">int ucx_array_util_set_a(UcxAllocator *alloc, void **array, size_t *capacity, size_t elmsize, size_t idx, void *data)</div><div class="ttdoc">Sets an element in an arbitrary user defined array. </div><div class="ttdef"><b>Definition:</b> array.c:72</div></div> | |
223 | <div class="ttc" id="allocator_8h_html_a98d2f1b341118b7a0e341fda5d8b2ebf"><div class="ttname"><a href="allocator_8h.html#a98d2f1b341118b7a0e341fda5d8b2ebf">ucx_default_allocator</a></div><div class="ttdeci">UcxAllocator * ucx_default_allocator()</div><div class="ttdoc">Returns a pointer to the default allocator. </div><div class="ttdef"><b>Definition:</b> allocator.c:41</div></div> | |
224 | </div><!-- fragment --> | |
225 | <p>Sets an element in an arbitrary user defined array. </p> | |
226 | <p>The data is copied from the specified data location.</p> | |
227 | <p>If the capacity is insufficient, the array is automatically reallocated and the possibly new pointer is stored in the <code>array</code> argument.</p> | |
228 | <p>On reallocation the capacity of the array is doubled until it is sufficient. The new capacity is stored back to <code>capacity</code>.</p> | |
229 | <dl class="params"><dt>Parameters</dt><dd> | |
230 | <table class="params"> | |
231 | <tr><td class="paramname">array</td><td>a pointer to location of the array pointer </td></tr> | |
232 | <tr><td class="paramname">capacity</td><td>a pointer to the capacity </td></tr> | |
233 | <tr><td class="paramname">elmsize</td><td>the size of each element </td></tr> | |
234 | <tr><td class="paramname">idx</td><td>the index of the element to set </td></tr> | |
235 | <tr><td class="paramname">data</td><td>a pointer to the element data </td></tr> | |
236 | </table> | |
237 | </dd> | |
238 | </dl> | |
239 | <dl class="section return"><dt>Returns</dt><dd>zero on success or non-zero on error (errno will be set) </dd></dl> | |
240 | ||
241 | </div> | |
242 | </div> | |
243 | <a id="a59a5b342965e790945f9c7a3f86b99f9"></a> | |
244 | <h2 class="memtitle"><span class="permalink"><a href="#a59a5b342965e790945f9c7a3f86b99f9">◆ </a></span>ucx_array_util_setptr</h2> | |
245 | ||
246 | <div class="memitem"> | |
247 | <div class="memproto"> | |
248 | <table class="memname"> | |
249 | <tr> | |
250 | <td class="memname">#define ucx_array_util_setptr</td> | |
251 | <td>(</td> | |
252 | <td class="paramtype"> </td> | |
253 | <td class="paramname">array, </td> | |
254 | </tr> | |
255 | <tr> | |
256 | <td class="paramkey"></td> | |
257 | <td></td> | |
258 | <td class="paramtype"> </td> | |
259 | <td class="paramname">capacity, </td> | |
260 | </tr> | |
261 | <tr> | |
262 | <td class="paramkey"></td> | |
263 | <td></td> | |
264 | <td class="paramtype"> </td> | |
265 | <td class="paramname">idx, </td> | |
266 | </tr> | |
267 | <tr> | |
268 | <td class="paramkey"></td> | |
269 | <td></td> | |
270 | <td class="paramtype"> </td> | |
271 | <td class="paramname">ptr </td> | |
272 | </tr> | |
273 | <tr> | |
274 | <td></td> | |
275 | <td>)</td> | |
276 | <td></td><td></td> | |
277 | </tr> | |
278 | </table> | |
279 | </div><div class="memdoc"> | |
280 | <b>Value:</b><div class="fragment"><div class="line"><a class="code" href="array_8h.html#ad708b333c0c1b02c998309a58ea65e31">ucx_array_util_setptr_a</a>(<a class="code" href="allocator_8h.html#a98d2f1b341118b7a0e341fda5d8b2ebf">ucx_default_allocator</a>(), (<span class="keywordtype">void</span>**)(array), \</div><div class="line"> capacity, idx, ptr)</div><div class="ttc" id="allocator_8h_html_a98d2f1b341118b7a0e341fda5d8b2ebf"><div class="ttname"><a href="allocator_8h.html#a98d2f1b341118b7a0e341fda5d8b2ebf">ucx_default_allocator</a></div><div class="ttdeci">UcxAllocator * ucx_default_allocator()</div><div class="ttdoc">Returns a pointer to the default allocator. </div><div class="ttdef"><b>Definition:</b> allocator.c:41</div></div> | |
281 | <div class="ttc" id="array_8h_html_ad708b333c0c1b02c998309a58ea65e31"><div class="ttname"><a href="array_8h.html#ad708b333c0c1b02c998309a58ea65e31">ucx_array_util_setptr_a</a></div><div class="ttdeci">int ucx_array_util_setptr_a(UcxAllocator *alloc, void **array, size_t *capacity, size_t idx, void *ptr)</div><div class="ttdoc">Stores a pointer in an arbitrary user defined array. </div><div class="ttdef"><b>Definition:</b> array.c:112</div></div> | |
282 | </div><!-- fragment --> | |
283 | <p>Stores a pointer in an arbitrary user defined array. </p> | |
284 | <p>The element size of the array must be sizeof(void*).</p> | |
285 | <p>If the capacity is insufficient, the array is automatically reallocated and the possibly new pointer is stored in the <code>array</code> argument.</p> | |
286 | <p>On reallocation the capacity of the array is doubled until it is sufficient. The new capacity is stored back to <code>capacity</code>.</p> | |
287 | <dl class="params"><dt>Parameters</dt><dd> | |
288 | <table class="params"> | |
289 | <tr><td class="paramname">array</td><td>a pointer to location of the array pointer </td></tr> | |
290 | <tr><td class="paramname">capacity</td><td>a pointer to the capacity </td></tr> | |
291 | <tr><td class="paramname">idx</td><td>the index of the element to set </td></tr> | |
292 | <tr><td class="paramname">ptr</td><td>the pointer to store </td></tr> | |
293 | </table> | |
294 | </dd> | |
295 | </dl> | |
296 | <dl class="section return"><dt>Returns</dt><dd>zero on success or non-zero on error (errno will be set) </dd></dl> | |
297 | ||
298 | </div> | |
299 | </div> | |
300 | <h2 class="groupheader">Function Documentation</h2> | |
301 | <a id="aea01731ad94ea73c0c8fb1d1b7a35fcf"></a> | |
302 | <h2 class="memtitle"><span class="permalink"><a href="#aea01731ad94ea73c0c8fb1d1b7a35fcf">◆ </a></span>ucx_array_append_from()</h2> | |
303 | ||
304 | <div class="memitem"> | |
305 | <div class="memproto"> | |
306 | <table class="memname"> | |
307 | <tr> | |
308 | <td class="memname">int ucx_array_append_from </td> | |
309 | <td>(</td> | |
310 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
311 | <td class="paramname"><em>array</em>, </td> | |
312 | </tr> | |
313 | <tr> | |
314 | <td class="paramkey"></td> | |
315 | <td></td> | |
316 | <td class="paramtype">void * </td> | |
317 | <td class="paramname"><em>data</em>, </td> | |
318 | </tr> | |
319 | <tr> | |
320 | <td class="paramkey"></td> | |
321 | <td></td> | |
322 | <td class="paramtype">size_t </td> | |
323 | <td class="paramname"><em>count</em> </td> | |
324 | </tr> | |
325 | <tr> | |
326 | <td></td> | |
327 | <td>)</td> | |
328 | <td></td><td></td> | |
329 | </tr> | |
330 | </table> | |
331 | </div><div class="memdoc"> | |
332 | ||
333 | <p>Inserts elements at the end of the array. </p> | |
334 | <p>This is an O(1) operation. The array will automatically grow, if the capacity is exceeded. If a pointer to data is provided, the data is copied into the array with memcpy(). Otherwise the new elements are completely zeroed.</p> | |
335 | <dl class="params"><dt>Parameters</dt><dd> | |
336 | <table class="params"> | |
337 | <tr><td class="paramname">array</td><td>a pointer the array where to append the data </td></tr> | |
338 | <tr><td class="paramname">data</td><td>a pointer to the data to insert (may be <code>NULL</code>) </td></tr> | |
339 | <tr><td class="paramname">count</td><td>number of elements to copy from data (if data is <code>NULL</code>, zeroed elements are appended) </td></tr> | |
340 | </table> | |
341 | </dd> | |
342 | </dl> | |
343 | <dl class="section return"><dt>Returns</dt><dd>zero on success, non-zero if a reallocation was necessary but failed </dd></dl> | |
344 | <dl class="section see"><dt>See also</dt><dd><a class="el" href="array_8h.html#a1bb545d065358d265d80d815ba382a28" title="Sets elements starting at the specified index. ">ucx_array_set_from()</a> </dd> | |
345 | <dd> | |
346 | ucx_array_append() </dd></dl> | |
347 | ||
348 | </div> | |
349 | </div> | |
350 | <a id="aa698085fd1a8b70d6b709999c51b49e8"></a> | |
351 | <h2 class="memtitle"><span class="permalink"><a href="#aa698085fd1a8b70d6b709999c51b49e8">◆ </a></span>ucx_array_at()</h2> | |
352 | ||
353 | <div class="memitem"> | |
354 | <div class="memproto"> | |
355 | <table class="memname"> | |
356 | <tr> | |
357 | <td class="memname">void* ucx_array_at </td> | |
358 | <td>(</td> | |
359 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> const * </td> | |
360 | <td class="paramname"><em>array</em>, </td> | |
361 | </tr> | |
362 | <tr> | |
363 | <td class="paramkey"></td> | |
364 | <td></td> | |
365 | <td class="paramtype">size_t </td> | |
366 | <td class="paramname"><em>index</em> </td> | |
367 | </tr> | |
368 | <tr> | |
369 | <td></td> | |
370 | <td>)</td> | |
371 | <td></td><td></td> | |
372 | </tr> | |
373 | </table> | |
374 | </div><div class="memdoc"> | |
375 | ||
376 | <p>Returns a pointer to the array element at the specified index. </p> | |
377 | <dl class="params"><dt>Parameters</dt><dd> | |
378 | <table class="params"> | |
379 | <tr><td class="paramname">array</td><td>the array to retrieve the element from </td></tr> | |
380 | <tr><td class="paramname">index</td><td>index of the element to return </td></tr> | |
381 | </table> | |
382 | </dd> | |
383 | </dl> | |
384 | <dl class="section return"><dt>Returns</dt><dd>a pointer to the element at the specified index or <code>NULL</code>, if the index is greater than the array size </dd></dl> | |
385 | ||
386 | </div> | |
387 | </div> | |
388 | <a id="a4a8c273370e4a3a3e2624e364f5ab410"></a> | |
389 | <h2 class="memtitle"><span class="permalink"><a href="#a4a8c273370e4a3a3e2624e364f5ab410">◆ </a></span>ucx_array_clone()</h2> | |
390 | ||
391 | <div class="memitem"> | |
392 | <div class="memproto"> | |
393 | <table class="memname"> | |
394 | <tr> | |
395 | <td class="memname">int ucx_array_clone </td> | |
396 | <td>(</td> | |
397 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
398 | <td class="paramname"><em>dest</em>, </td> | |
399 | </tr> | |
400 | <tr> | |
401 | <td class="paramkey"></td> | |
402 | <td></td> | |
403 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> const * </td> | |
404 | <td class="paramname"><em>src</em> </td> | |
405 | </tr> | |
406 | <tr> | |
407 | <td></td> | |
408 | <td>)</td> | |
409 | <td></td><td></td> | |
410 | </tr> | |
411 | </table> | |
412 | </div><div class="memdoc"> | |
413 | ||
414 | <p>Creates an shallow copy of an array. </p> | |
415 | <p>This function clones the specified array by using memcpy(). If the destination capacity is insufficient, an automatic reallocation is attempted.</p> | |
416 | <p>Note: if the destination array is uninitialized, the behavior is undefined.</p> | |
417 | <dl class="params"><dt>Parameters</dt><dd> | |
418 | <table class="params"> | |
419 | <tr><td class="paramname">dest</td><td>the array to copy to </td></tr> | |
420 | <tr><td class="paramname">src</td><td>the array to copy from </td></tr> | |
421 | </table> | |
422 | </dd> | |
423 | </dl> | |
424 | <dl class="section return"><dt>Returns</dt><dd>zero on success, non-zero on reallocation failure. </dd></dl> | |
425 | ||
426 | </div> | |
427 | </div> | |
428 | <a id="aa5a0bf3d3f0df6406beb0e569021cc28"></a> | |
429 | <h2 class="memtitle"><span class="permalink"><a href="#aa5a0bf3d3f0df6406beb0e569021cc28">◆ </a></span>ucx_array_concat()</h2> | |
430 | ||
431 | <div class="memitem"> | |
432 | <div class="memproto"> | |
433 | <table class="memname"> | |
434 | <tr> | |
435 | <td class="memname">int ucx_array_concat </td> | |
436 | <td>(</td> | |
437 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
438 | <td class="paramname"><em>array1</em>, </td> | |
439 | </tr> | |
440 | <tr> | |
441 | <td class="paramkey"></td> | |
442 | <td></td> | |
443 | <td class="paramtype">const <a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
444 | <td class="paramname"><em>array2</em> </td> | |
445 | </tr> | |
446 | <tr> | |
447 | <td></td> | |
448 | <td>)</td> | |
449 | <td></td><td></td> | |
450 | </tr> | |
451 | </table> | |
452 | </div><div class="memdoc"> | |
453 | ||
454 | <p>Concatenates two arrays. </p> | |
455 | <p>The contents of the second array are appended to the first array in one single operation. The second array is otherwise left untouched.</p> | |
456 | <p>The first array may grow automatically. If this fails, both arrays remain unmodified.</p> | |
457 | <dl class="params"><dt>Parameters</dt><dd> | |
458 | <table class="params"> | |
459 | <tr><td class="paramname">array1</td><td>first array </td></tr> | |
460 | <tr><td class="paramname">array2</td><td>second array </td></tr> | |
461 | </table> | |
462 | </dd> | |
463 | </dl> | |
464 | <dl class="section return"><dt>Returns</dt><dd>zero on success, non-zero if reallocation was necessary but failed or the element size does not match </dd></dl> | |
465 | ||
466 | </div> | |
467 | </div> | |
468 | <a id="a5241058cd2329147bc5b1593ae7e51dc"></a> | |
469 | <h2 class="memtitle"><span class="permalink"><a href="#a5241058cd2329147bc5b1593ae7e51dc">◆ </a></span>ucx_array_contains()</h2> | |
470 | ||
471 | <div class="memitem"> | |
472 | <div class="memproto"> | |
473 | <table class="memname"> | |
474 | <tr> | |
475 | <td class="memname">int ucx_array_contains </td> | |
476 | <td>(</td> | |
477 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> const * </td> | |
478 | <td class="paramname"><em>array</em>, </td> | |
479 | </tr> | |
480 | <tr> | |
481 | <td class="paramkey"></td> | |
482 | <td></td> | |
483 | <td class="paramtype">void * </td> | |
484 | <td class="paramname"><em>elem</em>, </td> | |
485 | </tr> | |
486 | <tr> | |
487 | <td class="paramkey"></td> | |
488 | <td></td> | |
489 | <td class="paramtype"><a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791">cmp_func</a> </td> | |
490 | <td class="paramname"><em>cmpfnc</em>, </td> | |
491 | </tr> | |
492 | <tr> | |
493 | <td class="paramkey"></td> | |
494 | <td></td> | |
495 | <td class="paramtype">void * </td> | |
496 | <td class="paramname"><em>data</em> </td> | |
497 | </tr> | |
498 | <tr> | |
499 | <td></td> | |
500 | <td>)</td> | |
501 | <td></td><td></td> | |
502 | </tr> | |
503 | </table> | |
504 | </div><div class="memdoc"> | |
505 | ||
506 | <p>Checks, if an array contains a specific element. </p> | |
507 | <p>An element is found, if <a class="el" href="array_8h.html#ae7bdbed94afee9b20b38b95e3ab470f0" title="Returns the index of an element containing the specified data. ">ucx_array_find()</a> returns a value less than the size.</p> | |
508 | <dl class="params"><dt>Parameters</dt><dd> | |
509 | <table class="params"> | |
510 | <tr><td class="paramname">array</td><td>the array where to search for the data </td></tr> | |
511 | <tr><td class="paramname">elem</td><td>the element data </td></tr> | |
512 | <tr><td class="paramname">cmpfnc</td><td>the compare function </td></tr> | |
513 | <tr><td class="paramname">data</td><td>additional data for the compare function </td></tr> | |
514 | </table> | |
515 | </dd> | |
516 | </dl> | |
517 | <dl class="section return"><dt>Returns</dt><dd>1, if and only if the array contains the specified element data </dd></dl> | |
518 | <dl class="section see"><dt>See also</dt><dd><a class="el" href="array_8h.html#ae7bdbed94afee9b20b38b95e3ab470f0" title="Returns the index of an element containing the specified data. ">ucx_array_find()</a> </dd></dl> | |
519 | ||
520 | </div> | |
521 | </div> | |
522 | <a id="a8e83681d8d5d8cddbf10f63ce5be4c10"></a> | |
523 | <h2 class="memtitle"><span class="permalink"><a href="#a8e83681d8d5d8cddbf10f63ce5be4c10">◆ </a></span>ucx_array_destroy()</h2> | |
524 | ||
525 | <div class="memitem"> | |
526 | <div class="memproto"> | |
527 | <table class="memname"> | |
528 | <tr> | |
529 | <td class="memname">void ucx_array_destroy </td> | |
530 | <td>(</td> | |
531 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
532 | <td class="paramname"><em>array</em></td><td>)</td> | |
533 | <td></td> | |
534 | </tr> | |
535 | </table> | |
536 | </div><div class="memdoc"> | |
537 | ||
538 | <p>Destroys the array. </p> | |
539 | <p>The data is freed and both capacity and count are reset to zero. If the array structure itself has been dynamically allocated, it has to be freed separately.</p> | |
540 | <dl class="params"><dt>Parameters</dt><dd> | |
541 | <table class="params"> | |
542 | <tr><td class="paramname">array</td><td>the array to destroy </td></tr> | |
543 | </table> | |
544 | </dd> | |
545 | </dl> | |
546 | ||
547 | </div> | |
548 | </div> | |
549 | <a id="a43292b448adb1741677aa8c578bcc201"></a> | |
550 | <h2 class="memtitle"><span class="permalink"><a href="#a43292b448adb1741677aa8c578bcc201">◆ </a></span>ucx_array_equals()</h2> | |
551 | ||
552 | <div class="memitem"> | |
553 | <div class="memproto"> | |
554 | <table class="memname"> | |
555 | <tr> | |
556 | <td class="memname">int ucx_array_equals </td> | |
557 | <td>(</td> | |
558 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> const * </td> | |
559 | <td class="paramname"><em>array1</em>, </td> | |
560 | </tr> | |
561 | <tr> | |
562 | <td class="paramkey"></td> | |
563 | <td></td> | |
564 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> const * </td> | |
565 | <td class="paramname"><em>array2</em>, </td> | |
566 | </tr> | |
567 | <tr> | |
568 | <td class="paramkey"></td> | |
569 | <td></td> | |
570 | <td class="paramtype"><a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791">cmp_func</a> </td> | |
571 | <td class="paramname"><em>cmpfnc</em>, </td> | |
572 | </tr> | |
573 | <tr> | |
574 | <td class="paramkey"></td> | |
575 | <td></td> | |
576 | <td class="paramtype">void * </td> | |
577 | <td class="paramname"><em>data</em> </td> | |
578 | </tr> | |
579 | <tr> | |
580 | <td></td> | |
581 | <td>)</td> | |
582 | <td></td><td></td> | |
583 | </tr> | |
584 | </table> | |
585 | </div><div class="memdoc"> | |
586 | ||
587 | <p>Compares two UCX arrays element-wise by using a compare function. </p> | |
588 | <p>Elements of the two specified arrays are compared by using the specified compare function and the additional data. The type and content of this additional data depends on the <a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791" title="Function pointer to a compare function. ">cmp_func()</a> used.</p> | |
589 | <p>This function always returns zero, if the element sizes of the arrays do not match and performs no comparisons in this case.</p> | |
590 | <dl class="params"><dt>Parameters</dt><dd> | |
591 | <table class="params"> | |
592 | <tr><td class="paramname">array1</td><td>the first array </td></tr> | |
593 | <tr><td class="paramname">array2</td><td>the second array </td></tr> | |
594 | <tr><td class="paramname">cmpfnc</td><td>the compare function </td></tr> | |
595 | <tr><td class="paramname">data</td><td>additional data for the compare function </td></tr> | |
596 | </table> | |
597 | </dd> | |
598 | </dl> | |
599 | <dl class="section return"><dt>Returns</dt><dd>1, if and only if the two arrays equal element-wise, 0 otherwise </dd></dl> | |
600 | ||
601 | </div> | |
602 | </div> | |
603 | <a id="ae7bdbed94afee9b20b38b95e3ab470f0"></a> | |
604 | <h2 class="memtitle"><span class="permalink"><a href="#ae7bdbed94afee9b20b38b95e3ab470f0">◆ </a></span>ucx_array_find()</h2> | |
605 | ||
606 | <div class="memitem"> | |
607 | <div class="memproto"> | |
608 | <table class="memname"> | |
609 | <tr> | |
610 | <td class="memname">size_t ucx_array_find </td> | |
611 | <td>(</td> | |
612 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> const * </td> | |
613 | <td class="paramname"><em>array</em>, </td> | |
614 | </tr> | |
615 | <tr> | |
616 | <td class="paramkey"></td> | |
617 | <td></td> | |
618 | <td class="paramtype">void * </td> | |
619 | <td class="paramname"><em>elem</em>, </td> | |
620 | </tr> | |
621 | <tr> | |
622 | <td class="paramkey"></td> | |
623 | <td></td> | |
624 | <td class="paramtype"><a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791">cmp_func</a> </td> | |
625 | <td class="paramname"><em>cmpfnc</em>, </td> | |
626 | </tr> | |
627 | <tr> | |
628 | <td class="paramkey"></td> | |
629 | <td></td> | |
630 | <td class="paramtype">void * </td> | |
631 | <td class="paramname"><em>data</em> </td> | |
632 | </tr> | |
633 | <tr> | |
634 | <td></td> | |
635 | <td>)</td> | |
636 | <td></td><td></td> | |
637 | </tr> | |
638 | </table> | |
639 | </div><div class="memdoc"> | |
640 | ||
641 | <p>Returns the index of an element containing the specified data. </p> | |
642 | <p>This function uses a <a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791" title="Function pointer to a compare function. ">cmp_func()</a> to compare the data of each list element with the specified data. If no cmp_func is provided, memcmp() is used.</p> | |
643 | <p>If the array contains the data more than once, the index of the first occurrence is returned. If the array does not contain the data, the size of array is returned.</p> | |
644 | <dl class="params"><dt>Parameters</dt><dd> | |
645 | <table class="params"> | |
646 | <tr><td class="paramname">array</td><td>the array where to search for the data </td></tr> | |
647 | <tr><td class="paramname">elem</td><td>the element data </td></tr> | |
648 | <tr><td class="paramname">cmpfnc</td><td>the compare function </td></tr> | |
649 | <tr><td class="paramname">data</td><td>additional data for the compare function </td></tr> | |
650 | </table> | |
651 | </dd> | |
652 | </dl> | |
653 | <dl class="section return"><dt>Returns</dt><dd>the index of the element containing the specified data or the size of the array, if the data is not found in this array </dd></dl> | |
654 | ||
655 | </div> | |
656 | </div> | |
657 | <a id="ac01ee914468a16f470bf3071fffbe438"></a> | |
658 | <h2 class="memtitle"><span class="permalink"><a href="#ac01ee914468a16f470bf3071fffbe438">◆ </a></span>ucx_array_free()</h2> | |
659 | ||
660 | <div class="memitem"> | |
661 | <div class="memproto"> | |
662 | <table class="memname"> | |
663 | <tr> | |
664 | <td class="memname">void ucx_array_free </td> | |
665 | <td>(</td> | |
666 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
667 | <td class="paramname"><em>array</em></td><td>)</td> | |
668 | <td></td> | |
669 | </tr> | |
670 | </table> | |
671 | </div><div class="memdoc"> | |
672 | ||
673 | <p>Destroys and frees the array. </p> | |
674 | <dl class="params"><dt>Parameters</dt><dd> | |
675 | <table class="params"> | |
676 | <tr><td class="paramname">array</td><td>the array to free </td></tr> | |
677 | </table> | |
678 | </dd> | |
679 | </dl> | |
680 | ||
681 | </div> | |
682 | </div> | |
683 | <a id="ab0cbf243824aaebee48277315e03afce"></a> | |
684 | <h2 class="memtitle"><span class="permalink"><a href="#ab0cbf243824aaebee48277315e03afce">◆ </a></span>ucx_array_grow()</h2> | |
685 | ||
686 | <div class="memitem"> | |
687 | <div class="memproto"> | |
688 | <table class="memname"> | |
689 | <tr> | |
690 | <td class="memname">int ucx_array_grow </td> | |
691 | <td>(</td> | |
692 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
693 | <td class="paramname"><em>array</em>, </td> | |
694 | </tr> | |
695 | <tr> | |
696 | <td class="paramkey"></td> | |
697 | <td></td> | |
698 | <td class="paramtype">size_t </td> | |
699 | <td class="paramname"><em>count</em> </td> | |
700 | </tr> | |
701 | <tr> | |
702 | <td></td> | |
703 | <td>)</td> | |
704 | <td></td><td></td> | |
705 | </tr> | |
706 | </table> | |
707 | </div><div class="memdoc"> | |
708 | ||
709 | <p>Resizes the capacity, if the specified number of elements would not fit. </p> | |
710 | <p>A call to ucx_array_grow(array, count) is effectively the same as ucx_array_reserve(array, array->size+count).</p> | |
711 | <dl class="params"><dt>Parameters</dt><dd> | |
712 | <table class="params"> | |
713 | <tr><td class="paramname">array</td><td>a pointer to the array </td></tr> | |
714 | <tr><td class="paramname">count</td><td>the number of elements that should additionally fit into the array </td></tr> | |
715 | </table> | |
716 | </dd> | |
717 | </dl> | |
718 | <dl class="section return"><dt>Returns</dt><dd>zero on success, non-zero if reallocation failed </dd></dl> | |
719 | ||
720 | </div> | |
721 | </div> | |
722 | <a id="ad921e85c28ffae32230777a53c5037e5"></a> | |
723 | <h2 class="memtitle"><span class="permalink"><a href="#ad921e85c28ffae32230777a53c5037e5">◆ </a></span>ucx_array_init()</h2> | |
724 | ||
725 | <div class="memitem"> | |
726 | <div class="memproto"> | |
727 | <table class="memname"> | |
728 | <tr> | |
729 | <td class="memname">void ucx_array_init </td> | |
730 | <td>(</td> | |
731 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
732 | <td class="paramname"><em>array</em>, </td> | |
733 | </tr> | |
734 | <tr> | |
735 | <td class="paramkey"></td> | |
736 | <td></td> | |
737 | <td class="paramtype">size_t </td> | |
738 | <td class="paramname"><em>capacity</em>, </td> | |
739 | </tr> | |
740 | <tr> | |
741 | <td class="paramkey"></td> | |
742 | <td></td> | |
743 | <td class="paramtype">size_t </td> | |
744 | <td class="paramname"><em>elemsize</em> </td> | |
745 | </tr> | |
746 | <tr> | |
747 | <td></td> | |
748 | <td>)</td> | |
749 | <td></td><td></td> | |
750 | </tr> | |
751 | </table> | |
752 | </div><div class="memdoc"> | |
753 | ||
754 | <p>Initializes a UCX array structure with the given capacity and element size. </p> | |
755 | <p>The structure must be uninitialized as the data pointer will be overwritten.</p> | |
756 | <dl class="params"><dt>Parameters</dt><dd> | |
757 | <table class="params"> | |
758 | <tr><td class="paramname">array</td><td>the structure to initialize </td></tr> | |
759 | <tr><td class="paramname">capacity</td><td>the initial capacity </td></tr> | |
760 | <tr><td class="paramname">elemsize</td><td>the element size </td></tr> | |
761 | </table> | |
762 | </dd> | |
763 | </dl> | |
764 | ||
765 | </div> | |
766 | </div> | |
767 | <a id="a2451e61ebb15a7ba1c1319267ba75b8c"></a> | |
768 | <h2 class="memtitle"><span class="permalink"><a href="#a2451e61ebb15a7ba1c1319267ba75b8c">◆ </a></span>ucx_array_init_a()</h2> | |
769 | ||
770 | <div class="memitem"> | |
771 | <div class="memproto"> | |
772 | <table class="memname"> | |
773 | <tr> | |
774 | <td class="memname">void ucx_array_init_a </td> | |
775 | <td>(</td> | |
776 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
777 | <td class="paramname"><em>array</em>, </td> | |
778 | </tr> | |
779 | <tr> | |
780 | <td class="paramkey"></td> | |
781 | <td></td> | |
782 | <td class="paramtype">size_t </td> | |
783 | <td class="paramname"><em>capacity</em>, </td> | |
784 | </tr> | |
785 | <tr> | |
786 | <td class="paramkey"></td> | |
787 | <td></td> | |
788 | <td class="paramtype">size_t </td> | |
789 | <td class="paramname"><em>elemsize</em>, </td> | |
790 | </tr> | |
791 | <tr> | |
792 | <td class="paramkey"></td> | |
793 | <td></td> | |
794 | <td class="paramtype"><a class="el" href="structUcxAllocator.html">UcxAllocator</a> * </td> | |
795 | <td class="paramname"><em>allocator</em> </td> | |
796 | </tr> | |
797 | <tr> | |
798 | <td></td> | |
799 | <td>)</td> | |
800 | <td></td><td></td> | |
801 | </tr> | |
802 | </table> | |
803 | </div><div class="memdoc"> | |
804 | ||
805 | <p>Initializes a UCX array structure using the specified allocator. </p> | |
806 | <p>The structure must be uninitialized as the data pointer will be overwritten.</p> | |
807 | <dl class="params"><dt>Parameters</dt><dd> | |
808 | <table class="params"> | |
809 | <tr><td class="paramname">array</td><td>the structure to initialize </td></tr> | |
810 | <tr><td class="paramname">capacity</td><td>the initial capacity </td></tr> | |
811 | <tr><td class="paramname">elemsize</td><td>the element size </td></tr> | |
812 | <tr><td class="paramname">allocator</td><td>the allocator to use </td></tr> | |
813 | </table> | |
814 | </dd> | |
815 | </dl> | |
816 | ||
817 | </div> | |
818 | </div> | |
819 | <a id="a994a2fbf1c33a3833e2a70cd9a4352b7"></a> | |
820 | <h2 class="memtitle"><span class="permalink"><a href="#a994a2fbf1c33a3833e2a70cd9a4352b7">◆ </a></span>ucx_array_new()</h2> | |
821 | ||
822 | <div class="memitem"> | |
823 | <div class="memproto"> | |
824 | <table class="memname"> | |
825 | <tr> | |
826 | <td class="memname"><a class="el" href="structUcxArray.html">UcxArray</a>* ucx_array_new </td> | |
827 | <td>(</td> | |
828 | <td class="paramtype">size_t </td> | |
829 | <td class="paramname"><em>capacity</em>, </td> | |
830 | </tr> | |
831 | <tr> | |
832 | <td class="paramkey"></td> | |
833 | <td></td> | |
834 | <td class="paramtype">size_t </td> | |
835 | <td class="paramname"><em>elemsize</em> </td> | |
836 | </tr> | |
837 | <tr> | |
838 | <td></td> | |
839 | <td>)</td> | |
840 | <td></td><td></td> | |
841 | </tr> | |
842 | </table> | |
843 | </div><div class="memdoc"> | |
844 | ||
845 | <p>Creates a new UCX array with the given capacity and element size. </p> | |
846 | <dl class="params"><dt>Parameters</dt><dd> | |
847 | <table class="params"> | |
848 | <tr><td class="paramname">capacity</td><td>the initial capacity </td></tr> | |
849 | <tr><td class="paramname">elemsize</td><td>the element size </td></tr> | |
850 | </table> | |
851 | </dd> | |
852 | </dl> | |
853 | <dl class="section return"><dt>Returns</dt><dd>a pointer to a new UCX array structure </dd></dl> | |
854 | ||
855 | </div> | |
856 | </div> | |
857 | <a id="a177170258c215eb2e4f5a32e59f0cb1b"></a> | |
858 | <h2 class="memtitle"><span class="permalink"><a href="#a177170258c215eb2e4f5a32e59f0cb1b">◆ </a></span>ucx_array_new_a()</h2> | |
859 | ||
860 | <div class="memitem"> | |
861 | <div class="memproto"> | |
862 | <table class="memname"> | |
863 | <tr> | |
864 | <td class="memname"><a class="el" href="structUcxArray.html">UcxArray</a>* ucx_array_new_a </td> | |
865 | <td>(</td> | |
866 | <td class="paramtype">size_t </td> | |
867 | <td class="paramname"><em>capacity</em>, </td> | |
868 | </tr> | |
869 | <tr> | |
870 | <td class="paramkey"></td> | |
871 | <td></td> | |
872 | <td class="paramtype">size_t </td> | |
873 | <td class="paramname"><em>elemsize</em>, </td> | |
874 | </tr> | |
875 | <tr> | |
876 | <td class="paramkey"></td> | |
877 | <td></td> | |
878 | <td class="paramtype"><a class="el" href="structUcxAllocator.html">UcxAllocator</a> * </td> | |
879 | <td class="paramname"><em>allocator</em> </td> | |
880 | </tr> | |
881 | <tr> | |
882 | <td></td> | |
883 | <td>)</td> | |
884 | <td></td><td></td> | |
885 | </tr> | |
886 | </table> | |
887 | </div><div class="memdoc"> | |
888 | ||
889 | <p>Creates a new UCX array using the specified allocator. </p> | |
890 | <dl class="params"><dt>Parameters</dt><dd> | |
891 | <table class="params"> | |
892 | <tr><td class="paramname">capacity</td><td>the initial capacity </td></tr> | |
893 | <tr><td class="paramname">elemsize</td><td>the element size </td></tr> | |
894 | <tr><td class="paramname">allocator</td><td>the allocator to use </td></tr> | |
895 | </table> | |
896 | </dd> | |
897 | </dl> | |
898 | <dl class="section return"><dt>Returns</dt><dd>a pointer to new UCX array structure </dd></dl> | |
899 | ||
900 | </div> | |
901 | </div> | |
902 | <a id="a95b52acc2193b5c33cf0eaa4f2082477"></a> | |
903 | <h2 class="memtitle"><span class="permalink"><a href="#a95b52acc2193b5c33cf0eaa4f2082477">◆ </a></span>ucx_array_prepend_from()</h2> | |
904 | ||
905 | <div class="memitem"> | |
906 | <div class="memproto"> | |
907 | <table class="memname"> | |
908 | <tr> | |
909 | <td class="memname">int ucx_array_prepend_from </td> | |
910 | <td>(</td> | |
911 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
912 | <td class="paramname"><em>array</em>, </td> | |
913 | </tr> | |
914 | <tr> | |
915 | <td class="paramkey"></td> | |
916 | <td></td> | |
917 | <td class="paramtype">void * </td> | |
918 | <td class="paramname"><em>data</em>, </td> | |
919 | </tr> | |
920 | <tr> | |
921 | <td class="paramkey"></td> | |
922 | <td></td> | |
923 | <td class="paramtype">size_t </td> | |
924 | <td class="paramname"><em>count</em> </td> | |
925 | </tr> | |
926 | <tr> | |
927 | <td></td> | |
928 | <td>)</td> | |
929 | <td></td><td></td> | |
930 | </tr> | |
931 | </table> | |
932 | </div><div class="memdoc"> | |
933 | ||
934 | <p>Inserts elements at the beginning of the array. </p> | |
935 | <p>This is an expensive operation, because the contents must be moved. If there is no particular reason to prepend data, you should use <a class="el" href="array_8h.html#aea01731ad94ea73c0c8fb1d1b7a35fcf" title="Inserts elements at the end of the array. ">ucx_array_append_from()</a> instead.</p> | |
936 | <dl class="params"><dt>Parameters</dt><dd> | |
937 | <table class="params"> | |
938 | <tr><td class="paramname">array</td><td>a pointer the array where to prepend the data </td></tr> | |
939 | <tr><td class="paramname">data</td><td>a pointer to the data to insert (may be <code>NULL</code>) </td></tr> | |
940 | <tr><td class="paramname">count</td><td>number of elements to copy from data (if data is <code>NULL</code>, zeroed elements are inserted) </td></tr> | |
941 | </table> | |
942 | </dd> | |
943 | </dl> | |
944 | <dl class="section return"><dt>Returns</dt><dd>zero on success, non-zero if a reallocation was necessary but failed </dd></dl> | |
945 | <dl class="section see"><dt>See also</dt><dd><a class="el" href="array_8h.html#aea01731ad94ea73c0c8fb1d1b7a35fcf" title="Inserts elements at the end of the array. ">ucx_array_append_from()</a> </dd> | |
946 | <dd> | |
947 | <a class="el" href="array_8h.html#a1bb545d065358d265d80d815ba382a28" title="Sets elements starting at the specified index. ">ucx_array_set_from()</a> </dd> | |
948 | <dd> | |
949 | ucx_array_prepend() </dd></dl> | |
950 | ||
951 | </div> | |
952 | </div> | |
953 | <a id="aa45eac6b697f83adac81c0860cf306b8"></a> | |
954 | <h2 class="memtitle"><span class="permalink"><a href="#aa45eac6b697f83adac81c0860cf306b8">◆ </a></span>ucx_array_remove()</h2> | |
955 | ||
956 | <div class="memitem"> | |
957 | <div class="memproto"> | |
958 | <table class="memname"> | |
959 | <tr> | |
960 | <td class="memname">void ucx_array_remove </td> | |
961 | <td>(</td> | |
962 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
963 | <td class="paramname"><em>array</em>, </td> | |
964 | </tr> | |
965 | <tr> | |
966 | <td class="paramkey"></td> | |
967 | <td></td> | |
968 | <td class="paramtype">size_t </td> | |
969 | <td class="paramname"><em>index</em> </td> | |
970 | </tr> | |
971 | <tr> | |
972 | <td></td> | |
973 | <td>)</td> | |
974 | <td></td><td></td> | |
975 | </tr> | |
976 | </table> | |
977 | </div><div class="memdoc"> | |
978 | ||
979 | <p>Removes an element from the array. </p> | |
980 | <p>This is in general an expensive operation, because several elements may be moved. If the order of the elements is not relevant, use <a class="el" href="array_8h.html#a548d81b07612bae3ba8c4c4b49104b8e" title="Removes an element from the array. ">ucx_array_remove_fast()</a> instead.</p> | |
981 | <dl class="params"><dt>Parameters</dt><dd> | |
982 | <table class="params"> | |
983 | <tr><td class="paramname">array</td><td>pointer to the array from which the element shall be removed </td></tr> | |
984 | <tr><td class="paramname">index</td><td>the index of the element to remove </td></tr> | |
985 | </table> | |
986 | </dd> | |
987 | </dl> | |
988 | ||
989 | </div> | |
990 | </div> | |
991 | <a id="a548d81b07612bae3ba8c4c4b49104b8e"></a> | |
992 | <h2 class="memtitle"><span class="permalink"><a href="#a548d81b07612bae3ba8c4c4b49104b8e">◆ </a></span>ucx_array_remove_fast()</h2> | |
993 | ||
994 | <div class="memitem"> | |
995 | <div class="memproto"> | |
996 | <table class="memname"> | |
997 | <tr> | |
998 | <td class="memname">void ucx_array_remove_fast </td> | |
999 | <td>(</td> | |
1000 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
1001 | <td class="paramname"><em>array</em>, </td> | |
1002 | </tr> | |
1003 | <tr> | |
1004 | <td class="paramkey"></td> | |
1005 | <td></td> | |
1006 | <td class="paramtype">size_t </td> | |
1007 | <td class="paramname"><em>index</em> </td> | |
1008 | </tr> | |
1009 | <tr> | |
1010 | <td></td> | |
1011 | <td>)</td> | |
1012 | <td></td><td></td> | |
1013 | </tr> | |
1014 | </table> | |
1015 | </div><div class="memdoc"> | |
1016 | ||
1017 | <p>Removes an element from the array. </p> | |
1018 | <p>This is an O(1) operation, but does not maintain the order of the elements. The last element in the array is moved to the location of the removed element.</p> | |
1019 | <dl class="params"><dt>Parameters</dt><dd> | |
1020 | <table class="params"> | |
1021 | <tr><td class="paramname">array</td><td>pointer to the array from which the element shall be removed </td></tr> | |
1022 | <tr><td class="paramname">index</td><td>the index of the element to remove </td></tr> | |
1023 | </table> | |
1024 | </dd> | |
1025 | </dl> | |
1026 | ||
1027 | </div> | |
1028 | </div> | |
1029 | <a id="a1c3bf8433c1de3c933f3854ab297fe1d"></a> | |
1030 | <h2 class="memtitle"><span class="permalink"><a href="#a1c3bf8433c1de3c933f3854ab297fe1d">◆ </a></span>ucx_array_reserve()</h2> | |
1031 | ||
1032 | <div class="memitem"> | |
1033 | <div class="memproto"> | |
1034 | <table class="memname"> | |
1035 | <tr> | |
1036 | <td class="memname">int ucx_array_reserve </td> | |
1037 | <td>(</td> | |
1038 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
1039 | <td class="paramname"><em>array</em>, </td> | |
1040 | </tr> | |
1041 | <tr> | |
1042 | <td class="paramkey"></td> | |
1043 | <td></td> | |
1044 | <td class="paramtype">size_t </td> | |
1045 | <td class="paramname"><em>capacity</em> </td> | |
1046 | </tr> | |
1047 | <tr> | |
1048 | <td></td> | |
1049 | <td>)</td> | |
1050 | <td></td><td></td> | |
1051 | </tr> | |
1052 | </table> | |
1053 | </div><div class="memdoc"> | |
1054 | ||
1055 | <p>Resizes the array only, if the capacity is insufficient. </p> | |
1056 | <p>If the requested capacity is smaller than the current capacity, this function does nothing.</p> | |
1057 | <dl class="params"><dt>Parameters</dt><dd> | |
1058 | <table class="params"> | |
1059 | <tr><td class="paramname">array</td><td>a pointer to the array </td></tr> | |
1060 | <tr><td class="paramname">capacity</td><td>the guaranteed capacity </td></tr> | |
1061 | </table> | |
1062 | </dd> | |
1063 | </dl> | |
1064 | <dl class="section return"><dt>Returns</dt><dd>zero on success, non-zero if reallocation failed </dd></dl> | |
1065 | ||
1066 | </div> | |
1067 | </div> | |
1068 | <a id="a27762e7c06a6c781015e3c8ceeee0ce3"></a> | |
1069 | <h2 class="memtitle"><span class="permalink"><a href="#a27762e7c06a6c781015e3c8ceeee0ce3">◆ </a></span>ucx_array_resize()</h2> | |
1070 | ||
1071 | <div class="memitem"> | |
1072 | <div class="memproto"> | |
1073 | <table class="memname"> | |
1074 | <tr> | |
1075 | <td class="memname">int ucx_array_resize </td> | |
1076 | <td>(</td> | |
1077 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
1078 | <td class="paramname"><em>array</em>, </td> | |
1079 | </tr> | |
1080 | <tr> | |
1081 | <td class="paramkey"></td> | |
1082 | <td></td> | |
1083 | <td class="paramtype">size_t </td> | |
1084 | <td class="paramname"><em>capacity</em> </td> | |
1085 | </tr> | |
1086 | <tr> | |
1087 | <td></td> | |
1088 | <td>)</td> | |
1089 | <td></td><td></td> | |
1090 | </tr> | |
1091 | </table> | |
1092 | </div><div class="memdoc"> | |
1093 | ||
1094 | <p>Sets the capacity of the array. </p> | |
1095 | <p>If the new capacity is smaller than the size of the array, the elements are removed and the size is adjusted accordingly.</p> | |
1096 | <dl class="params"><dt>Parameters</dt><dd> | |
1097 | <table class="params"> | |
1098 | <tr><td class="paramname">array</td><td>a pointer to the array </td></tr> | |
1099 | <tr><td class="paramname">capacity</td><td>the new capacity </td></tr> | |
1100 | </table> | |
1101 | </dd> | |
1102 | </dl> | |
1103 | <dl class="section return"><dt>Returns</dt><dd>zero on success, non-zero if reallocation failed </dd></dl> | |
1104 | ||
1105 | </div> | |
1106 | </div> | |
1107 | <a id="a1bb545d065358d265d80d815ba382a28"></a> | |
1108 | <h2 class="memtitle"><span class="permalink"><a href="#a1bb545d065358d265d80d815ba382a28">◆ </a></span>ucx_array_set_from()</h2> | |
1109 | ||
1110 | <div class="memitem"> | |
1111 | <div class="memproto"> | |
1112 | <table class="memname"> | |
1113 | <tr> | |
1114 | <td class="memname">int ucx_array_set_from </td> | |
1115 | <td>(</td> | |
1116 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
1117 | <td class="paramname"><em>array</em>, </td> | |
1118 | </tr> | |
1119 | <tr> | |
1120 | <td class="paramkey"></td> | |
1121 | <td></td> | |
1122 | <td class="paramtype">size_t </td> | |
1123 | <td class="paramname"><em>index</em>, </td> | |
1124 | </tr> | |
1125 | <tr> | |
1126 | <td class="paramkey"></td> | |
1127 | <td></td> | |
1128 | <td class="paramtype">void * </td> | |
1129 | <td class="paramname"><em>data</em>, </td> | |
1130 | </tr> | |
1131 | <tr> | |
1132 | <td class="paramkey"></td> | |
1133 | <td></td> | |
1134 | <td class="paramtype">size_t </td> | |
1135 | <td class="paramname"><em>count</em> </td> | |
1136 | </tr> | |
1137 | <tr> | |
1138 | <td></td> | |
1139 | <td>)</td> | |
1140 | <td></td><td></td> | |
1141 | </tr> | |
1142 | </table> | |
1143 | </div><div class="memdoc"> | |
1144 | ||
1145 | <p>Sets elements starting at the specified index. </p> | |
1146 | <p>If the any index is out of bounds, the array automatically grows. The pointer to the data may be NULL, in which case the elements are zeroed.</p> | |
1147 | <dl class="params"><dt>Parameters</dt><dd> | |
1148 | <table class="params"> | |
1149 | <tr><td class="paramname">array</td><td>a pointer the array where to set the data </td></tr> | |
1150 | <tr><td class="paramname">index</td><td>the index of the element to set </td></tr> | |
1151 | <tr><td class="paramname">data</td><td>a pointer to the data to insert (may be <code>NULL</code>) </td></tr> | |
1152 | <tr><td class="paramname">count</td><td>number of elements to copy from data (if data is <code>NULL</code>, the memory in the array is zeroed) </td></tr> | |
1153 | </table> | |
1154 | </dd> | |
1155 | </dl> | |
1156 | <dl class="section return"><dt>Returns</dt><dd>zero on success, non-zero if a reallocation was necessary but failed </dd></dl> | |
1157 | <dl class="section see"><dt>See also</dt><dd><a class="el" href="array_8h.html#aea01731ad94ea73c0c8fb1d1b7a35fcf" title="Inserts elements at the end of the array. ">ucx_array_append_from()</a> </dd> | |
1158 | <dd> | |
1159 | ucx_array_set() </dd></dl> | |
1160 | ||
1161 | </div> | |
1162 | </div> | |
1163 | <a id="a2daf50e80aee9bccebee876a7efd2dfc"></a> | |
1164 | <h2 class="memtitle"><span class="permalink"><a href="#a2daf50e80aee9bccebee876a7efd2dfc">◆ </a></span>ucx_array_shrink()</h2> | |
1165 | ||
1166 | <div class="memitem"> | |
1167 | <div class="memproto"> | |
1168 | <table class="memname"> | |
1169 | <tr> | |
1170 | <td class="memname">int ucx_array_shrink </td> | |
1171 | <td>(</td> | |
1172 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
1173 | <td class="paramname"><em>array</em></td><td>)</td> | |
1174 | <td></td> | |
1175 | </tr> | |
1176 | </table> | |
1177 | </div><div class="memdoc"> | |
1178 | ||
1179 | <p>Shrinks the memory to exactly fit the contents. </p> | |
1180 | <p>After this operation, the capacity equals the size.</p> | |
1181 | <dl class="params"><dt>Parameters</dt><dd> | |
1182 | <table class="params"> | |
1183 | <tr><td class="paramname">array</td><td>a pointer to the array </td></tr> | |
1184 | </table> | |
1185 | </dd> | |
1186 | </dl> | |
1187 | <dl class="section return"><dt>Returns</dt><dd>zero on success, non-zero if reallocation failed </dd></dl> | |
1188 | ||
1189 | </div> | |
1190 | </div> | |
1191 | <a id="add773514569b872a6624381b4b6af52c"></a> | |
1192 | <h2 class="memtitle"><span class="permalink"><a href="#add773514569b872a6624381b4b6af52c">◆ </a></span>ucx_array_sort()</h2> | |
1193 | ||
1194 | <div class="memitem"> | |
1195 | <div class="memproto"> | |
1196 | <table class="memname"> | |
1197 | <tr> | |
1198 | <td class="memname">void ucx_array_sort </td> | |
1199 | <td>(</td> | |
1200 | <td class="paramtype"><a class="el" href="structUcxArray.html">UcxArray</a> * </td> | |
1201 | <td class="paramname"><em>array</em>, </td> | |
1202 | </tr> | |
1203 | <tr> | |
1204 | <td class="paramkey"></td> | |
1205 | <td></td> | |
1206 | <td class="paramtype"><a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791">cmp_func</a> </td> | |
1207 | <td class="paramname"><em>cmpfnc</em>, </td> | |
1208 | </tr> | |
1209 | <tr> | |
1210 | <td class="paramkey"></td> | |
1211 | <td></td> | |
1212 | <td class="paramtype">void * </td> | |
1213 | <td class="paramname"><em>data</em> </td> | |
1214 | </tr> | |
1215 | <tr> | |
1216 | <td></td> | |
1217 | <td>)</td> | |
1218 | <td></td><td></td> | |
1219 | </tr> | |
1220 | </table> | |
1221 | </div><div class="memdoc"> | |
1222 | ||
1223 | <p>Sorts a <a class="el" href="structUcxArray.html" title="UCX array type. ">UcxArray</a> with the best available sort algorithm. </p> | |
1224 | <p>The qsort_r() function is used, if available (glibc, FreeBSD or MacOS). The order of arguments is automatically adjusted for the FreeBSD and MacOS version of qsort_r().</p> | |
1225 | <p>If qsort_r() is not available, a merge sort algorithm is used, which is guaranteed to use no more additional memory than for exactly one element.</p> | |
1226 | <dl class="params"><dt>Parameters</dt><dd> | |
1227 | <table class="params"> | |
1228 | <tr><td class="paramname">array</td><td>the array to sort </td></tr> | |
1229 | <tr><td class="paramname">cmpfnc</td><td>the function that shall be used to compare the element data </td></tr> | |
1230 | <tr><td class="paramname">data</td><td>additional data for the <a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791" title="Function pointer to a compare function. ">cmp_func()</a> or <code>NULL</code> </td></tr> | |
1231 | </table> | |
1232 | </dd> | |
1233 | </dl> | |
1234 | ||
1235 | </div> | |
1236 | </div> | |
1237 | <a id="ad0a8d76980cf1c1910e64a245803fb9a"></a> | |
1238 | <h2 class="memtitle"><span class="permalink"><a href="#ad0a8d76980cf1c1910e64a245803fb9a">◆ </a></span>ucx_array_util_set_a()</h2> | |
1239 | ||
1240 | <div class="memitem"> | |
1241 | <div class="memproto"> | |
1242 | <table class="memname"> | |
1243 | <tr> | |
1244 | <td class="memname">int ucx_array_util_set_a </td> | |
1245 | <td>(</td> | |
1246 | <td class="paramtype"><a class="el" href="structUcxAllocator.html">UcxAllocator</a> * </td> | |
1247 | <td class="paramname"><em>alloc</em>, </td> | |
1248 | </tr> | |
1249 | <tr> | |
1250 | <td class="paramkey"></td> | |
1251 | <td></td> | |
1252 | <td class="paramtype">void ** </td> | |
1253 | <td class="paramname"><em>array</em>, </td> | |
1254 | </tr> | |
1255 | <tr> | |
1256 | <td class="paramkey"></td> | |
1257 | <td></td> | |
1258 | <td class="paramtype">size_t * </td> | |
1259 | <td class="paramname"><em>capacity</em>, </td> | |
1260 | </tr> | |
1261 | <tr> | |
1262 | <td class="paramkey"></td> | |
1263 | <td></td> | |
1264 | <td class="paramtype">size_t </td> | |
1265 | <td class="paramname"><em>elmsize</em>, </td> | |
1266 | </tr> | |
1267 | <tr> | |
1268 | <td class="paramkey"></td> | |
1269 | <td></td> | |
1270 | <td class="paramtype">size_t </td> | |
1271 | <td class="paramname"><em>idx</em>, </td> | |
1272 | </tr> | |
1273 | <tr> | |
1274 | <td class="paramkey"></td> | |
1275 | <td></td> | |
1276 | <td class="paramtype">void * </td> | |
1277 | <td class="paramname"><em>data</em> </td> | |
1278 | </tr> | |
1279 | <tr> | |
1280 | <td></td> | |
1281 | <td>)</td> | |
1282 | <td></td><td></td> | |
1283 | </tr> | |
1284 | </table> | |
1285 | </div><div class="memdoc"> | |
1286 | ||
1287 | <p>Sets an element in an arbitrary user defined array. </p> | |
1288 | <p>The data is copied from the specified data location.</p> | |
1289 | <p>If the capacity is insufficient, the array is automatically reallocated using the specified allocator and the possibly new pointer is stored in the <code>array</code> argument.</p> | |
1290 | <p>On reallocation the capacity of the array is doubled until it is sufficient. The new capacity is stored back to <code>capacity</code>.</p> | |
1291 | <dl class="params"><dt>Parameters</dt><dd> | |
1292 | <table class="params"> | |
1293 | <tr><td class="paramname">alloc</td><td>the allocator that shall be used to reallocate the array </td></tr> | |
1294 | <tr><td class="paramname">array</td><td>a pointer to location of the array pointer </td></tr> | |
1295 | <tr><td class="paramname">capacity</td><td>a pointer to the capacity </td></tr> | |
1296 | <tr><td class="paramname">elmsize</td><td>the size of each element </td></tr> | |
1297 | <tr><td class="paramname">idx</td><td>the index of the element to set </td></tr> | |
1298 | <tr><td class="paramname">data</td><td>a pointer to the element data </td></tr> | |
1299 | </table> | |
1300 | </dd> | |
1301 | </dl> | |
1302 | <dl class="section return"><dt>Returns</dt><dd>zero on success or non-zero on error (errno will be set) </dd></dl> | |
1303 | ||
1304 | </div> | |
1305 | </div> | |
1306 | <a id="ad708b333c0c1b02c998309a58ea65e31"></a> | |
1307 | <h2 class="memtitle"><span class="permalink"><a href="#ad708b333c0c1b02c998309a58ea65e31">◆ </a></span>ucx_array_util_setptr_a()</h2> | |
1308 | ||
1309 | <div class="memitem"> | |
1310 | <div class="memproto"> | |
1311 | <table class="memname"> | |
1312 | <tr> | |
1313 | <td class="memname">int ucx_array_util_setptr_a </td> | |
1314 | <td>(</td> | |
1315 | <td class="paramtype"><a class="el" href="structUcxAllocator.html">UcxAllocator</a> * </td> | |
1316 | <td class="paramname"><em>alloc</em>, </td> | |
1317 | </tr> | |
1318 | <tr> | |
1319 | <td class="paramkey"></td> | |
1320 | <td></td> | |
1321 | <td class="paramtype">void ** </td> | |
1322 | <td class="paramname"><em>array</em>, </td> | |
1323 | </tr> | |
1324 | <tr> | |
1325 | <td class="paramkey"></td> | |
1326 | <td></td> | |
1327 | <td class="paramtype">size_t * </td> | |
1328 | <td class="paramname"><em>capacity</em>, </td> | |
1329 | </tr> | |
1330 | <tr> | |
1331 | <td class="paramkey"></td> | |
1332 | <td></td> | |
1333 | <td class="paramtype">size_t </td> | |
1334 | <td class="paramname"><em>idx</em>, </td> | |
1335 | </tr> | |
1336 | <tr> | |
1337 | <td class="paramkey"></td> | |
1338 | <td></td> | |
1339 | <td class="paramtype">void * </td> | |
1340 | <td class="paramname"><em>ptr</em> </td> | |
1341 | </tr> | |
1342 | <tr> | |
1343 | <td></td> | |
1344 | <td>)</td> | |
1345 | <td></td><td></td> | |
1346 | </tr> | |
1347 | </table> | |
1348 | </div><div class="memdoc"> | |
1349 | ||
1350 | <p>Stores a pointer in an arbitrary user defined array. </p> | |
1351 | <p>The element size of the array must be sizeof(void*).</p> | |
1352 | <p>If the capacity is insufficient, the array is automatically reallocated using the specified allocator and the possibly new pointer is stored in the <code>array</code> argument.</p> | |
1353 | <p>On reallocation the capacity of the array is doubled until it is sufficient. The new capacity is stored back to <code>capacity</code>.</p> | |
1354 | <dl class="params"><dt>Parameters</dt><dd> | |
1355 | <table class="params"> | |
1356 | <tr><td class="paramname">alloc</td><td>the allocator that shall be used to reallocate the array </td></tr> | |
1357 | <tr><td class="paramname">array</td><td>a pointer to location of the array pointer </td></tr> | |
1358 | <tr><td class="paramname">capacity</td><td>a pointer to the capacity </td></tr> | |
1359 | <tr><td class="paramname">idx</td><td>the index of the element to set </td></tr> | |
1360 | <tr><td class="paramname">ptr</td><td>the pointer to store </td></tr> | |
1361 | </table> | |
1362 | </dd> | |
1363 | </dl> | |
1364 | <dl class="section return"><dt>Returns</dt><dd>zero on success or non-zero on error (errno will be set) </dd></dl> | |
1365 | ||
1366 | </div> | |
1367 | </div> | |
1368 | </div><!-- contents --> | |
1369 | <!-- start footer part --> | |
1370 | <hr class="footer"/><address class="footer"><small> | |
1371 | Generated on Thu Dec 19 2019 19:58:24 for ucx by  <a href="http://www.doxygen.org/index.html"> | |
1372 | <img class="footer" src="doxygen.png" alt="doxygen"/> | |
1373 | </a> 1.8.13 | |
1374 | </small></address> | |
1375 | </body> | |
1376 | </html> |