MINOR: buffer: add bo_del() to delete a number of characters from output
This simply reduces the amount of output data from the buffer after
they have been transferred, in a way that is more natural than by
fiddling with buf->o. b_del() was renamed to bi_del() to avoid any
ambiguity (it's not yet used).
diff --git a/include/common/buffer.h b/include/common/buffer.h
index b299466..ada43d9 100644
--- a/include/common/buffer.h
+++ b/include/common/buffer.h
@@ -96,12 +96,21 @@
* The caller is responsible for ensuring that <del> is always smaller than or
* equal to b->i.
*/
-static inline void b_del(struct buffer *b, unsigned int del)
+static inline void bi_del(struct buffer *b, unsigned int del)
{
b->i -= del;
b->p = b_ptr(b, del);
}
+/* Skips <del> bytes from the output of buffer <b> by simply shrinking <o>.
+ * The caller is responsible for ensuring that <del> is always smaller than or
+ * equal to b->o.
+ */
+static inline void bo_del(struct buffer *b, unsigned int del)
+{
+ b->o -= del;
+}
+
/* Advances the buffer by <adv> bytes, which means that the buffer
* pointer advances, and that as many bytes from in are transferred
* to out. The caller is responsible for ensuring that adv is always