]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/hgfs/dat.h
upas/fs: fix more locking bugs, remove debugging clutter, remove planb mbox code
[plan9front.git] / sys / src / cmd / hgfs / dat.h
1 enum {
2         MAXPATH = 1024,
3         BUFSZ = 1024,
4         HASHSZ = 20,
5 };
6
7 typedef struct Revlog Revlog;
8 typedef struct Revmap Revmap;
9 typedef struct Revinfo Revinfo;
10 typedef struct Revtree Revtree;
11 typedef struct Revnode Revnode;
12 typedef struct Revfile Revfile;
13
14 struct Revmap
15 {
16         int     rev;
17         int     p1rev;
18         int     p2rev;
19         int     baserev;
20         int     linkrev;
21
22         uchar   hash[HASHSZ];
23
24         int     flags;
25
26         vlong   hoff;
27         vlong   hlen;
28
29         vlong   flen;
30
31         void    *aux;
32 };
33
34 struct Revlog
35 {
36         Ref;
37
38         Revlog  *next;
39
40         char    *path;
41
42         int     ifd;
43         int     dfd;
44
45         vlong   ioff;
46
47         int     nmap;
48         Revmap  *map;
49
50         int     tfd;
51         int     tid;
52 };
53
54 struct Revnode
55 {
56         char    *name;
57         uchar   *hash;
58         uvlong  path;
59
60         Revnode *up;
61         Revnode *next;
62         Revnode *down;
63         Revnode *before;
64
65         char    mode;
66 };
67
68 struct Revinfo
69 {
70         uchar   chash[HASHSZ];
71         uchar   mhash[HASHSZ];
72
73         char    *who;
74         char    *why;
75         ulong   when;
76
77         vlong   logoff;
78         vlong   loglen;
79 };
80
81 struct Revtree
82 {
83         Ref;
84         int     level;
85         Revnode *root;
86 };
87
88 struct Revfile
89 {
90         int     level;
91
92         Revinfo *info;
93         Revtree *tree;
94         Revnode *node;
95         Revlog  *rlog;
96
97         char    *buf;
98         int     fd;
99         int     doff;   /* length of metadata to skip */
100 };
101
102 uchar nullid[HASHSZ];