/* Global Download Server - DMS - February 2003 - by Bob Le Gob */ /******************************************************************************* Functions *******************************************************************************/ /******************************************************************************* Functions: Client handling *******************************************************************************/ /******************************************************************************* the client part of the module has been deleted cli -> CLIENT : Client <- I : Not used *******************************************************************************/ fun cbDeleteClient (cli) = _DMSeventTag this CtoU cli "ended" nil nil nil; 0;; /******************************************************************************* destroys a client from -> DMI : Not used user -> User : User triggering the action action -> S : Not used param -> S : Not used others -> [User r1] : Not used tag -> Tag : Not used <- I : Not used *******************************************************************************/ fun cbDestroy (from, user, action, param, others, tag) = let UtoC user -> cli in ( _DMSdelClientDMI this cli; _DMSeventTag this user "destroyed" nil nil nil; ); 0;; /******************************************************************************* creates a client from -> DMI : Not used user -> User : User triggering the action action -> S : Not used param -> S : Parameters of the action others -> [User r1] : Not used tag -> Tag : Not used p -> S : Server parameters for client - strbuild format <- I : Not used *******************************************************************************/ fun cbStart (from, user, action, param, others, tag, p) = if _DMScreateClientDMI this UtoC user p then _DMSeventTag this user "started" nil nil nil else nil; 0;; /******************************************************************************* Functions: Module instanciation *******************************************************************************/ /******************************************************************************* Standard IniDMI file -> S : Not used <- I : Not used *******************************************************************************/ fun IniDMI(file)= let _DMSgetDef this "dmi" -> l in let getInfo l "bgBmp" -> sBgBmp in let getInfo l "bgCol" -> sBgCol in let getInfo l "pgCol" -> sPgCol in let getInfo l "crCol" -> sCrCol in let (if !strcmp sBgBmp nil then strbuild ("bgCol"::sBgCol::nil)::("pgCol"::sPgCol::nil)::("crCol"::sCrCol::nil)::nil else strbuild ("bgBmp"::sBgBmp::nil)::("pgCol"::sPgCol::nil)::("crCol"::sCrCol::nil)::nil) -> sParam in ( _DMSregister this nil @cbDeleteClient nil; _DMSdefineActions this (["start" (mkfun7 @cbStart sParam)]):: (["destroy" @cbDestroy]):: nil; ); 0;;