static int file_open(URLContext *h, const char *filename, int flags)

{

    int access;

    int fd;



    av_strstart(filename, "file:", &filename);



    if (flags & URL_RDWR) {

        access = O_CREAT | O_TRUNC | O_RDWR;

    } else if (flags & URL_WRONLY) {

        access = O_CREAT | O_TRUNC | O_WRONLY;

    } else {

        access = O_RDONLY;

    }

#if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__)

    access |= O_BINARY;

#endif

    fd = open(filename, access, 0666);

    if (fd < 0)

        return AVERROR(ENOENT);

    h->priv_data = (void *)(size_t)fd;

    return 0;

}

static int file_open(URLContext *h, const char *filename, int flags)

{

    int access;

    int fd;



    av_strstart(filename, "file:", &filename);



    if (flags & URL_RDWR) {

        access = O_CREAT | O_TRUNC | O_RDWR;

    } else if (flags & URL_WRONLY) {

        access = O_CREAT | O_TRUNC | O_WRONLY;

    } else {

        access = O_RDONLY;

    }

#if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__)

    access |= O_BINARY;

#endif

    fd = open(filename, access, 0666);

    if (fd < 0)

        return AVERROR(ENOENT);

    h->priv_data = (void *)(size_t)fd;

    return 0;

}

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

{

    int VAR_3;

    int VAR_4;



    av_strstart(VAR_1, "file:", &VAR_1);



    if (VAR_2 & URL_RDWR) {

        VAR_3 = O_CREAT | O_TRUNC | O_RDWR;

    } else if (VAR_2 & URL_WRONLY) {

        VAR_3 = O_CREAT | O_TRUNC | O_WRONLY;

    } else {

        VAR_3 = O_RDONLY;

    }

#if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__)

    VAR_3 |= O_BINARY;

#endif

    VAR_4 = open(VAR_1, VAR_3, 0666);

    if (VAR_4 < 0)

        return AVERROR(ENOENT);

    VAR_0->priv_data = (void *)(size_t)VAR_4;

    return 0;

}

static int FUNC_0(URLContext *VAR_0, const char *VAR_1, int VAR_2)
{ int VAR_3; int VAR_4; av_strstart(VAR_1, "file:", &VAR_1); if (VAR_2 & URL_RDWR) { VAR_3 = O_CREAT | O_TRUNC | O_RDWR; } else if (VAR_2 & URL_WRONLY) { VAR_3 = O_CREAT | O_TRUNC | O_WRONLY; } else { VAR_3 = O_RDONLY; } #if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__)
VAR_3 |= O_BINARY; #endif
VAR_4 = open(VAR_1, VAR_3, 0666); if (VAR_4 < 0)
return AVERROR(ENOENT); VAR_0->priv_data = (void *)(size_t)VAR_4; return 0; }