include "venti.m";
venti := load Venti Venti->PATH;
Session, Entry, Root: import venti;
init: fn();
Session: adt {
new: fn(fd: ref Sys->FD): ref Session;
read: fn(s: self ref Session, score: Venti->Score, etype: int, maxn: int): array of byte;
write: fn(s: self ref Session, etype: int, buf: array of byte): (int, Venti->Score);
sync: fn(s: self ref Session): int;
};
Score: adt {
a: array of byte;
eq: fn(a: self Score, b: Score): int;
text: fn(a: self Score): string;
parse: fn(s: string): (int, Score);
zero: fn(): Score;
};
Entry: adt {
new: fn(psize, dsize, flags: int, size: big, score: Venti->Score): ref Entry;
pack: fn(e: self ref Entry): array of byte;
unpack: fn(d: array of byte): ref Entry;
};
Root: adt {
new: fn(name, rtype: string, score: Venti->Score, blocksize: int, prev: ref Venti->Score): ref Root;
unpack: fn(d: array of byte): ref Root;
pack: fn(r: self ref Root): array of byte;
};
An Entry represents a hash tree stored in Venti.
Root represents the root of a file hierarchy stored in Venti.
| VENTI(2) | Rev: Sat May 03 22:49:09 GMT 2008 |