File: tar.h

package info (click to toggle)
erofs-utils 1.9-3
  • links: PTS
  • area: main
  • in suites: forky
  • size: 1,484 kB
  • sloc: ansic: 28,409; makefile: 203; sh: 33
file content (73 lines) | stat: -rw-r--r-- 1,346 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* SPDX-License-Identifier: GPL-2.0+ OR Apache-2.0 */
#ifndef __EROFS_TAR_H
#define __EROFS_TAR_H

#ifdef __cplusplus
extern "C"
{
#endif

#include <sys/stat.h>

#include "internal.h"

struct erofs_pax_header {
	struct stat st;
	struct list_head xattrs;
	bool use_mtime;
	bool use_size;
	bool use_uid;
	bool use_gid;
	char *path, *link;
};

#define EROFS_IOS_DECODER_NONE		0
#define EROFS_IOS_DECODER_GZIP		1
#define EROFS_IOS_DECODER_LIBLZMA	2
#define EROFS_IOS_DECODER_GZRAN		3

struct erofs_iostream_liblzma;
struct erofs_gzran_builder;

struct erofs_iostream {
	union {
		struct {
			struct erofs_vfile vf;
			struct erofs_gzran_builder *gb;
		};
		void *handler;
#ifdef HAVE_LIBLZMA
		struct erofs_iostream_liblzma *lzma;
#endif
	};
	u64 sz;
	char *buffer;
	unsigned int head, tail, bufsize;
	int decoder, dumpfd;
	bool feof;
};

struct erofs_tarfile {
	struct erofs_pax_header global;
	struct erofs_iostream ios;
	char *mapfile, *dumpfile;

	u32 dev;
	int fd;
	u64 offset;
	bool index_mode, headeronly_mode, rvsp_mode, aufs;
	bool ddtaridx_mode;
	bool try_no_reorder;
};

struct erofs_importer;

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_importer *im, struct erofs_tarfile *tar);

#ifdef __cplusplus
}
#endif

#endif