37 return m ? m->
count : 0;
49 i = prev - m->
elems + 1;
53 for (; i < m->
count; i++) {
56 for (j = 0; s[j] == key[j] && key[j]; j++)
75 char *oldval =
NULL, *copy_key =
NULL, *copy_value =
NULL;
81 copy_key = (
void *)key;
85 copy_value = (
void *)value;
90 if (!m || (key && !copy_key) || (value && !copy_value))
105 }
else if (copy_value) {
116 size_t len = strlen(oldval) + strlen(copy_value) + 1;
138 if (m && !m->
count) {
151 snprintf(valuestr,
sizeof(valuestr),
"%"PRId64, value);
157 const char *key_val_sep,
const char *pairs_sep,
164 if (key && *key && strspn(*buf, key_val_sep)) {
169 if (key && *key && val && *val)
181 const char *key_val_sep,
const char *pairs_sep,
231 const char key_val_sep,
const char pairs_sep)
236 char special_chars[] = {pairs_sep, key_val_sep,
'\0'};
238 if (!buffer || pairs_sep ==
'\0' || key_val_sep ==
'\0' || pairs_sep == key_val_sep ||
239 pairs_sep ==
'\\' || key_val_sep ==
'\\')
244 return *buffer ? 0 :
AVERROR(ENOMEM);
260 time_t seconds = timestamp / 1000000;
261 struct tm *ptm, tmbuf;
265 if (!strftime(buf,
sizeof(buf),
"%Y-%m-%dT%H:%M:%S", ptm))
267 av_strlcatf(buf,
sizeof(buf),
".%06dZ", (
int)(timestamp % 1000000));
const char const char void * val
void * av_realloc(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory.
Memory handling functions.
#define AV_DICT_DONT_OVERWRITE
Don't overwrite existing entries.
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
int av_dict_get_string(const AVDictionary *m, char **buffer, const char key_val_sep, const char pairs_sep)
Get dictionary entries as a string.
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
#define AV_DICT_DONT_STRDUP_KEY
Take ownership of a key that's been allocated with av_malloc() or another memory allocation function...
int avpriv_dict_set_timestamp(AVDictionary **dict, const char *key, int64_t timestamp)
Set a dictionary value to an ISO-8601 compliant timestamp string.
#define AV_DICT_MULTIKEY
Allow to store several equal keys in the dictionary.
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size)
Append data to a print buffer.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AV_DICT_MATCH_CASE
Only get an entry with exact-case key match.
#define AV_BPRINT_SIZE_UNLIMITED
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
char * av_get_token(const char **buf, const char *term)
Unescape the given string until a non escaped terminating char, and return the token corresponding to...
static struct tm * gmtime_r(const time_t *clock, struct tm *result)
common internal API header
AVDictionaryEntry * elems
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
GLsizei GLboolean const GLfloat * value
#define AV_DICT_APPEND
If the entry already exists, append to it.
int av_dict_parse_string(AVDictionary **pm, const char *str, const char *key_val_sep, const char *pairs_sep, int flags)
Parse the key/value pairs list and add the parsed entries to a dictionary.
char * av_strdup(const char *s)
Duplicate a string.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
static av_const int av_toupper(int c)
Locale-independent conversion of ASCII characters to uppercase.
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars, enum AVEscapeMode mode, int flags)
Escape the content in src and append it to dstbuf.
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set that converts the value to a string and stores it...
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string.
#define AVERROR_EXTERNAL
Generic error in an external library.
static int parse_key_value_pair(AVDictionary **pm, const char **buf, const char *key_val_sep, const char *pairs_sep, int flags)