diff --git a/include/import/ist.h b/include/import/ist.h index 1262e8f59..3f63ed2dd 100644 --- a/include/import/ist.h +++ b/include/import/ist.h @@ -407,6 +407,16 @@ static inline int istneq(const struct ist ist1, const struct ist ist2, size_t co return isteq(l, r); } +/* appends after . The caller must ensure that the underlying buffer + * is large enough to fit the character. + */ +static inline struct ist istappend(struct ist dst, const char src) +{ + dst.ptr[dst.len++] = src; + + return dst; +} + /* copies over for a maximum of bytes. Returns the number * of characters copied (src.len), or -1 if it does not fit. In all cases, the * contents are copied prior to reporting an error, so that the destination