36 return m ? m->
count : 0;
48 i = prev - m->
elems + 1;
52 for (; i < m->
count; i++) {
55 for (j = 0; s[j] == key[j] && key[j]; j++)
110 int len = strlen(oldval) + strlen(value) + 1;
130 if (m && !m->
count) {
143 snprintf(valuestr,
sizeof(valuestr),
"%"PRId64, value);
148 const char *key_val_sep,
const char *pairs_sep,
155 if (key && *key && strspn(*buf, key_val_sep)) {
160 if (key && *key && val && *val)
172 const char *key_val_sep,
const char *pairs_sep,
217 const char key_val_sep,
const char pairs_sep)
222 char special_chars[] = {pairs_sep, key_val_sep,
'\0'};
224 if (!buffer || pairs_sep ==
'\0' || key_val_sep ==
'\0' || pairs_sep == key_val_sep ||
225 pairs_sep ==
'\\' || key_val_sep ==
'\\')
230 return *buffer ? 0 :
AVERROR(ENOMEM);
253 static void test_separators(
const AVDictionary *m,
const char pair,
const char val)
256 char pairs[] = {pair ,
'\0'};
257 char vals[] = {
val,
'\0'};
263 printf(
"%s\n", buffer);
276 printf(
"Testing av_dict_get_string() and av_dict_parse_string()\n");
278 printf(
"%s\n", buffer);
287 test_separators(dict,
',',
'=');
293 test_separators(dict,
'"',
'=');
294 test_separators(dict,
'\'',
'=');
295 test_separators(dict,
',',
'"');
296 test_separators(dict,
',',
'\'');
297 test_separators(dict,
'\'',
'"');
298 test_separators(dict,
'"',
'\'');