File: tarpet.h

package info (click to toggle)
gnome-vfs 1:2.24.4-6.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 17,144 kB
  • ctags: 10,422
  • sloc: ansic: 78,500; sh: 10,341; makefile: 902; perl: 99
file content (119 lines) | stat: -rw-r--r-- 2,290 bytes parent folder | download | duplicates (7)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#ifndef TARPET_H
#define TARPET_H

/*
 * Tarpet - Tar struct definitions
 * 
 * Placed in the public domain by Abigail Brady <morwen@evilmagic.org>
 *
 * Implemented from a definition provided by Rachel Hestilow, 
 * md5sum 7606d69d61dfc7eed10857a888136b62
 *
 * See documentation-1.1.txt for details.
 *
 */

struct TARPET_POSIX {
  char name[100];
  char mode[8];
  char uid[8];
  char gid[8];
  char size[12];
  char mtime[12];
  char checksum[8];
  char typeflag;
  char linkname[100];
  char magic[6];
  char version[2];
  char username[32];
  char groupname[32];
  char major[8];
  char minor[8];
  char extend[155];
};

#define TARPET_TYPE_REGULAR    '\0'
#define TARPET_TYPE_REGULAR2   '0'
#define TARPET_TYPE_LINK       '1'
#define TARPET_TYPE_SYMLINK    '2'
#define TARPET_TYPE_CHARDEV    '3'
#define TARPET_TYPE_BLOCKDEV   '4'
#define TARPET_TYPE_DIRECTORY  '5'
#define TARPET_TYPE_FIFO       '6'
#define TARPET_TYPE_CONTIGUOUS '7'

#define TARPET_TYPE_DUMPDIR    'D'
#define TARPET_TYPE_LONGLINKN  'K'
#define TARPET_TYPE_LONGFILEN  'L'
#define TARPET_TYPE_MULTIVOL   'M'
#define TARPET_TYPE_LONGNAME   'N'
#define TARPET_TYPE_SPARSE     'S'
#define TARPET_TYPE_VOLUME     'V'

#define TARPET_GNU_MAGIC       "ustar"
#define TARPET_GNU_MAGIC_OLD   "ustar  "

#define TARPET_GNU_VERSION "00"

/*
 * for the mode, #include <sys/types.h> and use
 *
 * S_ISUID
 * S_ISGID
 * 
 * S_IRUSR
 * S_IWUSR
 * S_IXUSR
 * S_IRGRP
 * S_IWGRP
 * S_IXGRP
 * S_IROTH
 * S_IWOTH
 * S_IXOTH
 */

struct TARPET_sparsefile {
  char padding[12];
  char numbytes[12];
};

struct TARPET_GNU_ext {
  char atime[12];
  char ctime[12];
  char offset[12];
  char realsize[12];
  char longnames[4];
  char padding[68];
  struct TARPET_sparsefile sparse[16];
  char extend;
};

struct TARPET_GNU_ext_old {
  char padding[345];
  char atime[12];
  char ctime[12];
  char longnames[4];
  char padding2;
  struct TARPET_sparsefile sparse[4];
  char extend;
  char realsize[12];
};

struct TARPET_GNU_sparseheader {
  struct TARPET_sparsefile sparse[21];
  char extend;
};

struct TARPET_rawdata {
  char data[512];
};

union TARPET_block {
  struct TARPET_POSIX p;
  struct TARPET_GNU_ext gnu;
  struct TARPET_GNU_ext_old gnu_old;
  struct TARPET_GNU_sparseheader sparse;
  struct TARPET_rawdata raw;
};

#endif