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 !=
'\'')
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,
':');
290 return c >=
'0' && c <=
'9';
295 return c > 32 && c < 127;
300 return c ==
' ' || c ==
'\f' || c ==
'\n' || c ==
'\r' || c ==
'\t' ||
307 return av_isdigit(c) || (c >=
'a' && c <=
'f');
315 static const char *
const strings[] = {
331 "'foo : ' :blahblah",
337 " foo bar : blahblah",
339 "'foo : \\ \\ ' : blahblah",
340 "'\\fo\\o:': blahblah",
341 "\\'fo\\o\\:': foo ' :blahblah"
344 printf(
"Testing av_get_token()\n");
346 const char *p = strings[i];
350 printf(
" -> |%s|", q);
351 printf(
" + |%s|\n", p);