summaryrefslogtreecommitdiff
path: root/libavutil/avstring.h
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-12-23 21:25:24 +0100
committerLuca Barbato <lu_zero@gentoo.org>2012-12-29 17:26:22 +0100
commitd8fd06c37de94d78eb37af93177de7c3040cf1f2 (patch)
tree6505d5945220cc9541c2302a83ac4641f4238491 /libavutil/avstring.h
parentc73c87b41298ff81b5a86569b0f680a556fc1a21 (diff)
downloadffmpeg-d8fd06c37de94d78eb37af93177de7c3040cf1f2.tar.gz
avstring: add av_basename and av_dirname
Thread safe version of the common basename and dirname.
Diffstat (limited to 'libavutil/avstring.h')
-rw-r--r--libavutil/avstring.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavutil/avstring.h b/libavutil/avstring.h
index ed4e465cbc..acd6610d38 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -168,6 +168,22 @@ int av_strcasecmp(const char *a, const char *b);
*/
int av_strncasecmp(const char *a, const char *b, size_t n);
+
+/**
+ * Thread safe basename.
+ * @param path the path, on DOS both \ and / are considered separators.
+ * @return pointer to the basename substring.
+ */
+const char *av_basename(const char *path);
+
+/**
+ * Thread safe dirname.
+ * @param path the path, on DOS both \ and / are considered separators.
+ * @return the path with the separator replaced by the string terminator or ".".
+ * @note the function may change the input string.
+ */
+const char *av_dirname(char *path);
+
/**
* @}
*/