Revision 7a79e51c libavutil/tree.h
libavutil/tree.h | ||
---|---|---|
61 | 61 |
* This allows the use of flat arrays, which have |
62 | 62 |
* lower overhead compared to many malloced elements. |
63 | 63 |
* You might want to define a function like: |
64 |
* @code |
|
64 | 65 |
* void *tree_insert(struct AVTreeNode **rootp, void *key, int (*cmp)(void *key, const void *b), AVTreeNode **next){ |
65 | 66 |
* if(!*next) *next= av_mallocz(av_tree_node_size); |
66 | 67 |
* return av_tree_insert(rootp, key, cmp, next); |
... | ... | |
69 | 70 |
* if(*next) av_freep(next); |
70 | 71 |
* return av_tree_insert(rootp, key, cmp, next); |
71 | 72 |
* } |
72 |
* |
|
73 |
* @endcode
|
|
73 | 74 |
* @return If no insertion happened, the found element; if an insertion or |
74 | 75 |
* removal happened, then either key or NULL will be returned. |
75 | 76 |
* Which one it is depends on the tree state and the implementation. You |
Also available in: Unified diff