-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrace.h
72 lines (66 loc) · 1.36 KB
/
trace.h
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
typedef struct TrBlock TrBlock;
typedef struct TrDir TrDir;
enum {
TrScoreSize = 20,
TrNumDirect = 6,
TrDirSize = 62,
TrHeaderSize = 35,
};
enum {
TrModeDir = 0x4000,
TrModeAppend = 0x2000,
TrModeLock = 0x1000,
TrModeRead = 0x4,
TrModeWrite = 0x2,
TrModeExec = 0x1,
};
enum {
TrTagNull = 0, /* blank block */
TrTagSuper, /* super block */
TrTagDir, /* directory contents */
TrTagInd1, /* points to blocks */
TrTagInd2, /* points to TrTagInd1 */
TrTagFile, /* file contents */
TrTagMax
};
struct TrDir {
short slot;
long path;
long version;
short mode;
long size;
long dblock[TrNumDirect];
long iblock;
long diblock;
long mtime;
long atime;
short uid;
short gid;
short wid;
};
struct TrBlock {
int tag;
long path; /* file it is part of */
long addr; /* address */
short zsize; /* zero truncated size */
short wsize; /* wack compressed size */
short dsize; /* deflate compressed size */
char score[TrScoreSize]; /* block identity */
union {
struct {
long cwraddr; /* cfs root addr */
long roraddr; /* dump root addr */
long last; /* last super block addr */
long next; /* next super block addr */
} super;
struct {
int length; /* in TrDirs */
TrDir dir[1]; /* variable length */
} dir;
struct {
int length; /* in longs */
long addr[1]; /* variable length */
} ind;
} u;
};
extern TrBlock *trRead(FILE*);