]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/hgfs/dat.h
hgfs: fixed mkfile
[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
56 struct Revinfo
57 {
58         uchar   chash[HASHSZ];
59         uchar   mhash[HASHSZ];
60
61         char    *who;
62         char    *why;
63         long    when;
64 };
65
66 struct Revtree
67 {
68         Ref;
69         int     level;
70         Revnode *root;
71 };
72
73 struct Revfile
74 {
75         int     level;
76
77         Revinfo *info;
78         Revtree *tree;
79         Revnode *node;
80
81         char    *buf;
82         int     fd;
83 };