ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / modules / tarpet.h
1 #ifndef TARPET_H
2 #define TARPET_H
3
4 /*
5  * Tarpet - Tar struct definitions
6  * 
7  * Placed in the public domain by Abigail Brady <morwen@evilmagic.org>
8  *
9  * Implemented from a definition provided by Rachel Hestilow, 
10  * md5sum 7606d69d61dfc7eed10857a888136b62
11  *
12  * See documentation-1.1.txt for details.
13  *
14  */
15
16 struct TARPET_POSIX {
17   char name[100];
18   char mode[8];
19   char uid[8];
20   char gid[8];
21   char size[12];
22   char mtime[12];
23   char checksum[8];
24   char typeflag;
25   char linkname[100];
26   char magic[6];
27   char version[2];
28   char username[32];
29   char groupname[32];
30   char major[8];
31   char minor[8];
32   char extend[155];
33 };
34
35 #define TARPET_TYPE_REGULAR    '\0'
36 #define TARPET_TYPE_REGULAR2   '0'
37 #define TARPET_TYPE_LINK       '1'
38 #define TARPET_TYPE_SYMLINK    '2'
39 #define TARPET_TYPE_CHARDEV    '3'
40 #define TARPET_TYPE_BLOCKDEV   '4'
41 #define TARPET_TYPE_DIRECTORY  '5'
42 #define TARPET_TYPE_FIFO       '6'
43 #define TARPET_TYPE_CONTIGUOUS '7'
44
45 #define TARPET_TYPE_DUMPDIR    'D'
46 #define TARPET_TYPE_LONGLINKN  'K'
47 #define TARPET_TYPE_LONGFILEN  'L'
48 #define TARPET_TYPE_MULTIVOL   'M'
49 #define TARPET_TYPE_LONGNAME   'N'
50 #define TARPET_TYPE_SPARSE     'S'
51 #define TARPET_TYPE_VOLUME     'V'
52
53 #define TARPET_GNU_MAGIC       "ustar"
54 #define TARPET_GNU_MAGIC_OLD   "ustar  "
55
56 #define TARPET_GNU_VERSION "00"
57
58 /*
59  * for the mode, #include <sys/types.h> and use
60  *
61  * S_ISUID
62  * S_ISGID
63  * 
64  * S_IRUSR
65  * S_IWUSR
66  * S_IXUSR
67  * S_IRGRP
68  * S_IWGRP
69  * S_IXGRP
70  * S_IROTH
71  * S_IWOTH
72  * S_IXOTH
73  */
74
75 struct TARPET_sparsefile {
76   char padding[12];
77   char numbytes[12];
78 };
79
80 struct TARPET_GNU_ext {
81   char atime[12];
82   char ctime[12];
83   char offset[12];
84   char realsize[12];
85   char longnames[4];
86   char padding[68];
87   struct TARPET_sparsefile sparse[16];
88   char extend;
89 };
90
91 struct TARPET_GNU_ext_old {
92   char padding[345];
93   char atime[12];
94   char ctime[12];
95   char longnames[4];
96   char padding2;
97   struct TARPET_sparsefile sparse[4];
98   char extend;
99   char realsize[12];
100 };
101
102 struct TARPET_GNU_sparseheader {
103   struct TARPET_sparsefile sparse[21];
104   char extend;
105 };
106
107 struct TARPET_rawdata {
108   char data[512];
109 };
110
111 union TARPET_block {
112   struct TARPET_POSIX p;
113   struct TARPET_GNU_ext gnu;
114   struct TARPET_GNU_ext_old gnu_old;
115   struct TARPET_GNU_sparseheader sparse;
116   struct TARPET_rawdata raw;
117 };
118
119 #endif