]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/hgfs/dat.h
9d19400447e45adf8e6719f018410afdfce8b4c0
[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         int     ifd;
37         int     dfd;
38
39         vlong   ioff;
40
41         int     nmap;
42         Revmap  *map;
43 };
44
45 struct Revnode
46 {
47         char    *name;
48         uchar   *hash;
49         uvlong  path;
50
51         Revnode *up;
52         Revnode *next;
53         Revnode *down;
54
55         char    mode;
56 };
57
58 struct Revinfo
59 {
60         uchar   chash[HASHSZ];
61         uchar   mhash[HASHSZ];
62
63         char    *who;
64         char    *why;
65         long    when;
66
67         vlong   logoff;
68         vlong   loglen;
69 };
70
71 struct Revtree
72 {
73         Ref;
74         int     level;
75         Revnode *root;
76 };
77
78 struct Revfile
79 {
80         int     level;
81
82         Revinfo *info;
83         Revtree *tree;
84         Revnode *node;
85
86         char    *buf;
87         int     fd;
88 };