From 0e9d87bf0676a0813cef6cb0c85e74e5707cff7d Mon Sep 17 00:00:00 2001 From: Baptiste Assmann Date: Sat, 18 Apr 2020 14:50:11 +0200 Subject: [PATCH] MINOR: istbuf: add ist2buf() function Purpose of this function is to build a from a . --- include/common/istbuf.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/common/istbuf.h b/include/common/istbuf.h index 9b6ce7c..a533c71 100644 --- a/include/common/istbuf.h +++ b/include/common/istbuf.h @@ -139,6 +139,19 @@ static inline size_t b_putist(struct buffer *b, const struct ist ist) return b_putblk(b, ist.ptr, ist.len); } +/* builds and return a based on + */ +static inline struct buffer ist2buf(const struct ist ist) +{ + struct buffer buf; + + buf.area = ist.ptr; + buf.size = ist.len; + buf.data = ist.len; + buf.head = 0; + return buf; +} + #endif /* _COMMON_ISTBUF_H */ /* -- 1.7.10.4