include "venti.m";
venti := load Venti Venti->PATH;
Session: import venti;
init: fn();
unpackentry: fn(d: array of byte): ref Entry;
unpackroot: fn(d: array of byte): ref Root;
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;
};