aboutsummaryrefslogtreecommitdiff
path: root/include/erofs/tar.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/erofs/tar.h')
-rw-r--r--include/erofs/tar.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/erofs/tar.h b/include/erofs/tar.h
index b50db1d..a76f740 100644
--- a/include/erofs/tar.h
+++ b/include/erofs/tar.h
@@ -7,6 +7,9 @@ extern "C"
{
#endif
+#if defined(HAVE_ZLIB)
+#include <zlib.h>
+#endif
#include <sys/stat.h>
#include "internal.h"
@@ -21,8 +24,24 @@ struct erofs_pax_header {
char *path, *link;
};
+#define EROFS_IOS_DECODER_NONE 0
+#define EROFS_IOS_DECODER_GZIP 1
+
+struct erofs_iostream {
+ union {
+ int fd; /* original fd */
+ void *handler;
+ };
+ u64 sz;
+ char *buffer;
+ unsigned int head, tail, bufsize;
+ int decoder;
+ bool feof;
+};
+
struct erofs_tarfile {
struct erofs_pax_header global;
+ struct erofs_iostream ios;
char *mapfile;
int fd;
@@ -30,6 +49,8 @@ struct erofs_tarfile {
bool index_mode, aufs;
};
+void erofs_iostream_close(struct erofs_iostream *ios);
+int erofs_iostream_open(struct erofs_iostream *ios, int fd, int decoder);
int tarerofs_parse_tar(struct erofs_inode *root, struct erofs_tarfile *tar);
#ifdef __cplusplus