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