lstlib.html

来自「vxworks相关论文」· HTML 代码 · 共 486 行 · 第 1/2 页

HTML
486
字号
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/lstLib.html - generated by refgen from lstLib.c --> <title> lstLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>lstLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>lstLib</strong> - doubly linked list subroutine library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./lstLib.html#lstInit">lstInit</a></i>(&nbsp;)</b>  -  initialize a list descriptor<br><b><i><a href="./lstLib.html#lstAdd">lstAdd</a></i>(&nbsp;)</b>  -  add a node to the end of a list<br><b><i><a href="./lstLib.html#lstConcat">lstConcat</a></i>(&nbsp;)</b>  -  concatenate two lists<br><b><i><a href="./lstLib.html#lstCount">lstCount</a></i>(&nbsp;)</b>  -  report the number of nodes in a list<br><b><i><a href="./lstLib.html#lstDelete">lstDelete</a></i>(&nbsp;)</b>  -  delete a specified node from a list<br><b><i><a href="./lstLib.html#lstExtract">lstExtract</a></i>(&nbsp;)</b>  -  extract a sublist from a list<br><b><i><a href="./lstLib.html#lstFirst">lstFirst</a></i>(&nbsp;)</b>  -  find first node in list<br><b><i><a href="./lstLib.html#lstGet">lstGet</a></i>(&nbsp;)</b>  -  delete and return the first node from a list<br><b><i><a href="./lstLib.html#lstInsert">lstInsert</a></i>(&nbsp;)</b>  -  insert a node in a list after a specified node<br><b><i><a href="./lstLib.html#lstLast">lstLast</a></i>(&nbsp;)</b>  -  find the last node in a list<br><b><i><a href="./lstLib.html#lstNext">lstNext</a></i>(&nbsp;)</b>  -  find the next node in a list<br><b><i><a href="./lstLib.html#lstNth">lstNth</a></i>(&nbsp;)</b>  -  find the Nth node in a list<br><b><i><a href="./lstLib.html#lstPrevious">lstPrevious</a></i>(&nbsp;)</b>  -  find the previous node in a list<br><b><i><a href="./lstLib.html#lstNStep">lstNStep</a></i>(&nbsp;)</b>  -  find a list node <i>nStep</i> steps away from a specified node<br><b><i><a href="./lstLib.html#lstFind">lstFind</a></i>(&nbsp;)</b>  -  find a node in a list<br><b><i><a href="./lstLib.html#lstFree">lstFree</a></i>(&nbsp;)</b>  -  free up a list<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This subroutine library supports the creation and maintenance of adoubly linked list.  The user supplies a list descriptor (type LIST)that will contain pointers to the first and last nodes in the list,and a count of the number of nodes in the list.  The nodes in thelist can be any user-defined structure, but they must reserve spacefor two pointers as their first elements.  Both the forward andbackward chains are terminated with a NULL pointer.<p>The linked-list library simply manipulates the linked-list data structures;no kernel functions are invoked.  In particular, linked lists by themselvesprovide no task synchronization or mutual exclusion.  If multiple tasks willaccess a single linked list, that list must be guarded with somemutual-exclusion mechanism (e.g., a mutual-exclusion semaphore).<p></blockquote><h4>NON-EMPTY LIST</h4><blockquote><p><p><pre>   ---------             --------          --------   | head---------------&gt;| next-----------&gt;| next---------   |       |             |      |          |      |      |   |       |       ------- prev |&lt;---------- prev |      |   |       |       |     |      |          |      |      |   | tail------    |     | ...  |    -----&gt;| ...  |      |   |       |  |    v                 |                   v   |count=2|  |  -----               |                 -----   ---------  |   ---                |                  ---              |    -                 |                   -              |                      |              ------------------------</pre></blockquote><h4>EMPTY LIST</h4><blockquote><p><p><pre>        -----------        |  head------------------        |         |             |        |  tail----------       |        |         |     |       v        | count=0 |   -----   -----        -----------    ---     ---                        -       -</pre></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>lstLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./lstLib.html#top">lstLib</a></b><hr><a name="lstInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>lstInit</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>lstInit</i>(&nbsp;)</strong> - initialize a list descriptor</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void lstInit    (    LIST * pList /* ptr to list descriptor to be initialized */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes a specified list to an empty list.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./lstLib.html#top">lstLib</a></b><hr><a name="lstAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>lstAdd</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>lstAdd</i>(&nbsp;)</strong> - add a node to the end of a list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void lstAdd    (    LIST * pList, /* pointer to list descriptor */    NODE * pNode  /* pointer to node to be added */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a specified node to the end of a specified list.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./lstLib.html#top">lstLib</a></b><hr><a name="lstConcat"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>lstConcat</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>lstConcat</i>(&nbsp;)</strong> - concatenate two lists</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void lstConcat    (    LIST * pDstList, /* destination list */    LIST * pAddList  /* list to be added to dstList */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine concatenates the second list to the end of the first list.The second list is left empty.  Either list (or both) can beempty at the beginning of the operation.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./lstLib.html#top">lstLib</a></b><hr><a name="lstCount"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>lstCount</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>lstCount</i>(&nbsp;)</strong> - report the number of nodes in a list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int lstCount    (    LIST * pList /* pointer to list descriptor */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the number of nodes in a specified list.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of nodes in the list.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./lstLib.html#top">lstLib</a></b><hr><a name="lstDelete"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>lstDelete</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>lstDelete</i>(&nbsp;)</strong> - delete a specified node from a list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void lstDelete    (    LIST * pList, /* pointer to list descriptor */    NODE * pNode  /* pointer to node to be deleted */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a specified node from a specified list.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./lstLib.html#top">lstLib</a></b><hr><a name="lstExtract"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>lstExtract</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>lstExtract</i>(&nbsp;)</strong> - extract a sublist from a list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void lstExtract    (    LIST * pSrcList,   /* pointer to source list */    NODE * pStartNode, /* first node in sublist to be extracted */    NODE * pEndNode,   /* last node in sublist to be extracted */    LIST * pDstList    /* ptr to list where to put extracted list */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine extracts the sublist that starts with <i>pStartNode</i> and endswith <i>pEndNode</i> from a source list.  It places the extracted list in<i>pDstList</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./lstLib.html#top">lstLib</a></b><hr><a name="lstFirst"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>lstFirst</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>lstFirst</i>(&nbsp;)</strong> - find first node in list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>NODE *lstFirst    (    LIST * pList /* pointer to list descriptor */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine finds the first node in a linked list.<p>

⌨️ 快捷键说明

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