]> git.sesse.net Git - ffmpeg/commitdiff
avutil/avstring: add av_strnlen()
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Dec 2013 14:42:04 +0000 (15:42 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Dec 2013 21:25:15 +0000 (22:25 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/APIchanges
libavutil/avstring.h
libavutil/version.h

index 7139f7a266a74fc95e3e76cad22a6a29ad76c057..21a8c4c0c47dd80f2808cba4fd3876ba63a32b52 100644 (file)
@@ -14,6 +14,10 @@ libavutil:     2012-10-22
 
 
 API changes, most recent first:
+
+2013-12-22 - xxxxxxx - lavu 52.59.100 - avstring.h
+  Add av_strnlen() function.
+
 2013-12-xx - xxxxxxx - lavu 52.57.100 - opencl.h
   Add av_opencl_benchmark() function.
 
index 882a2b57dc22ac1a1b8e4606a9c4760d51eece63..de2f71d12b62609ff5b7864bb592766801b20f30 100644 (file)
@@ -131,6 +131,20 @@ size_t av_strlcat(char *dst, const char *src, size_t size);
  */
 size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4);
 
+/**
+ * Get the count of continuous non zero chars starting from the beginning.
+ *
+ * @param len maximum number of characters to check in the string, that
+ *            is the maximum value which is returned by the function
+ */
+static inline size_t av_strnlen(const char *s, size_t len)
+{
+    size_t i;
+    for (i = 0; i < len && s[i]; i++)
+        ;
+    return i;
+}
+
 /**
  * Print arguments following specified format into a large enough auto
  * allocated buffer. It is similar to GNU asprintf().
index e7bad6f9a81b95757f1db1f03733f483fffbadf1..a70a1106623a783f4b4e4d0c9dc9452acf1fd215 100644 (file)
@@ -75,8 +75,8 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  52
-#define LIBAVUTIL_VERSION_MINOR  58
-#define LIBAVUTIL_VERSION_MICRO 101
+#define LIBAVUTIL_VERSION_MINOR  59
+#define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \