summaryrefslogtreecommitdiff
path: root/libavutil/avstring.h
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-09-27 16:23:43 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-09-27 16:23:43 +0000
commit372e2884089e6a17be6d0028386ea2099dd86268 (patch)
treed65753e450b0613788dde3e5f23a116a157cd1c7 /libavutil/avstring.h
parent4a94cfea02f4c3da43d2f2ed25f14ee461a1a315 (diff)
Move av_get_token() from libavfilter to libavutil.
Originally committed as revision 25225 to svn://svn.ffmpeg.org/ffmpeg/trunk
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 01c2391b5f..04d1197386 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -114,4 +114,20 @@ size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...);
*/
char *av_d2str(double d);
+/**
+ * Unescape the given string until a non escaped terminating char,
+ * and return the token corresponding to the unescaped string.
+ *
+ * The normal \ and ' escaping is supported. Leading and trailing
+ * whitespaces are removed, unless they are escaped with '\' or are
+ * enclosed between ''.
+ *
+ * @param buf the buffer to parse, buf will be updated to point to the
+ * terminating char
+ * @param term a 0-terminated list of terminating chars
+ * @return the malloced unescaped string, which must be av_freed by
+ * the user, NULL in case of allocation failure
+ */
+char *av_get_token(const char **buf, const char *term);
+
#endif /* AVUTIL_AVSTRING_H */