From d4251a7e98878975375423bc309cc491cab28244 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Fri, 29 Jun 2018 16:17:34 +0200 Subject: [PATCH] MINOR: channel: Add co_set_data(). Add a new function that lets one set the channel's output amount. --- include/proto/channel.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/proto/channel.h b/include/proto/channel.h index 8e1ae3f..26bc481 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -198,6 +198,12 @@ static inline void c_realign_if_empty(struct channel *chn) b_realign_if_empty(chn->buf); } +/* Sets the amount of output for the channel */ +static inline void co_set_data(struct channel *c, size_t output) +{ + c->buf->o = output; +} + /* co_head() : returns a pointer to the beginning of output data in the buffer. * The "__" variants don't support wrapping, "ofs" are relative to -- 1.7.10.4