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)
67 char *
av_strnstr(
const char *haystack,
const char *needle,
size_t hay_length)
69 size_t needle_len = strlen(needle);
72 while (hay_length >= needle_len) {
74 if (!memcmp(haystack, needle, needle_len))
84 while (++len < size && *src)
88 return len + strlen(src) - 1;
93 size_t len = strlen(dst);
95 return len + strlen(src);
96 return len +
av_strlcpy(dst + len, src, size - len);
101 int len = strlen(dst);
105 len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
115 snprintf(str, 16,
"%f", d);
119 #define WHITESPACES " \n\t" 124 char *ret =
out, *end =
out;
125 const char *p = *
buf;
130 while (*p && !strspn(p, term)) {
132 if (c ==
'\\' && *p) {
135 }
else if (c ==
'\'') {
136 while (*p && *p !=
'\'')
162 }
while (c1 && c1 == c2);
168 const char *end = a + n;
173 }
while (a < end && c1 && c1 == c2);
179 char *p = strrchr(path,
'/');
182 char *q = strrchr(path,
'\\');
183 char *d = strchr(path,
':');
196 char *p = strrchr(path,
'/');
199 char *q = strrchr(path,
'\\');
200 char *d = strchr(path,
':');
223 namelen = strlen(name);
224 while ((p = strchr(names,
','))) {
225 len =
FFMAX(p - names, namelen);
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
memory handling functions
char * av_stristr(const char *s1, const char *s2)
Locate the first case-independent occurrence in the string haystack of the string needle...
int av_strncasecmp(const char *a, const char *b, size_t n)
Locale-independent case-insensitive compare.
int av_stristart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str independent of case.
const char * av_basename(const char *path)
Thread safe basename.
static av_const int av_tolower(int c)
Locale-independent conversion of ASCII characters to lowercase.
int av_match_name(const char *name, const char *names)
Match instances of a name in a comma-separated list of names.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
char * av_get_token(const char **buf, const char *term)
Unescape the given string until a non escaped terminating char, and return the token corresponding to...
int av_strcasecmp(const char *a, const char *b)
AVFifoBuffer ** buf
single buffer for interleaved, per-channel buffers for planar
static av_const int av_toupper(int c)
Locale-independent conversion of ASCII characters to uppercase.
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
char * av_d2str(double d)
Convert a number to a av_malloced string.
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
char * av_strnstr(const char *haystack, const char *needle, size_t hay_length)
Locate the first occurrence of the string needle in the string haystack where not more than hay_lengt...
common internal and external API header
const char * av_dirname(char *path)
Thread safe dirname.