32 int av_strstart(
const char *str,
const char *pfx,
const char **ptr)
34 while (*pfx && *pfx == *str) {
43 int av_stristart(
const char *str,
const char *pfx,
const char **ptr)
45 while (*pfx && toupper((
unsigned)*pfx) == toupper((
unsigned)*str)) {
57 return (
char*)(intptr_t)s1;
61 return (
char*)(intptr_t)s1;
70 while (++len < size && *src)
74 return len + strlen(src) - 1;
79 size_t len = strlen(dst);
81 return len + strlen(src);
82 return len +
av_strlcpy(dst + len, src, size - len);
87 int len = strlen(dst);
91 len +=
vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
130 #define WHITESPACES " \n\t"
135 char *ret= out, *
end= out;
136 const char *p = *
buf;
137 if (!out)
return NULL;
140 while(*p && !strspn(p, term)) {
146 while(*p && *p !=
'\'')
166 char *
av_strtok(
char *s,
const char *delim,
char **saveptr)
170 if (!s && !(s = *saveptr))
174 s += strspn(s, delim);
184 s += strcspn(s, delim);
201 }
while (c1 && c1 == c2);
207 const char *
end = a + n;
212 }
while (a < end && c1 && c1 == c2);
218 char *p = strrchr(path,
'/');
221 char *q = strrchr(path,
'\\');
222 char *d = strchr(path,
':');
235 char *p = strrchr(path,
'/');
238 char *q = strrchr(path,
'\\');
239 char *d = strchr(path,
':');
263 printf(
"Testing av_get_token()\n");
265 const char *strings[] = {
281 "'foo : ' :blahblah",
287 " foo bar : blahblah",
289 "'foo : \\ \\ ' : blahblah",
290 "'\\fo\\o:': blahblah",
291 "\\'fo\\o\\:': foo ' :blahblah"
295 const char *p = strings[i];
299 printf(
" -> |%s|", q);
300 printf(
" + |%s|\n", p);