You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

402 lines
18 KiB

<!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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EmbeddedEtcher: os/heap.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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</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">EmbeddedEtcher
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('heap_8h.html','');});
</script>
<div id="doc-content">
<!-- 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 class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">heap.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Heap implementation for the tasks of the operating system.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="ostypes_8h_source.html">ostypes.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for heap.h:</div>
<div class="dyncontent">
<div class="center"><img src="heap_8h__incl.png" border="0" usemap="#os_2heap_8h" alt=""/></div>
<map name="os_2heap_8h" id="os_2heap_8h">
<area shape="rect" id="node2" href="ostypes_8h.html" title="Different types the operating system uses are defined here. " alt="" coords="51,80,129,107"/>
<area shape="rect" id="node4" href="ossettings_8h.html" title="File where all settings take place. " alt="" coords="95,155,189,181"/>
</map>
</div>
</div>
<p><a href="heap_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="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae4c24d26f4411ab5492a2cc8dd5a4e7c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="heap_8h.html#ae4c24d26f4411ab5492a2cc8dd5a4e7c">osHeapInit</a> (<a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *ioarray)</td></tr>
<tr class="separator:ae4c24d26f4411ab5492a2cc8dd5a4e7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a51c0aca53767d5038681cc649d5fa8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="heap_8h.html#a5a51c0aca53767d5038681cc649d5fa8">osHeapHeapify</a> (<a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *ioarray, uint8_t iind)</td></tr>
<tr class="separator:a5a51c0aca53767d5038681cc649d5fa8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba6f21f0421450da6531c7ea9f6976b5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="heap_8h.html#aba6f21f0421450da6531c7ea9f6976b5">osHeapBuild</a> (<a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *ioarray)</td></tr>
<tr class="separator:aba6f21f0421450da6531c7ea9f6976b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a73414cf2e4e1d2cebb4597a36bc018"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="heap_8h.html#a2a73414cf2e4e1d2cebb4597a36bc018">osHeapMaximum</a> (<a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *ioarray, <a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *iomax)</td></tr>
<tr class="separator:a2a73414cf2e4e1d2cebb4597a36bc018"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31002fadb05f80382c9714462dfb092e"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="heap_8h.html#a31002fadb05f80382c9714462dfb092e">osHeapExtractMaximum</a> (<a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *ioarray, <a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *iomax)</td></tr>
<tr class="separator:a31002fadb05f80382c9714462dfb092e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5c1d9c908e7d618bd5869f6e0ed16c5"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="heap_8h.html#ab5c1d9c908e7d618bd5869f6e0ed16c5">osHeapInsert</a> (<a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *ioarray, <a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> x)</td></tr>
<tr class="separator:ab5c1d9c908e7d618bd5869f6e0ed16c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfcd76f5650f218825578b0bd1652587"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="heap_8h.html#abfcd76f5650f218825578b0bd1652587">osHeapPrintS</a> (<a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *ioarray)</td></tr>
<tr class="separator:abfcd76f5650f218825578b0bd1652587"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a999a4beae27d4c7085278724feeabbc1"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="heap_8h.html#a999a4beae27d4c7085278724feeabbc1">osHeapIsEmpty</a> (<a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *ioarray)</td></tr>
<tr class="separator:a999a4beae27d4c7085278724feeabbc1"><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>Heap implementation for the tasks of the operating system. </p>
<dl class="section author"><dt>Author</dt><dd>Maximilian Stiefel </dd></dl>
<dl class="section date"><dt>Date</dt><dd>8 Jan 2018 </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="aba6f21f0421450da6531c7ea9f6976b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba6f21f0421450da6531c7ea9f6976b5">&#9670;&nbsp;</a></span>osHeapBuild()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void osHeapBuild </td>
<td>(</td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *&#160;</td>
<td class="paramname"><em>ioarray</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Build the heap from the bottom up. Given an array which is not heapified at all.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ioarray</td><td>Array where the heap is stored. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a31002fadb05f80382c9714462dfb092e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a31002fadb05f80382c9714462dfb092e">&#9670;&nbsp;</a></span>osHeapExtractMaximum()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t osHeapExtractMaximum </td>
<td>(</td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *&#160;</td>
<td class="paramname"><em>ioarray</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *&#160;</td>
<td class="paramname"><em>iomax</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy heap maximum and remove it (extract).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ioarray</td><td>Array where the heap is stored. </td></tr>
<tr><td class="paramname">iomax</td><td>Node, which is the maximum. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">1</td><td>(SUCCESS) or 0 (heap is empty). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a5a51c0aca53767d5038681cc649d5fa8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a51c0aca53767d5038681cc649d5fa8">&#9670;&nbsp;</a></span>osHeapHeapify()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void osHeapHeapify </td>
<td>(</td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *&#160;</td>
<td class="paramname"><em>ioarray</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>iind</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Classic heapify operation.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ioarray</td><td>Array where the heap is stored. </td></tr>
<tr><td class="paramname">iind</td><td>Element to be put in the right place. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ae4c24d26f4411ab5492a2cc8dd5a4e7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4c24d26f4411ab5492a2cc8dd5a4e7c">&#9670;&nbsp;</a></span>osHeapInit()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void osHeapInit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *&#160;</td>
<td class="paramname"><em>ioarray</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes all heap elements by setting them to NULL.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Array</td><td>where the heap is stored. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ab5c1d9c908e7d618bd5869f6e0ed16c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5c1d9c908e7d618bd5869f6e0ed16c5">&#9670;&nbsp;</a></span>osHeapInsert()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t osHeapInsert </td>
<td>(</td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *&#160;</td>
<td class="paramname"><em>ioarray</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a>&#160;</td>
<td class="paramname"><em>x</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Insert a node into the heap.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ioarray</td><td>Array where the heap is stored. </td></tr>
<tr><td class="paramname">x</td><td>Node to be inserted into the heap. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">1</td><td>(SUCCESS) or 0 (heap is full). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a999a4beae27d4c7085278724feeabbc1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a999a4beae27d4c7085278724feeabbc1">&#9670;&nbsp;</a></span>osHeapIsEmpty()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t osHeapIsEmpty </td>
<td>(</td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *&#160;</td>
<td class="paramname"><em>ioarray</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Is the heap empty?</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ioarray</td><td>Array where the heap is stored. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a2a73414cf2e4e1d2cebb4597a36bc018"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a73414cf2e4e1d2cebb4597a36bc018">&#9670;&nbsp;</a></span>osHeapMaximum()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t osHeapMaximum </td>
<td>(</td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *&#160;</td>
<td class="paramname"><em>ioarray</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *&#160;</td>
<td class="paramname"><em>iomax</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy heap maximum.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ioarray</td><td>Array where the heap is stored. </td></tr>
<tr><td class="paramname">iomax</td><td>Node, which is the maximum. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">1</td><td>(SUCCESS) or 0 (heap is empty). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="abfcd76f5650f218825578b0bd1652587"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abfcd76f5650f218825578b0bd1652587">&#9670;&nbsp;</a></span>osHeapPrintS()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void osHeapPrintS </td>
<td>(</td>
<td class="paramtype"><a class="el" href="ostypes_8h.html#a7b59ec4a57312624d7d832ba4a8e04be">osHeapNode_t</a> *&#160;</td>
<td class="paramname"><em>ioarray</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Print heap all priorities for debugging purposes.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ioarray</td><td>Array where the heap is stored. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_8b7cb6c889a10e2a101a7e90c854ca4d.html">os</a></li><li class="navelem"><a class="el" href="heap_8h.html">heap.h</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>