Plan 9 from Bell Labs’s /usr/web/sources/contrib/maht/inferno/module/buf.m

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.




Buf : module {
	PATH : con "/dis/lib/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;
};

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].