Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
8c28e01d
Commit
8c28e01d
authored
Jul 08, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dict: extend documentation.
parent
fdaf1d06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
dict.h
libavutil/dict.h
+36
-3
No files found.
libavutil/dict.h
View file @
8c28e01d
...
@@ -25,10 +25,42 @@
...
@@ -25,10 +25,42 @@
#ifndef AVUTIL_DICT_H
#ifndef AVUTIL_DICT_H
#define AVUTIL_DICT_H
#define AVUTIL_DICT_H
/**
* @defgroup dict_api Public Dictionary API
* @{
* Dictionaries are used for storing key:value pairs. To create
* an AVDictionary, simply pass an address of a NULL pointer to
* av_dict_set(). NULL can be used as an empty dictionary wherever
* a pointer to an AVDictionary is required.
* Use av_dict_get() to retrieve an entry or iterate over all
* entries and finally av_dict_free() to free the dictionary
* and all its contents.
*
* @code
* AVDictionary *d = NULL; // "create" an empty dictionary
* av_dict_set(&d, "foo", "bar", 0); // add an entry
*
* char *k = av_strdup("key"); // if your strings are already allocated,
* char *v = av_strdup("value"); // you can avoid copying them like this
* av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
*
* AVDictionaryEntry *t = NULL;
* while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
* <....> // iterate over all entries in d
* }
*
* av_dict_free(&d);
* @endcode
*
* @}
*/
#define AV_DICT_MATCH_CASE 1
#define AV_DICT_MATCH_CASE 1
#define AV_DICT_IGNORE_SUFFIX 2
#define AV_DICT_IGNORE_SUFFIX 2
#define AV_DICT_DONT_STRDUP_KEY 4
#define AV_DICT_DONT_STRDUP_KEY 4
/**< Take ownership of a key that's been
#define AV_DICT_DONT_STRDUP_VAL 8
allocated with av_malloc() and children. */
#define AV_DICT_DONT_STRDUP_VAL 8
/**< Take ownership of a value that's been
allocated with av_malloc() and chilren. */
#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries.
#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries.
#define AV_DICT_APPEND 32
/**< If the entry already exists, append to it. Note that no
#define AV_DICT_APPEND 32
/**< If the entry already exists, append to it. Note that no
delimiter is added, the strings are simply concatenated. */
delimiter is added, the strings are simply concatenated. */
...
@@ -74,7 +106,8 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags
...
@@ -74,7 +106,8 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags
void
av_dict_copy
(
AVDictionary
**
dst
,
AVDictionary
*
src
,
int
flags
);
void
av_dict_copy
(
AVDictionary
**
dst
,
AVDictionary
*
src
,
int
flags
);
/**
/**
* Free all the memory allocated for an AVDictionary struct.
* Free all the memory allocated for an AVDictionary struct
* and all keys and values.
*/
*/
void
av_dict_free
(
AVDictionary
**
m
);
void
av_dict_free
(
AVDictionary
**
m
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment