Buf : module {
PATH : con "/usr/maht/buf/buf.dis";
EOF : con -1;
Data : adt {
txt : string;
ptr : int;
seek: fn(b: self ref Data, n, where: int): int;
offset: fn(b: self ref Data): int;
# read: fn(b: self ref Data, a: array of byte, n: int): int;
# write: fn(b: self ref Data, a: array of byte, n: int): int;
# getb: fn(b: self ref Data): int;
getc: fn(b: self ref Data): int;
gets: fn(b: self ref Data, sep: int): string;
# gett: fn(b: self ref Data, sep: string): string;
# ungetb: fn(b: self ref Data): int;
ungetc: fn(b: self ref Data): int;
# putb: fn(b: self ref Data, b: byte): int;
# putc: fn(b: self ref Data, c: int): int;
# puts: fn(b: self ref Data, s: string): int;
# flush: fn(b: self ref Data): int;
# close: fn(b: self ref Data);
};
new : fn(s : string) : ref Data;
};
|