From 46439007cf417cbd9ac8049bb4122c890097a0fa Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 22 Dec 2006 20:52:35 +0000 Subject: 20060303-partial --- module/registries.m | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 module/registries.m (limited to 'module/registries.m') diff --git a/module/registries.m b/module/registries.m new file mode 100644 index 00000000..5aaa53f4 --- /dev/null +++ b/module/registries.m @@ -0,0 +1,44 @@ +Registries: module { + PATH: con "/dis/lib/registries.dis"; + init: fn(); + + Attributes: adt { + attrs: list of (string, string); + + get: fn(a: self ref Attributes, attr: string): string; + set: fn(a: self ref Attributes, attr, val: string); + new: fn(attrs: list of (string, string)): ref Attributes; + }; + + Attached: adt { + fd: ref Sys->FD; + signerpkhash: string; + localuser: string; + remoteuser: string; + }; + + Service: adt { + addr: string; # dial this to connect to the service. + attrs: ref Attributes; # information about the nature of the service. + + attach: fn(s: self ref Service, user: string, keydir: string): ref Attached; + }; + + Registered: adt { + addr: string; + reg: ref Registry; + fd: ref Sys->FD; + }; + + Registry: adt { + dir: string; + indexfd: ref Sys->FD; + + new: fn(dir: string): ref Registry; + connect: fn(svc: ref Service, user: string, keydir: string): ref Registry; + services: fn(r: self ref Registry): (list of ref Service, string); + find: fn(r: self ref Registry, a: list of (string, string)): (list of ref Service, string); + register: fn(r: self ref Registry, addr: string, attrs: ref Attributes, persist: int): (ref Registered, string); + unregister: fn(r: self ref Registry, addr: string): string; + }; +}; -- cgit v1.2.3