Add uc_mbuf_head accessor function

This commit is contained in:
Nils O. Selåsdal
2013-11-25 20:52:43 +01:00
parent 3d2e0ce540
commit 306a3d2a90
2 changed files with 12 additions and 3 deletions
+10 -1
View File
@@ -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