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++)
106 int len = strlen(oldval) + strlen(value) + 1;
139 snprintf(valuestr,
sizeof(valuestr),
"%"PRId64, value);
144 const char *key_val_sep,
const char *pairs_sep,
151 if (key && *key && strspn(*buf, key_val_sep)) {
156 if (key && *key && val && *val)
168 const char *key_val_sep,
const char *pairs_sep,
213 const char key_val_sep,
const char pairs_sep)
218 char special_chars[] = {pairs_sep, key_val_sep,
'\0'};
220 if (!buffer || pairs_sep ==
'\0' || key_val_sep ==
'\0' || pairs_sep == key_val_sep ||
221 pairs_sep ==
'\\' || key_val_sep ==
'\\')
226 return *buffer ? 0 :
AVERROR(ENOMEM);
249 static void test_separators(
const AVDictionary *m,
const char pair,
const char val)
252 char pairs[] = {pair ,
'\0'};
253 char vals[] = {
val,
'\0'};
259 printf(
"%s\n", buffer);
272 printf(
"Testing av_dict_get_string() and av_dict_parse_string()\n");
274 printf(
"%s\n", buffer);
283 test_separators(dict,
',',
'=');
289 test_separators(dict,
'"',
'=');
290 test_separators(dict,
'\'',
'=');
291 test_separators(dict,
',',
'"');
292 test_separators(dict,
',',
'\'');
293 test_separators(dict,
'\'',
'"');
294 test_separators(dict,
'"',
'\'');