⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 queue_8h.html

📁 常用的数据结构和算法函数库
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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>C Algorithms: queue.h File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.4 --><div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</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>queue.h File Reference</h1>Double-ended queue. <a href="#_details">More...</a><p><table border="0" cellpadding="0" cellspacing="0"><tr><td></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="a0"></a><!-- doxytag: member="queue.h::Queue" ref="a0" args="" -->typedef _Queue&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a0">Queue</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A double-ended queue. <br></td></tr><tr><td colspan="2"><br><h2>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="queue_8h.html#a0">Queue</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a1">queue_new</a> (void)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a new double-ended queue.  <a href="#a1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a2">queue_free</a> (<a class="el" href="queue_8h.html#a0">Queue</a> *queue)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroy a queue.  <a href="#a2"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a3">queue_push_head</a> (<a class="el" href="queue_8h.html#a0">Queue</a> *queue, void *data)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add data to the head of a queue.  <a href="#a3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a4">queue_pop_head</a> (<a class="el" href="queue_8h.html#a0">Queue</a> *queue)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove data from the head of a queue.  <a href="#a4"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a5">queue_peek_head</a> (<a class="el" href="queue_8h.html#a0">Queue</a> *queue)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read data from the head of queue, without removing it from the queue.  <a href="#a5"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a6">queue_push_tail</a> (<a class="el" href="queue_8h.html#a0">Queue</a> *queue, void *data)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add data to the tail of a queue.  <a href="#a6"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a7">queue_pop_tail</a> (<a class="el" href="queue_8h.html#a0">Queue</a> *queue)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove data from the tail of a queue.  <a href="#a7"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a8">queue_peek_tail</a> (<a class="el" href="queue_8h.html#a0">Queue</a> *queue)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read data from the tail of queue, without removing it from the queue.  <a href="#a8"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a9">queue_is_empty</a> (<a class="el" href="queue_8h.html#a0">Queue</a> *queue)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Query if any data is currently in a queue.  <a href="#a9"></a><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Double-ended queue. <p>A double ended queue stores a list of pointers in order. New data can be added and removed from either end of the queue.<p>To create a new queue, use <a class="el" href="queue_8h.html#a1">queue_new</a>. To destroy a queue, use <a class="el" href="queue_8h.html#a2">queue_free</a>.<p>To add data to a queue, use <a class="el" href="queue_8h.html#a3">queue_push_head</a> and <a class="el" href="queue_8h.html#a6">queue_push_tail</a>.<p>To read data from the ends of a queue, use <a class="el" href="queue_8h.html#a4">queue_pop_head</a> and <a class="el" href="queue_8h.html#a7">queue_pop_tail</a>. To examine the ends without removing data from the queue, use <a class="el" href="queue_8h.html#a5">queue_peek_head</a> and <a class="el" href="queue_8h.html#a8">queue_peek_tail</a>.<hr><h2>Function Documentation</h2><a class="anchor" name="a2"></a><!-- doxytag: member="queue.h::queue_free" ref="a2" args="(Queue *queue)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void queue_free           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="queue_8h.html#a0">Queue</a> *&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>queue</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>Destroy a queue. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>queue</em>&nbsp;</td><td>The queue to destroy.</td></tr>  </table></dl>    </td>  </tr></table><a class="anchor" name="a9"></a><!-- doxytag: member="queue.h::queue_is_empty" ref="a9" args="(Queue *queue)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">int queue_is_empty           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="queue_8h.html#a0">Queue</a> *&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>queue</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>Query if any data is currently in a queue. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>queue</em>&nbsp;</td><td>The queue. </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>Zero if the queue is not empty, non-zero if the queue is empty.</dd></dl>    </td>  </tr></table><a class="anchor" name="a1"></a><!-- doxytag: member="queue.h::queue_new" ref="a1" args="(void)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"><a class="el" href="queue_8h.html#a0">Queue</a>* queue_new           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </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>Create a new double-ended queue. <p><dl compact><dt><b>Returns:</b></dt><dd>A new queue.</dd></dl>    </td>  </tr></table><a class="anchor" name="a5"></a><!-- doxytag: member="queue.h::queue_peek_head" ref="a5" args="(Queue *queue)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void* queue_peek_head           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="queue_8h.html#a0">Queue</a> *&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>queue</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>Read data from the head of queue, without removing it from the queue. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>queue</em>&nbsp;</td><td>The queue. </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>Data at the head of the queue, or NULL if the queue is empty.</dd></dl>    </td>  </tr></table><a class="anchor" name="a8"></a><!-- doxytag: member="queue.h::queue_peek_tail" ref="a8" args="(Queue *queue)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void* queue_peek_tail           </td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -