summaryrefslogtreecommitdiffstats
path: root/osdep/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/io.h')
-rw-r--r--osdep/io.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/osdep/io.h b/osdep/io.h
index 4cb16677f2..53097a1b78 100644
--- a/osdep/io.h
+++ b/osdep/io.h
@@ -20,12 +20,17 @@
#ifndef MPLAYER_OSDEP_IO
#define MPLAYER_OSDEP_IO
+#include "config.h"
#include <stdbool.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#if HAVE_GLOB
+#include <glob.h>
+#endif
+
#ifndef O_BINARY
#define O_BINARY 0
#endif
@@ -71,6 +76,18 @@ int mp_closedir(DIR *dir);
int mp_mkdir(const char *path, int mode);
char *mp_getenv(const char *name);
+typedef struct {
+ size_t gl_pathc;
+ char **gl_pathv;
+ size_t gl_offs;
+ void *ctx;
+} mp_glob_t;
+
+// glob-win.c
+int mp_glob(const char *restrict pattern, int flags,
+ int (*errfunc)(const char*, int), mp_glob_t *restrict pglob);
+void mp_globfree(mp_glob_t *pglob);
+
// NOTE: stat is not overridden with mp_stat, because MinGW-w64 defines it as
// macro.
@@ -85,6 +102,14 @@ char *mp_getenv(const char *name);
#define mkdir(...) mp_mkdir(__VA_ARGS__)
#define getenv(...) mp_getenv(__VA_ARGS__)
+#ifndef GLOB_NOMATCH
+#define GLOB_NOMATCH 3
+#endif
+
+#define glob_t mp_glob_t
+#define glob(...) mp_glob(__VA_ARGS__)
+#define globfree(...) mp_globfree(__VA_ARGS__)
+
#else /* __MINGW32__ */
#define mp_stat(...) stat(__VA_ARGS__)