blob: 2d6fa7d7bf76395c9a40f137c0df36a2c34c7a63 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libguac: guacamole/pool.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libguac
&#160;<span id="projectnumber">1.1.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_6bb9fad85c98b48a11165f494b9f53ce.html">guacamole</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">pool.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Provides functions and structures for maintaining dynamically allocated and freed pools of integers.
<a href="#details">More...</a></p>
<p><a href="pool_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structguac__pool.html">guac_pool</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A pool of integers. <a href="structguac__pool.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structguac__pool__int.html">guac_pool_int</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a single integer within a larger pool of integers. <a href="structguac__pool__int.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a3e7589997fdd734a6d6155badebd042f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structguac__pool.html">guac_pool</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pool_8h.html#a3e7589997fdd734a6d6155badebd042f">guac_pool_alloc</a> (int size)</td></tr>
<tr class="memdesc:a3e7589997fdd734a6d6155badebd042f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates a new <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a> having the given minimum size. <a href="#a3e7589997fdd734a6d6155badebd042f">More...</a><br /></td></tr>
<tr class="separator:a3e7589997fdd734a6d6155badebd042f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7015e5939617ab7e55477ba0a4f85bdb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pool_8h.html#a7015e5939617ab7e55477ba0a4f85bdb">guac_pool_free</a> (<a class="el" href="structguac__pool.html">guac_pool</a> *pool)</td></tr>
<tr class="memdesc:a7015e5939617ab7e55477ba0a4f85bdb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees the given <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a>. <a href="#a7015e5939617ab7e55477ba0a4f85bdb">More...</a><br /></td></tr>
<tr class="separator:a7015e5939617ab7e55477ba0a4f85bdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe3c79e0fec121e3d1b1d3ce37aa45f4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pool_8h.html#abe3c79e0fec121e3d1b1d3ce37aa45f4">guac_pool_next_int</a> (<a class="el" href="structguac__pool.html">guac_pool</a> *pool)</td></tr>
<tr class="memdesc:abe3c79e0fec121e3d1b1d3ce37aa45f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the next available integer from the given <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a>. <a href="#abe3c79e0fec121e3d1b1d3ce37aa45f4">More...</a><br /></td></tr>
<tr class="separator:abe3c79e0fec121e3d1b1d3ce37aa45f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad90069a41689cf319f46af44bb113579"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pool_8h.html#ad90069a41689cf319f46af44bb113579">guac_pool_free_int</a> (<a class="el" href="structguac__pool.html">guac_pool</a> *pool, int value)</td></tr>
<tr class="memdesc:ad90069a41689cf319f46af44bb113579"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees the given integer back into the given <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a>. <a href="#ad90069a41689cf319f46af44bb113579">More...</a><br /></td></tr>
<tr class="separator:ad90069a41689cf319f46af44bb113579"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Provides functions and structures for maintaining dynamically allocated and freed pools of integers. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a3e7589997fdd734a6d6155badebd042f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e7589997fdd734a6d6155badebd042f">&#9670;&nbsp;</a></span>guac_pool_alloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structguac__pool.html">guac_pool</a>* guac_pool_alloc </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>size</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates a new <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a> having the given minimum size. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">size</td><td>The minimum number of integers which must have been returned by guac_pool_next_int before freed integers (previously used integers) are allowed to be returned. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A new, empty <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a>, having the given minimum size. </dd></dl>
</div>
</div>
<a id="a7015e5939617ab7e55477ba0a4f85bdb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7015e5939617ab7e55477ba0a4f85bdb">&#9670;&nbsp;</a></span>guac_pool_free()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void guac_pool_free </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__pool.html">guac_pool</a> *&#160;</td>
<td class="paramname"><em>pool</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Frees the given <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pool</td><td>The <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a> to free. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ad90069a41689cf319f46af44bb113579"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad90069a41689cf319f46af44bb113579">&#9670;&nbsp;</a></span>guac_pool_free_int()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void guac_pool_free_int </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__pool.html">guac_pool</a> *&#160;</td>
<td class="paramname"><em>pool</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Frees the given integer back into the given <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a>. </p>
<p>The integer given will be available for future calls to guac_pool_next_int. This operation is threadsafe.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pool</td><td>The <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a> to free the given integer into.</td></tr>
<tr><td class="paramname">value</td><td>The integer which should be returned to the given pool, such that it can be received by a future call to guac_pool_next_int. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="abe3c79e0fec121e3d1b1d3ce37aa45f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe3c79e0fec121e3d1b1d3ce37aa45f4">&#9670;&nbsp;</a></span>guac_pool_next_int()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int guac_pool_next_int </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structguac__pool.html">guac_pool</a> *&#160;</td>
<td class="paramname"><em>pool</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the next available integer from the given <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a>. </p>
<p>All integers returned are non-negative, and are returned in sequences, starting from 0. This operation is threadsafe.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pool</td><td>The <a class="el" href="structguac__pool.html" title="A pool of integers. ">guac_pool</a> to retrieve an integer from.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The next available integer, which may be either an integer not yet returned by a call to guac_pool_next_int, or an integer which was previously returned, but has since been freed. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>