summaryrefslogtreecommitdiff
path: root/libavformat/internal.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-08-19 14:49:53 +0000
committerMartin Storsjö <martin@martin.st>2010-08-19 14:49:53 +0000
commitf9c399c4fd85ac140ea3b81d0eeb649df29ade3d (patch)
treedf512bccb2887a264855827fbaa2bf4731ca8def /libavformat/internal.h
parent8d88402013acf73e2a0e70c6a36df793742fd4f5 (diff)
Make parse_key_value from httpauth a common lavf internal function
Originally committed as revision 24832 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/internal.h')
-rw-r--r--libavformat/internal.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 6d3ec23767..1b33fb153a 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -192,4 +192,28 @@ int ff_get_line(ByteIOContext *s, char *buf, int maxlen);
#define SPACE_CHARS " \t\r\n"
+/**
+ * Callback function type for ff_parse_key_value.
+ *
+ * @param key a pointer to the key
+ * @param key_len the number of bytes that belong to the key, including the '='
+ * char
+ * @param dest return the destination pointer for the value in *dest, may
+ * be null to ignore the value
+ * @param dest_len the length of the *dest buffer
+ */
+typedef void (*ff_parse_key_val_cb)(void *context, const char *key,
+ int key_len, char **dest, int *dest_len);
+/**
+ * Parse a string with comma-separated key=value pairs. The value strings
+ * may be quoted and may contain escaped characters within quoted strings.
+ *
+ * @param str the string to parse
+ * @param callback_get_buf function that returns where to store the
+ * unescaped value string.
+ * @param context the opaque context pointer to pass to callback_get_buf
+ */
+void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
+ void *context);
+
#endif /* AVFORMAT_INTERNAL_H */