📄 a00014.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>The Protothreads Library 1.0: Local continuations</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.6 --><div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>Local continuations<br><small>[<a class="el" href="a00012.html">Protothreads</a>]</small></h1><hr><a name="_details"></a><h2>Detailed Description</h2>Local continuations form the basis for implementing protothreads. 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 </td><td class="memItemRight" valign=bottom><a class="el" href="a00009.html">lc.h</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Local continuations. <br><br></td></tr><p><tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="a00008.html">lc-switch.h</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Implementation of local continuations based on switch() statment. <br><br></td></tr><p><tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="a00007.html">lc-addrlabels.h</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Implementation of local continuations based on the "Labels as values" feature of gcc. <br><br></td></tr><p><tr><td colspan=2><br><h2>Defines</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a00014.html#ga2">LC_INIT</a>(lc)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize a local continuation. <a href="#ga2"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a00014.html#ga3">LC_SET</a>(lc)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Set a local continuation. <a href="#ga3"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a00014.html#ga4">LC_RESUME</a>(lc)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Resume a local continuation. <a href="#ga4"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a00014.html#ga5">LC_END</a>(lc)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Mark the end of local continuation usage. <a href="#ga5"></a><br><br></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="ga0" doxytag="lc::lc_t" ></a>typedef unsigned short </td><td class="memItemRight" valign=bottom><a class="el" href="a00014.html#ga0">lc_t</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">The local continuation type. <br><br></td></tr></table><hr><h2>Define Documentation</h2><a class="anchor" name="ga5" doxytag="lc.h::LC_END" ></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 LC_END</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">lc </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Mark the end of local continuation usage. <p>The end operation signifies that local continuations should not be used any more in the function. This operation is not needed for most implementations of local continuation, but is required by a few implementations. </td> </tr></table><a class="anchor" name="ga2" doxytag="lc.h::LC_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"> #define LC_INIT</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">lc </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Initialize a local continuation. <p>This operation initializes the local continuation, thereby unsetting any previously set continuation state. </td> </tr></table><a class="anchor" name="ga4" doxytag="lc.h::LC_RESUME" ></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 LC_RESUME</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">lc </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Resume a local continuation. <p>The resume operation resumes a previously set local continuation, thus restoring the state in which the function was when the local continuation was set. If the local continuation has not been previously set, the resume operation does nothing. </td> </tr></table><a class="anchor" name="ga3" doxytag="lc.h::LC_SET" ></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 LC_SET</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">lc </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set a local continuation. <p>The set operation saves the state of the function at the point where the operation is executed. As far as the set operation is concerned, the state of the function does <b>not</b> include the call-stack or local (automatic) variables, but only the program counter and such CPU registers that needs to be saved. </td> </tr></table><hr size="1"><address style="align: right;"><small>Generated on Thu Feb 24 11:39:17 2005 for The Protothreads Library 1.0 by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.6 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -