lstLib.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* lstLib.h - doubly linked list library header */
  2. /* Copyright 1984-2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01n,19sep01,pcm  added lstLibInit () (SPR 20698)
  7. 01m,02apr93,edm  ifdef'd out non-ASMLANGUAGE portions
  8. 01l,22sep92,rrr  added support for c++
  9. 01k,04jul92,jcf  cleaned up.
  10. 01j,26may92,rrr  the tree shuffle
  11. 01i,04oct91,rrr  passed through the ansification filter
  12.   -changed VOID to void
  13.   -changed copyright notice
  14. 01h,23oct90,shl  included "vxWorks.h" so include file order isn't crucial.
  15. 01g,05oct90,shl  added ANSI function prototypes.
  16.                  made #endif ANSI style.
  17.                  added copyright notice.
  18. 01f,10aug90,dnw  added declaration of lstInsert().
  19. 01e,07aug90,shl  added IMPORT type to function declarations.
  20. 01d,21may86,llk  added forward declaration of lstNStep.
  21. 01c,03jun84,dnw  changed list.{head,tail} to list.node.
  22.  added declarations of lst{First,Last,Next,Previous}.
  23. 01b,27jan84,ecs  added inclusion test.
  24. 01b,15mar83,dnw  changed name from lstlb to lstLib
  25. */
  26. #ifndef __INClstLibh
  27. #define __INClstLibh
  28. #ifndef _ASMLANGUAGE
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. #include "vxWorks.h"
  33. /* type definitions */
  34. typedef struct node /* Node of a linked list. */
  35.     {
  36.     struct node *next; /* Points at the next node in the list */
  37.     struct node *previous; /* Points at the previous node in the list */
  38.     } NODE;
  39. /* HIDDEN */
  40. typedef struct /* Header for a linked list. */
  41.     {
  42.     NODE node; /* Header list node */
  43.     int count; /* Number of nodes in list */
  44.     } LIST;
  45. /* END_HIDDEN */
  46. /* function declarations */
  47. #if defined(__STDC__) || defined(__cplusplus)
  48. extern void lstLibInit (void);
  49. extern NODE * lstFirst (LIST *pList);
  50. extern NODE * lstGet (LIST *pList);
  51. extern NODE * lstLast (LIST *pList);
  52. extern NODE * lstNStep (NODE *pNode, int nStep);
  53. extern NODE * lstNext (NODE *pNode);
  54. extern NODE * lstNth (LIST *pList, int nodenum);
  55. extern NODE * lstPrevious (NODE *pNode);
  56. extern int  lstCount (LIST *pList);
  57. extern int  lstFind (LIST *pList, NODE *pNode);
  58. extern void  lstAdd (LIST *pList, NODE *pNode);
  59. extern void  lstConcat (LIST *pDstList, LIST *pAddList);
  60. extern void  lstDelete (LIST *pList, NODE *pNode);
  61. extern void  lstExtract (LIST *pSrcList, NODE *pStartNode, NODE *pEndNode,
  62.        LIST *pDstList);
  63. extern void  lstFree (LIST *pList);
  64. extern void  lstInit (LIST *pList);
  65. extern void  lstInsert (LIST *pList, NODE *pPrev, NODE *pNode);
  66. #else /* __STDC__ */
  67. extern void lstLibInit ();
  68. extern NODE * lstFirst ();
  69. extern NODE * lstGet ();
  70. extern NODE * lstLast ();
  71. extern NODE * lstNStep ();
  72. extern NODE * lstNext ();
  73. extern NODE * lstNth ();
  74. extern NODE * lstPrevious ();
  75. extern int  lstCount ();
  76. extern int  lstFind ();
  77. extern void  lstAdd ();
  78. extern void  lstConcat ();
  79. extern void  lstDelete ();
  80. extern void  lstExtract ();
  81. extern void  lstFree ();
  82. extern void  lstInit ();
  83. extern void  lstInsert ();
  84. #endif /* __STDC__ */
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif /* ~ _ASMLANGUAGE */
  89. #endif /* __INClstLibh */