1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.8.13"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>ucx: /home/mike/workspace/c/ucx/src/ucx/ucx.h File Reference</title>
9 <link href="tabs.css" rel="stylesheet" type="text/css"/>
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <link href="search/search.css" rel="stylesheet" type="text/css"/>
13 <script type="text/javascript" src="search/searchdata.js"></script>
14 <script type="text/javascript" src="search/search.js"></script>
15 <link href="doxygen.css" rel="stylesheet" type="text/css" />
16 </head>
17 <body>
18 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
19 <div id="titlearea">
20 <table cellspacing="0" cellpadding="0">
21 <tbody>
22 <tr style="height: 56px;">
23 <td id="projectlogo"><img alt="Logo" src="uaplogo.png"/></td>
24 <td id="projectalign" style="padding-left: 0.5em;">
25 <div id="projectname">ucx
26 </div>
27 <div id="projectbrief">UAP Common Extensions</div>
28 </td>
29 </tr>
30 </tbody>
31 </table>
32 </div>
33 <!-- end header part -->
34 <!-- Generated by Doxygen 1.8.13 -->
35 <script type="text/javascript">
36 var searchBox = new SearchBox("searchBox", "search",false,'Search');
37 </script>
38 <script type="text/javascript" src="menudata.js"></script>
39 <script type="text/javascript" src="menu.js"></script>
40 <script type="text/javascript">
41 $(function() {
42 initMenu('',true,false,'search.php','Search');
43 $(document).ready(function() { init_search(); });
44 });
45 </script>
46 <div id="main-nav"></div>
47 <!-- window showing the filter options -->
48 <div id="MSearchSelectWindow"
49 onmouseover="return searchBox.OnSearchSelectShow()"
50 onmouseout="return searchBox.OnSearchSelectHide()"
51 onkeydown="return searchBox.OnSearchSelectKey(event)">
52 </div>
53
54 <!-- iframe showing the search results (closed by default) -->
55 <div id="MSearchResultsWindow">
56 <iframe src="javascript:void(0)" frameborder="0"
57 name="MSearchResults" id="MSearchResults">
58 </iframe>
59 </div>
60
61 <div id="nav-path" class="navpath">
62 <ul>
63 <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_69f4ea29401808fe6229564976cde3ce.html">ucx</a></li> </ul>
64 </div>
65 </div><!-- top -->
66 <div class="header">
67 <div class="summary">
68 <a href="#define-members">Macros</a> |
69 <a href="#typedef-members">Typedefs</a> |
70 <a href="#func-members">Functions</a> </div>
71 <div class="headertitle">
72 <div class="title">ucx.h File Reference</div> </div>
73 </div><!--header-->
74 <div class="contents">
75
76 <p>Main UCX Header providing most common definitions.
77 <a href="#details">More...</a></p>
78 <div class="textblock"><code>#include <stdlib.h></code><br />
79 <code>#include <stdint.h></code><br />
80 <code>#include <sys/types.h></code><br />
81 </div>
82 <p><a href="ucx_8h_source.html">Go to the source code of this file.</a></p>
83 <table class="memberdecls">
84 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
85 Macros</h2></td></tr>
86 <tr class="memitem:aa57e5dd22d42387d748cc16777df1383"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#aa57e5dd22d42387d748cc16777df1383">UCX_VERSION_MAJOR</a>   2</td></tr>
87 <tr class="memdesc:aa57e5dd22d42387d748cc16777df1383"><td class="mdescLeft"> </td><td class="mdescRight">Major UCX version as integer constant. <a href="#aa57e5dd22d42387d748cc16777df1383">More...</a><br /></td></tr>
88 <tr class="separator:aa57e5dd22d42387d748cc16777df1383"><td class="memSeparator" colspan="2"> </td></tr>
89 <tr class="memitem:a9ac10d6353e23d4615a87fc737c65eb0"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#a9ac10d6353e23d4615a87fc737c65eb0">UCX_VERSION_MINOR</a>   1</td></tr>
90 <tr class="memdesc:a9ac10d6353e23d4615a87fc737c65eb0"><td class="mdescLeft"> </td><td class="mdescRight">Minor UCX version as integer constant. <a href="#a9ac10d6353e23d4615a87fc737c65eb0">More...</a><br /></td></tr>
91 <tr class="separator:a9ac10d6353e23d4615a87fc737c65eb0"><td class="memSeparator" colspan="2"> </td></tr>
92 <tr class="memitem:af12001920ca2fc1405615684e4dea284"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#af12001920ca2fc1405615684e4dea284">UCX_VERSION</a>   (((<a class="el" href="ucx_8h.html#aa57e5dd22d42387d748cc16777df1383">UCX_VERSION_MAJOR</a>)<<16)|<a class="el" href="ucx_8h.html#a9ac10d6353e23d4615a87fc737c65eb0">UCX_VERSION_MINOR</a>)</td></tr>
93 <tr class="memdesc:af12001920ca2fc1405615684e4dea284"><td class="mdescLeft"> </td><td class="mdescRight">Version constant which ensures to increase monotonically. <a href="#af12001920ca2fc1405615684e4dea284">More...</a><br /></td></tr>
94 <tr class="separator:af12001920ca2fc1405615684e4dea284"><td class="memSeparator" colspan="2"> </td></tr>
95 <tr class="memitem:a0b5ed6c1a0b15356f4f948acfd32a4cc"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#a0b5ed6c1a0b15356f4f948acfd32a4cc">ucx_szmul</a>(a, b, result)   <a class="el" href="ucx_8h.html#a6637171cc0ec097b297f731a3036dd3b">ucx_szmul_impl</a>(a, b, result)</td></tr>
96 <tr class="memdesc:a0b5ed6c1a0b15356f4f948acfd32a4cc"><td class="mdescLeft"> </td><td class="mdescRight">Performs a multiplication of size_t values and checks for overflow. <a href="#a0b5ed6c1a0b15356f4f948acfd32a4cc">More...</a><br /></td></tr>
97 <tr class="separator:a0b5ed6c1a0b15356f4f948acfd32a4cc"><td class="memSeparator" colspan="2"> </td></tr>
98 </table><table class="memberdecls">
99 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
100 Typedefs</h2></td></tr>
101 <tr class="memitem:ad2b370c2809914c8b7fedab163c266b3"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#ad2b370c2809914c8b7fedab163c266b3">ucx_destructor</a>) (void *)</td></tr>
102 <tr class="memdesc:ad2b370c2809914c8b7fedab163c266b3"><td class="mdescLeft"> </td><td class="mdescRight">A function pointer to a destructor function. <a href="#ad2b370c2809914c8b7fedab163c266b3">More...</a><br /></td></tr>
103 <tr class="separator:ad2b370c2809914c8b7fedab163c266b3"><td class="memSeparator" colspan="2"> </td></tr>
104 <tr class="memitem:afe5e2d5dbf34778e0e97852051570791"><td class="memItemLeft" align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#afe5e2d5dbf34778e0e97852051570791">cmp_func</a>) (const void *, const void *, void *)</td></tr>
105 <tr class="memdesc:afe5e2d5dbf34778e0e97852051570791"><td class="mdescLeft"> </td><td class="mdescRight">Function pointer to a compare function. <a href="#afe5e2d5dbf34778e0e97852051570791">More...</a><br /></td></tr>
106 <tr class="separator:afe5e2d5dbf34778e0e97852051570791"><td class="memSeparator" colspan="2"> </td></tr>
107 <tr class="memitem:a0bc5bf89e556c1d45d10863d52728ac9"><td class="memItemLeft" align="right" valign="top">typedef intmax_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#a0bc5bf89e556c1d45d10863d52728ac9">distance_func</a>) (const void *, const void *, void *)</td></tr>
108 <tr class="memdesc:a0bc5bf89e556c1d45d10863d52728ac9"><td class="mdescLeft"> </td><td class="mdescRight">Function pointer to a distance function. <a href="#a0bc5bf89e556c1d45d10863d52728ac9">More...</a><br /></td></tr>
109 <tr class="separator:a0bc5bf89e556c1d45d10863d52728ac9"><td class="memSeparator" colspan="2"> </td></tr>
110 <tr class="memitem:aab917a5fe0965673c73e8ebd0a1fc967"><td class="memItemLeft" align="right" valign="top">typedef void *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#aab917a5fe0965673c73e8ebd0a1fc967">copy_func</a>) (const void *, void *)</td></tr>
111 <tr class="memdesc:aab917a5fe0965673c73e8ebd0a1fc967"><td class="mdescLeft"> </td><td class="mdescRight">Function pointer to a copy function. <a href="#aab917a5fe0965673c73e8ebd0a1fc967">More...</a><br /></td></tr>
112 <tr class="separator:aab917a5fe0965673c73e8ebd0a1fc967"><td class="memSeparator" colspan="2"> </td></tr>
113 <tr class="memitem:a989b3f0fa4d307d278378fde435641ed"><td class="memItemLeft" align="right" valign="top">typedef size_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#a989b3f0fa4d307d278378fde435641ed">write_func</a>) (const void *, size_t, size_t, void *)</td></tr>
114 <tr class="memdesc:a989b3f0fa4d307d278378fde435641ed"><td class="mdescLeft"> </td><td class="mdescRight">Function pointer to a write function. <a href="#a989b3f0fa4d307d278378fde435641ed">More...</a><br /></td></tr>
115 <tr class="separator:a989b3f0fa4d307d278378fde435641ed"><td class="memSeparator" colspan="2"> </td></tr>
116 <tr class="memitem:a6a67e255e460acb58f802067b3ff5fd5"><td class="memItemLeft" align="right" valign="top">typedef size_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#a6a67e255e460acb58f802067b3ff5fd5">read_func</a>) (void *, size_t, size_t, void *)</td></tr>
117 <tr class="memdesc:a6a67e255e460acb58f802067b3ff5fd5"><td class="mdescLeft"> </td><td class="mdescRight">Function pointer to a read function. <a href="#a6a67e255e460acb58f802067b3ff5fd5">More...</a><br /></td></tr>
118 <tr class="separator:a6a67e255e460acb58f802067b3ff5fd5"><td class="memSeparator" colspan="2"> </td></tr>
119 </table><table class="memberdecls">
120 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
121 Functions</h2></td></tr>
122 <tr class="memitem:a6637171cc0ec097b297f731a3036dd3b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="ucx_8h.html#a6637171cc0ec097b297f731a3036dd3b">ucx_szmul_impl</a> (size_t a, size_t b, size_t *result)</td></tr>
123 <tr class="memdesc:a6637171cc0ec097b297f731a3036dd3b"><td class="mdescLeft"> </td><td class="mdescRight">Performs a multiplication of size_t values and checks for overflow. <a href="#a6637171cc0ec097b297f731a3036dd3b">More...</a><br /></td></tr>
124 <tr class="separator:a6637171cc0ec097b297f731a3036dd3b"><td class="memSeparator" colspan="2"> </td></tr>
125 </table>
126 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
127 <div class="textblock"><p>Main UCX Header providing most common definitions. </p>
128 <dl class="section author"><dt>Author</dt><dd>Mike Becker </dd>
129 <dd>
130 Olaf Wintermann </dd></dl>
131 </div><h2 class="groupheader">Macro Definition Documentation</h2>
132 <a id="a0b5ed6c1a0b15356f4f948acfd32a4cc"></a>
133 <h2 class="memtitle"><span class="permalink"><a href="#a0b5ed6c1a0b15356f4f948acfd32a4cc">◆ </a></span>ucx_szmul</h2>
134
135 <div class="memitem">
136 <div class="memproto">
137 <table class="memname">
138 <tr>
139 <td class="memname">#define ucx_szmul</td>
140 <td>(</td>
141 <td class="paramtype"> </td>
142 <td class="paramname">a, </td>
143 </tr>
144 <tr>
145 <td class="paramkey"></td>
146 <td></td>
147 <td class="paramtype"> </td>
148 <td class="paramname">b, </td>
149 </tr>
150 <tr>
151 <td class="paramkey"></td>
152 <td></td>
153 <td class="paramtype"> </td>
154 <td class="paramname">result </td>
155 </tr>
156 <tr>
157 <td></td>
158 <td>)</td>
159 <td></td><td>   <a class="el" href="ucx_8h.html#a6637171cc0ec097b297f731a3036dd3b">ucx_szmul_impl</a>(a, b, result)</td>
160 </tr>
161 </table>
162 </div><div class="memdoc">
163
164 <p>Performs a multiplication of size_t values and checks for overflow. </p>
165 <dl class="params"><dt>Parameters</dt><dd>
166 <table class="params">
167 <tr><td class="paramname">a</td><td>first operand </td></tr>
168 <tr><td class="paramname">b</td><td>second operand </td></tr>
169 <tr><td class="paramname">result</td><td>a pointer to a size_t, where the result should be stored </td></tr>
170 </table>
171 </dd>
172 </dl>
173 <dl class="section return"><dt>Returns</dt><dd>zero, if no overflow occurred and the result is correct, non-zero otherwise </dd></dl>
174
175 </div>
176 </div>
177 <a id="af12001920ca2fc1405615684e4dea284"></a>
178 <h2 class="memtitle"><span class="permalink"><a href="#af12001920ca2fc1405615684e4dea284">◆ </a></span>UCX_VERSION</h2>
179
180 <div class="memitem">
181 <div class="memproto">
182 <table class="memname">
183 <tr>
184 <td class="memname">#define UCX_VERSION   (((<a class="el" href="ucx_8h.html#aa57e5dd22d42387d748cc16777df1383">UCX_VERSION_MAJOR</a>)<<16)|<a class="el" href="ucx_8h.html#a9ac10d6353e23d4615a87fc737c65eb0">UCX_VERSION_MINOR</a>)</td>
185 </tr>
186 </table>
187 </div><div class="memdoc">
188
189 <p>Version constant which ensures to increase monotonically. </p>
190
191 </div>
192 </div>
193 <a id="aa57e5dd22d42387d748cc16777df1383"></a>
194 <h2 class="memtitle"><span class="permalink"><a href="#aa57e5dd22d42387d748cc16777df1383">◆ </a></span>UCX_VERSION_MAJOR</h2>
195
196 <div class="memitem">
197 <div class="memproto">
198 <table class="memname">
199 <tr>
200 <td class="memname">#define UCX_VERSION_MAJOR   2</td>
201 </tr>
202 </table>
203 </div><div class="memdoc">
204
205 <p>Major UCX version as integer constant. </p>
206
207 </div>
208 </div>
209 <a id="a9ac10d6353e23d4615a87fc737c65eb0"></a>
210 <h2 class="memtitle"><span class="permalink"><a href="#a9ac10d6353e23d4615a87fc737c65eb0">◆ </a></span>UCX_VERSION_MINOR</h2>
211
212 <div class="memitem">
213 <div class="memproto">
214 <table class="memname">
215 <tr>
216 <td class="memname">#define UCX_VERSION_MINOR   1</td>
217 </tr>
218 </table>
219 </div><div class="memdoc">
220
221 <p>Minor UCX version as integer constant. </p>
222
223 </div>
224 </div>
225 <h2 class="groupheader">Typedef Documentation</h2>
226 <a id="afe5e2d5dbf34778e0e97852051570791"></a>
227 <h2 class="memtitle"><span class="permalink"><a href="#afe5e2d5dbf34778e0e97852051570791">◆ </a></span>cmp_func</h2>
228
229 <div class="memitem">
230 <div class="memproto">
231 <table class="memname">
232 <tr>
233 <td class="memname">typedef int(* cmp_func) (const void *, const void *, void *)</td>
234 </tr>
235 </table>
236 </div><div class="memdoc">
237
238 <p>Function pointer to a compare function. </p>
239 <p>The compare function shall take three arguments: the two values that shall be compared and optional additional data. The function shall then return -1 if the first argument is less than the second argument, 1 if the first argument is greater than the second argument and 0 if both arguments are equal. If the third argument is <code>NULL</code>, it shall be ignored. </p>
240
241 </div>
242 </div>
243 <a id="aab917a5fe0965673c73e8ebd0a1fc967"></a>
244 <h2 class="memtitle"><span class="permalink"><a href="#aab917a5fe0965673c73e8ebd0a1fc967">◆ </a></span>copy_func</h2>
245
246 <div class="memitem">
247 <div class="memproto">
248 <table class="memname">
249 <tr>
250 <td class="memname">typedef void*(* copy_func) (const void *, void *)</td>
251 </tr>
252 </table>
253 </div><div class="memdoc">
254
255 <p>Function pointer to a copy function. </p>
256 <p>The copy function shall create a copy of the first argument and may use additional data provided by the second argument. If the second argument is <code>NULL</code>, it shall be ignored.</p>
257 <p><b>Attention:</b> if pointers returned by functions of this type may be passed to <code>free()</code> depends on the implementation of the respective <code>copy_func</code>. </p>
258
259 </div>
260 </div>
261 <a id="a0bc5bf89e556c1d45d10863d52728ac9"></a>
262 <h2 class="memtitle"><span class="permalink"><a href="#a0bc5bf89e556c1d45d10863d52728ac9">◆ </a></span>distance_func</h2>
263
264 <div class="memitem">
265 <div class="memproto">
266 <table class="memname">
267 <tr>
268 <td class="memname">typedef intmax_t(* distance_func) (const void *, const void *, void *)</td>
269 </tr>
270 </table>
271 </div><div class="memdoc">
272
273 <p>Function pointer to a distance function. </p>
274 <p>The distance function shall take three arguments: the two values for which the distance shall be computed and optional additional data. The function shall then return the signed distance as integer value. </p>
275
276 </div>
277 </div>
278 <a id="a6a67e255e460acb58f802067b3ff5fd5"></a>
279 <h2 class="memtitle"><span class="permalink"><a href="#a6a67e255e460acb58f802067b3ff5fd5">◆ </a></span>read_func</h2>
280
281 <div class="memitem">
282 <div class="memproto">
283 <table class="memname">
284 <tr>
285 <td class="memname">typedef size_t(* read_func) (void *, size_t, size_t, void *)</td>
286 </tr>
287 </table>
288 </div><div class="memdoc">
289
290 <p>Function pointer to a read function. </p>
291 <p>The signature of the read function shall be compatible to the signature of standard <code>fread</code>, though it may use arbitrary data types for source and destination.</p>
292 <p>The arguments shall contain (in ascending order): a pointer to the destination, the length of one element, the element count and a pointer to the source. </p>
293
294 </div>
295 </div>
296 <a id="ad2b370c2809914c8b7fedab163c266b3"></a>
297 <h2 class="memtitle"><span class="permalink"><a href="#ad2b370c2809914c8b7fedab163c266b3">◆ </a></span>ucx_destructor</h2>
298
299 <div class="memitem">
300 <div class="memproto">
301 <table class="memname">
302 <tr>
303 <td class="memname">typedef void(* ucx_destructor) (void *)</td>
304 </tr>
305 </table>
306 </div><div class="memdoc">
307
308 <p>A function pointer to a destructor function. </p>
309 <dl class="section see"><dt>See also</dt><dd>ucx_mempool_setdestr() </dd>
310 <dd>
311 ucx_mempool_regdestr() </dd></dl>
312
313 </div>
314 </div>
315 <a id="a989b3f0fa4d307d278378fde435641ed"></a>
316 <h2 class="memtitle"><span class="permalink"><a href="#a989b3f0fa4d307d278378fde435641ed">◆ </a></span>write_func</h2>
317
318 <div class="memitem">
319 <div class="memproto">
320 <table class="memname">
321 <tr>
322 <td class="memname">typedef size_t(* write_func) (const void *, size_t, size_t, void *)</td>
323 </tr>
324 </table>
325 </div><div class="memdoc">
326
327 <p>Function pointer to a write function. </p>
328 <p>The signature of the write function shall be compatible to the signature of standard <code>fwrite</code>, though it may use arbitrary data types for source and destination.</p>
329 <p>The arguments shall contain (in ascending order): a pointer to the source, the length of one element, the element count and a pointer to the destination. </p>
330
331 </div>
332 </div>
333 <h2 class="groupheader">Function Documentation</h2>
334 <a id="a6637171cc0ec097b297f731a3036dd3b"></a>
335 <h2 class="memtitle"><span class="permalink"><a href="#a6637171cc0ec097b297f731a3036dd3b">◆ </a></span>ucx_szmul_impl()</h2>
336
337 <div class="memitem">
338 <div class="memproto">
339 <table class="memname">
340 <tr>
341 <td class="memname">int ucx_szmul_impl </td>
342 <td>(</td>
343 <td class="paramtype">size_t </td>
344 <td class="paramname"><em>a</em>, </td>
345 </tr>
346 <tr>
347 <td class="paramkey"></td>
348 <td></td>
349 <td class="paramtype">size_t </td>
350 <td class="paramname"><em>b</em>, </td>
351 </tr>
352 <tr>
353 <td class="paramkey"></td>
354 <td></td>
355 <td class="paramtype">size_t * </td>
356 <td class="paramname"><em>result</em> </td>
357 </tr>
358 <tr>
359 <td></td>
360 <td>)</td>
361 <td></td><td></td>
362 </tr>
363 </table>
364 </div><div class="memdoc">
365
366 <p>Performs a multiplication of size_t values and checks for overflow. </p>
367 <p>This is a custom implementation in case there is no compiler builtin available.</p>
368 <dl class="params"><dt>Parameters</dt><dd>
369 <table class="params">
370 <tr><td class="paramname">a</td><td>first operand </td></tr>
371 <tr><td class="paramname">b</td><td>second operand </td></tr>
372 <tr><td class="paramname">result</td><td>a pointer to a size_t where the result should be stored </td></tr>
373 </table>
374 </dd>
375 </dl>
376 <dl class="section return"><dt>Returns</dt><dd>zero, if no overflow occurred and the result is correct, non-zero otherwise </dd></dl>
377
378 </div>
379 </div>
380 </div><!-- contents -->
381 <!-- start footer part -->
382 <hr class="footer"/><address class="footer"><small>
383 Generated on Thu Dec 19 2019 19:58:24 for ucx by  <a href="http://www.doxygen.org/index.html">
384 <img class="footer" src="doxygen.png" alt="doxygen"/>
385 </a> 1.8.13
386 </small></address>
387 </body>
388 </html>
389