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

VxWorks

开发平台:

C/C++

  1. /* msgQLibP.h - private message queue library header file */
  2. /* Copyright 1984-2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01h,06sep01,bwa  Added VxWorks events support.
  7. 01g,19may98,drm  merged 3rd party code which added external declarations
  8.                  of distributed msgQ routines.
  9.                  - merged code was originally based on version 01d
  10. 01f,17apr98,rlp  canceled MSG_Q modification for backward compatibility.
  11. 01e,04nov97,rlp  modified MSG_Q structure for tracking messages sent.
  12. 01d,16jan94,c_s  added extern declaration for msgQInstClassId.
  13. 01c,22sep92,rrr  added support for c++
  14. 01b,19jul92,pme  added external declaration of shared msgQ show routine.
  15. 01a,04jul92,jcf  created.
  16. */
  17. #ifndef __INCmsgQLibPh
  18. #define __INCmsgQLibPh
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #include "vxWorks.h"
  23. #include "vwModNum.h"
  24. #include "msgQLib.h"
  25. #include "classLib.h"
  26. #include "qJobLib.h"
  27. #include "private/objLibP.h"
  28. #include "private/eventLibP.h"
  29. typedef struct msg_q /* MSG_Q */
  30.     {
  31.     OBJ_CORE objCore; /* object management */
  32.     Q_JOB_HEAD msgQ; /* message queue head */
  33.     Q_JOB_HEAD freeQ; /* free message queue head */
  34.     int options; /* message queue options */
  35.     int maxMsgs; /* max number of messages in queue */
  36.     int maxMsgLength; /* max length of message */
  37.     int sendTimeouts; /* number of send timeouts */
  38.     int recvTimeouts; /* number of receive timeouts */
  39.     EVENTS_RSRC events; /* VxWorks events */
  40.     } MSG_Q;
  41. typedef struct /* MSG_NODE */
  42.     {
  43.     Q_JOB_NODE node; /* queue node */
  44.     int msgLength; /* number of bytes of data */
  45.     } MSG_NODE;
  46. #define MSG_NODE_DATA(pNode)   (((char *) pNode) + sizeof (MSG_NODE))
  47. /* variable definitions */
  48. extern CLASS_ID msgQClassId; /* message queue class id */
  49. extern CLASS_ID msgQInstClassId; /* message q instrumented class id */
  50. /* shared memory objects function pointers */
  51. extern FUNCPTR  msgQSmSendRtn;
  52. extern FUNCPTR  msgQSmReceiveRtn;
  53. extern FUNCPTR  msgQSmNumMsgsRtn;
  54. extern FUNCPTR  msgQSmShowRtn;
  55. /* distributed objects function pointers */
  56. extern FUNCPTR  msgQDistSendRtn;
  57. extern FUNCPTR  msgQDistReceiveRtn;
  58. extern FUNCPTR  msgQDistNumMsgsRtn;
  59. extern FUNCPTR  msgQDistShowRtn;
  60. /* function declarations */
  61. #if defined(__STDC__) || defined(__cplusplus)
  62. extern STATUS msgQTerminate (MSG_Q_ID msgQId);
  63. extern STATUS msgQInit (MSG_Q *pMsgQ, int maxMsgs, int maxMsgLength,
  64.   int options, void *pMsgPool);
  65. #else /* __STDC__ */
  66. extern STATUS msgQTerminate ();
  67. extern STATUS msgQInit ();
  68. #endif /* __STDC__ */
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72. #endif /* __INCmsgQLibPh */