|
@ -73,14 +73,14 @@ uint32_t sbufReadU32(sbuf_t *src) |
|
|
return ret; |
|
|
return ret; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void sbufReadData(sbuf_t *src, void *data, int len) |
|
|
|
|
|
|
|
|
void sbufReadData(const sbuf_t *src, void *data, int len) |
|
|
{ |
|
|
{ |
|
|
memcpy(data, src->ptr, len); |
|
|
memcpy(data, src->ptr, len); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// reader - return bytes remaining in buffer |
|
|
// reader - return bytes remaining in buffer |
|
|
// writer - return available space |
|
|
// writer - return available space |
|
|
int sbufBytesRemaining(sbuf_t *buf) |
|
|
|
|
|
|
|
|
int sbufBytesRemaining(const sbuf_t *buf) |
|
|
{ |
|
|
{ |
|
|
return buf->end - buf->ptr; |
|
|
return buf->end - buf->ptr; |
|
|
} |
|
|
} |
|
@ -90,6 +90,11 @@ uint8_t* sbufPtr(sbuf_t *buf) |
|
|
return buf->ptr; |
|
|
return buf->ptr; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const uint8_t* sbufConstPtr(const sbuf_t *buf) |
|
|
|
|
|
{ |
|
|
|
|
|
return buf->ptr; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// advance buffer pointer |
|
|
// advance buffer pointer |
|
|
// reader - skip data |
|
|
// reader - skip data |
|
|
// writer - commit written data |
|
|
// writer - commit written data |
|
|