diff options
author | Denis Kenzior <denkenz@gmail.com> | 2024-02-05 21:38:30 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2024-02-05 22:02:01 -0600 |
commit | 05362362f51db95a5b9cc6938d91c15ee0d2b4e5 (patch) | |
tree | 30fb12dac568c13b614d4f3d27137b5390544a8f | |
parent | c46b477a7765824a254ad3558d70519dc551df66 (diff) |
utf8: Add l_ascii_toupper
-rw-r--r-- | ell/utf8.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1,6 +1,7 @@ /* * Embedded Linux library * Copyright (C) 2011-2014 Intel Corporation + * Copyright (C) 2024 Cruise, LLC * * SPDX-License-Identifier: LGPL-2.1-or-later */ @@ -86,6 +87,14 @@ static inline __attribute__ ((always_inline)) bool l_ascii_isascii(int c) return false; } +static inline __attribute__ ((always_inline)) char l_ascii_toupper(char c) +{ + if (!l_ascii_islower(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); |