diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2013-03-06 14:00:22 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-03-07 15:16:26 +0200 |
commit | 12c5c1d3e3906e18a96ec380605d2f1504fc3d3b (patch) | |
tree | c34b4dd893f2e5ab67c3f8556beec201ebeda610 /libavutil/avstring.c | |
parent | 54b298fe5650c124c29a8283cfd05024ac409d3a (diff) | |
download | ffmpeg-12c5c1d3e3906e18a96ec380605d2f1504fc3d3b.tar.gz |
avstring: Add locale independent versions of some ctype.h functions
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil/avstring.c')
-rw-r--r-- | libavutil/avstring.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libavutil/avstring.c b/libavutil/avstring.c index 625f723686..6ce0310c1a 100644 --- a/libavutil/avstring.c +++ b/libavutil/avstring.c @@ -213,6 +213,28 @@ const char *av_dirname(char *path) return path; } +int av_isdigit(int c) +{ + return c >= '0' && c <= '9'; +} + +int av_isgraph(int c) +{ + return c > 32 && c < 127; +} + +int av_isspace(int c) +{ + return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || + c == '\v'; +} + +int av_isxdigit(int c) +{ + c = av_tolower(c); + return av_isdigit(c) || (c >= 'a' && c <= 'z'); +} + #ifdef TEST int main(void) |