📄 group__gdsl__list.html
字号:
</tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>GDSL doubly-linked list type. <p>This type is voluntary opaque. Variables of this kind could'nt be directly used, but by the functions of this module. <p>Definition at line <a class="el" href="gdsl__list_8h-source.html#l00051">51</a> of file <a class="el" href="gdsl__list_8h-source.html">gdsl_list.h</a>. </td> </tr></table><a class="anchor" name="g4a74cd75b7a6917479c5e3cfeb1eecf1"></a><!-- doxytag: member="gdsl_list.h::gdsl_list_cursor_t" ref="g4a74cd75b7a6917479c5e3cfeb1eecf1" args="" --><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">typedef struct _gdsl_list_cursor* <a class="el" href="group__gdsl__list.html#g4a74cd75b7a6917479c5e3cfeb1eecf1">gdsl_list_cursor_t</a> </td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>GDSL doubly-linked list cursor type. <p>This type is voluntary opaque. Variables of this kind could'nt be directly used, but by the functions of this module. <p>Definition at line <a class="el" href="gdsl__list_8h-source.html#l00059">59</a> of file <a class="el" href="gdsl__list_8h-source.html">gdsl_list.h</a>. </td> </tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="g7fe9720535ab73f5f6f8d22485a48fbb"></a><!-- doxytag: member="gdsl_list.h::gdsl_list_alloc" ref="g7fe9720535ab73f5f6f8d22485a48fbb" args="(const char *NAME, gdsl_alloc_func_t ALLOC_F, gdsl_free_func_t FREE_F)" --><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="group__gdsl__list.html#g6e449755578066b63cbe063a2daec25b">gdsl_list_t</a> gdsl_list_alloc </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>NAME</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="group__gdsl__types.html#g32a9b4e8b9665183c2741d28a5ced64f">gdsl_alloc_func_t</a> </td> <td class="mdname" nowrap> <em>ALLOC_F</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="group__gdsl__types.html#g2c6b3f96b291b5b39d2799f93e350053">gdsl_free_func_t</a> </td> <td class="mdname" nowrap> <em>FREE_F</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Create a new list. <p>Allocate a new list data structure which name is set to a copy of NAME. The function pointers ALLOC_F and FREE_F could be used to respectively, alloc and free elements in the list. These pointers could be set to NULL to use the default ones:<ul><li>the default ALLOC_F simply returns its argument</li><li>the default FREE_F does nothing</li></ul><p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>nothing </dd></dl><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>NAME</em> </td><td>The name of the new list to create </td></tr> <tr><td valign="top"></td><td valign="top"><em>ALLOC_F</em> </td><td>Function to alloc element when inserting it in the list </td></tr> <tr><td valign="top"></td><td valign="top"><em>FREE_F</em> </td><td>Function to free element when removing it from the list </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>the newly allocated list in case of success. <p>NULL in case of insufficient memory. </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__list.html#g9d220b3b117386ae70fe7fdb6e0cef5b">gdsl_list_free()</a> <p><a class="el" href="group__gdsl__list.html#g1e53326dafde19d04ce482136e92bac4">gdsl_list_flush()</a> </dd></dl> </td> </tr></table><a class="anchor" name="g9d220b3b117386ae70fe7fdb6e0cef5b"></a><!-- doxytag: member="gdsl_list.h::gdsl_list_free" ref="g9d220b3b117386ae70fe7fdb6e0cef5b" args="(gdsl_list_t L)" --><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 gdsl_list_free </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__gdsl__list.html#g6e449755578066b63cbe063a2daec25b">gdsl_list_t</a> </td> <td class="mdname1" valign="top" nowrap> <em>L</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Destroy a list. <p>Flush and destroy the list L. All the elements of L are freed using L's FREE_F function passed to <a class="el" href="group__gdsl__list.html#g7fe9720535ab73f5f6f8d22485a48fbb">gdsl_list_alloc()</a>.<p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( |L| ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>L must be a valid gdsl_list_t </dd></dl><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>L</em> </td><td>The list to destroy </td></tr> </table></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__list.html#g7fe9720535ab73f5f6f8d22485a48fbb">gdsl_list_alloc()</a> <p><a class="el" href="group__gdsl__list.html#g1e53326dafde19d04ce482136e92bac4">gdsl_list_flush()</a> </dd></dl> </td> </tr></table><a class="anchor" name="g1e53326dafde19d04ce482136e92bac4"></a><!-- doxytag: member="gdsl_list.h::gdsl_list_flush" ref="g1e53326dafde19d04ce482136e92bac4" args="(gdsl_list_t L)" --><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 gdsl_list_flush </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__gdsl__list.html#g6e449755578066b63cbe063a2daec25b">gdsl_list_t</a> </td> <td class="mdname1" valign="top" nowrap> <em>L</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Flush a list. <p>Destroy all the elements of the list L by calling L's FREE_F function passed to <a class="el" href="group__gdsl__list.html#g7fe9720535ab73f5f6f8d22485a48fbb">gdsl_list_alloc()</a>. L is not deallocated itself and L's name is not modified.<p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( |L| ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>L must be a valid gdsl_list_t </dd></dl><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -