rt-thread/components/net/uip/doc/html/a00155.html

83 lines
6.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 1.0: Local continuations</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul></div>
<h1>Local continuations<br>
<small>
[<a class="el" href="a00142.html">Protothreads</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Local continuations form the basis for implementing protothreads.
<p>
A local continuation can be <em>set</em> in a specific function to capture the state of the function. After a local continuation has been set can be <em>resumed</em> in order to restore the state of the function at the point where the local continuation was set.
<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="a00125.html">lc.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Local continuations. <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="a00124.html">lc-switch.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Implementation of local continuations based on switch() statment. <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="a00123.html">lc-addrlabels.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Implementation of local continuations based on the "Labels as values" feature of gcc. <br></td></tr>
<p>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g44311ecc30759ca38b4069182247bdae"></a><!-- doxytag: member="lc::__LC_SWTICH_H__" ref="g44311ecc30759ca38b4069182247bdae" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#g44311ecc30759ca38b4069182247bdae">__LC_SWTICH_H__</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2c1bb4fa6d7a6ff951a41c73fc721109"></a><!-- doxytag: member="lc::LC_INIT" ref="g2c1bb4fa6d7a6ff951a41c73fc721109" args="(s)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#g2c1bb4fa6d7a6ff951a41c73fc721109">LC_INIT</a>(s)&nbsp;&nbsp;&nbsp;s = 0;</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g1ec8b8f4710dce1fa7fb87d3a31541ae"></a><!-- doxytag: member="lc::LC_RESUME" ref="g1ec8b8f4710dce1fa7fb87d3a31541ae" args="(s)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#g1ec8b8f4710dce1fa7fb87d3a31541ae">LC_RESUME</a>(s)&nbsp;&nbsp;&nbsp;switch(s) { case 0:</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd8eec328a4868d767f0c00c8d1c6cfc1"></a><!-- doxytag: member="lc::LC_SET" ref="gd8eec328a4868d767f0c00c8d1c6cfc1" args="(s)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#gd8eec328a4868d767f0c00c8d1c6cfc1">LC_SET</a>(s)&nbsp;&nbsp;&nbsp;s = __LINE__; case __LINE__:</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gca51ceb2f5d855dfde55bcedf8d3b92d"></a><!-- doxytag: member="lc::LC_END" ref="gca51ceb2f5d855dfde55bcedf8d3b92d" args="(s)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#gca51ceb2f5d855dfde55bcedf8d3b92d">LC_END</a>(s)&nbsp;&nbsp;&nbsp;}</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2c1bb4fa6d7a6ff951a41c73fc721109"></a><!-- doxytag: member="lc::LC_INIT" ref="g2c1bb4fa6d7a6ff951a41c73fc721109" args="(s)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#g2c1bb4fa6d7a6ff951a41c73fc721109">LC_INIT</a>(s)&nbsp;&nbsp;&nbsp;s = NULL</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g1ec8b8f4710dce1fa7fb87d3a31541ae"></a><!-- doxytag: member="lc::LC_RESUME" ref="g1ec8b8f4710dce1fa7fb87d3a31541ae" args="(s)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#g1ec8b8f4710dce1fa7fb87d3a31541ae">LC_RESUME</a>(s)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd8eec328a4868d767f0c00c8d1c6cfc1"></a><!-- doxytag: member="lc::LC_SET" ref="gd8eec328a4868d767f0c00c8d1c6cfc1" args="(s)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#gd8eec328a4868d767f0c00c8d1c6cfc1">LC_SET</a>(s)&nbsp;&nbsp;&nbsp;do { ({ __label__ resume; resume: (s) = &amp;&amp;resume; }); }while(0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gca51ceb2f5d855dfde55bcedf8d3b92d"></a><!-- doxytag: member="lc::LC_END" ref="gca51ceb2f5d855dfde55bcedf8d3b92d" args="(s)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#gca51ceb2f5d855dfde55bcedf8d3b92d">LC_END</a>(s)</td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g3983e0c026396d5c4506779d770007ba"></a><!-- doxytag: member="lc::lc_t" ref="g3983e0c026396d5c4506779d770007ba" args="" -->
typedef unsigned short&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#g3983e0c026396d5c4506779d770007ba">lc_t</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2bdc4b7b4038454a79f1b2a94a6d2a98"></a><!-- doxytag: member="lc::lc_t" ref="g2bdc4b7b4038454a79f1b2a94a6d2a98" args="" -->
typedef void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00155.html#g2bdc4b7b4038454a79f1b2a94a6d2a98">lc_t</a></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
</body>
</html>