summaryrefslogtreecommitdiffstats
path: root/stream/stream_libarchive.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:36:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:36:56 +0000
commit51de1d8436100f725f3576aefa24a2bd2057bc28 (patch)
treec6d1d5264b6d40a8d7ca34129f36b7d61e188af3 /stream/stream_libarchive.h
parentInitial commit. (diff)
downloadmpv-51de1d8436100f725f3576aefa24a2bd2057bc28.tar.xz
mpv-51de1d8436100f725f3576aefa24a2bd2057bc28.zip
Adding upstream version 0.37.0.upstream/0.37.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--stream/stream_libarchive.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/stream/stream_libarchive.h b/stream/stream_libarchive.h
new file mode 100644
index 0000000..151e4ee
--- /dev/null
+++ b/stream/stream_libarchive.h
@@ -0,0 +1,35 @@
+#include <locale.h>
+#include "osdep/io.h"
+
+#ifdef __APPLE__
+# include <string.h>
+# include <xlocale.h>
+#endif
+
+struct mp_log;
+
+struct mp_archive {
+ locale_t locale;
+ struct mp_log *log;
+ struct archive *arch;
+ struct stream *primary_src;
+ char buffer[4096];
+ int flags;
+ int num_volumes; // INT_MAX if unknown (initial state)
+
+ // Current entry, as set by mp_archive_next_entry().
+ struct archive_entry *entry;
+ char *entry_filename;
+ int entry_num;
+};
+
+void mp_archive_free(struct mp_archive *mpa);
+
+#define MP_ARCHIVE_FLAG_UNSAFE (1 << 0)
+#define MP_ARCHIVE_FLAG_NO_VOLUMES (1 << 1)
+#define MP_ARCHIVE_FLAG_PRIV (1 << 2)
+
+struct mp_archive *mp_archive_new(struct mp_log *log, struct stream *src,
+ int flags, int max_volumes);
+
+bool mp_archive_next_entry(struct mp_archive *mpa);