diff options
Diffstat (limited to 'libavutil/avstring.h')
-rw-r--r-- | libavutil/avstring.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libavutil/avstring.h b/libavutil/avstring.h index b08d78ee8c..3896b5f2bb 100644 --- a/libavutil/avstring.h +++ b/libavutil/avstring.h @@ -186,6 +186,30 @@ 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 isdigit. + */ +static inline int av_isdigit(int c) +{ + return c >= '0' && c <= '9'; +} + +/** + * Locale-independent conversion of ASCII isgraph. + */ +static inline int av_isgraph(int c) +{ + return c > 32 && c < 127; +} + +/** + * Locale-independent conversion of ASCII isspace. + */ +static inline int av_isspace(int c) +{ + return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v'; +} + +/** * Locale-independent conversion of ASCII characters to uppercase. */ static inline int av_toupper(int c) @@ -206,6 +230,15 @@ static inline int av_tolower(int c) } /** + * Locale-independent conversion of ASCII isxdigit. + */ +static inline int av_isxdigit(int c) +{ + c = av_tolower(c); + return av_isdigit(c) || (c >= 'a' && c <= 'z'); +} + +/** * Locale-independent case-insensitive compare. * @note This means only ASCII-range characters are case-insensitive */ |