#include "config.h"
#include "avutil.h"
#include "file_open.h"
#include "mem.h"
#include <stdarg.h>
#include <fcntl.h>
#include <sys/stat.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_IO_H
#include <io.h>
#endif
#ifdef _WIN32
#undef open
#undef lseek
#undef stat
#undef fstat
#include <windows.h>
#include <share.h>
#include <errno.h>
#include "wchar_filename.h"
static int win32_open(const char *filename_utf8, int oflag, int pmode)
{
int fd;
wchar_t *filename_w;
if (get_extended_win32_path(filename_utf8, &filename_w))
return -1;
if (!filename_w)
goto fallback;
fd = _wsopen(filename_w, oflag, SH_DENYNO, pmode);
av_freep(&filename_w);
if (fd != -1 || (oflag & O_CREAT))
return fd;
fallback:
return _sopen(filename_utf8, oflag, SH_DENYNO, pmode);
}
#define open …
#endif
int avpriv_open(const char *filename, int flags, ...)
{ … }
FileLogContext;
static const AVClass file_log_ctx_class = …;
int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx)
{ … }
FILE *avpriv_fopen_utf8(const char *path, const char *mode)
{ … }