29 #include "libavutil/avstring.h"
37 const char *authorization,
const char *hostname,
38 int port,
const char *
fmt, ...)
47 if (authorization && authorization[0])
49 #if CONFIG_NETWORK && defined(AF_INET6)
54 if (ai->ai_family == AF_INET6) {
71 int len = strlen(str);
74 vsnprintf(str + len, size > len ? size - len : 0, fmt, vl);
83 char *sep, *path_query;
85 if (base && strstr(base,
"://") && rel[0] ==
'/') {
88 sep = strstr(buf,
"://");
96 sep = strchr(sep,
'/');
105 if (!base || strstr(rel,
"://") || rel[0] ==
'/') {
113 path_query = strchr(buf,
'?');
114 if (path_query != NULL)
124 sep = strrchr(buf,
'/');
132 sep = strrchr(buf,
'/');
134 if (!strcmp(sep ? &sep[1] : buf,
"..")) {
void ff_make_absolute_url(char *buf, int size, const char *base, const char *rel)
Convert a relative url into an absolute url, given a base url.
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.
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
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.
unbuffered private I/O API
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...) av_printf_format(3
Append output to a string, according to a format.