aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/unarchive.h61
1 files changed, 35 insertions, 26 deletions
diff --git a/include/unarchive.h b/include/unarchive.h
index 68e83f01c..e3afb8af9 100644
--- a/include/unarchive.h
+++ b/include/unarchive.h
@@ -8,8 +8,8 @@ typedef struct file_header_t {
8 char *name; 8 char *name;
9 char *link_target; 9 char *link_target;
10#if ENABLE_FEATURE_TAR_UNAME_GNAME 10#if ENABLE_FEATURE_TAR_UNAME_GNAME
11 char *uname; 11 char *tar__uname;
12 char *gname; 12 char *tar__gname;
13#endif 13#endif
14 off_t size; 14 off_t size;
15 uid_t uid; 15 uid_t uid;
@@ -19,16 +19,25 @@ typedef struct file_header_t {
19 dev_t device; 19 dev_t device;
20} file_header_t; 20} file_header_t;
21 21
22struct hardlinks_t;
23
22typedef struct archive_handle_t { 24typedef struct archive_handle_t {
25 /* Flags. 1st since it is most used member */
26 unsigned ah_flags;
27
28 /* The raw stream as read from disk or stdin */
29 int src_fd;
30
23 /* Define if the header and data component should be processed */ 31 /* Define if the header and data component should be processed */
24 char FAST_FUNC (*filter)(struct archive_handle_t *); 32 char FAST_FUNC (*filter)(struct archive_handle_t *);
33 /* List of files that have been accepted */
25 llist_t *accept; 34 llist_t *accept;
26 /* List of files that have been rejected */ 35 /* List of files that have been rejected */
27 llist_t *reject; 36 llist_t *reject;
28 /* List of files that have successfully been worked on */ 37 /* List of files that have successfully been worked on */
29 llist_t *passed; 38 llist_t *passed;
30 39
31 /* Contains the processed header entry */ 40 /* Currently processed file's header */
32 file_header_t *file_header; 41 file_header_t *file_header;
33 42
34 /* Process the header component, e.g. tar -t */ 43 /* Process the header component, e.g. tar -t */
@@ -37,33 +46,33 @@ typedef struct archive_handle_t {
37 /* Process the data component, e.g. extract to filesystem */ 46 /* Process the data component, e.g. extract to filesystem */
38 void FAST_FUNC (*action_data)(struct archive_handle_t *); 47 void FAST_FUNC (*action_data)(struct archive_handle_t *);
39 48
40#if ENABLE_DPKG || ENABLE_DPKG_DEB
41 /* "subarchive" is used only by dpkg[-deb] applets */
42 /* How to process any sub archive, e.g. get_header_tar_gz */
43 char FAST_FUNC (*action_data_subarchive)(struct archive_handle_t *);
44 /* Contains the handle to a sub archive */
45 struct archive_handle_t *sub_archive;
46#endif
47
48 /* The raw stream as read from disk or stdin */
49 int src_fd;
50
51 /* Count the number of bytes processed */
52 off_t offset;
53
54 /* Function that skips data */ 49 /* Function that skips data */
55 void FAST_FUNC (*seek)(int fd, off_t amount); 50 void FAST_FUNC (*seek)(int fd, off_t amount);
56 51
57 /* Temporary storage */ 52 /* Count processed bytes */
58 char *ah_buffer; 53 off_t offset;
59
60 /* Flags and misc. stuff */
61 unsigned ah_flags;
62
63 /* "Private" storage for archivers */
64// unsigned char ah_priv_inited;
65 void *ah_priv[8];
66 54
55 /* Archiver specific. Can make it a union if it ever gets big */
56#if ENABLE_TAR
57 smallint tar__end;
58# if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
59 char* tar__longname;
60 char* tar__linkname;
61# endif
62#endif
63#if ENABLE_CPIO
64 uoff_t cpio__blocks;
65 struct hardlinks_t *cpio__hardlinks_to_create;
66 struct hardlinks_t *cpio__created_hardlinks;
67#endif
68#if ENABLE_DPKG || ENABLE_DPKG_DEB
69 /* Temporary storage */
70 char *dpkg__buffer;
71 /* How to process any sub archive, e.g. get_header_tar_gz */
72 char FAST_FUNC (*dpkg__action_data_subarchive)(struct archive_handle_t *);
73 /* Contains the handle to a sub archive */
74 struct archive_handle_t *dpkg__sub_archive;
75#endif
67} archive_handle_t; 76} archive_handle_t;
68/* bits in ah_flags */ 77/* bits in ah_flags */
69#define ARCHIVE_RESTORE_DATE (1 << 0) 78#define ARCHIVE_RESTORE_DATE (1 << 0)