xref: /inferno-os/module/plumbmsg.m (revision 46439007cf417cbd9ac8049bb4122c890097a0fa)
1*46439007SCharles.ForsythPlumbmsg: module
2*46439007SCharles.Forsyth{
3*46439007SCharles.Forsyth	PATH:	con "/dis/lib/plumbmsg.dis";
4*46439007SCharles.Forsyth
5*46439007SCharles.Forsyth	# Message format:
6*46439007SCharles.Forsyth	#	source application\n
7*46439007SCharles.Forsyth	#	destination application\n
8*46439007SCharles.Forsyth	#	working directory\n
9*46439007SCharles.Forsyth	#	type\n
10*46439007SCharles.Forsyth	#	properties\n
11*46439007SCharles.Forsyth	#	nbytes\n
12*46439007SCharles.Forsyth	#	n bytes
13*46439007SCharles.Forsyth
14*46439007SCharles.Forsyth	Msg: adt
15*46439007SCharles.Forsyth	{
16*46439007SCharles.Forsyth		src:		string;
17*46439007SCharles.Forsyth		dst:		string;
18*46439007SCharles.Forsyth		dir:		string;
19*46439007SCharles.Forsyth		kind:		string;
20*46439007SCharles.Forsyth		attr:		string;
21*46439007SCharles.Forsyth		data:		array of byte;
22*46439007SCharles.Forsyth
23*46439007SCharles.Forsyth		# used by applications
24*46439007SCharles.Forsyth		send: 	fn(msg: self ref Msg): int;
25*46439007SCharles.Forsyth		recv: 	fn(): ref Msg;
26*46439007SCharles.Forsyth
27*46439007SCharles.Forsyth		# used by plumb and send, recv
28*46439007SCharles.Forsyth		pack: 	fn(msg: self ref Msg): array of byte;
29*46439007SCharles.Forsyth		unpack: 	fn(b: array of byte): ref Msg;
30*46439007SCharles.Forsyth	};
31*46439007SCharles.Forsyth
32*46439007SCharles.Forsyth	Attr: adt
33*46439007SCharles.Forsyth	{
34*46439007SCharles.Forsyth		name:	string;
35*46439007SCharles.Forsyth		val:		string;
36*46439007SCharles.Forsyth	};
37*46439007SCharles.Forsyth
38*46439007SCharles.Forsyth	init:	fn(doinput: int, rcvport: string, maxdata: int): int;
39*46439007SCharles.Forsyth	shutdown:	fn();
40*46439007SCharles.Forsyth
41*46439007SCharles.Forsyth	string2attrs:	fn(s: string): list of ref Attr;
42*46439007SCharles.Forsyth	attrs2string:	fn(l: list of ref Attr): string;
43*46439007SCharles.Forsyth	lookup:	fn(attrs: list of ref Attr, name: string): (int, string);
44*46439007SCharles.Forsyth};
45