mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-10 21:38:16 +00:00
MINOR: buffer: introduce b_make() to make a buffer from its parameters
This is convenient to assign a buffer from parts of another one.
This commit is contained in:
parent
7562a7291d
commit
e39b58f045
@ -399,6 +399,18 @@ static inline void b_reset(struct buffer *b)
|
||||
b->data = 0;
|
||||
}
|
||||
|
||||
/* b_make() : make a buffer from all parameters */
|
||||
static inline struct buffer b_make(char *area, size_t size, size_t head, size_t data)
|
||||
{
|
||||
struct buffer b;
|
||||
|
||||
b.area = area;
|
||||
b.size = size;
|
||||
b.head = head;
|
||||
b.data = data;
|
||||
return b;
|
||||
}
|
||||
|
||||
/* b_sub() : decreases the buffer length by <count> */
|
||||
static inline void b_sub(struct buffer *b, size_t count)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user