add function msgb_printf() to print formatted text into msg buf

In ASCII string based protocols it a printf() version that prints
directly to the message buffer may be useful.

Add function msgb_printf(), make sure that msg buffer bounderies
are not exceeded. If the end of the tail buffer is hit, return
with an error code.

Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index 91b7ec7..9c3ccf0 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -498,5 +498,6 @@
 
 void *msgb_talloc_ctx_init(void *root_ctx, unsigned int pool_size);
 void msgb_set_talloc_ctx(void *ctx) OSMO_DEPRECATED("Use msgb_talloc_ctx_init() instead");
+int msgb_printf(struct msgb *msgb, const char *format, ...);
 
 /*! @} */