diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2013-01-02 21:04:23 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-01-25 17:20:03 +0100 |
commit | 38c1466ca41c73c7ce347da702362cb69c151716 (patch) | |
tree | d797243061d8be4d957c8c06ce5efc16acb90234 /libavutil/dict.h | |
parent | 5ea5ffc9cee1b91eed471fff2f51d771222cf8d2 (diff) | |
download | ffmpeg-38c1466ca41c73c7ce347da702362cb69c151716.tar.gz |
dict: add av_dict_parse_string()
Can be used to set multiple key/value pairs from a string.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavutil/dict.h')
-rw-r--r-- | libavutil/dict.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavutil/dict.h b/libavutil/dict.h index 492da9a41c..ab23f26e6f 100644 --- a/libavutil/dict.h +++ b/libavutil/dict.h @@ -107,6 +107,23 @@ int av_dict_count(const AVDictionary *m); int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags); /** + * Parse the key/value pairs list and add to a dictionary. + * + * @param key_val_sep a 0-terminated list of characters used to separate + * key from value + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other + * @param flags flags to use when adding to dictionary. + * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL + * are ignored since the key/value tokens will always + * be duplicated. + * @return 0 on success, negative AVERROR code on failure + */ +int av_dict_parse_string(AVDictionary **pm, const char *str, + const char *key_val_sep, const char *pairs_sep, + int flags); + +/** * Copy entries from one AVDictionary struct into another. * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, * this function will allocate a struct for you and put it in *dst |