22 #ifndef AVFORMAT_OS_SUPPORT_H 23 #define AVFORMAT_OS_SUPPORT_H 43 #if defined(_WIN32) && !defined(__MINGW32CE__) 46 # define lseek(f,p,w) _lseeki64((f), (p), (w)) 48 # define stat _stati64 50 # define fstat(f,s) _fstati64((f), (s)) 56 if (path[0] && path[1] ==
':')
62 #if defined(__OS2__) || defined(__Plan9__) 69 #define SHUT_RD SD_RECEIVE 70 #define SHUT_WR SD_SEND 71 #define SHUT_RDWR SD_BOTH 74 #define S_IRUSR S_IREAD 77 #define S_IWUSR S_IWRITE 83 typedef int socklen_t;
88 #define closesocket close 92 typedef unsigned long nfds_t;
97 #if !HAVE_STRUCT_POLLFD 105 #define POLLIN 0x0001 106 #define POLLOUT 0x0002 107 #define POLLRDNORM POLLIN 108 #define POLLWRNORM POLLOUT 109 #define POLLRDBAND 0x0008 110 #define POLLWRBAND 0x0010 111 #define POLLPRI 0x0020 114 #define POLLERR 0x0004 115 #define POLLHUP 0x0080 116 #define POLLNVAL 0x1000 120 int ff_poll(
struct pollfd *fds, nfds_t numfds,
int timeout);
125 #if defined(__MINGW32CE__) 126 #define mkdir(a, b) _mkdir(a) 127 #elif defined(_WIN32) 133 #include <winapifamily.h> 136 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 137 #define USE_MOVEFILEEXA 141 #define USE_MOVEFILEEXA 144 #define DEF_FS_FUNCTION(name, wfunc, afunc) \ 145 static inline int win32_##name(const char *filename_utf8) \ 147 wchar_t *filename_w; \ 150 if (utf8towchar(filename_utf8, &filename_w)) \ 155 ret = wfunc(filename_w); \ 156 av_free(filename_w); \ 161 return afunc(filename_utf8); \ 164 DEF_FS_FUNCTION(unlink, _wunlink, _unlink)
165 DEF_FS_FUNCTION(mkdir, _wmkdir, _mkdir)
166 DEF_FS_FUNCTION(rmdir, _wrmdir , _rmdir)
168 static inline int win32_rename(
const char *src_utf8,
const char *dest_utf8)
170 wchar_t *src_w, *dest_w;
173 if (utf8towchar(src_utf8, &src_w))
175 if (utf8towchar(dest_utf8, &dest_w)) {
179 if (!src_w || !dest_w) {
185 ret = MoveFileExW(src_w, dest_w, MOVEFILE_REPLACE_EXISTING);
195 #ifdef USE_MOVEFILEEXA 196 ret = MoveFileExA(src_utf8, dest_utf8, MOVEFILE_REPLACE_EXISTING);
208 ret = rename(src_utf8, dest_utf8);
213 #define mkdir(a, b) win32_mkdir(a) 214 #define rename win32_rename 215 #define rmdir win32_rmdir 216 #define unlink win32_unlink
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static int is_dos_path(const char *path)