int ffurl_alloc(URLContext **puc, const char *filename, int flags,

                const AVIOInterruptCB *int_cb)

{

    URLProtocol *up = NULL;

    char proto_str[128], proto_nested[128], *ptr;

    size_t proto_len = strspn(filename, URL_SCHEME_CHARS);



    if (filename[proto_len] != ':' || is_dos_path(filename))

        strcpy(proto_str, "file");

    else

        av_strlcpy(proto_str, filename,

                   FFMIN(proto_len + 1, sizeof(proto_str)));



    av_strlcpy(proto_nested, proto_str, sizeof(proto_nested));

    if ((ptr = strchr(proto_nested, '+')))

        *ptr = '\0';



    while (up = ffurl_protocol_next(up)) {

        if (!strcmp(proto_str, up->name))

            return url_alloc_for_protocol(puc, up, filename, flags, int_cb);

        if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&

            !strcmp(proto_nested, up->name))

            return url_alloc_for_protocol(puc, up, filename, flags, int_cb);

    }

    *puc = NULL;

    return AVERROR_PROTOCOL_NOT_FOUND;

}

int ffurl_alloc(URLContext **puc, const char *filename, int flags,

                const AVIOInterruptCB *int_cb)

{

    URLProtocol *up = NULL;

    char proto_str[128], proto_nested[128], *ptr;

    size_t proto_len = strspn(filename, URL_SCHEME_CHARS);



    if (filename[proto_len] != ':' || is_dos_path(filename))

        strcpy(proto_str, "file");

    else

        av_strlcpy(proto_str, filename,

                   FFMIN(proto_len + 1, sizeof(proto_str)));



    av_strlcpy(proto_nested, proto_str, sizeof(proto_nested));

    if ((ptr = strchr(proto_nested, '+')))

        *ptr = '\0';



    while (up = ffurl_protocol_next(up)) {

        if (!strcmp(proto_str, up->name))

            return url_alloc_for_protocol(puc, up, filename, flags, int_cb);

        if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&

            !strcmp(proto_nested, up->name))

            return url_alloc_for_protocol(puc, up, filename, flags, int_cb);

    }

    *puc = NULL;

    return AVERROR_PROTOCOL_NOT_FOUND;

}

int FUNC_0(URLContext **VAR_0, const char *VAR_1, int VAR_2,

                const AVIOInterruptCB *VAR_3)

{

    URLProtocol *up = NULL;

    char VAR_4[128], VAR_5[128], *VAR_6;

    size_t proto_len = strspn(VAR_1, URL_SCHEME_CHARS);



    if (VAR_1[proto_len] != ':' || is_dos_path(VAR_1))

        strcpy(VAR_4, "file");

    else

        av_strlcpy(VAR_4, VAR_1,

                   FFMIN(proto_len + 1, sizeof(VAR_4)));



    av_strlcpy(VAR_5, VAR_4, sizeof(VAR_5));

    if ((VAR_6 = strchr(VAR_5, '+')))

        *VAR_6 = '\0';



    while (up = ffurl_protocol_next(up)) {

        if (!strcmp(VAR_4, up->name))

            return url_alloc_for_protocol(VAR_0, up, VAR_1, VAR_2, VAR_3);

        if (up->VAR_2 & URL_PROTOCOL_FLAG_NESTED_SCHEME &&

            !strcmp(VAR_5, up->name))

            return url_alloc_for_protocol(VAR_0, up, VAR_1, VAR_2, VAR_3);

    }

    *VAR_0 = NULL;

    return AVERROR_PROTOCOL_NOT_FOUND;

}

int FUNC_0(URLContext **VAR_0, const char *VAR_1, int VAR_2,
const AVIOInterruptCB *VAR_3)
{ URLProtocol *up = NULL; char VAR_4[128], VAR_5[128], *VAR_6; size_t proto_len = strspn(VAR_1, URL_SCHEME_CHARS); if (VAR_1[proto_len] != ':' || is_dos_path(VAR_1))
strcpy(VAR_4, "file"); else
av_strlcpy(VAR_4, VAR_1,
FFMIN(proto_len + 1, sizeof(VAR_4))); av_strlcpy(VAR_5, VAR_4, sizeof(VAR_5)); if ((VAR_6 = strchr(VAR_5, '+')))
*VAR_6 = '\0'; while (up = ffurl_protocol_next(up)) { if (!strcmp(VAR_4, up->name))
return url_alloc_for_protocol(VAR_0, up, VAR_1, VAR_2, VAR_3); if (up->VAR_2 & URL_PROTOCOL_FLAG_NESTED_SCHEME &&
!strcmp(VAR_5, up->name))
return url_alloc_for_protocol(VAR_0, up, VAR_1, VAR_2, VAR_3); } *VAR_0 = NULL; return AVERROR_PROTOCOL_NOT_FOUND; }