📄 msgqueue.h
字号:
#ifndef _WG_MSGQUEUE_H_
#define _WG_MSGQUEUE_H_
#include <string.h>
#include "msg_key.h"
#define open_queue(key) msgget(key, IPC_CREAT | 0660)
#define send_msg(qid, qbuf) msgsnd(qid, qbuf, sizeof((qbuf)->sender)+strlen((qbuf)->msg)+1, IPC_NOWAIT)
#define read_msg(qid, type, qbuf) msgrcv(qid, qbuf, sizeof(MSG)-sizeof(long), type, IPC_NOWAIT | MSG_NOERROR)
#define is_msg_exists(qid, type) (((msgrcv(qid, NULL, 0, type, IPC_NOWAIT)==-1) && (errno == E2BIG)) ? TRUE : FALSE)
#endif //_WG_MSGQUEUE_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -