MINOR: ring: add a ring_write() function

This function tries to write to the ring buffer, possibly removing enough
old messages to make room for the new one. It takes two arrays of fragments
on input to ease the insertion of prefixes by the caller. It atomically
writes the message, possibly truncating it if desired, and returns the
operation's status.
diff --git a/include/proto/ring.h b/include/proto/ring.h
index 6c08353..e324034 100644
--- a/include/proto/ring.h
+++ b/include/proto/ring.h
@@ -22,11 +22,14 @@
 #ifndef _PROTO_RING_H
 #define _PROTO_RING_H
 
+#include <stdlib.h>
+#include <common/ist.h>
 #include <types/ring.h>
 
 struct ring *ring_new(size_t size);
 struct ring *ring_resize(struct ring *ring, size_t size);
 void ring_free(struct ring *ring);
+ssize_t ring_write(struct ring *ring, size_t maxlen, const struct ist pfx[], size_t npfx, const struct ist msg[], size_t nmsg);
 
 #endif /* _PROTO_RING_H */