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

               const AVIOInterruptCB *int_cb, AVDictionary **options)

{

    int ret = ffurl_alloc(puc, filename, flags, int_cb);

    if (ret < 0)

        return ret;

    if (options && (*puc)->prot->priv_data_class &&

        (ret = av_opt_set_dict((*puc)->priv_data, options)) < 0)

        goto fail;

    if ((ret = av_opt_set_dict(*puc, options)) < 0)

        goto fail;

    ret = ffurl_connect(*puc, options);

    if (!ret)

        return 0;

fail:

    ffurl_close(*puc);

    *puc = NULL;

    return ret;

}

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

               const AVIOInterruptCB *int_cb, AVDictionary **options)

{

    int ret = ffurl_alloc(puc, filename, flags, int_cb);

    if (ret < 0)

        return ret;

    if (options && (*puc)->prot->priv_data_class &&

        (ret = av_opt_set_dict((*puc)->priv_data, options)) < 0)

        goto fail;

    if ((ret = av_opt_set_dict(*puc, options)) < 0)

        goto fail;

    ret = ffurl_connect(*puc, options);

    if (!ret)

        return 0;

fail:

    ffurl_close(*puc);

    *puc = NULL;

    return ret;

}

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

               const AVIOInterruptCB *VAR_3, AVDictionary **VAR_4)

{

    int VAR_5 = ffurl_alloc(VAR_0, VAR_1, VAR_2, VAR_3);

    if (VAR_5 < 0)

        return VAR_5;

    if (VAR_4 && (*VAR_0)->prot->priv_data_class &&

        (VAR_5 = av_opt_set_dict((*VAR_0)->priv_data, VAR_4)) < 0)

        goto fail;

    if ((VAR_5 = av_opt_set_dict(*VAR_0, VAR_4)) < 0)

        goto fail;

    VAR_5 = ffurl_connect(*VAR_0, VAR_4);

    if (!VAR_5)

        return 0;

fail:

    ffurl_close(*VAR_0);

    *VAR_0 = NULL;

    return VAR_5;

}

int FUNC_0(URLContext **VAR_0, const char *VAR_1, int VAR_2,
const AVIOInterruptCB *VAR_3, AVDictionary **VAR_4)
{ int VAR_5 = ffurl_alloc(VAR_0, VAR_1, VAR_2, VAR_3); if (VAR_5 < 0)
return VAR_5; if (VAR_4 && (*VAR_0)->prot->priv_data_class &&
(VAR_5 = av_opt_set_dict((*VAR_0)->priv_data, VAR_4)) < 0)
goto fail; if ((VAR_5 = av_opt_set_dict(*VAR_0, VAR_4)) < 0)
goto fail; VAR_5 = ffurl_connect(*VAR_0, VAR_4); if (!VAR_5)
return 0; fail:
ffurl_close(*VAR_0); *VAR_0 = NULL; return VAR_5; }