1 /*
2 * copyright (c) 2009 Michael Niedermayer
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <string.h>
22
27
31 };
32
34 {
35 return m ? m->
count : 0;
36 }
37
40 {
41 unsigned int i, j;
42
43 if(!m)
44 return NULL;
45
46 if(prev) i= prev - m->
elems + 1;
47 else i= 0;
48
49 for(; i<m->
count; i++){
53 if(key[j])
54 continue;
56 continue;
58 }
59 return NULL;
60 }
61
63 {
66 char *oldval = NULL;
67
68 if(!m)
70
71 if(tag) {
73 return 0;
76 else
80 } else {
82 if(tmp) {
84 } else
86 }
87 if (value) {
90 } else
95 int len = strlen(oldval) + strlen(value) + 1;
97 if (!newval)
103 } else
106 }
110 }
111
112 return 0;
113 }
114
116 const char *key_val_sep, const char *pairs_sep,
118 {
122
123 if (key && *key && strspn(*buf, key_val_sep)) {
124 (*buf)++;
126 }
127
128 if (key && *key && val && *val)
130 else
132
135
137 }
138
140 const char *key_val_sep, const char *pairs_sep,
142 {
144
145 if (!str)
146 return 0;
147
148 /* ignore STRDUP flags */
150
151 while (*str) {
153 return ret;
154
155 if (*str)
156 str++;
157 }
158
159 return 0;
160 }
161
163 {
165
166 if (m) {
170 }
172 }
174 }
175
177 {
179
182 }