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

📄 glib-double-ended-queues.html

📁 glid编写实例
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<p>Reverses the order of the items in <em class="parameter"><code>queue</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></td><td> a <a href="glib-Double-ended-Queues.html#GQueue"><span class="type">GQueue</span></a></td></tr></tbody></table></div><p>Since  2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3125924"></a><h3><a name="g-queue-copy"></a>g_queue_copy ()</h3><a class="indexterm" name="id3125935"></a><pre class="programlisting"><a href="glib-Double-ended-Queues.html#GQueue">GQueue</a>*     g_queue_copy                    (<a href="glib-Double-ended-Queues.html#GQueue">GQueue</a> *queue);</pre><p>Copies a <em class="parameter"><code>queue</code></em>. Note that is a shallow copy. If the elements in thequeue consist of pointers to data, the pointers are copied, but theactual data is not.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></td><td> a <a href="glib-Double-ended-Queues.html#GQueue"><span class="type">GQueue</span></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td><td> A copy of <em class="parameter"><code>queue</code></em></td></tr></tbody></table></div><p>Since  2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3126021"></a><h3><a name="g-queue-foreach"></a>g_queue_foreach ()</h3><a class="indexterm" name="id3126031"></a><pre class="programlisting">void        g_queue_foreach                 (<a href="glib-Double-ended-Queues.html#GQueue">GQueue</a> *queue,                                             <a href="glib-Doubly-Linked-Lists.html#GFunc">GFunc</a> func,                                             <a href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>Calls <em class="parameter"><code>func</code></em> for each element in the queue passing <em class="parameter"><code>user_data</code></em> to thefunction.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></td><td> a <a href="glib-Double-ended-Queues.html#GQueue"><span class="type">GQueue</span></a></td></tr><tr><td><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></td><td> the function to call for each element's data</td></tr><tr><td><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></td><td> user data to pass to <em class="parameter"><code>func</code></em></td></tr></tbody></table></div><p>Since  2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3126155"></a><h3><a name="g-queue-find"></a>g_queue_find ()</h3><a class="indexterm" name="id3126165"></a><pre class="programlisting"><a href="glib-Doubly-Linked-Lists.html#GList">GList</a>*      g_queue_find                    (<a href="glib-Double-ended-Queues.html#GQueue">GQueue</a> *queue,                                             <a href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> data);</pre><p>Finds the first link in <em class="parameter"><code>queue</code></em> which contains <em class="parameter"><code>data</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></td><td> a <a href="glib-Double-ended-Queues.html#GQueue"><span class="type">GQueue</span></a></td></tr><tr><td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td><td> data to find</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td><td> The first link in <em class="parameter"><code>queue</code></em> which contains <em class="parameter"><code>data</code></em>.</td></tr></tbody></table></div><p>Since  2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3126283"></a><h3><a name="g-queue-find-custom"></a>g_queue_find_custom ()</h3><a class="indexterm" name="id3126294"></a><pre class="programlisting"><a href="glib-Doubly-Linked-Lists.html#GList">GList</a>*      g_queue_find_custom             (<a href="glib-Double-ended-Queues.html#GQueue">GQueue</a> *queue,                                             <a href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> data,                                             <a href="glib-Doubly-Linked-Lists.html#GCompareFunc">GCompareFunc</a> func);</pre><p>Finds an element in a <a href="glib-Double-ended-Queues.html#GQueue"><span class="type">GQueue</span></a>, using a supplied function to find thedesired element. It iterates over the queue, calling the given functionwhich should return 0 when the desired element is found. The functiontakes two gconstpointer arguments, the <a href="glib-Double-ended-Queues.html#GQueue"><span class="type">GQueue</span></a> element's data and thegiven user data.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></td><td> a <a href="glib-Double-ended-Queues.html#GQueue"><span class="type">GQueue</span></a></td></tr><tr><td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td><td> user data passed to <em class="parameter"><code>func</code></em></td></tr><tr><td><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></td><td> a <a href="glib-Doubly-Linked-Lists.html#GCompareFunc"><span class="type">GCompareFunc</span></a> to call for each element. It should return 0when the desired element is found</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td><td> The found link, or <code class="literal">NULL</code> if it wasn't found</td></tr></tbody></table></div><p>Since  2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3126452"></a><h3><a name="g-queue-sort"></a>g_queue_sort ()</h3><a class="indexterm" name="id3126462"></a><pre class="programlisting">void        g_queue_sort                    (<a href="glib-Double-ended-Queues.html#GQueue">GQueue</a> *queue,                                             <a href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> compare_func,                                             <a href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>Sorts <em class="parameter"><code>queue</code></em> using <em class="parameter"><code>compare_func</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></td><td> a <a href="glib-Double-ended-Queues.html#GQueue"><span class="type">GQueue</span></a></td></tr><tr><td><span class="term"><em class="parameter"><code>compare_func</code></em>&#160;:</span></td><td> the <a href="glib-Doubly-Linked-Lists.html#GCompareDataFunc"><span class="type">GCompareDataFunc</span></a> used to sort <em class="parameter"><code>queue</code></em>. This function    is passed two elements of the queue and should return 0 if they are    equal, a negative value if the first comes before the second, and    a positive value if the second comes before the first.</td></tr><tr><td><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></td><td> user data passed to <em class="parameter"><code>compare_func</code></em></td></tr></tbody></table></div><p>Since  2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3126603"></a><h3><a name="g-queue-push-head"></a>g_queue_push_head ()</h3><a class="indexterm" name="id3126615"></a><pre class="programlisting">void        g_queue_push_head               (<a href="glib-Double-ended-Queues.html#GQueue">GQueue</a> *queue,                                             <a href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre><p>Adds a new element at the head of the queue.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></td><td> a <a href="glib-Double-ended-Queues.html#GQueue"><span class="type">GQueue</span></a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td><td> the data for the new element.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3126694"></a><h3><a name="g-queue-push-tail"></a>g_queue_push_tail ()</h3><a class="indexterm" name="id3126705"></a><pre class="programlisting">void        g_queue_push_tail               (<a href="glib-Double-ended-Queues.html#GQueue">GQueue</a> *queue,                                             <a href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre><p>Adds a new element at the tail of the queue.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></td><td> a <a href="glib-Double-ended-Queues.html#GQueue"><span class="type">GQueue</span></a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td><td> the data for the new element.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3126784"></a><h3><a name="g-queue-push-nth"></a>g_queue_push_nth ()</h3><a class="indexterm" name="id3126795"></a><pre class="programlisting">void        g_queue_push_nth                (<a href="glib-Double-ended-Queues.html#GQueue">GQueue</a> *queue,                                             <a href="glib-Basic-Types.html#gpointer">gpointer</a> data,                                             <a href="glib-Basic-Types.html#gint">gint</a> n);</pre><p>Inserts a new element into <em class="parameter"><code>queue</code></em> at the given position</p><p></p><div class="variablelist"><table border="0">

⌨️ 快捷键说明

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