38 const char *authorization,
const char *hostname,
39 int port,
const char *fmt, ...)
48 if (authorization && authorization[0])
50 #if CONFIG_NETWORK && defined(AF_INET6) 55 if (ai->ai_family == AF_INET6) {
72 size_t len = strlen(str);
75 vsnprintf(str + len, size > len ? size - len : 0, fmt, vl);
84 const char *root = rel;
90 if (p && (sep = strstr(p,
"://"))) {
92 root = strchr(sep,
'/');
99 while (p && (node = strstr(p,
".."))) {
100 av_strlcat(tmp_path, p, node - p + strlen(tmp_path));
102 sep = strrchr(tmp_path,
'/');
125 char *sep, *path_query;
129 memset(tmp_path, 0,
sizeof(tmp_path));
131 if (base && strstr(base,
"://") && rel[0] ==
'/') {
134 sep = strstr(buf,
"://");
142 sep = strchr(sep,
'/');
149 memset(buf, 0, size);
154 if (!base || strstr(rel,
"://") || rel[0] ==
'/') {
155 memset(buf, 0, size);
163 path_query = strchr(buf,
'?');
171 memset(buf, 0, size);
178 if (p && strstr(p,
"://")) {
179 sep = strstr(p,
"://");
182 root = strchr(sep,
'/');
189 sep = strrchr(buf,
'/');
190 if (sep && sep <= root)
201 sep = strrchr(buf,
'/');
205 if (!strcmp(sep ? &sep[1] : buf,
"..")) {
219 memset(buf, 0, size);
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.
int64_t filemode
Unix file mode, -1 if unknown.
Describes single entry of the directory.
int64_t modification_timestamp
Time of last modification in microseconds since unix epoch, -1 if unknown.
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.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
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.
int64_t access_timestamp
Time of last access in microseconds since unix epoch, -1 if unknown.
static void trim_double_dot_url(char *buf, const char *rel, int size)
int64_t size
File size in bytes, -1 if unknown.
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
int type
Type of the entry.
int64_t group_id
Group ID of owner, -1 if unknown.
size_t av_strlcatf(char *dst, size_t size, 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.
int64_t status_change_timestamp
Time of last status change in microseconds since unix epoch, -1 if unknown.
AVIODirEntry * ff_alloc_dir_entry(void)
Allocate directory entry with default values.
int64_t user_id
User ID of owner, -1 if unknown.
unbuffered private I/O API