a00010.html 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
  3. <title>The Protothreads Library 1.4: lc-switch.h File Reference</title>
  4. <link href="doxygen.css" rel="stylesheet" type="text/css">
  5. <link href="tabs.css" rel="stylesheet" type="text/css">
  6. </head><body>
  7. <!-- Generated by Doxygen 1.4.6 -->
  8. <div class="tabs">
  9. <ul>
  10. <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
  11. <li><a href="modules.html"><span>Modules</span></a></li>
  12. <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
  13. <li id="current"><a href="files.html"><span>Files</span></a></li>
  14. </ul></div>
  15. <div class="tabs">
  16. <ul>
  17. <li><a href="files.html"><span>File&nbsp;List</span></a></li>
  18. <li><a href="globals.html"><span>Globals</span></a></li>
  19. </ul></div>
  20. <h1>lc-switch.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
  21. Implementation of local continuations based on switch() statment.
  22. <p>
  23. <dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@sics.se">adam@sics.se</a>&gt;</dd></dl>
  24. This implementation of local continuations uses the C switch() statement to resume execution of a function somewhere inside the function's body. The implementation is based on the fact that switch() statements are able to jump directly into the bodies of control structures such as if() or while() statmenets.<p>
  25. This implementation borrows heavily from Simon Tatham's coroutines implementation in C: <a href="http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html">http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html</a>
  26. <p>
  27. Definition in file <a class="el" href="a00019.html">lc-switch.h</a>.
  28. <p>
  29. <p>
  30. <a href="a00019.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
  31. <tr><td></td></tr>
  32. <tr><td colspan="2"><br><h2>Defines</h2></td></tr>
  33. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2c1bb4fa6d7a6ff951a41c73fc721109"></a><!-- doxytag: member="lc-switch.h::LC_INIT" ref="g2c1bb4fa6d7a6ff951a41c73fc721109" args="(s)" -->
  34. #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#g2c1bb4fa6d7a6ff951a41c73fc721109">LC_INIT</a>(s)&nbsp;&nbsp;&nbsp;s = 0;</td></tr>
  35. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g1ec8b8f4710dce1fa7fb87d3a31541ae"></a><!-- doxytag: member="lc-switch.h::LC_RESUME" ref="g1ec8b8f4710dce1fa7fb87d3a31541ae" args="(s)" -->
  36. #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#g1ec8b8f4710dce1fa7fb87d3a31541ae">LC_RESUME</a>(s)&nbsp;&nbsp;&nbsp;switch(s) { case 0:</td></tr>
  37. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd8eec328a4868d767f0c00c8d1c6cfc1"></a><!-- doxytag: member="lc-switch.h::LC_SET" ref="gd8eec328a4868d767f0c00c8d1c6cfc1" args="(s)" -->
  38. #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#gd8eec328a4868d767f0c00c8d1c6cfc1">LC_SET</a>(s)&nbsp;&nbsp;&nbsp;s = __LINE__; case __LINE__:</td></tr>
  39. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gca51ceb2f5d855dfde55bcedf8d3b92d"></a><!-- doxytag: member="lc-switch.h::LC_END" ref="gca51ceb2f5d855dfde55bcedf8d3b92d" args="(s)" -->
  40. #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#gca51ceb2f5d855dfde55bcedf8d3b92d">LC_END</a>(s)&nbsp;&nbsp;&nbsp;}</td></tr>
  41. <tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
  42. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gfad6704adb116cc16edb80f744e7239d"></a><!-- doxytag: member="lc-switch.h::lc_t" ref="gfad6704adb116cc16edb80f744e7239d" args="" -->
  43. typedef unsigned short&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#gfad6704adb116cc16edb80f744e7239d">lc_t</a></td></tr>
  44. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The local continuation type. <br></td></tr>
  45. </table>
  46. <hr size="1"><address style="align: right;"><small>Generated on Mon Oct 2 10:06:29 2006 for The Protothreads Library 1.4 by&nbsp;
  47. <a href="http://www.doxygen.org/index.html">
  48. <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
  49. </body>
  50. </html>