33 int av_strstart(
const char *str,
const char *pfx,
const char **ptr)
35 while (*pfx && *pfx == *str) {
44 int av_stristart(
const char *str,
const char *pfx,
const char **ptr)
58 return (
char*)(intptr_t)s1;
62 return (
char*)(intptr_t)s1;
68 char *
av_strnstr(
const char *haystack,
const char *needle,
size_t hay_length)
70 size_t needle_len = strlen(needle);
72 return (
char*)haystack;
73 while (hay_length >= needle_len) {
75 if (!memcmp(haystack, needle, needle_len))
76 return (
char*)haystack;
85 while (++len < size && *src)
89 return len + strlen(src) - 1;
94 size_t len = strlen(dst);
96 return len + strlen(src);
97 return len +
av_strlcpy(dst + len, src, size - len);
102 int len = strlen(dst);
106 len +=
vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
146 #define WHITESPACES " \n\t"
152 const char *p = *
buf;
157 while (*p && !strspn(p, term)) {
159 if (c ==
'\\' && *p) {
162 }
else if (c ==
'\'') {
163 while (*p && *p !=
'\'')
183 char *
av_strtok(
char *s,
const char *delim,
char **saveptr)
187 if (!s && !(s = *saveptr))
191 s += strspn(s, delim);
201 s += strcspn(s, delim);
218 }
while (c1 && c1 == c2);
224 const char *
end = a + n;
229 }
while (a < end && c1 && c1 == c2);
235 char *p = strrchr(path,
'/');
238 char *q = strrchr(path,
'\\');
239 char *d = strchr(path,
':');
252 char *p = strrchr(path,
'/');
255 char *q = strrchr(path,
'\\');
256 char *d = strchr(path,
':');
293 const char *strings[] = {
309 "'foo : ' :blahblah",
315 " foo bar : blahblah",
317 "'foo : \\ \\ ' : blahblah",
318 "'\\fo\\o:': blahblah",
319 "\\'fo\\o\\:': foo ' :blahblah"
322 printf(
"Testing av_get_token()\n");
324 const char *p = strings[i];
328 printf(
" -> |%s|", q);
329 printf(
" + |%s|\n", p);