]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/hgfs/dat.h
hgfs: add wip debug command
[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
51 struct Revnode
52 {
53         char    *name;
54         uchar   *hash;
55         uvlong  path;
56
57         Revnode *up;
58         Revnode *next;
59         Revnode *down;
60         Revnode *before;
61
62         char    mode;
63 };
64
65 struct Revinfo
66 {
67         uchar   chash[HASHSZ];
68         uchar   mhash[HASHSZ];
69
70         char    *who;
71         char    *why;
72         ulong   when;
73
74         vlong   logoff;
75         vlong   loglen;
76 };
77
78 struct Revtree
79 {
80         Ref;
81         int     level;
82         Revnode *root;
83 };
84
85 struct Revfile
86 {
87         int     level;
88
89         Revinfo *info;
90         Revtree *tree;
91         Revnode *node;
92         Revlog  *rlog;
93
94         char    *buf;
95         int     fd;
96 };