/*Daily Diff Server - DMS - Jan 00 - by Sylvain HUET */ typeof day=[I I];; typeof trlist=[[S I] r1];; fun switchstr(l,s)= if l==nil then nil else let l->[[a b] n] in if !strcmp a s then b else switchstr n s;; fun refreshday()= let localtime time->[_ _ _ _ _ yn _ dn] in let day->[y d] in if yn==y && dn==d then nil else (set trlist=nil; set day=[yn dn]);; fun _in(cli,param,rep)= refreshday; let cli.trCLI -> tr in if 0==switchstr trlist tr then nil else (set trlist=[tr 0]::trlist; _DMSevent this cli "out" param rep);; fun _inparam(cli,tr,rep)= refreshday; if 0==switchstr trlist tr then nil else (set trlist=[tr 0]::trlist; _DMSevent this cli "out" tr rep);; fun activate(from,cli,action,param,rep)= if !strcmp action "in" then _in cli param rep else if !strcmp action "inparam" then _inparam cli param rep else nil;; fun IniDMI(param)= refreshday; _DMSregisterDMI this @activate nil nil nil; _DMSevent this nil "start" nil nil;;