aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2024-02-05 21:39:08 -0600
committerDenis Kenzior <denkenz@gmail.com>2024-02-05 22:02:03 -0600
commite71edfe4f476c0e707f6fe1a197ff168436958cb (patch)
tree22c2705b5e8c1a76544eb07511271ea2c6d37a42
parent05362362f51db95a5b9cc6938d91c15ee0d2b4e5 (diff)
utf8: Add l_ascii_tolower
-rw-r--r--ell/utf8.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ell/utf8.h b/ell/utf8.h
index 124ec026..7817cf16 100644
--- a/ell/utf8.h
+++ b/ell/utf8.h
@@ -95,6 +95,14 @@ static inline __attribute__ ((always_inline)) char l_ascii_toupper(char c)
return c - 32;
}
+static inline __attribute__ ((always_inline)) char l_ascii_tolower(char c)
+{
+ if (!l_ascii_isupper(c))
+ return c;
+
+ return c + 32;
+}
+
bool l_utf8_validate(const char *src, size_t len, const char **end);
size_t l_utf8_strlen(const char *str);