diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2011-11-05 17:15:43 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-11-06 11:52:54 +0200 |
commit | 07b172fe8f6a5d567edc4dac3f813b210874d3b1 (patch) | |
tree | 71ca31415be8da95b8bb8ad6313e8dd7dfe2f7b2 | |
parent | 66760b30a393388490a9bd87ef27ef211ca627f6 (diff) | |
download | ffmpeg-07b172fe8f6a5d567edc4dac3f813b210874d3b1.tar.gz |
avstring: Add locale independent implementations of toupper/tolower
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | doc/APIchanges | 3 | ||||
-rw-r--r-- | libavutil/avstring.h | 20 | ||||
-rw-r--r-- | libavutil/avutil.h | 2 |
3 files changed, 24 insertions, 1 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index 1e6adf5a62..0dd8350c2d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2011-04-18 API changes, most recent first: +2011-11-xx - xxxxxxx - lavu 51.13.0 + Add av_toupper()/av_tolower() + 2011-11-xx - xxxxxxx - lavf 53.13.0 Add avformat_network_init()/avformat_network_uninit() diff --git a/libavutil/avstring.h b/libavutil/avstring.h index 44ed89d654..8d97e1f768 100644 --- a/libavutil/avstring.h +++ b/libavutil/avstring.h @@ -131,4 +131,24 @@ char *av_d2str(double d); */ char *av_get_token(const char **buf, const char *term); +/** + * 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; +} + #endif /* AVUTIL_AVSTRING_H */ diff --git a/libavutil/avutil.h b/libavutil/avutil.h index fae6801142..b688321161 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -40,7 +40,7 @@ #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) #define LIBAVUTIL_VERSION_MAJOR 51 -#define LIBAVUTIL_VERSION_MINOR 12 +#define LIBAVUTIL_VERSION_MINOR 13 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |