/****************************************************************/ /* Filter for use with Weasel */ /* */ /* The function of this filter is to call a sequence of */ /* other filters. This allows you to take filters written */ /* by other people, and in effect combine them without */ /* having to rewrite the individual filters. As long as */ /* the filter result is 0, all filters are called in the */ /* specified sequence. The first filter to return a nonzero */ /* result interrupts the sequence. */ /* */ /* STATUS: Working */ /* */ /* Author: Peter Moylan (peter@ee.newcastle.edu.au) */ /* Started: 30 October 2001 */ /* (modified by Dave Saville to handle Perl scripts) */ /* Last revised: 06 August 2003 */ /* */ /* Installation: */ /* Change the assignment to string variable FiltersToCall */ /* (see below, line 32 of this script) to make it a */ /* comma-separated list of the individual filter */ /* programs that you want to call. */ /* If you want to handle Perl scripts, modify line 47 to */ /* give the correct path for your perl.exe. */ /* Put this file in the directory containing WEASEL.INI */ /* Put its name in the 'Options' page in Setup. */ /* Weasel needs to be restarted to recognise the change. */ /* */ /****************************************************************/ FiltersToCall = "virusfilter.cmd, example.exe, subscriptionfilter.pl, admincommands.pl" CALL RxFuncAdd SysLoadFuncs, rexxutil, sysloadfuncs CALL SysLoadFuncs PARSE ARG SrcFile userlist ReturnCode = 0 DO WHILE (ReturnCode = 0) & (FiltersToCall \= '') PARSE VAR FiltersToCall ThisFilter ',' FiltersToCall k = LASTPOS('.', ThisFilter) IF (k>0) & (TRANSLATE(SUBSTR(ThisFilter, k+1)) = 'CMD') THEN INTERPRET 'CALL "'STRIP(ThisFilter)'" SrcFile userlist' ELSE IF (k>0) & (TRANSLATE(SUBSTR(ThisFilter, k+1)) = 'PL') THEN DO '@d:\usr\bin\perl.exe 'STRIP(ThisFilter) SrcFile userlist result = rc END ELSE DO '@'ThisFilter SrcFile userlist result = rc END ReturnCode = result END say "Multifilter - ReturnCode from "||ThisFilter||" = "||ReturnCode RETURN ReturnCode