📄 lcmq_pub.h
字号:
#ifdef __cplusplusextern "C"{#endif #ifndef __INC_LCMQ_PUB_H__#define __INC_LCMQ_PUB_H__#define MSG_CREATE_BY_DATA( pMb, pHead, TrueLen, pData, Len )\\do\{\ pMb = msg_alloc();\ if(NULL != pMb )\ {\ pMb->head = (U8*)pHead;\ pMb->truelen = TrueLen;\ pMb->end = pMb->head + TrueLen;\ pMb->data = (U8*)pData;\ pMb->len = Len;\ pMb->tail = pMb->data + pMb->len;\ \ AOS_ASSERT( pMb->data >= pMb->head );\ AOS_ASSERT( (U32)(pMb->data - pMb->head) >= (L3_MSG_HEAD_LEN + 2 *sizeof(U32)) );\ }\}while(0)#define MSG_CREATE_BY_DATA_4SNMP( pMb, pHead, TrueLen, pData, Len )\\do\{\ pMb = msg_alloc();\ if(NULL != pMb )\ {\ pMb->head = (U8*)pHead;\ pMb->truelen = TrueLen;\ pMb->end = pMb->head + TrueLen;\ pMb->data = (U8*)pData;\ pMb->len = Len;\ pMb->tail = pMb->data + pMb->len;\ \ AOS_ASSERT( pMb->data >= pMb->head );\ }\}while(0)struct msg_blk{ struct msg_blk *prev; struct msg_blk *next; U32 truelen; U32 len; U8 *head; U8 *data; U8 *tail; U8 *end; };struct msg_blk_que{ struct msg_blk *prev; struct msg_blk *next; U32 qlen; U32 lock;};U32 m_lcmque_init( );VOID msg_lock_que_init( struct msg_blk_que *que );VOID msg_que_init( struct msg_blk_que *que );VOID msg_que_head( struct msg_blk_que *que, struct msg_blk *newmb );VOID msg_que_tail( struct msg_blk_que *que, struct msg_blk *newmb );struct msg_blk *msg_deque( struct msg_blk_que *que );struct msg_blk *msg_remove_tail( struct msg_blk_que *que );struct msg_blk *msg_alloc_x(S8 *file, U32 line );struct msg_blk *msg_clone_x( struct msg_blk *oldmb, S8 *file, U32 line );VOID msg_free( struct msg_blk *mb );U8 *msg_put( struct msg_blk * mb, U32 len );U8 *msg_push( struct msg_blk * mb, U32 len );U8 *msg_pull( struct msg_blk * mb, U32 len );struct msg_blk *msg_clone_by_v5_data( VOID*datap );struct msg_blk *msg_alloc4drv( U32 size );struct msg_blk *msg_que_head_ptr( struct msg_blk_que *que );#if( CONFIG_MANUAL_ALIGN == TRUE )VOID msg_align( struct msg_blk * mb );#else#define msg_align( mb ) #endif#define msg_alloc() msg_alloc_x(__FILE__,__LINE__)#define msg_clone(oldmb) msg_clone_x(oldmb,__FILE__,__LINE__)#endif#ifdef __cplusplus}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -