/* Grep Server - DMS - feb 98 - by Sylvain HUET */ /* Rev. Aug. '98 - by Marc BARILLEY */ /* v 1.1 */ var SECOND = 0;; var FOLLOWING = 1;; var WHOLE = 2;; var NONE = 3;; typeof patt=[[S I] r1];; /* pattern transmit_mode */ fun act (cli, l_param, i)= if i >= sizelist patt then 0 else ( let nth_list patt i -> [pattern mode] in if (!strcmp hd hd l_param pattern)||(!strcmp pattern "*") then _DMSevent this cli (strcatn "out"::(itoa i)::"."::pattern::nil) if mode==SECOND then hd tl hd l_param else if mode==FOLLOWING then strbuild (tl hd l_param)::tl l_param else if mode==NONE then nil else strbuild l_param nil else nil; act cli l_param i+1 ) ;; fun activate (from,cli,action,param,rep)= if !strcmp action "input" then act cli strextr param 0 else nil;; fun getPatt (l)= if l==nil then nil else let hd l->[keyword [str [mode _]]] in if !strcmp keyword "patt" then [str (atoi mode)]::getPatt tl l else getPatt tl l ;; fun IniDMI(param)= _DMSregisterDMI this @activate nil nil nil; set patt=getPatt strextr _getpack _checkpack param;;