commMsgQueue.h 573 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef _commMsgQueue_H_
  2. #define _commMsgQueue_H_
  3. #include <stdio.h>
  4. #include <sys/types.h>
  5. #include <sys/ipc.h>
  6. #include <sys/msg.h>
  7. #include <string.h>
  8. #define PATHNAME "."
  9. #define PROJ_ID 0x0824
  10. enum{
  11. QUEUE_MSG_CLIENT, //客户端
  12. QUEUE_MSG_POST, //网页端
  13. QUEUE_MSG_UNLOCK, //开锁
  14. QUEUE_MSG_MAX //最大
  15. };
  16. struct msgbuf{
  17. long mtype;
  18. char mtext[1024];
  19. };
  20. int creatMsgQueue();
  21. int getMsgQueue();
  22. int destroyMsgQueue(int msgid);
  23. int sendMsg(int msgid, int type, const char *msg);
  24. int recvMsg(int msgid, int type, char *out);
  25. #endif