Files
uip/doc/html/a00076.html
2013-03-27 21:30:25 +01:00

270 lines
12 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: Example applications</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>Example applications</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The uIP distribution contains a number of example applications that can be either used directory or studied when learning to develop applications for uIP.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00059.html">memb.c</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Memory block allocation routines. <br><br></td></tr>
<p>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00060.html">memb.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Memory block allocation routines. <br><br></td></tr>
<p>
<tr><td colspan=2><br><h2>Modules</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00095.html">Web client</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00096.html">SMTP E-mail sender</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00097.html">Telnet server</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00098.html">Web server</a></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a4">MEMB</a>(name, size, num)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Declare a memory block. </em> <a href="#a4"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a0">memb_init</a> (struct memb_blocks *m)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize a memory block that was declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a1">memb_alloc</a> (struct memb_blocks *m)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocate a memory block from a block of memory declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a2">memb_ref</a> (struct memb_blocks *m, char *ptr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Increase the reference count for a memory chunk. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a3">memb_free</a> (struct memb_blocks *m, char *ptr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deallocate a memory block from a memory block previously declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="#a3"></a><em><br><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a name="a4" doxytag="memb.h::MEMB"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define MEMB</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">name, <tr>
<td></td>
<td></td>
<td class="md" nowrap>size, <tr>
<td></td>
<td></td>
<td class="md" nowrap>num&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
<b>Value:</b><div class="fragment"><pre><span class="keyword">static</span> <span class="keywordtype">char</span> memb_mem[(size + 1) * num]; \
<span class="keyword">static</span> <span class="keyword">struct </span>memb_blocks name = {size, num, memb_mem}
</pre></div>Declare a memory block.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>name</em>&nbsp;</td><td>The name of the memory block (later used with <a class="el" href="a00076.html#a0">memb_init()</a>, <a class="el" href="a00076.html#a1">memb_alloc()</a> and <a class="el" href="a00076.html#a3">memb_free()</a>).</td></tr>
<tr><td valign=top><em>size</em>&nbsp;</td><td>The size of each memory chunk, in bytes.</td></tr>
<tr><td valign=top><em>num</em>&nbsp;</td><td>The total number of memory chunks in the block. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a1" doxytag="memb.h::memb_alloc"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> char* memb_alloc </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">struct memb_blocks *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>m</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Allocate a memory block from a block of memory declared with <a class="el" href="a00076.html#a4">MEMB()</a>.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>m</em>&nbsp;</td><td>A memory block previosly declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a3" doxytag="memb.h::memb_free"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> char memb_free </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">struct memb_blocks *&nbsp;</td>
<td class="mdname" nowrap> <em>m</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>char *&nbsp;</td>
<td class="mdname" nowrap> <em>ptr</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Deallocate a memory block from a memory block previously declared with <a class="el" href="a00076.html#a4">MEMB()</a>.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>m</em>&nbsp;</td><td>m A memory block previosly declared with <a class="el" href="a00076.html#a4">MEMB()</a>.</td></tr>
<tr><td valign=top><em>ptr</em>&nbsp;</td><td>A pointer to the memory block that is to be deallocated.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The new reference count for the memory block (should be 0 if successfully deallocated) or -1 if the pointer "ptr" did not point to a legal memory block. </dd></dl>
</td>
</tr>
</table>
<a name="a0" doxytag="memb.h::memb_init"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void memb_init </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">struct memb_blocks *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>m</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Initialize a memory block that was declared with <a class="el" href="a00076.html#a4">MEMB()</a>.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>m</em>&nbsp;</td><td>A memory block previosly declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a2" doxytag="memb.h::memb_ref"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> char memb_ref </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">struct memb_blocks *&nbsp;</td>
<td class="mdname" nowrap> <em>m</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>char *&nbsp;</td>
<td class="mdname" nowrap> <em>ptr</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Increase the reference count for a memory chunk.
<p>
<dl compact><dt><b>Note:</b></dt><dd>No sanity checks are currently made.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>m</em>&nbsp;</td><td>m A memory block previosly declared with <a class="el" href="a00076.html#a4">MEMB()</a>.</td></tr>
<tr><td valign=top><em>ptr</em>&nbsp;</td><td>A pointer to the memory chunk for which the reference count should be increased.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The new reference count. </dd></dl>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>