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)) {
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);
100 if(str) snprintf(str, 16,
"%f", d);
104 #define WHITESPACES " \n\t"
109 char *ret= out, *end= out;
110 const char *p = *
buf;
111 if (!out)
return NULL;
114 while(*p && !strspn(p, term)) {
120 while(*p && *p !=
'\'')
146 }
while (c1 && c1 == c2);
152 const char *end = a + n;
157 }
while (a < end && c1 && c1 == c2);
163 char *p = strrchr(path,
'/');
166 char *q = strrchr(path,
'\\');
167 char *d = strchr(path,
':');
180 char *p = strrchr(path,
'/');
183 char *q = strrchr(path,
'\\');
184 char *d = strchr(path,
':');
208 printf(
"Testing av_get_token()\n");
210 const char *strings[] = {
226 "'foo : ' :blahblah",
232 " foo bar : blahblah",
234 "'foo : \\ \\ ' : blahblah",
235 "'\\fo\\o:': blahblah",
236 "\\'fo\\o\\:': foo ' :blahblah"
240 const char *p = strings[i], *q;
243 printf(
" -> |%s|", q);
244 printf(
" + |%s|\n", p);
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 int av_tolower(int c)
Locale-independent conversion of ASCII characters to lowercase.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int main(int argc, char **argv)
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
#define FF_ARRAY_ELEMS(a)
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.
common internal and external API header
const char * av_dirname(char *path)
Thread safe dirname.