MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / av_get_token

Function av_get_token

libavutil/avstring.c:143–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141#define WHITESPACES " \n\t\r"
142
143char *av_get_token(const char **buf, const char *term)
144{
145 char *out = av_realloc(NULL, strlen(*buf) + 1);
146 char *ret = out, *end = out;
147 const char *p = *buf;
148 if (!out)
149 return NULL;
150 p += strspn(p, WHITESPACES);
151
152 while (*p && !strspn(p, term)) {
153 char c = *p++;
154 if (c == '\\' && *p) {
155 *out++ = *p++;
156 end = out;
157 } else if (c == '\'') {
158 while (*p && *p != '\'')
159 *out++ = *p++;
160 if (*p) {
161 p++;
162 end = out;
163 }
164 } else {
165 *out++ = c;
166 }
167 }
168
169 do
170 *out-- = 0;
171 while (out >= end && strspn(out, WHITESPACES));
172
173 *buf = p;
174
175 char *small_ret = av_realloc(ret, out - ret + 2);
176 return small_ret ? small_ret : ret;
177}
178
179char *av_strtok(char *s, const char *delim, char **saveptr)
180{

Callers 15

process_lineFunction · 0.85
tee_write_headerFunction · 0.85
rtp_openFunction · 0.85
concatf_openFunction · 0.85
ip_parse_addr_listFunction · 0.85
concat_parse_scriptFunction · 0.85
tee_openFunction · 0.85
parse_key_value_pairFunction · 0.85
parse_key_value_pairFunction · 0.85
av_opt_get_key_valueFunction · 0.85
mainFunction · 0.85
opt_mapFunction · 0.85

Calls 1

av_reallocFunction · 0.70

Tested by 1

mainFunction · 0.68