summaryrefslogtreecommitdiff
path: root/module/alphabet
diff options
context:
space:
mode:
Diffstat (limited to 'module/alphabet')
-rw-r--r--module/alphabet/abc.m74
-rw-r--r--module/alphabet/abcstyx.m33
-rw-r--r--module/alphabet/abctypes.m23
-rw-r--r--module/alphabet/endpoints.m14
-rw-r--r--module/alphabet/extvalues.m12
-rw-r--r--module/alphabet/fs.m82
-rw-r--r--module/alphabet/fstypes.m23
-rw-r--r--module/alphabet/grid.m43
-rw-r--r--module/alphabet/gridtypes.m23
-rw-r--r--module/alphabet/reports.m16
10 files changed, 343 insertions, 0 deletions
diff --git a/module/alphabet/abc.m b/module/alphabet/abc.m
new file mode 100644
index 00000000..384b8d38
--- /dev/null
+++ b/module/alphabet/abc.m
@@ -0,0 +1,74 @@
+# warning: autogenerated code; don't bother to change this, change mktypeset.b or abc.b instead
+Abc: module {
+ PATH: con "/dis/alphabet/abc.dis";
+ Value: adt {
+ m: fn(v: self ref Value): ref Value.Vm; # vmods
+ t: fn(v: self ref Value): ref Value.Vt; # vtypes
+ A: fn(v: self ref Value): ref Value.VA; # abc
+ w: fn(v: self ref Value): ref Value.Vw; # wfd
+ c: fn(v: self ref Value): ref Value.Vc; # cmd
+ r: fn(v: self ref Value): ref Value.Vr; # status
+ f: fn(v: self ref Value): ref Value.Vf; # fd
+ s: fn(v: self ref Value): ref Value.Vs; # string
+ typec: fn(v: self ref Value): int;
+ type2s: fn(t: int): string;
+ free: fn(v: self ref Value, used: int);
+ dup: fn(v: self ref Value): ref Value;
+ pick {
+ Vm =>
+ i: Modulesval;
+ Vt =>
+ i: Typesval;
+ VA =>
+ i: Abcval;
+ Vw =>
+ i: chan of ref Sys->FD;
+ Vc =>
+ i: ref Sh->Cmd;
+ Vr =>
+ i: chan of string;
+ Vf =>
+ i: chan of ref Sys->FD;
+ Vs =>
+ i: string;
+ }
+ };
+ init: fn();
+ Abcval: adt {
+ refcount: chan of int;
+ alphabet: Alphabet;
+ };
+ Typesval: adt {
+ abc: ref Value.VA;
+ types: list of ref Type;
+ };
+ Modulesval: adt {
+ abc: ref Value.VA;
+ types: list of ref Type;
+ mods: list of (string, string, ref Sh->Cmd);
+ query: chan of (string, chan of (string, ref Sh->Cmd));
+ };
+ Type: adt {
+ name: string;
+ actname: string;
+ nodup: int;
+ destructor: ref Sh->Cmd;
+ };
+ mkabc: fn(alphabet: Alphabet): ref Value.VA;
+
+};
+
+Abcmodule: module {
+ types: fn(): string;
+ init: fn();
+ quit: fn();
+ run: fn(errorc: chan of string, r: ref Reports->Report,
+ opts: list of (int, list of ref Abc->Value), args: list of ref Abc->Value): ref Abc->Value;
+};
+
+Declares: module {
+ PATH: con "/dis/alphabet/abc/declares.dis";
+ init: fn();
+ quit: fn();
+ declares: fn(a: Alphabet, decls: ref Sh->Cmd, errorc: chan of string, stopc: chan of int): string;
+};
diff --git a/module/alphabet/abcstyx.m b/module/alphabet/abcstyx.m
new file mode 100644
index 00000000..227550a9
--- /dev/null
+++ b/module/alphabet/abcstyx.m
@@ -0,0 +1,33 @@
+ABCStyx: module {
+ PATH: con "/dis/alphabet/abcstyx.dis";
+ Value: adt {
+ c: fn(v: self ref Value): ref Value.C; # cmd
+ s: fn(v: self ref Value): ref Value.S; # string
+ w: fn(v: self ref Value): ref Value.W; # wfd
+ x: fn(v: self ref Value): ref Value.D; # styx
+
+ typec: fn(v: self ref Value): int;
+ type2s: fn(t: int): string;
+ discard: fn(v: self ref Value);
+ reusable: fn(v: self ref Value): int;
+
+ pick {
+ S =>
+ i: string;
+ C =>
+ i: ref Sh->Cmd;
+ W =>
+ i: chan of ref Sys->FD;
+ X =>
+ i: (chan of ref Styx->Rmsg, chan of ref Styx->Tmsg);
+ }
+ };
+ init: fn();
+};
+
+Styxmodule: module {
+ types: fn(): string;
+ init: fn();
+ run: fn(errorc: chan of string, r: ref Reports->Report,
+ opts: list of (int, list of ref ABCStyx->Value), args: list of ref ABCStyx->Value): ref ABCStyx->Value;
+};
diff --git a/module/alphabet/abctypes.m b/module/alphabet/abctypes.m
new file mode 100644
index 00000000..0acacfdc
--- /dev/null
+++ b/module/alphabet/abctypes.m
@@ -0,0 +1,23 @@
+# warning: autogenerated code; don't bother to change this, change mktypeset.b or abc.b instead
+Abctypes: module {
+ PATH: con "/dis/alphabet/abctypes.dis";
+ Abccvt: adt {
+ values: ref Extvalues->Values[ref Abc->Value];
+
+ int2ext: fn(cvt: self ref Abccvt, v: ref Abc->Value): ref Alphabet->Value;
+ ext2int: fn(cvt: self ref Abccvt, ev: ref Alphabet->Value): ref Abc->Value;
+ dup: fn(cvt: self ref Abccvt, ev: ref Alphabet->Value): ref Alphabet->Value;
+ free: fn(cvt: self ref Abccvt, ev: ref Alphabet->Value, used: int);
+ };
+
+ proxy: fn(): chan of ref Proxy->Typescmd[ref Alphabet->Value];
+ proxy0: fn(): (
+ chan of ref Proxy->Typescmd[ref Alphabet->Value],
+ chan of (string, chan of ref Proxy->Typescmd[ref Abc->Value]),
+ ref Abccvt
+ );
+};
+
+Abcsubtypes: module {
+ proxy: fn(): chan of ref Proxy->Typescmd[ref Abc->Value];
+};
diff --git a/module/alphabet/endpoints.m b/module/alphabet/endpoints.m
new file mode 100644
index 00000000..b01d8c20
--- /dev/null
+++ b/module/alphabet/endpoints.m
@@ -0,0 +1,14 @@
+Endpoints: module {
+ PATH: con "/dis/alphabet/endpoints.dis";
+ Endpoint: adt {
+ addr: string;
+ id: string;
+ about: string;
+ text: fn(e: self Endpoint): string;
+ mk: fn(s: string): Endpoint;
+ };
+ init: fn();
+ new: fn(net, addr: string, force: int): string;
+ create: fn(addr: string): (ref Sys->FD, Endpoint);
+ open: fn(net: string, ep: Endpoint): (ref Sys->FD, string);
+};
diff --git a/module/alphabet/extvalues.m b/module/alphabet/extvalues.m
new file mode 100644
index 00000000..ffc867ce
--- /dev/null
+++ b/module/alphabet/extvalues.m
@@ -0,0 +1,12 @@
+Extvalues: module {
+ PATH: con "/dis/alphabet/extvalues.dis";
+ Values: adt[V] {
+ lock: chan of int;
+ v: array of (int, V);
+ freeids: list of int;
+ new: fn(): ref Values[V];
+ add: fn(vals: self ref Values, v: V): int;
+ inc: fn(vals: self ref Values, id: int);
+ del: fn(vals: self ref Values, id: int);
+ };
+};
diff --git a/module/alphabet/fs.m b/module/alphabet/fs.m
new file mode 100644
index 00000000..baca3e5b
--- /dev/null
+++ b/module/alphabet/fs.m
@@ -0,0 +1,82 @@
+# warning: autogenerated code; don't bother to change this, change mktypeset.b or fs.b instead
+Fs: module {
+ PATH: con "/dis/alphabet/fs.dis";
+ Value: adt {
+ r: fn(v: self ref Value): ref Value.Vr; # status
+ d: fn(v: self ref Value): ref Value.Vd; # data
+ c: fn(v: self ref Value): ref Value.Vc; # command
+ f: fn(v: self ref Value): ref Value.Vf; # fd
+ s: fn(v: self ref Value): ref Value.Vs; # string
+ m: fn(v: self ref Value): ref Value.Vm; # selector
+ p: fn(v: self ref Value): ref Value.Vp; # gate
+ t: fn(v: self ref Value): ref Value.Vt; # entries
+ x: fn(v: self ref Value): ref Value.Vx; # fs
+ typec: fn(v: self ref Value): int;
+ type2s: fn(t: int): string;
+ free: fn(v: self ref Value, used: int);
+ dup: fn(v: self ref Value): ref Value;
+ pick {
+ Vr =>
+ i: chan of string;
+ Vd =>
+ i: Datachan;
+ Vc =>
+ i: ref Sh->Cmd;
+ Vf =>
+ i: chan of ref Sys->FD;
+ Vs =>
+ i: string;
+ Vm =>
+ i: Cmpchan;
+ Vp =>
+ i: Gatechan;
+ Vt =>
+ i: Entrychan;
+ Vx =>
+ i: Fschan;
+ }
+ };
+ init: fn();
+ sendnulldir: fn(c: Fschan): int;
+ copy: fn(src, dst: Fschan): int;
+ Option: adt {
+ opt: int;
+ args: list of ref Value;
+ };
+ Datachan: adt {
+ d: chan of array of byte;
+ stop: chan of int;
+ };
+ Entrychan: adt {
+ sync: chan of int;
+ c: chan of Entry;
+ };
+ Cmpchan: type chan of (ref Sys->Dir, ref Sys->Dir, chan of int);
+ Entry: type (ref Sys->Dir, string, int);
+ Gatequery: type (Entry, chan of int);
+ Gatechan: type chan of Gatequery;
+ Fsdata: adt {
+ dir: ref Sys->Dir;
+ data: array of byte;
+ };
+ Fschan: type chan of (Fsdata, chan of int);
+ Next, Down, Skip, Quit: con iota;
+ Nilentry: con (nil, nil, 0);
+
+};
+
+Fsmodule: module {
+ types: fn(): string;
+ init: fn();
+ run: fn(ctxt: ref Draw->Context, r: ref Reports->Report,
+ opts: list of Fs->Option, args: list of ref Fs->Value): ref Fs->Value;
+};
+Fsfilter: module {
+ PATH: con "/dis/alphabet/fsfilter.dis";
+ filter: fn[T](t: T, src, dst: Fs->Fschan)
+ for{
+ T =>
+ query: fn(t: self T, d: ref Sys->Dir, name: string, depth: int): int;
+ };
+};
+
diff --git a/module/alphabet/fstypes.m b/module/alphabet/fstypes.m
new file mode 100644
index 00000000..8929fba7
--- /dev/null
+++ b/module/alphabet/fstypes.m
@@ -0,0 +1,23 @@
+# warning: autogenerated code; don't bother to change this, change mktypeset.b or fs.b instead
+Fstypes: module {
+ PATH: con "/dis/alphabet/fstypes.dis";
+ Fscvt: adt {
+ values: ref Extvalues->Values[ref Fs->Value];
+
+ int2ext: fn(cvt: self ref Fscvt, v: ref Fs->Value): ref Alphabet->Value;
+ ext2int: fn(cvt: self ref Fscvt, ev: ref Alphabet->Value): ref Fs->Value;
+ dup: fn(cvt: self ref Fscvt, ev: ref Alphabet->Value): ref Alphabet->Value;
+ free: fn(cvt: self ref Fscvt, ev: ref Alphabet->Value, used: int);
+ };
+
+ proxy: fn(): chan of ref Proxy->Typescmd[ref Alphabet->Value];
+ proxy0: fn(): (
+ chan of ref Proxy->Typescmd[ref Alphabet->Value],
+ chan of (string, chan of ref Proxy->Typescmd[ref Fs->Value]),
+ ref Fscvt
+ );
+};
+
+Fssubtypes: module {
+ proxy: fn(): chan of ref Proxy->Typescmd[ref Fs->Value];
+};
diff --git a/module/alphabet/grid.m b/module/alphabet/grid.m
new file mode 100644
index 00000000..b9042ec0
--- /dev/null
+++ b/module/alphabet/grid.m
@@ -0,0 +1,43 @@
+# warning: autogenerated code; don't bother to change this, change mktypeset.b or grid.b instead
+Grid: module {
+ PATH: con "/dis/alphabet/grid.dis";
+ Value: adt {
+ b: fn(v: self ref Value): ref Value.Vb; # records
+ e: fn(v: self ref Value): ref Value.Ve; # endpoint
+ w: fn(v: self ref Value): ref Value.Vw; # wfd
+ c: fn(v: self ref Value): ref Value.Vc; # cmd
+ r: fn(v: self ref Value): ref Value.Vr; # status
+ f: fn(v: self ref Value): ref Value.Vf; # fd
+ s: fn(v: self ref Value): ref Value.Vs; # string
+ typec: fn(v: self ref Value): int;
+ type2s: fn(t: int): string;
+ free: fn(v: self ref Value, used: int);
+ dup: fn(v: self ref Value): ref Value;
+ pick {
+ Vb =>
+ i: chan of ref Sys->FD;
+ Ve =>
+ i: chan of Endpoints->Endpoint;
+ Vw =>
+ i: chan of ref Sys->FD;
+ Vc =>
+ i: ref Sh->Cmd;
+ Vr =>
+ i: chan of string;
+ Vf =>
+ i: chan of ref Sys->FD;
+ Vs =>
+ i: string;
+ }
+ };
+ init: fn();
+
+};
+
+Gridmodule: module {
+ types: fn(): string;
+ init: fn();
+ run: fn(errorc: chan of string, r: ref Reports->Report,
+ opts: list of (int, list of ref Grid->Value), args: list of ref Grid->Value): ref Grid->Value;
+};
+
diff --git a/module/alphabet/gridtypes.m b/module/alphabet/gridtypes.m
new file mode 100644
index 00000000..dd704f3b
--- /dev/null
+++ b/module/alphabet/gridtypes.m
@@ -0,0 +1,23 @@
+# warning: autogenerated code; don't bother to change this, change mktypeset.b or grid.b instead
+Gridtypes: module {
+ PATH: con "/dis/alphabet/gridtypes.dis";
+ Gridcvt: adt {
+ values: ref Extvalues->Values[ref Grid->Value];
+
+ int2ext: fn(cvt: self ref Gridcvt, v: ref Grid->Value): ref Alphabet->Value;
+ ext2int: fn(cvt: self ref Gridcvt, ev: ref Alphabet->Value): ref Grid->Value;
+ dup: fn(cvt: self ref Gridcvt, ev: ref Alphabet->Value): ref Alphabet->Value;
+ free: fn(cvt: self ref Gridcvt, ev: ref Alphabet->Value, used: int);
+ };
+
+ proxy: fn(): chan of ref Proxy->Typescmd[ref Alphabet->Value];
+ proxy0: fn(): (
+ chan of ref Proxy->Typescmd[ref Alphabet->Value],
+ chan of (string, chan of ref Proxy->Typescmd[ref Grid->Value]),
+ ref Gridcvt
+ );
+};
+
+Gridsubtypes: module {
+ proxy: fn(): chan of ref Proxy->Typescmd[ref Grid->Value];
+};
diff --git a/module/alphabet/reports.m b/module/alphabet/reports.m
new file mode 100644
index 00000000..e1cd49d2
--- /dev/null
+++ b/module/alphabet/reports.m
@@ -0,0 +1,16 @@
+Reports: module {
+ PATH: con "/dis/alphabet/reports.dis";
+ Report: adt {
+ startc: chan of (string, chan of string, chan of int);
+ enablec: chan of int;
+
+ enable: fn(r: self ref Report);
+ start: fn(r: self ref Report, name: string): chan of string;
+ add: fn(r: self ref Report, name: string, errorc: chan of string, stopc: chan of int);
+ };
+ KILL, PROPAGATE: con 1<<iota;
+ reportproc: fn(errorc: chan of string, stopc: chan of int, reply: chan of ref Report);
+ quit: fn(errorc: chan of string);
+ report: fn(errorc: chan of string, err: string);
+ newpgrp: fn(stopc: chan of int, flags: int): chan of int;
+};