📄 msgapi.h
字号:
#ifndef _MSGAPI_H_
#define _MSGAPI_H_
#include <sys/types.h>
/************************************************************
NonBlock Message Queue API define
*************************************************************/
/* Return code define */
#define MSGMNG_IPC_ERR -1
#define MSG_Q_NOT_FOUND -2
#define MSGMNG_FULL -3
#define MSG_RLOG_FULL -4
#define MSGID_NOT_FOUND -5
#define PID_NOT_FOUND -6
#define MSG_MALLOC_ERR -7
#define MSG_R_NOT_FOUND -8
#define MSG_LOG_NOT_FOUND -9
#define MSG_R_LOG_NOT_FOUND -10
#define MSGSND_ERR -11
#define MSGRCV_ERR -12
#define MSG_LOG_FULL -13
#define INSERT_MSGQLOG_ERR -14
#define MSGKEY_NOT_FOUND -15
#define MSG_DATA_FULL -16
#define MSGID_ERR -17
#define MSG_W_LOG_NOT_FOUND -18
#define MSG_W_LOG_FULL -19
#define MSGRCV_TIME_OUT -20
#define MTYPE_ERR -21
#define P_SEMOP_ERR -22
#define V_SEMOP_ERR -23
#define SIGNAL_BRK -24
#define MSGSND_TIME_OUT -25
#define PRIORITY 0x01
#define AUTO_LOGOUT 0x02
struct msg_q_stat {
int msg_w_log_cnt;
int msg_log_cnt;
};
struct msg_s_stat {
int free_msg_w_log;
int free_msg_r_log;
int free_msg_log;
int free_mem_byte;
};
/* Message queue init proc */
int create_message_queue ( key_t MSGKEY , int max_delay_time );
int get_message_queue ( key_t MSGKEY );
int remove_message_queue ( key_t MSGKEY );
int message_r_login ( int msgid , long mtype );
int message_r_logout ( int msgid , long mtype );
/* Message communication proc */
int message_send ( int msgid , char *data , int size , long mtype , \
int timeout , int flag );
int message_recv ( int msgid , char *data , int size , long *mtype , \
int timeout , int flag );
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -