/* ContX Server - DMS - may 1999 by Patrice FAVRE */ typeof CLSID=S;; typeof listAct=[[S S S] r1];; typeof listEvt=[[S S S] r1];; defcom CaddAct=addAct S S;; defcom CaddEvt=addEvt S S;; defcom Cgo=go;; /*-----------------------*/ fun clidestroyed(cli)= _DMSevent this cli "destroyed" nil nil;; /*-----------------------*/ fun sendAct(cli,l)= if l==nil then 0 else let l -> [[_ act alias] nxt] in ( _DMSsend this cli CaddAct [act alias]; sendAct cli nxt );; /*-----------------------*/ fun sendEvt(cli,l)= if l==nil then 0 else let l -> [[_ evt alias] nxt] in ( _DMSsend this cli CaddEvt [evt alias]; sendEvt cli nxt );; /*-----------------------*/ fun action(from,cli,act,param,rep)= if !strcmp act "start" then ( _DMScreateClientDMI this cli CLSID; sendAct cli listAct; sendEvt cli listEvt; _DMSsend this cli Cgo []; ) else if !strcmp act "destroy" then ( _DMSdelClientDMI this cli; clidestroyed cli ) else nil;; /*-----------------------*/ fun load(l)= if l==nil then 0 else let l -> [[key infos] nxt] in ( if !strcmp key "compCLSID" then ( set CLSID=hd infos; 0; ) else if !strcmp key "listAct" then ( set listAct=[[hd infos hd tl infos hd tl tl infos] listAct]; 0; ) else if !strcmp key "listEvt" then ( set listEvt=[[hd infos hd tl infos hd tl tl infos] listEvt]; 0; ) else nil; load nxt; );; /*-----------------------*/ fun IniDMI(s)= _DMSregisterDMI this @action nil @clidestroyed nil; load strextr _getpack _checkpack s;;