From c5b47cc03200c983981ac4b8de20fb0e26d4f873 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 10 Oct 2017 16:53:21 +0200 Subject: 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 --- include/osmocom/core/msgb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 91b7ec7e..9c3ccf0d 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -498,5 +498,6 @@ uint8_t *msgb_data(const struct msgb *msg); 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, ...); /*! @} */ -- cgit v1.2.3