]> git.sesse.net Git - ffmpeg/commitdiff
avstring: Add locale independent versions of some ctype.h functions
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 6 Mar 2013 12:00:22 +0000 (14:00 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 7 Mar 2013 13:16:26 +0000 (15:16 +0200)
Signed-off-by: Martin Storsjö <martin@martin.st>
doc/APIchanges
libavutil/avstring.c
libavutil/avstring.h
libavutil/version.h

index b58f4da52296b9cea3bdc2b31f3945a1ff8a3e70..d7d95df4756a57d37392688bc5f5bdbde80e3b91 100644 (file)
@@ -13,6 +13,9 @@ libavutil:     2012-10-22
 
 API changes, most recent first:
 
+2013-xx-xx - xxxxxxx - lavu 52.8.0 - avstring.h
+  Add av_isdigit, av_isgraph, av_isspace, av_isxdigit.
+
 2013-xx-xx - xxxxxxx - lavfi 3.4.0 - avfiltergraph.h
   Add resample_lavr_opts to AVFilterGraph for setting libavresample options
   for auto-inserted resample filters.
index 625f723686e042f9ff0dae68a7ff45f24db6407f..6ce0310c1a899fcf6e3064f36f65921984104f8a 100644 (file)
@@ -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)
index e0e6ed26f57801edfc46d45c8ea24abeb869eb11..b7d10983c395cc433925e2f09ada3605c0c5d5a3 100644 (file)
@@ -151,6 +151,21 @@ char *av_d2str(double d);
  */
 char *av_get_token(const char **buf, const char *term);
 
+/**
+ * Locale-independent conversion of ASCII isdigit.
+ */
+int av_isdigit(int c);
+
+/**
+ * Locale-independent conversion of ASCII isgraph.
+ */
+int av_isgraph(int c);
+
+/**
+ * Locale-independent conversion of ASCII isspace.
+ */
+int av_isspace(int c);
+
 /**
  * Locale-independent conversion of ASCII characters to uppercase.
  */
@@ -171,6 +186,11 @@ static inline int av_tolower(int c)
     return c;
 }
 
+/**
+ * Locale-independent conversion of ASCII isxdigit.
+ */
+int av_isxdigit(int c);
+
 /*
  * Locale-independent case-insensitive compare.
  * @note This means only ASCII-range characters are case-insensitive
index 8d7e3789941ce9761ee5a633827bec9131924b60..38b11a408d3ffe346e1388cbe42a8e91039a385b 100644 (file)
@@ -37,7 +37,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 52
-#define LIBAVUTIL_VERSION_MINOR  7
+#define LIBAVUTIL_VERSION_MINOR  8
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \