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

VxWorks

开发平台:

C/C++

  1. /* qJobLib.h - job queue header file */
  2. /* Copyright 1984-2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 02d,02oct01,bwa  added MSG_Q_ID msgQId to list of arguments of 
  7.                  qJobGet()(SPR #20195)
  8. 02c,10sep01,bwa  Modified qJobPut() parameters
  9. 02b,22sep92,rrr  added support for c++
  10. 02a,04jul92,jcf  cleaned up.
  11. 01e,26may92,rrr  the tree shuffle
  12. 01d,04oct91,rrr  passed through the ansification filter
  13.   -changed VOID to void
  14.   -changed ASMLANGUAGE to _ASMLANGUAGE
  15.   -changed copyright notice
  16. 01c,16oct90,shl  made #else ANSI style.
  17. 01b,05oct90,shl  added ANSI function prototypes.
  18.                  made #endif ANSI style.
  19.  added copyright notice.
  20. 01a,01may90,dnw   written.
  21. */
  22. #ifndef __INCqJobLibh
  23. #define __INCqJobLibh
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #include "vxWorks.h"
  28. #ifndef _ASMLANGUAGE
  29. #include "qLib.h"
  30. #include "msgQLib.h"
  31. /* qJobPut "priorities" */
  32. #define Q_JOB_PRI_TAIL 0 /* add node to tail of queue */
  33. #define Q_JOB_PRI_HEAD 1 /* add node to head of queue */
  34. #define Q_JOB_PRI_DONT_CARE 1 /* head is a bit faster */
  35. /* HIDDEN */
  36. typedef struct qJobNode /* Node of a job queue */
  37.     {
  38.     struct qJobNode *next;
  39.     } Q_JOB_NODE;
  40. typedef struct /* Head of job queue */
  41.     {
  42.     Q_JOB_NODE *first; /* first node in queue */
  43.     Q_JOB_NODE *last; /* last node in queue */
  44.     int count; /* number of nodes in queue */
  45.     Q_CLASS    *pQClass; /* must be 4th long word */
  46.     Q_HEAD pendQ; /* queue of blocked tasks */
  47.     } Q_JOB_HEAD;
  48. /* END HIDDEN */
  49. IMPORT Q_CLASS_ID qJobClassId; /* job queue class */
  50. /* function declarations */
  51. #if defined(__STDC__) || defined(__cplusplus)
  52. extern Q_JOB_HEAD * qJobCreate (Q_CLASS_ID pendQType);
  53. extern Q_JOB_NODE * qJobGet (MSG_Q_ID msgQId, Q_JOB_HEAD *pQHead, 
  54.  int timeout);
  55. extern STATUS  qJobDelete (Q_JOB_HEAD *pQHead);
  56. extern STATUS  qJobInit (Q_JOB_HEAD *pQHead, Q_CLASS_ID pendQType);
  57. extern STATUS  qJobTerminate (Q_JOB_HEAD *pQHead);
  58. extern int  qJobInfo (Q_JOB_HEAD *pQHead, int nodeArray [],
  59.   int maxNodes);
  60. extern STATUS  qJobPut (MSG_Q_ID msgQId, Q_JOB_HEAD *pQHead,
  61. Q_JOB_NODE *pNode, int key);
  62. extern Q_JOB_NODE * qJobEach (Q_JOB_HEAD *pQHead, FUNCPTR routine,
  63.   int routineArg);
  64. #else /* __STDC__ */
  65. extern Q_JOB_HEAD * qJobCreate ();
  66. extern Q_JOB_NODE * qJobEach ();
  67. extern Q_JOB_NODE * qJobGet ();
  68. extern STATUS  qJobDelete ();
  69. extern STATUS  qJobInit ();
  70. extern STATUS  qJobTerminate ();
  71. extern int  qJobInfo ();
  72. extern STATUS  qJobPut ();
  73. #endif /* __STDC__ */
  74. #else /* _ASMLANGUAGE */
  75. #define _QHEAD
  76. #define _QTAIL (4)
  77. #define _QCOUNT (8)
  78. #define _QPENDQ (16)
  79. #endif /* _ASMLANGUAGE */
  80. #ifdef __cplusplus
  81. }
  82. #endif
  83. #endif /* __INCqJobLibh */