diff options
Diffstat (limited to 'libavutil/avstring.h')
-rw-r--r-- | libavutil/avstring.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libavutil/avstring.h b/libavutil/avstring.h index 3fb3fbaf04..4ea64e46a9 100644 --- a/libavutil/avstring.h +++ b/libavutil/avstring.h @@ -166,6 +166,26 @@ char *av_get_token(const char **buf, const char *term); char *av_strtok(char *s, const char *delim, char **saveptr); /** + * Locale independent conversion of ASCII characters to upper case. + */ +static inline int av_toupper(int c) +{ + if (c >= 'a' && c <= 'z') + c ^= 0x20; + return c; +} + +/** + * Locale independent conversion of ASCII characters to lower case. + */ +static inline int av_tolower(int c) +{ + if (c >= 'A' && c <= 'Z') + c ^= 0x20; + return c; +} + +/** * Locale independent case-insensitive compare. * Note: This means only ASCII-range characters are case-insensitive */ |