From a356c4e3e8cea183ceeb910fe710490f18255a74 Mon Sep 17 00:00:00 2001 From: Srivardhan Hebbar Date: Wed, 21 Oct 2015 14:04:43 -0700 Subject: [PATCH] eina: add API for converting strbuf to lowercase. Summary: This API would be used in efl_network_websocket. Signed-off-by: Srivardhan Hebbar Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3200 Signed-off-by: Cedric BAIL --- src/lib/eina/eina_strbuf.c | 8 ++++++++ src/lib/eina/eina_strbuf.h | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/lib/eina/eina_strbuf.c b/src/lib/eina/eina_strbuf.c index 828d842455..ff461a7544 100644 --- a/src/lib/eina/eina_strbuf.c +++ b/src/lib/eina/eina_strbuf.c @@ -197,6 +197,14 @@ eina_strbuf_rtrim(Eina_Strbuf *buf) ((unsigned char *)buf->buf)[buf->len] = '\0'; } +EAPI void +eina_strbuf_tolower(Eina_Strbuf *buf) +{ + if (!buf || !(buf->buf)) return; + + eina_str_tolower((char **)&(buf->buf)); +} + /* Unicode */ #include "eina_strbuf_template_c.x" diff --git a/src/lib/eina/eina_strbuf.h b/src/lib/eina/eina_strbuf.h index 1a628b9fef..3799a3d50b 100644 --- a/src/lib/eina/eina_strbuf.h +++ b/src/lib/eina/eina_strbuf.h @@ -641,6 +641,15 @@ EAPI void eina_strbuf_ltrim(Eina_Strbuf *buf) EINA_ARG_NONNULL(1); */ EAPI void eina_strbuf_rtrim(Eina_Strbuf *buf) EINA_ARG_NONNULL(1); +/** + * @brief Convert the string to lower case. + * + * @param buf the string buffer to work with. + * + * This function converts all the characters in the strbuf to lower case. + */ +EAPI void eina_strbuf_tolower(Eina_Strbuf *buf) EINA_ARG_NONNULL(1); + /** * @} */