Add uc_mbuf_head accessor function
This commit is contained in:
+10
-1
@@ -151,7 +151,7 @@ static UC_INLINE uint32_t uc_mbuf_tailroom(struct MBuf *mbuf)
|
||||
/**
|
||||
* @return the length of the headroom in this mbuf
|
||||
*/
|
||||
static inline uint32_t uc_mbuf_headroom(struct MBuf *mbuf)
|
||||
static UC_INLINE uint32_t uc_mbuf_headroom(struct MBuf *mbuf)
|
||||
{
|
||||
return (uint32_t)(mbuf->head - mbuf->bufstart);
|
||||
}
|
||||
@@ -187,6 +187,15 @@ uint8_t *uc_mbuf_push(struct MBuf *mbuf, uint32_t size);
|
||||
**/
|
||||
uint8_t *uc_mbuf_pull(struct MBuf *mbuf, uint32_t size);
|
||||
|
||||
/** Get a pointer to the data of the buffer
|
||||
*
|
||||
* @return pointer to the start of the data (head)
|
||||
*/
|
||||
static UC_INLINE uint8_t *uc_mbuf_head(struct MBuf* mbuf)
|
||||
{
|
||||
return mbuf->head;
|
||||
}
|
||||
|
||||
#undef UC_INLINE
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user