diff --git a/include/common/istbuf.h b/include/common/istbuf.h index 9b6ce7c6b..933ec99fb 100644 --- a/include/common/istbuf.h +++ b/include/common/istbuf.h @@ -33,6 +33,9 @@ #include +/* makes a buffer pointer from an IST */ +#define b_fromist(in) ({ const struct ist __i = (in); &(const struct buffer){ .area = __i.ptr, .head = 0, .data = __i.len, .size = __i.len}; }) + /* b_isteq() : returns > 0 if the first characters of buffer starting * at offset relative to the buffer's head match . (empty strings do * match). It is designed to be used with reasonably small strings (it matches