add osmo_quote_str_buf3, osmo_escape_str_buf3

There already are osmo_quote_str_buf() and osmo_quote_str_buf2(), same
for _escape_, but none of them return the snprintf() like string length.
A private function does, publish this in the API.

The returned chars_needed is required to accurately allocate sufficient
size in string functions that call osmo_quote_str/osmo_escape_str. I am
adding such in osmo-upf.git.

Related: SYS#5599
Change-Id: I05d75a40599e3133da099a11e8babaaad0e9493a
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 327aa3d..eda0e39 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -157,10 +157,12 @@
 char *osmo_quote_cstr_c(void *ctx, const char *str, int in_len);
 
 const char *osmo_escape_str(const char *str, int len);
+int osmo_escape_str_buf3(char *buf, size_t bufsize, const char *str, int in_len);
 char *osmo_escape_str_buf2(char *buf, size_t bufsize, const char *str, int in_len);
 const char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize);
 char *osmo_escape_str_c(const void *ctx, const char *str, int in_len);
 const char *osmo_quote_str(const char *str, int in_len);
+int osmo_quote_str_buf3(char *buf, size_t bufsize, const char *str, int in_len);
 char *osmo_quote_str_buf2(char *buf, size_t bufsize, const char *str, int in_len);
 const char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize);
 char *osmo_quote_str_c(const void *ctx, const char *str, int in_len);