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

VxWorks

开发平台:

C/C++

  1. /* qPriListLib.h - priority linked list header file */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 02c,22sep92,rrr  added support for c++
  7. 02b,19jul92,pme  made qPriListRemove return STATUS.
  8. 02a,04jul92,jcf  cleaned up.
  9. 01f,26may92,rrr  the tree shuffle
  10. 01e,04oct91,rrr  passed through the ansification filter
  11.   -changed VOID to void
  12.   -changed copyright notice
  13. 01d,05oct90,shl  added ANSI function prototypes.
  14.                  made #endif ANSI style.
  15.  added copyright notice.
  16. 01c,05jul90,jcf  added qPriListCalibrate().
  17.  made priority key unsigned.
  18. 01b,26jun90,jcf  removed queue class definition.
  19. 01a,22oct89,jcf  written.
  20. */
  21. #ifndef __INCqPriListLibh
  22. #define __INCqPriListLibh
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include "vxWorks.h"
  27. #include "qClass.h"
  28. #include "qPriNode.h"
  29. #include "dllLib.h"
  30. /*******************************************************************************
  31. *
  32. * qPriListFirst - find first node in list
  33. *
  34. * DESCRIPTION
  35. *
  36. * RETURNS
  37. * Pointer to the first node in a list, or
  38. * NULL if the list is empty.
  39. */
  40. #define Q_PRI_LIST_FIRST(pList)
  41.     (
  42.     (DLL_FIRST((Q_PRI_HEAD *)(pList)))
  43.     )
  44. /*******************************************************************************
  45. *
  46. * qPriListEmpty - boolean function to check for empty list
  47. *
  48. * RETURNS:
  49. *  TRUE if list is empty
  50. * FALSE otherwise
  51. */
  52. #define Q_PRI_LIST_EMPTY(pList)
  53.     (
  54.     (DLL_EMPTY((Q_PRI_HEAD *)(pList)))
  55.     )
  56. /* function declarations */
  57. #if defined(__STDC__) || defined(__cplusplus)
  58. extern Q_PRI_HEAD *qPriListCreate (void);
  59. extern Q_PRI_NODE *qPriListEach (Q_PRI_HEAD *pQHead, FUNCPTR routine,
  60.  int routineArg);
  61. extern Q_PRI_NODE *qPriListGet (Q_PRI_HEAD *pQPriHead);
  62. extern Q_PRI_NODE *qPriListGetExpired (Q_PRI_HEAD *pQPriHead);
  63. extern STATUS  qPriListDelete (Q_PRI_HEAD *pQPriHead);
  64. extern STATUS  qPriListInit (Q_PRI_HEAD *pQPriHead);
  65. extern STATUS  qPriListTerminate (Q_PRI_HEAD *pQPriHead);
  66. extern ULONG  qPriListKey (Q_PRI_NODE *pQPriNode, int keyType);
  67. extern int  qPriListInfo (Q_PRI_HEAD *pQPriHead, int nodeArray [],
  68.       int maxNodes);
  69. extern void  qPriListAdvance (Q_PRI_HEAD *pQPriHead);
  70. extern void  qPriListCalibrate (Q_PRI_HEAD *pQHead, ULONG keyDelta);
  71. extern void  qPriListPut (Q_PRI_HEAD *pQPriHead, Q_PRI_NODE *pQPriNode,
  72.      ULONG key);
  73. extern void  qPriListPutFromTail (Q_PRI_HEAD *pQPriHead,
  74.      Q_PRI_NODE *pQPriNode, ULONG key);
  75. extern STATUS  qPriListRemove (Q_PRI_HEAD *pQPriHead, Q_PRI_NODE *pQPriNode);
  76. extern void  qPriListResort (Q_PRI_HEAD *pQPriHead, Q_PRI_NODE *pQPriNode,
  77. ULONG newKey);
  78. #else /* __STDC__ */
  79. extern Q_PRI_HEAD *qPriListCreate ();
  80. extern Q_PRI_NODE *qPriListEach ();
  81. extern Q_PRI_NODE *qPriListGet ();
  82. extern Q_PRI_NODE *qPriListGetExpired ();
  83. extern STATUS  qPriListDelete ();
  84. extern STATUS  qPriListInit ();
  85. extern STATUS  qPriListTerminate ();
  86. extern ULONG  qPriListKey ();
  87. extern int  qPriListInfo ();
  88. extern void  qPriListAdvance ();
  89. extern void  qPriListCalibrate ();
  90. extern void  qPriListPut ();
  91. extern void  qPriListPutFromTail ();
  92. extern STATUS  qPriListRemove ();
  93. extern void  qPriListResort ();
  94. #endif /* __STDC__ */
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98. #endif /* __INCqPriListLibh */