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