Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Internet » StarterPak/!Newsbase/!RunimageS
StarterPak/!Newsbase/!RunimageS
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Internet |
Filename: | StarterPak/!Newsbase/!RunimageS |
Read OK: | ✔ |
File size: | 209F4 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10ONERRORREPORT:PRINT" at ";ERL:END 20PROCinit 30IFFNduptask>0THENEND 40PROCcreatedirs 50PROCloadcode 60PROCstartmsgtrans 70PROCstartwimp 80REM claim all free memory, bar 64k, up to a maximum of 320k (free space) 90END=HIMEM+FNfreemem(-64) 100IF(HIMEM-END)>320*1024THENEND=END+320*1024 110PROCloadsysconf 120PROCchecknewsdir 130PROCgettransports 140PROClocknewsdir 150PROCinitgrpdata 160PROCinitfilters 170END=(END+&4000) 180PROCreadconfig 190PROCinituserdata 200PROCstarttransport 210PROCautoconfigure 220FORl1%=1TO3:PROCpoll(0):NEXTl1% 230END=(END+&4000) 240startupok%=1:PROCnbstartup(0,0,0) 250PROCcheckoutfiles 260PROCinitconf(initconf%) 270END=HIMEM+FNcheckslot 280ONERRORPROCerrorbox(TRUE) 290PROCstartupcheckexpire 300REPEAT 310 IFcheckfiles%THEN 320 REPEAT 330 start%=0 340 file$=FNcheckforfiles(start%) 350 END=HIMEM+FNcheckslot 360 IFfile$>""THENPROCcheckdisk:PROCdobatch(file$,start%) 370 UNTILfile$="" 380 checkfiles%=autodebatch% 390 ENDIF 400 PROCsleep 410UNTIL0 420END 430 440DEFPROCinitconf(i%) 450IFi%>0ANDrw%THEN 460 IFi%=2THENPROCmessage0("Sinfo2",1) 470 PROCfront(msetup%):PROCprint(FNmsg0("Setup"),FNmsg0("Swait"),"","") 480 REPEAT:PROCpoll(50):UNTILconfopen%=FALSE:PROCsaveconfig 490ENDIF 500ENDPROC 510 520DEFPROCcron 530IFABS(time%-cron0%)>600THENcron0%=time%:PROCcheckoutfiles 540IFABS(time%-cron1%)>1200THENcron1%=time%:PROCchecktosend 550IFABS(time%-cron2%)>6000THENcron2%=time%:PROCchecklock:PROClog("") 560IFABS(time%-cron3%)>400ANDinfoopen%THENPROCcredits:cron3%=time% 570IFABS(time%-cron4%)>30000THENcron4%=time%:IFblockexpire%=0THENPROCcheckexpire 580ENDPROC 590 600DEFPROCsleep 610LOCALm$ 620m$="Idle2":IFrw%THENm$="Idle" 630PROCprint(FNmsg0(m$)," "," "," "):sleep%=time% 640REPEATPROCpoll(200):UNTILforcebatch%ORABS(time%-sleep%)>=chktime% 650forcebatch%=0 660ENDPROC 670 680DEFPROCchecknewsdir 690WHILEnewsroot$="" 700 IFrw%THENPROCmessage0("Snewsdir",1)ELSEPROCmessage0("Sronewsdir",1) 710 PROCcreatedirs:IFnewsroot$=""ANDrw%PROCcfront(savend%,0,0) 720 REPEATPROCpoll(200):UNTILndopen%=0:PROCcreatedirs 730ENDWHILE 740IFVALFNvarval("NewsDir$Version")<1ANDrw%THEN 750 PROCmessage0("Supdate",0):PROCpoll(0) 760 PROCmakenewsdir("<NewsDir$Dir>"):PROCmessage("",0) 770ENDIF 780ENDPROC 790 800DEFFNcheckforfiles(RETURN start%) 810LOCALt1%,l%,f$,pat$ 820IFrw%ANDFNfreemem(0)>32*1024THEN 830 PROCprint(FNmsg0("Idle"),FNmsg0("Fcheck")," "," ") 840 REM first check for recovery record... 850 f$=FNcheck_recfile(start%) 860 IFf$=""THEN 870 start%=0:t1%=0 880 IFtransi$(transport%,0)=""THENl%=FNruntransportfile(13,"","","") 890 REPEAT 900 l%=0 910 REPEATpat$=transi$(t1%,l%) 920 IFpat$>""THENf$=FNcheckinfiles(pat$):l%+=1 930 UNTILf$>""ORpat$=""ORl%=10 940 t1%+=transport% 950 UNTILf$>""ORt1%>transport%ORtransport%=0 960 ENDIF 970ENDIF 980=f$ 990 1000DEFPROCstartupcheckexpire 1010IFFNcheckexpiretime(FNtime)THEN 1020 REM check if expiry is wanted; mark as done if not. 1030 IFFNconfirm2(FNmsg0("Econfirm"))=2THENPROCstamp(newsroot$+".news") 1040ENDIF 1050IFrw%THENblockexpire%=0:cron4%=0 1060ENDPROC 1070 1080DEFPROCcheckexpire 1090LOCALt%,g%,t$,now% 1100now%=FNtime 1110IFFNcheckexpiretime(now%)THEN 1120 PROCnbupdate(10,"",0,"","") 1130 PROClog("Starting automatic expiry") 1140 PROCprint("",FNmsg0("Echeck")," "," ") 1150 PROCstamp(newsroot$+".news") 1160 g%=0:REPEATg%+=1 1170 t%=FNfiletime(FNpath(grp$(g%))) 1180 IFt%<now%THENPROCexpiregroup(g%,0,autoexp%) 1190 IFg%MOD10=0THENPROCpoll(slice%*2) 1200 IFcancel%THEN 1210 IFFNconfirm(FNmsg1("Ccancexp",g$))=2THENcancel%=0ELSEcancel%=TRUE 1220 ENDIF 1230 UNTILg%=groups%ORcancel%<>0 1240 PROClog("Finished expiry") 1250 PROCrunsupport("Trimlist "+STR$ngexp%):PROCexpmiscdir(tmpdir$,1) 1260ENDIF 1270ENDPROC 1280 1290DEFFNcheckexpiretime(now%) 1300LOCALyes%,last%,now$,test$,etime% 1310yes%=0 1320IFrw%THEN 1330 last%=FNfiletime(newsroot$+".news") 1340 REM test$ is expiry trigger time as string, format CEYRMNDYHRMI 1350 REM FNfiletime returns file timestamp in same format 1360 IFpostfetchready%<>0THEN 1370 postfetchready%=0 1380 t%=FNruntransportfile(5,"","",""):REM postfetch... 1390 ENDIF 1400 etime%=exptime%:IFexpany%THENetime%=0 1410 IFautoexp%ANDindebatch%=0THEN 1420 test$=STR$now%+RIGHT$("0000"+STR$etime%,4) 1430 now$=FNfulltime 1440 yes%=(now$>test$) 1450 IFyes%THEN 1460 REM also check last expiry was yesterday... 1470 IFlast%>now%-1THENyes%=0 1480 REM and check transport not active... don't want expiry while online. 1490 IFyes%THENIFFNruntransportfile(15,"","","")<>0THENyes%=0 1500 ENDIF 1510 ENDIF 1520ENDIF 1530=yes% 1540 1550DEFPROCcheckoutfiles 1560LOCALl%,t%,f$,d$,p$,n%:l%=0 1570REPEAT 1580 f$=transo$(transport%,l%):l%+=1 1590 d$=FNdir(f$):p$=FNleaf(f$) 1600 SYS"XOS_GBPB",9,d$,tmp%,1,0,255,p$ TO,,,n%;err% 1610 IF(err%AND1)=0ANDn%>0THENt%+=1 1620UNTILf$=""ORl%=11 1630d$=defic$:IFt%=0THENdefic$="newsbase1"ELSEdefic$="newsbase2" 1640IFd$<>defic$THENPROCchangeic(defic$) 1650ENDPROC 1660 1670DEFFNcheckinfiles(A$) 1680LOCALresult$,n%,next%,f$,ff$,f%,F%,l%,source$,pat$,dirbuf%,dbr% 1690next%=0 1700dbr%=FNclaim(dirbuf%,dbsize%,"dbuf") 1710source$=FNdir(A$):pat$=FNleaf(A$) 1720REPEAT 1730 SYS"XOS_GBPB",9,source$,dirbuf%,1,next%,dbsize%,pat$ TO,,,n%,next%;F% 1740 IF(F%AND1)=0ANDn%>0THEN 1750 f$=FNstr(dirbuf%):ff$=source$+"."+f$ 1760 REM attempt deletion of any empty files... 1770 IFFNfilesize(ff$)=0THENF%=FNdelfile(ff$) 1780 REM see if file can be opened for read access... 1790 F%=0:f1%=FNopenin(ff$) 1800 IFf1%<>0THEN 1810 PROCcf(f1%) 1820 IFsource$<>workdir$THEN 1830 F%=FNruntransportfile(4,ff$,"","") 1840 IFF%=0THEN 1850 F%=FNmovefile(ff$,workdir$+"."+f$) 1860 ELSE 1870 PROCmessage1("Dnoprefetch",FNvarval("Newsbase$ReturnInfo"),1) 1880 ENDIF 1890 ENDIF 1900 IFF%=0THENresult$=workdir$+"."+f$ 1910 ENDIF 1920 ELSE 1930 PROCpoll(slice%*2) 1940 ENDIF 1950UNTILresult$>""ORnext%<0OR(F%AND1)<>0 1960PROCrelease(dbr%) 1970=result$ 1980 1990DEFPROCchecktosend 2000LOCALn%,next%,f$,d$,F%,dirbuf%,dbr%,info$,u$,ty% 2010IFrw%THEN 2020 nf%=0:dbr%=FNclaim(dirbuf%,dbsize%,"dbuf") 2030 FORty%=0TO1:n%=transm%(transport%,ty%+1) 2040 IFFNfreemem(0)>=n%*1024THEN 2050 next%=0:REPEAT 2060 SYS"XOS_GBPB",9,outdir$(ty%),dirbuf%,1,next%,dbsize%,"*"TO,,,n%,next%;F% 2070 IF(F%AND1)=0ANDn%>0THEN 2080 f$=outdir$(ty%)+"."+FNstr(dirbuf%):PROCsettype(f$,&FFF) 2090 d$=FNtmpfile:F%=FNmovefile(f$,d$) 2100 IF(F%AND1)=0THEN 2110 next%-=1:info$=FNkeepfile(ty%,d$,u$) 2120 CASEty%OF 2130 WHEN0:r$=FNsendmail(d$,u$) 2140 WHEN1:r$=FNsendnews(d$,info$,u$) 2150 ENDCASE 2160 IFr$>""PROCmessage1("Qsendfail",d$,1) 2170 PROCpoll(slice%*2) 2180 ENDIF 2190 ENDIF 2200 UNTILnext%<0OR(F%AND1)<>0 2210 ENDIF 2220 NEXTty% 2230 PROCrelease(dbr%) 2240ENDIF 2250ENDPROC 2260 2270DEFFNdir(f$) 2280LOCALl% 2290l%=LENf$:REPEATl%-=1:UNTILMID$(f$,l%,1)="."ORl%<1 2300=LEFT$(f$,l%-1) 2310 2320DEFFNleaf(f$) 2330LOCALl% 2340l%=LENf$:REPEATl%-=1:UNTILMID$(f$,l%,1)="."ORl%<1 2350=MID$(f$,l%+1) 2360 2370DEFPROCdobatch(fullbf$,bstart%) 2380LOCALbf$,ty$,F% 2390bf$=FNleaf(fullbf$) 2400PROCdecompress(fullbf$) 2410IFFNfiletype(fullbf$)=&FCA THEN 2420 PROCmessage0("CompFail4",1):PROClog("Batch decompression failed for "+bf$) 2430 IFFNmovetodebug(fullbf$)<>0THENF%=FNforcedelfile(fullbf$) 2440 ELSE 2450 PROCstartmemmgr:indebatch%=TRUE 2460 inbuf%=base%:PROCextend(inbufsize%):artbase%=base%+inbufsize% 2470 PROCprint(FNmsg0("Dstart")," "," "," ") 2480 PROCopenbatch(fullbf$,bstart%) 2490 cancel%=FALSE 2500 done%=0:del%=TRUE:off%=0:ptr%=0:recpos%=0:lastpos%=0:batartlen%=0 2510 type%=FNidentifyfile(fullbf$,bstart%) 2520 IFtype%=0THENty$=FNmsg0("Mail")ELSEty$=FNmsg0("News") 2530 start%=TRUE:total%=0:dstime%=time% 2540 WHILEeof%=FALSE 2550 cancel%=FALSE:PROCdoarticle:PROCsavelist 2560 PROCprint(FNmsg1("Dtype",ty$),"","","") 2570 IFcancel%THENPROCcancelbatch 2580 ENDWHILE 2590 PROCextend(0):indebatch%=0 2600 PROCendbatch(fullbf$) 2610ENDIF 2620ENDPROC 2630 2640DEFPROCcancelbatch 2650eof%=TRUE:del%=FALSE:PROCcf(f00%):PROCwrite_recfile:indebatch%=0 2660PROCmessage0("Dcancel",0):PROCpause 2670ENDPROC 2680 2690DEFPROCendbatch(batchf$) 2700LOCALF%,n%,t%,debdir$,rate$:rate$="" 2710PROCwriteindexbuf 2720REM write debatch stats to logfile 2730t%=ABS(dstime%-time%)DIV100:IFt%>0THENrate$=STR$((len%-bstart%)DIVt%)+"cps" 2740PROClog("Finished batch "+bf$+" "+STR$done%+" arts "+STR$len%+" bytes "+rate$) 2750PROCcf(f00%):REM batch file should be closed already, but this ensures. 2760PROCchangeic(defic$) 2770IFcancel%=0THEN 2780 PROCsavegrpdata 2790 PROCdel_recfile 2800 IFkeepb%<>0ORdel%=0THEN 2810 IFFNmovetodebug(batchf$)<>0THENF%=FNforcedelfile(batchf$) 2820 ELSE 2830 F%=FNforcedelfile(batchf$) 2840 ENDIF 2850 IFF%<>0THENPROCmessage1("Ddelfail",bf$,1) 2860 postfetchready%=1 2870 PROCexpmiscdir(baddir$,dbg_exptime%) 2880ENDIF 2890PROCarrive 2900ENDPROC 2910 2920DEFFNmovetodebug(f$) 2930LOCALF%,n%,d$,bf$,b% 2940bf$=FNleaf(f$) 2950d$=baddir$+"."+bf$:PROCensuredir(d$) 2960IFFNobjtype(d$)<2THENd$=baddir$ 2970n%=1:REPEAT 2980 ?tmp%=3:SYS"OS_Word",14,tmp% 2990 SYS"Territory_ConvertDateAndTime",1,tmp%,tmp%+128,128,"%MN%DY%24%MI%SE"TOb% 3000 n%+=1:F%=FNrename(f$,d$+"."+FNstr(b%)) 3010UNTILn%>9ORF%=0 3020=F% 3030 3040DEFPROCarrive 3050LOCALa$,a% 3060CASEarrart%OF 3070 WHEN0:a$=FNmsg0("Nonews") 3080 WHEN1:a$=FNmsg0("Newnews1") 3090 OTHERWISE:a$=FNmsg1("Newnews",STR$arrart%) 3100ENDCASE 3110PROCupdateiconstring(arrive%,1,a$) 3120IFarrmail$>""THENa$=FNmsg1("Newmail",MID$(arrmail$,2))ELSEa$=FNmsg0("Nomail") 3130PROCupdateiconstring(arrive%,2,LEFT$(a$,36)) 3140IFalert%THEN 3150 IFarrmail$>""OR(arrart%>0ANDalertnews%<>0)THEN 3160 IFarropen%=0PROCcfront(arrive%,0,0)ELSEPROCfront(arrive%) 3170 a%=1:IFdefclient$>""ANDFNobjtype(defclient$)>0THENa%=0 3180 PROCsetshaded(arrive%,3,a%) 3190 IFalertbeep%VDU7 3200 ENDIF 3210ENDIF 3220ENDPROC 3230 3240DEFPROCsavegrpdata 3250IFstartupok%<>0THEN 3260 PROCwritegrpdata 3270 PROCwriteindexbuf 3280ENDIF 3290PROCadddelbuf(0,0) 3300ENDPROC 3310 3320DEFPROCdoarticle 3330PROCextend(inbufsize%+defartbuf%) 3340PROCclearheader 3350outg%()=0:ptr%=0:inhdr%=TRUE:out$="":foundid%=0 3360nextartpos%=pos%+thisartlen%:thisartpos%=pos% 3370REPEAT 3380 IFinhdr%THEN 3390 PROCheaderline(line$):start%=0:PROCpoll(slice%*2) 3400 IFdiscard%=0PROCaddtobuffer(line$):ELSEPROCdiscard 3410 IFline$=""THENinhdr%=FALSE:IFthisartlen%>0THENPROCblockmove:PROCbatchpoll 3420 ELSE 3430 PROCaddtobuffer(line$):PROCbatchpoll 3440 ENDIF 3450 line$=FNgetline 3460 IFinhdr%=0ANDpos%>nextartpos%-100THENIFLEFT$(line$,seplen%)=sep$THENstart%=TRUE 3470UNTILstart%<>0 OReof%<>0 3480IFLEFT$(line$,4)="#! r"THENthisartlen%=VALMID$(line$,10):ELSEthisartlen%=0 3490done%+=1:total%+=1:IFtype%=1THENarrart%+=1 3500ENDPROC 3510 3520DEFPROCdiscard 3530LOCALtmp$:tmp$=line$ 3540WHILElong%:tmp$=FNgetline:ENDWHILE 3550ENDPROC 3560 3570DEFPROCbatchpoll 3580PROCpoll(slice%):IFABS(time%-stime%)>200THENPROCupdatepos:stime%=time% 3590ENDPROC 3600 3610DEFPROCblockmove 3620LOCALl%,F%,m%,a0%,a1%,a2%,a3% 3630l%=thisartlen%-pos%+thisartpos% 3640IFbufptr%+l%+4>inbufsize%THENENDPROC 3650m%=inbuf%+bufptr%+l%:a0%=?m%:a1%=m%?1:a2%=m%?2:a3%=m%?3 3660REM check for "#! r" without reading string (buffer overrun-possible data abort) 3670IFa0%=35ANDa1%=33ANDa2%=32ANDa3%=114THEN 3680 IFptr%+l%>bufsize%THENPROCextend(inbufsize%+bufsize%+l%+1024) 3690 SYS"XWimp_TransferBlock",task%,inbuf%+bufptr%,task%,artbase%+ptr%,l%TO;F% 3700 IF(F%AND1)=0THENpos%+=l%:ptr%+=l%:bufptr%+=l% 3710ENDIF 3720ENDPROC 3730 3740DEFPROCclearheader 3750to$="<blank>":from$="(no sender)":subject$="(no subject)":cc$="":origto$="" 3760messid$="<0>":newsgroup$="":expires%=0:artdate%=0:supersede$="":control$="" 3770receipt$="":lasth%=0:precedence$="":replyto$="":approved$="":reference$="" 3780ENDPROC 3790 3800DEFFNidentifyfile(file$,offset%) 3810LOCALt%,lc%,clue%,a$:t%=-1:clue%=-1 3820REPEAT 3830 line$=FNgetline 3840 lc%+=1:line$=FNclean(line$):a$=FNlower(line$) 3850 IFASC(line$)=1THENt%=0:sep$=CHR$1:ident$="" 3860 IFLEFT$(line$,5)="From "THENt%=0:sep$="From ":ident$="" 3870 IFLEFT$(line$,8)="#! rmail"THENt%=0:sep$="#! rmail":ident$="":thisartlen%=VALMID$(line$,10) 3880 IFLEFT$(line$,8)="#! rnews"THENt%=1:sep$="#! rnews":ident$="Newsgroups:":thisartlen%=VALMID$(line$,10) 3890 IFLEFT$(a$,11)="newsgroups:"ORLEFT$(a$,5)="xref:"ORLEFT$(a$,5)="path:"THENclue%=1 3900 IFLEFT$(a$,4)="to: "ORLEFT$(a$,14)="apparently-to:"THENclue%=0 3910UNTILt%>=0OReof%<>0 3920IFt%<0THEN 3930 t%=1:sep$="#! rnews":ident$="Newsgroups:" 3940 IFclue%=0THENt%=0:sep$="From ":ident$="" 3950ENDIF 3960IFlc%>1THENPROCrestartbatch(file$,t%,offset%) 3970seplen%=LENsep$ 3980=t% 3990 4000DEFPROCheaderline(line$) 4010LOCALA$ 4020IFsep$<>"From "ANDLEFT$(line$,seplen%)=sep$THENdiscard%=TRUE:ENDPROC 4030PROCsetheadervar(line$) 4040IFtype%=1ANDLEFT$(line$,5)="Path:"THENPROCaddustopath(line$):ENDPROC 4050IFfoundid%>0THENENDPROC 4060IFtype%=0ORlasth%=11THEN 4070 IFtype%=0THEN 4080 A$="Email."+bf$:IFFNuserok(bf$)=0THENA$="Email.postmaster" 4090 ELSE 4100 A$=newsgroup$:outg%()=0 4110 ENDIF 4120 PROCaddheadertobuffer(line$):PROCgroupsline(A$):discard%=TRUE:foundid%=1 4130 IFtype%=1THENPROCdoxref 4140ENDIF 4150ENDPROC 4160 4170DEFPROCsetheadervar(A$) 4180LOCALno%:IFA$=""THENENDPROC 4190CALLheaderno%,A$,no% 4200CASEno%OF 4210 WHEN1:subject$=FNclean(MID$(A$,9)) 4220 WHEN2:from$=FNclean(MID$(A$,6)) 4230 WHEN3:messid$=FNclean(MID$(A$,12)) 4240 WHEN4:supersede$=FNclean(MID$(A$,12)) 4250 WHEN5:expires%=FNdecodedate(MID$(A$,9)) 4260 WHEN6:control$=FNclean(MID$(A$,9)) 4270 WHEN7:artdate%=FNdecodedate(MID$(A$,7)) 4280 WHEN8:discard%=TRUE 4290 WHEN9:IFto$=""THENto$=FNclean(MID$(A$,15)) 4300 WHEN10:to$=FNclean(MID$(A$,4)) 4310 WHEN11:newsgroup$=FNclean(MID$(A$,12)) 4320 WHEN12:receipt$=FNclean(MID$(A$,20)) 4330 WHEN13:precedence$=FNclean(MID$(A$,12)) 4340 WHEN14:replyto$=FNclean(MID$(A$,10)) 4350 WHEN15:approved$=FNclean(MID$(A$,10)) 4360 WHEN16:PROCaddtobuffer(A$):discard%=TRUE:line$="":REM "Message:" header 4370 WHEN17:reference$=FNclean(MID$(A$,12)) 4380 WHEN18:cc$=FNclean(MID$(A$,5)) 4390 WHEN19:origto$=FNclean(MID$(A$,19)) 4400 WHEN20:REM Errors-To: 4410 OTHERWISE:IFLEFT$(A$,1)=" "THENPROCconthline(A$,lasth%)ELSElashh%=0 4420ENDCASE 4430IFno%>0THENlasth%=no% 4440ENDPROC 4450 4460DEFPROCconthline(a$,t%) 4470CASEt%OF 4480 WHEN10:IFLENto$+LENa$<250THENto$+=a$ 4490 WHEN17:IFLENreference$+LENa$<250THENreference$+=a$ 4500 WHEN18:IFLENcc$+LENa$<250THENcc$+=a$ 4510ENDCASE 4520ENDPROC 4530 4540DEFFNdecodedate(A$) 4550LOCALres%,d$,m$,y$,l%,m%:REM attempt to decode header date... 4560l%=INSTR(A$,","):IFl%>0THENA$=MID$(A$,l%+1) 4570 A$=FNclean(A$):A$=FNlower(A$):l%=INSTR(A$," ") 4580 d$=LEFT$(A$,l%-1):IFl%=2THENd$="0"+d$ 4590 m%=INSTR("janfebmaraprmayjunjulaugsepoctnovdec",MID$(A$,l%+1,3))DIV3+1 4600 m$=RIGHT$("0"+STR$m%,2) 4610 y$=MID$(A$,l%+5,4):l%=INSTR(y$," ") 4620 IFl%>0THENy$=STR$((FNtime)DIV1E6)+LEFT$(y$,2) 4630 IFVALd$*VALm$*VALy$>0THENres%=VAL(y$+m$+d$) 4640=res% 4650 4660DEFPROCdeleteid(g%,id$) 4670LOCALa%,f$,id1$ 4680REPEATid1$=FNgetpar(id$," ") 4690 PROCprint("",FNmsg1("Acancel",id1$),"",""):a%=FNfindartid(g%,id1$) 4700 IFa%>0THEN 4710 PROCdelart(g%,a%):PROClog("Cancelled "+id1$+" in "+grp$(g%)) 4720 ELSE 4730 PROCprint("",FNmsg0("Afail"),"","") 4740 ENDIF 4750UNTILid$="" 4760ENDPROC 4770 4780DEFPROCdocontrol(g%,a$) 4790LOCALc$ 4800c$=FNclean(FNgetpar(a$," ")) 4810IFc$="cancel"ANDdocanc%<>0THEN 4820 a$=FNclean(a$):IFLEFT$(a$,1)="<"ANDRIGHT$(a$)=">"THENPROCdeleteid(g%,a$) 4830ENDIF 4840ENDPROC 4850 4860DEFPROCdoxref 4870LOCALxref$,c%,t% 4880IFoutg%(0)>0THEN 4890 xref$="Xref: "+hostname$ 4900 c%=0:REPEAT 4910 IFLENxref$+LENgrp$(outg%(c%))<200 THENxref$=xref$+" "+grp$(outg%(c%))+":"+STR$outs%(c%) 4920 c%+=1 4930 UNTILoutg%(c%)=0ORc%=maxsave% 4940 t%=long%:long%=0:PROCaddtobuffer(xref$):long%=t% 4950ENDIF 4960ENDPROC 4970 4980DEFPROCaddustopath(a$) 4990LOCALtemp%,l%:l%=0 5000IFhostname$>""ANDINSTR(a$,hostname$)<1THEN 5010 temp%=long%:long%=TRUE 5020 PROCaddheadertobuffer("Path: "+hostname$+"!"):long%=temp% 5030 l%=INSTR(a$,":") 5040ENDIF 5050PROCaddtobuffer(FNclean(MID$(a$,l%+1))):discard%=TRUE 5060ENDPROC 5070 5080DEFFNgetline 5090REM if line incomplete, long% is set to TRUE. 5100LOCALC%,P%,l%,loc%,A$ 5110long%=FALSE:P%=0:discard%=0:lastpos%=pos% 5120REM first try fast line fetch 5130IFpos%+254<len%ANDbufptr%+254<inbufsize%THEN 5140 loc%=bufptr%+inbuf%:CALLgetline%,long%,loc%,A$ 5150 P%=LENA$-(long%=0):bufptr%+=P%:pos%+=P%:=A$ 5160ENDIF 5170REM if that fails, use the slower smarter one 5180P%=0:REPEAT 5190 C%=bufptr%?inbuf%:bufptr%+=1:P%+=1 5200 IFP%<250THENtmp%?P%=C% ELSEC%=10:long%=TRUE 5210 IFpos%>=len% THENeof%=TRUE ELSEIFbufptr%=inbufsize% PROCfill 5220UNTILC%=10 ORC%=13 OReof%<>0:pos%+=P% 5230IFtmp%?P%<32 ANDtmp%?P%<>1 THENtmp%?P%=13 ELSEtmp%?(P%+1)=13 5240=$(tmp%+1) 5250 5260DEFPROCupdatepos 5270LOCALstat$,t% 5280IFlen%>0 THEN 5290 stat$=STR$pos%+"/"+STR$len%+" bytes ("+STR$(INT(100*(pos%/len%)))+"%) " 5300 t%=ABS(dstime%-time%)DIV100:IFt%>0THENstat$+=STR$((pos%-bstart%)DIVt%)+"cps" 5310 PROCprint("","",stat$,FNmsg1("Newnews",STR$total%)) 5320 IFbaric$=defic$THENPROCchangeic("newsbased")ELSEPROCchangeic(defic$) 5330ENDIF 5340ENDPROC 5350 5360DEFPROCaddtobuffer(A$) 5370REM this automatically adds continuation lines to the buffer. 5380IFptr%>cbufsize% PROCextend(inbufsize%+bufsize%+defartbuf%) 5390$(artbase%+ptr%)=A$:ptr%+=LENA$:IFlong%THENPROCaddlong 5400artbase%?ptr%=10:ptr%+=1 5410ENDPROC 5420 5430DEFPROCaddlong 5440WHILElong% 5450 A$=FNgetline 5460 IFptr%>cbufsize%THENPROCextend(inbufsize%+bufsize%+defartbuf%) 5470 $(artbase%+ptr%)=A$:ptr%+=LENA$ 5480ENDWHILE 5490ENDPROC 5500 5510DEFPROCaddheadertobuffer(A$) 5520IFptr%>cbufsize% PROCextend(inbufsize%+bufsize%+defartbuf%) 5530$(artbase%+ptr%)=A$:ptr%+=LENA$:IFlong%=0THENartbase%?ptr%=10:ptr%+=1 5540ENDPROC 5550: 5560DEFPROCextend(mem%) 5570REPEAT 5580 SYS"Wimp_SlotSize",min_mem%+mem%,-1TOnew% 5590 IF(min_mem%+mem%)>new%THENPROCmessage0("Needmem1",1) 5600UNTIL(min_mem%+mem%)<=new% 5610bufsize%=new%-min_mem%-inbufsize%:cbufsize%=bufsize%-300 5620ENDPROC 5630 5640DEFPROCcheckdisk 5650LOCALf%,F% 5660REPEAT 5670f%=FNdiskspace(basedir$) 5680IFf%<(mindsk%*1024)THENPROCmessage0("Needdisk",1) 5690UNTILf%>=(mindsk%*1024) 5700ENDPROC 5710 5720DEFFNdiskspace(a$) 5730LOCALF%,f% 5740SYS"XOS_FSControl",49,basedir$TOf%;F%:IF(F%AND1)<>0THENf%=0 5750=f% 5760 5770DEFFNclean(A$) 5780REM strips leading & trailing spaces 5790LOCALB$:IFA$>""THENCALLtrimstr%,A$,B$ 5800=B$ 5810 5820DEFPROCopenbatch(f$,offset%) 5830f00%=FNopenin(f$) 5840bufptr%=0:eof%=FALSE:len%=0:pos%=offset% 5850IFf00%<>0THENlen%=EXT#f00%:PTR#f00%=offset% 5860PROCfill 5870ENDPROC 5880 5890DEFPROCrestartbatch(f$,t%,offset%) 5900LOCALa$:a$=FNmsg0("Mail"):IFt%>0THENa$=FNmsg0("News") 5910PROCmessage1("Dbadhead",a$,0) 5920PROCcf(f00%):line$="":del%=FALSE:PROCopenbatch(f$,offset%) 5930ENDPROC 5940 5950DEFPROCfill 5960LOCALr3%,F% 5970IFf00%<>0THEN 5980 SYS"XOS_GBPB",4,f00%,inbuf%,inbufsize%TO,,,r3%;F% 5990 IF(F%AND1)<>0ORr3%>0THENPROCcf(f00%) 6000ENDIF 6010bufptr%=0 6020ENDPROC 6030 6040DEFFNaddtosavelist(g$,c%) 6050LOCALg% 6060g%=FNnametono(FNclean(g$),TRUE) 6070IFg%>0ANDc%<=maxsave%THENoutg%(c%)=g%:outs%(c%)=FNseq(g%):c%+=1 6080=c% 6090 6100DEFPROCdefaultsavelist 6110LOCALg% 6120CASEtype%OF 6130WHEN0:g%=FNnametono("Email.postmaster",TRUE) 6140OTHERWISE:g%=FNnametono("junk",TRUE) 6150ENDCASE 6160IFg%>0THENoutg%()=0:outg%(0)=g%:outs%(0)=FNseq(g%) 6170ENDPROC 6180 6190DEFPROCgroupsline(list$) 6200LOCALng%:ng%=0 6210IFINSTR(list$,",")=0THENng%=FNaddtosavelist(list$,ng%):ENDPROC 6220IFlong%THENPROClonggroupsline(list$):ENDPROC 6230REPEAT 6240 ng%=FNaddtosavelist(FNgetpar(list$,","),ng%) 6250UNTILlist$="" 6260ENDPROC 6270 6280DEFPROClonggroupsline(list$) 6290LOCALg$,p%,frag$,gfrag$,ng%,end%:ng%=0:end%=0 6300REPEAT 6310frag$="" 6320IFlong%=0THEN 6330 end%=TRUE 6340 ELSE 6350 p%=LENlist$:REPEATp%-=1:UNTILp%=1ORMID$(list$,p%,1)="," 6360 IFMID$(list$,p%,1)=","THENfrag$=MID$(list$,p%+1):list$=LEFT$(list$,p%-1) 6370ENDIF 6380REPEAT 6390 g$=FNgetpar(list$,","):IFgfrag$>""THENg$=gfrag$+g$:gfrag$="" 6400 ng%=FNaddtosavelist(g$,ng%) 6410UNTILg$=""ANDlist$="" 6420gfrag$=frag$ 6430IFlong%THENlist$=FNgetline:PROCaddheadertobuffer(list$) 6440UNTILend% 6450ENDPROC 6460 6470DEFPROCsavelist 6480LOCALc%,u$,g$ 6490IFoutg%(0)=0THENPROCdefaultsavelist 6500IFfilt%(type%)>0THENPROCcheckfilters 6510IFtype%=0THEN 6520 g$=grp$(outg%(0)):u$=FNgtou(g$) 6530 PROClog("New mail for "+u$+" from "+from$) 6540 IFreceipt$>""PROCreturnreceipt(receipt$) 6550 IFFNcheckforward(g$,u$)=1THENENDPROC 6560ENDIF 6570recpos%=lastpos% 6580c%=0:WHILEoutg%(c%)>0ANDc%<maxsave% 6590 PROCartsave(outg%(c%),outs%(c%)):c%+=1 6600ENDWHILE 6610ENDPROC 6620 6630DEFPROCcheckfilters 6640LOCALl%,t%:l%=0 6650WHILEl%<=nfilt%:t%=flt%(l%) 6660IFt%=3OR(t%=2ANDtype%=0)OR(t%=1ANDtype%=1)THENIFFNdofilter(l%)<>0THENl%=nfilt% 6670l%+=1 6680ENDWHILE 6690ENDPROC 6700 6710DEFFNdofilter(n%) 6720LOCALn$,a$,l1%,ok%,last% 6730ok%=0 6740FORl1%=0TO2:fl_ok%(l1%)=FALSE 6750 a$="*"+flc$(n%,l1%)+"*" 6760 CASEflc%(n%,l1%)OF 6770 WHEN1:IFFNsmatch(a$,from$)>0THENfl_ok%(l1%)=TRUE 6780 WHEN2:IFFNsmatch(a$,to$)>0ORFNsmatch(a$,cc$)>0ORFNsmatch(a$,origto$)>0THENfl_ok%(l1%)=TRUE 6790 WHEN3:IFFNsmatch(a$,subject$)>0THENfl_ok%(l1%)=TRUE 6800 WHEN4:IFFNsmatch(a$,newsgroup$)>0THENfl_ok%(l1%)=TRUE 6810 WHEN5:IFFNsmatch(a$,replyto$)>0THENfl_ok%(l1%)=TRUE 6820 WHEN6:IFFNsmatch(a$,precedence$)>0THENfl_ok%(l1%)=TRUE 6830 WHEN7:IFFNsmatch(a$,bf$)>0THENfl_ok%(l1%)=TRUE 6840 ENDCASE 6850 IFfln%(n%,l1%)>0THENfl_ok%(l1%)=(fl_ok%(l1%)=FALSE) 6860NEXTl1% 6870ok%=fl_ok%(0) 6880IFflc%(n%,1)>0THEN 6890 IFflj%(n%,1)=0THENok%=ok%*fl_ok%(1)ELSEok%=ok%+fl_ok%(1) 6900 IFflc%(n%,2)>0THEN 6910 IFflj%(n%,2)=0THENok%=ok%*fl_ok%(2)ELSEok%=ok%+fl_ok%(2) 6920 ENDIF 6930ENDIF 6940IFok%THEN 6950 PROCprint("",FNmsg1("Fapply",STR$(n%+1)),"","") 6960 a$=FNfsubst(fla$(n%)) 6970 CASEfla%(n%)OF 6980 WHEN1:PROCnosave:PROCdefaultsavelist 6990 WHEN2:PROCnosave 7000 WHEN3:IFLEFT$(a$,1)="+"THENn$=FNgetpar(a$," "):ELSEPROCnosave 7010 PROClog("Filter redirection to "+a$) 7020 ok%=0:WHILEoutg%(ok%)>0ANDok%<maxsave%:ok%+=1:ENDWHILE 7030 WHILEa$>"" 7040 last%=ok%:n$=FNgetpar(a$," ") 7050 ok%=FNaddtosavelist(FNclean(n$),ok%) 7060 IFok%=last%ANDn$>""THENPROClog("Invalid redirection to "+n$) 7070 ENDWHILE 7080 WHEN4:PROCsubmit(a$) 7090 ENDCASE 7100ENDIF 7110=ok% 7120 7130DEFFNfsubst(a$) 7140LOCALb$,l% 7150l%=INSTR(a$,"%") 7160WHILEl%>0:b$="" 7170CASEMID$(a$,l%+1,1)OF 7180 WHEN"u":IFtype%=1THENb$="news"ELSEb$=FNgtou(grp$(outg%(0))) 7190 WHEN"f":b$=from$ 7200 WHEN"t":b$=to$ 7210 WHEN"c":b$=cc$ 7220 WHEN"r":b$=replyto$ 7230 WHEN"%":b$="%" 7240ENDCASE 7250a$=LEFT$(a$,l%-1)+b$+MID$(a$,l%+2):l%+=LENb$-1 7260l%=INSTR(a$,"%",l%) 7270ENDWHILE 7280=a$ 7290 7300DEFPROCnosave 7310LOCALn%,g%:n%=0:REPEATg%=outg%(n%):IFg%>0THENoutg%(n%)=0:IFgrpseq%(g%)>0THENgrpseq%(g%)-=1 7320n%+=1:UNTILg%=0ORn%>maxsave% 7330ENDPROC 7340 7350DEFPROCsubmit(a$) 7360LOCALf$,b$,F%,m%,d%:f$=FNtmpfile 7370SYS"XOS_File",10,f$,&FFF,,artbase%,artbase%+ptr%TO;F% 7380IF(F%AND1)=0THEN 7390 WHILELEFT$(FNclean(a$),1)="-" 7400 b$=FNgetpar(a$," ") 7410 CASELEFT$(b$,2)OF 7420 WHEN"-M":m%=1024*VALMID$(b$,3) 7430 WHEN"-K":PROCnosave 7440 WHEN"-D":d%=TRUE 7450 WHEN"-J":PROCnosave:PROCdefaultsavelist 7460 ENDCASE 7470 ENDWHILE 7480 IFFNfreemem(0)<m%THENPROCmessage0("Fmem1",1) 7490 IFFNfreemem(0)>=m%THEN 7500 PROClog("Submitting filter job: "+a$):PROChgon 7510 SYS"XWimp_StartTask",a$+" "+f$:PROChgoff:IFd%THENPROCpoll(0):F%=FNdelfile(f$) 7520 ELSE 7530 PROCmessage0("Fmem2",0) 7540 ENDIF 7550ENDIF 7560ENDPROC 7570 7580DEFFNcheckforward(g$,u$) 7590LOCALu%,f$,F%,fto$,ret% 7600u%=FNuserno(u$):IFu%>0THEN 7610 f$=FNupath(u$)+".vacation" 7620 IFFNobjtype(f$)=1THEN 7630 IFprecedence$<>"bulk"ANDprecedence$<>"junk"ANDfrom$>""THEN 7640 IFFNfilesize(f$)>0THENPROCvacation(u$,f$) 7650 ENDIF 7660 ENDIF 7670 IFuserf$(u%)>""THEN 7680 fto$=userf$(u%):WHILELEFT$(fto$,1)="+":fto$=MID$(fto$,2):ENDWHILE 7690 PROClog("Forwarding mail for "+u$+" to "+fto$) 7700 f$=FNtmpfile:SYS"XOS_File",10,f$,&FFF,,artbase%,artbase%+ptr% TOerr%;F% 7710 IF(F%AND1)=0THEN 7720 f$=FNremail(fto$,f$,u$) 7730 IFf$=""ANDLEFT$(userf$(u%),1)<>"+"THENret%=1 7740 ENDIF 7750 ENDIF 7760ENDIF 7770IFret%=0ANDINSTR(arrmail$,u$)=0THENarrmail$+=","+u$ 7780=ret% 7790 7800DEFFNgtou(g$) 7810LOCALu$,u%:u$=g$ 7820IFLEFT$(FNlower(g$),6)="email."THEN 7830 u$=MID$(g$,7):u%=INSTR(u$,"."):IFu%>0THENu$=LEFT$(u$,u%-1) 7840ENDIF 7850=u$ 7860 7870DEFPROCvacation(u$,f2$) 7880LOCALf$,d$,s$,F% 7890f$=FNtmpfile:d$=from$:IFreplyto$>""THENd$=replyto$ 7900s$=subject$:IFLEFT$(FNlower(subject$),4)<>"re: "THENs$="Re: "+s$ 7910f1%=FNopenout(f$) 7920IFf1%>0ANDd$>""THEN 7930 f2%=FNopenin(f2$) 7940 IFf2%>0THEN 7950 BPUT#f1%,"To: "+d$ 7960 BPUT#f1%,"From: "+u$+"@"+mailname$ 7970 BPUT#f1%,"Subject: "+s$ 7980 PROCautoheaders(f1%):PROCfcopy(f2%,f1%) 7990 PROCcf(f1%):PROCcf(f2%):PROCsettype(f$,&FFF) 8000 a$=FNsendmail(f$,u$) 8010 ELSE 8020 PROCcf(f1%) 8030 ENDIF 8040ENDIF 8050F%=FNdelfile(f$) 8060ENDPROC 8070 8080DEFPROCreturnreceipt(d$) 8090LOCALf$,a$,s$,F% 8100IFdoreceipt%<>0ANDprecedence$<>"bulk"ANDprecedence$<>"junk"THEN 8110 f$=FNtmpfile 8120 s$=subject$:IFLEFT$(FNlower(s$),4)<>"re: "ANDs$>""THENs$="Re: "+s$ 8130 f1%=FNopenout(f$) 8140 IFf1%>0THEN 8150 BPUT#f1%,"To: "+d$ 8160 BPUT#f1%,"From: mailer-daemon@"+mailname$ 8170 BPUT#f1%,"Subject: Acknowledgement of receipt "+s$ 8180 PROCautoheaders(f1%) 8190 BPUT#f1%,"Your message "+messid$ 8200 IFsubject$>""THENBPUT#f1%,"concerning "+subject$ 8210 BPUT#f1%,"to "+to$ 8220 BPUT#f1%,"was received at "+hostname$ 8230 PROCcf(f1%):PROCsettype(f$,&FFF) 8240 a$=FNsendmail(f$,"mailer-daemon"):F%=FNdelfile(f$) 8250 ENDIF 8260ENDIF 8270ENDPROC 8280 8290DEFPROCautoheaders(out%) 8300BPUT#out%,"Message-ID: <"+FNid_date+"@"+hostname$+">" 8310BPUT#out%,"Date: "+FNrfc_date 8320BPUT#out%,"Precedence: bulk" 8330BPUT#out%,"X-Mailer: RISC OS Newsbase "+ver$ 8340BPUT#out%,"" 8350ENDPROC 8360 8370DEFPROCartsave(g%,s%) 8380LOCALg$,s$,outd$,outf$ 8390IFsupersede$>""ANDapproved$>""PROCdeleteid(g%,supersede$) 8400IFcontrol$>""ANDapproved$>""PROCdocontrol(g%,control$) 8410g$=grp$(g%):s$=FNseqstr(s%):outf$=FNarticleop(g%,s$,0,"",0) 8420IFoutf$>""THEN 8430 PROCnbupdate(2,g$,s%,from$,subject$):PROCaddtoindex(g%,s%) 8440 IFexpires%>0ANDigexp%=0THENPROCsetfileexp(outf$,expires%) 8450 PROCprint("",g$+"."+s$,"",""):PROCpoll(slice%) 8460 IFtotal%MOD30=0ANDfast%=0THENPROCwrite_recfile 8470 ELSE 8480 PROCmessage(FNmsg2("Dsavefail",STR$s%,g$),1) 8490 PROClog("Debatch save failure: "+g$+" #"+STR$s%) 8500ENDIF 8510ENDPROC 8520 8530DEFPROCwrite_recfile 8540IFrecpos%=0ORFNdiskspace(basedir$)<200THENENDPROC 8550f0%=FNopenout(basedir$+".recover") 8560IFf0%>0THEN 8570 BPUT#f0%,bf$ 8580 BPUT#f0%,STR$len% 8590 BPUT#f0%,STR$recpos% 8600 PROCcf(f0%):PROCsettype(basedir$+".recover",&FFF) 8610 PROCwritegrpdata 8620ENDIF 8630ENDPROC 8640 8650DEFPROCdel_recfile 8660LOCALF%:F%=FNdelfile(basedir$+".recover") 8670ENDPROC 8680 8690DEFFNcheck_recfile(RETURN p%) 8700LOCALf$,f2$,l%,m$ 8710f0%=FNopenin(basedir$+".recover") 8720IFf0%>0THEN 8730 f$=GET$#f0% 8740 l%=VALGET$#f0% 8750 p%=VALGET$#f0% 8760 PROCcf(f0%) 8770 f2$=workdir$+"."+f$ 8780 IFFNobjtype(f2$)=1ANDFNfilesize(f2$)=l%ANDp%<l%THEN 8790 m$=FNmsg2("Drecover",f$,STR$p%) 8800 PROCmessage(m$,0):PROCpoll(0):PROClog(m$) 8810 l%=FNdelfile(basedir$+".recover"):PROCpoll(100):PROCmessage("",0) 8820 ELSE 8830 f2$="":p%=0 8840 ENDIF 8850ENDIF 8860=f2$ 8870 8880DEFPROCsetfileexp(f$,d%) 8890LOCALF%,e%,l% 8900SYS"XOS_File",2,f$,&FFFFFFFF TO;F% 8910SYS"XOS_File",3,f$,,d% TO;F% 8920IF(F%AND1)THEN 8930 SYS"XOS_File",9,f$ 8940 ELSE 8950 SYS"XOS_File",17,f$TO,,l%,e%;F% 8960 IF(F%AND1)=0THENIFl%<>&FFFFFFFF ORe%<>d% THENSYS"XOS_File",9,f$ 8970ENDIF 8980ENDPROC 8990 9000DEFFNartcopy(g%,s%,source$) 9010LOCALdest$ 9020IFg%>0THEN 9030 dest$=FNarticleop(g%,FNseqstr(s%),1,source$,0) 9040 IFdest$>""THEN 9050 PROCnbupdate(2,grp$(g%),s%,from$,subject$) 9060 PROCaddtoindex(g%,s%) 9070 ENDIF 9080ENDIF 9090=(dest$>"") 9100 9110DEFFNarticleop(g%,dest$,mode%,source$,pack%) 9120REM save or move a file to a group. 9130REM mode% = 0 to save from mem, 1 to copy, 2 to rename 9140REM source$ = file to copy/rename 9150REM returns resulting filename or null for fail 9160LOCALp$,outd$,outf$,oldd$,a$,F%,try%,dfail%,err% 9170try%=0:dfail%=0:p$=FNpath(grp$(g%)) 9180IFg%>0ANDp$>""THEN 9190 oldd$=p$+".~x":a$="~x":IFpack%=0THENa$=FNartdir(VALdest$) 9200 outd$=oldd$+"."+a$:outf$=outd$+"."+dest$ 9210 REPEAT 9220 F%=0 9230 CASEmode%OF 9240 WHEN0:SYS"XOS_File",10,outf$,&FFF,,artbase%,artbase%+ptr%TOerr%;F% 9250 WHEN1:SYS"XOS_FSControl",26,source$,outf$TOerr%;F% 9260 WHEN2:IFsource$<>outf$THENSYS"XOS_FSControl",25,source$,outf$TOerr%;F% 9270 ENDCASE 9280 IF(F%AND1)THEN 9290 err%=(!err%AND&FF) 9300 CASEerr%OF 9310 WHEN&B3:PROCcheckdisk:PROCfulldir(outd$) 9320 WHEN&D6:IFdfail%=0THEN 9330 dfail%=1 9340 IFFNensurenewstruct(oldd$)=0THENF%=FNensuredir(outd$):ELSEoutd$=oldd$ 9350 ELSE 9360 outd$=oldd$ 9370 ENDIF 9380 OTHERWISE:PROCcheckdisk 9390 ENDCASE 9400 try%+=1 9410 ELSE 9420 err%=0 9430 ENDIF 9440 UNTILtry%>3 ORerr%=0 9450ENDIF 9460IFerr%>0THENoutf$="" 9470=outf$ 9480 9490DEFFNensurenewstruct(d$) 9500LOCALr3%,F%:SYS"XOS_GBPB",11,d$,tmp%,1,0,250,"*"TO,,,r3%;F% 9510IF(F%AND1)=0ANDr3%>0THENt%=tmp%!16:IFt%=1THENF%=FNinsertdir(d$) 9520=0 9530 9540DEFFNartdir(n%) 9550="~x"+STR$(((n%)DIV75)MOD75) 9560 9570DEFPROCfulldir(p$) 9580IFLEFT$(FNleaf(p$),2)="~x"THENF%=FNinsertdir(p$)ELSEPROCmessage1("Fulldir",p$,1) 9590ENDPROC 9600 9610DEFFNinsertdir(p$) 9620LOCALex%,l$:l$=FNleaf(p$) 9630ex%=FNrename(p$,workdir$+"."+l$) 9640PROCensuredir(p$) 9650IFex%=0THENex%=FNrename(workdir$+"."+l$,p$+"."+l$) 9660=(ex%AND1) 9670 9680DEFFNseq(g%) 9690IFgrpseq%(g%)<>0 THEN 9700 grpseq%(g%)=ABS(grpseq%(g%))+1 9710 ELSE 9720 grpseq%(g%)=FNfindhighest(FNpath(grp$(g%)),0) 9730 IFgrpseq%(g%)=0THENgrpseq%(g%)=1 9740ENDIF 9750=ABSgrpseq%(g%) 9760 9770DEFFNseqstr(s%) 9780=RIGHT$("00000000"+STR$(ABSs%),8) 9790 9800DEFFNensuredir(path$) 9810LOCALp$,l%,lp$,F%,t%,ok% 9820t%=FNobjtype(path$):ok%=t% 9830IFt%<2 THEN 9840 path$=FNcanon(path$):l%=INSTR(path$,"$"):ok%=1 9850 REPEAT 9860 l%=INSTR(path$+".",".",l%+1) 9870 p$=LEFT$(path$,l%-1):t%=FNobjtype(p$) 9880 CASEt%OF 9890 WHEN0:PROCprint("",FNmsg1("Dmakepath",p$),"","") 9900 SYS"XOS_File",8,p$TOerr%;F%:IF(F%AND1)THENok%=0 9910 WHEN1:ok%=0 9920 OTHERWISE:lp$=p$ 9930 ENDCASE 9940 IFok%=0:PROCmessage1("Dpathfail",p$,1) 9950 UNTILl%>=LENpath$ORok%=0 9960ENDIF 9970=ok% 9980 9990DEFFNnametono(g$,add%) 10000LOCALlow%,high%,mid%,found%,g1$,no% 10010g1$=FNlower(g$) 10020IFg1$=lgrp$THEN 10030 no%=lgrp% 10040 ELSE 10050 IFg$>""ANDINSTR(g$,"*")<1THEN 10060 low%=1:high%=groups%:found%=0 10070 WHILElow%<=high% 10080 mid%=(low%+high%)DIV2:tg$=FNlower(grp$(mid%)) 10090 IFg1$<tg$THEN 10100 high%=mid%-1 10110 ELSE 10120 IFg1$>tg$THENlow%=mid%+1ELSEfound%=mid%:low%=high%+1 10130 ENDIF 10140 ENDWHILE 10150 IFfound%>0THEN 10160 lgrp$=g1$:lgrp%=found%:no%=found% 10170 ELSE 10180 IFadd%THEN 10190 found%=0:IFFNactive(g$)ANDFNisachef(g$)=0THENfound%=FNaddnewgroup(g$) 10200 IFfound%>0THENlgrp$=g1$:lgrp%=found%:no%=found% 10210 ENDIF 10220 ENDIF 10230 ENDIF 10240ENDIF 10250=no% 10260 10270DEFFNnotopath(g%) 10280=FNpath(grp$(g%)) 10290 10300DEFFNcheckcase(g$) 10310LOCALg1$:g1$=FNlower(g$) 10320IFLEFT$(g1$,6)="email."THEN:="Email."+MID$(g$,7) 10330IFLEFT$(g1$,7)="folder."THEN:="Folder."+MID$(g$,8) 10340=g1$ 10350 10360DEFFNaddnewgroup(g$) 10370LOCALp$,no%:g$=FNcheckcase(g$) 10380p$=FNpath(g$):no%=0 10390IFp$>""ANDgroups%<maxgroup%THEN 10400 PROCwriteindexbuf:PROCadddelbuf(0,0) 10410 IFFNensuredir(p$)<>0THEN 10420 PROCnbupdate(0,g$,0,"",""):PROCprint("",FNmsg1("Gcreate",g$),"","") 10430 no%=FNaddgrptolist(g$,TRUE):IFno%>0THEN 10440 PROClog(FNmsg1("Lcrgrp",g$)) 10450 SYS"XOS_File",11,p$+".~index",&FFD,0,0 10460 SYS"XOS_File",8,p$+".~x",0 10470 ENDIF 10480 ENDIF 10490ENDIF 10500=no% 10510 10520DEFFNaddgrptolist(g$,cmod%) 10530LOCALl%,l1%,w%,g1$,low%,high%,mid%:g$=FNcheckcase(g$):g1$=FNlower(g$) 10540IFg1$<FNlower(grp$(groups%))THEN 10550l%=1:WHILEg1$>FNlower(grp$(l%))ANDl%<=groups%:l%+=1:ENDWHILE 10560ELSE 10570l%=groups%+1 10580ENDIF 10590IFl%<maxgroup%THEN 10600 FORw%=groups%TOl%STEP-1 10610 grp$(w%+1)=grp$(w%):grpf%(w%+1)=grpf%(w%):grpseq%(w%+1)=grpseq%(w%) 10620 grpexp%(w%+1)=grpexp%(w%) 10630 grpmod%(w%+1)=grpmod%(w%) 10640 NEXTw% 10650 grp$(l%)=g$:grpf%(l%)=-1:grpseq%(l%)=0 10660 grpexp%(l%)=0:grpmod%(l%)=0 10670 IFcmod%<>0THEN 10680 IFFNspecialgrp(g$)=0THENgrpmod%(l%)=FNisgrpmod(g$) 10690 IFFNspecialgrp(g$)>1THENgrpexp%(l%)=1E6 10700 ENDIF 10710 groups%+=1 10720 REM now fix up the save list, to allow for group insertions... 10730 FORl1%=0TOmaxsave% 10740 IFoutg%(l1%)>l%THENoutg%(l1%)+=1 10750 NEXTl1% 10760 ELSE 10770 l%=0:PROCtoomanyg 10780ENDIF 10790=l% 10800 10810DEFPROCtoomanyg 10820PROCmessage0("Gfull",1) 10830ENDPROC 10840 10850DEFPROCrmgrplist(g$) 10860LOCALl%,w%:WHILEgrp$(l%)<>g$ANDl%<=groups%:l%+=1:ENDWHILE 10870IFgrp$(l%)=g$THEN 10880 PROCwriteindexbuf:PROCadddelbuf(0,0) 10890 FORw%=l%+1TOgroups% 10900 grp$(w%-1)=grp$(w%):grpf%(w%-1)=grpf%(w%) 10910 grpseq%(w%-1)=grpseq%(w%):grpmod%(w%-1)=grpmod%(w%): 10920 grpexp%(w%-1)=grpexp%(w%) 10930 NEXTw% 10940 grp$(groups%)="":groups%-=1:lgrp$="BLANK" 10950ENDIF 10960ENDPROC 10970 10980DEFFNobjtype(f$) 10990LOCALF%,t% 11000SYS"XOS_File",17,f$TOt%;F% 11010IF(F%AND1)THEN=-1 11020=t% 11030 11040DEFFNfiletype(f$) 11050LOCALF% 11060SYS"XOS_File",23,f$TO,,,,,,t%;F% 11070IF(F%AND1)THEN=-1 11080=t% 11090 11100DEFPROCexpiregroup(ng%,pto%,exp%) 11110REM pto% is a modifier to expiry time. 11120LOCALgdir%,n$,cnt%,prot%:prot%=0 11130pt%=grpexp%(ng%):IFpt%=0THENpt%=defexp% 11140IFpt%>1E4THENprot%=TRUE 11150IFgrp$(ng%)>""THEN 11160 pt%+=pto%:IFpt%<0THENpt%=0 11170 gdir$=FNpath(grp$(ng%)) 11180 IFexpmail%=0ANDFNspecialgrp(grp$(ng%))>1THENprot%=TRUE 11190 IFexp%<>0THENcnt%=FNexpiredir(gdir$,ng%,pt%,FALSE,prot%):PROCstamp(gdir$) 11200 PROCnbupdate(12,grp$(ng%),0,"","") 11210ENDIF 11220ENDPROC 11230 11240DEFFNexpiredir(p$,g%,pt%,force%,protect%) 11250LOCALcnt%:cnt%=0 11260IFprotect%THEN 11270PROCprint(FNmsg1("Gcomp",grp$(g%))," "," "," ") 11280ELSE 11290PROCprint(FNmsg1("Gexp",grp$(g%)),FNmsg1("Glast",""),FNmsg1("Gtime",STR$pt%)," ") 11300ENDIF 11310IFFNobjtype(p$)>1THEN 11320 cnt%=FNdelfile(p$+".~seq"):cnt%=FNensurenewstruct(p$+".~x") 11330 cancel%=FALSE:cnt%=FNexpiresubdir(p$,g%,pt%,force%,protect%) 11340 PROCadddelbuf(0,0):PROCprint(FNmsg0("Done")," "," "," ") 11350ENDIF 11360PROCgact("") 11370=cnt% 11380 11390DEFFNexpiresubdir(p$,expg%,pt%,force%,protect%) 11400LOCALdirptr%,f%,f$,now%,t$,t%,r3%,nread%,v%,attr%,ft%,cnt%,move$,testtime% 11410LOCALdeltest%,dirbuf%,dbr%,addr%,floop%,trymove%,canmove%,mustmove%,date% 11420LOCALg$,pack%,flen%,nfiles% 11430g$=grp$(expg%) 11440IFforce%THEN 11450 PROCgact(FNmsg1("Gdel",g$)) 11460 ELSE 11470 IFprotect%THENPROCgact(FNmsg1("Gcomp",g$))ELSEPROCgact(FNmsg1("Gexp",g$)) 11480ENDIF 11490mustmove%=(RIGHT$(p$,6)=".~x.~x") 11500f$=FNleaf(p$):canmove%=(RIGHT$(FNdir(p$),LENf$)=f$) 11510nfiles%=0:dirptr%=0 11520now%=FNday(FNtime):testtime%=pt%:dbr%=FNclaim(dirbuf%,dbsize%,"expire") 11530REPEAT 11540addr%=dirbuf% 11550SYS"XOS_GBPB",11,p$,dirbuf%,20,dirptr%,dbsize%,"*"TO,,,r3%,dirptr%;F%:nread%=dirptr% 11560IFr3%>0AND(F%AND1)=0THEN 11570 nfiles%+=r3%:REM number of files in directory 11580 FORfloop%=1TOr3% 11590 t%=addr%!16:attr%=addr%!12:f$=FNstr(addr%+29):date%=addr%+24:flen%=addr%!8 11600 v%=VALf$:deltest%=0:trymove%=mustmove%:pack%=((attr%AND8)AND(mustmove%=FALSE)) 11610 CASEt%OF 11620 WHEN1: 11630 IFv%>0THEN 11640 IF(addr%?28)<>&FF ORforce%<>0THEN 11650 REM standard article 11660 SYS"Territory_ConvertDateAndTime",1,date%,tmp%,128,"%CE%YR%MN%DY"TOb% 11670 ft%=VALFNstr(b%) 11680 IFFNday(ft%)<=now%-testtime%THENdeltest%=TRUE 11690 ELSE 11700 REM has expiry time 11710 ft%=(addr%!24) 11720 IFft%<=FNtime THEN 11730 deltest%=TRUE 11740 ELSE 11750 REM pack all non-clarinet articles with expiry headers 11760 IFtesttime%=0THENtrymove%=TRUE 11770 IFFNsmatch("clari*",g$)=0ANDmustmove%=0ANDnfiles%<6THENpack%=TRUE 11780 ENDIF 11790 ENDIF 11800 IFprotect%=0AND(deltest%ORforce%)THEN 11810 IFforce%THENPROCsetattr(p$+"."+f$,"R") 11820 IFFNdelfile(p$+"."+f$)=0 THEN 11830 dirptr%-=1:cnt%+=1:PROCartdeleted(expg%,VALf$):trymove%=0 11840 ELSE 11850 IFFNobjtype(p$+"."+f$)=0THEN 11860 PROCartdeleted(expg%,VALf$):trymove%=0 11870 ELSE 11880 trymove%=canmove% 11890 ENDIF 11900 ENDIF 11910 ELSE 11920 IFcompress%THENPROCcompress(p$+"."+f$,flen%) 11930 ENDIF 11940 REM don't pack files if >5 files in the directory... 11950 REM ... just want to avoid scattered almost-single articles. 11960 IFnfiles%>6THENpack%=0 11970 IFtrymove%ORpack%THEN 11980 PROCsetattr(p$+"."+f$,"R") 11990 move$=FNarticleop(expg%,f$,2,p$+"."+f$,pack%) 12000 SYS"XOS_File",4,move$,,,,attr%:SYS"XOS_File",4,p$+"."+f$,,,,attr% 12010 IFmove$>""THENdirptr%-=1 12020 ENDIF 12030 ENDIF 12040 WHEN2,3:IFLEFT$(f$,2)="~x"THENcnt%=cnt%+FNexpiresubdir(p$+"."+f$,expg%,pt%,force%,protect%) 12050 F%=FNdelfile(p$+"."+f$) 12060 ENDCASE 12070 IFcancel%THENfloop%=r3% 12080 PROCpoll(slice%*2):addr%=addr%+(33+LENf$)ANDNOT3 12090 NEXTfloop% 12100ENDIF 12110UNTILnread%=-1ORcancel% 12120PROCrelease(dbr%) 12130=cnt% 12140 12150DEFPROCsetattr(f$,a$) 12160SYS"XOS_FSControl",24,f$,a$ 12170ENDPROC 12180 12190DEFPROCartdeleted(g%,n%) 12200PROCadddelbuf(g%,n%):PROCnbupdate(3,grp$(g%),n%,"","") 12210PROCprint("","","",FNmsg1("Adel",STR$n%)) 12220ENDPROC 12230 12240DEFPROCexpmiscdir(p$,etime%) 12250LOCALn%,f$,now%,t%,t$,r3%,nread%,a%,d%,ft%,dirbuf%,dbr%,floop%,addr% 12260n%=0:now%=FNday(FNtime):dbr%=FNclaim(dirbuf%,dbsize%,"dbuf") 12270REPEAT 12280addr%=dirbuf% 12290SYS"XOS_GBPB",11,p$,dirbuf%,20,n%,dbsize%,"*"TO,,,r3%,n%;F%:nread%=n% 12300IFr3%>0AND(F%AND1)=0THEN 12310 FORfloop%=1TOr3% 12320 t%=addr%!16:a%=addr%!12:f$=FNstr(addr%+29) 12330 CASEt%OF 12340 WHEN1: 12350 IF(a%AND8)=0THEN 12360 SYS"Territory_ConvertDateAndTime",1,addr%+24,tmp%,128,"%CE%YR%MN%DY"TOb% 12370 ft%=VALFNstr(b%):IFFNday(ft%)<=now%-etime%THENIFFNdelfile(p$+"."+f$)=0n%=n%-1 12380 ENDIF 12390 WHEN2,3:PROCexpmiscdir(p$+"."+f$,etime%):F%=FNdelfile(p$+"."+f$) 12400 ENDCASE 12410 PROCpoll(slice%*2):addr%=addr%+(33+LENf$)ANDNOT3 12420 NEXTfloop% 12430ENDIF 12440UNTILnread%=-1 12450PROCrelease(dbr%) 12460ENDPROC 12470 12480DEFFNtime 12490LOCALb% 12500?tmp%=3:SYS"OS_Word",14,tmp% 12510SYS"Territory_ConvertDateAndTime",1,tmp%,tmp%+128,128,"%CE%YR%MN%DY"TOb% 12520=VALFNstr(b%) 12530 12540DEFFNfulltime 12550LOCALb% 12560?tmp%=3:SYS"OS_Word",14,tmp% 12570SYS"Territory_ConvertDateAndTime",1,tmp%,tmp%+128,128,"%CE%YR%MN%DY%24%MI"TOb% 12580=FNstr(b%) 12590 12600DEFFNfiletime(f$) 12610LOCALl%,e%,o%,r% 12620SYS"XOS_File",23,f$TOo%,,l%,e% 12630IFo%>0THEN 12640 !tmp%=e%:tmp%!4=l% 12650 SYS"Territory_ConvertDateAndTime",1,tmp%,tmp%+128,128,"%CE%YR%MN%DY"TOb% 12660 r%=VALFNstr(b%) 12670ENDIF 12680=r% 12690 12700DEFFNday(t%) 12710REM convert date to no.of days since start of century. 12720LOCALday%,month%,year%,m%,d% 12730day%=t%MOD100 12740month%=(t%DIV100)MOD100 12750year%=(t%DIV10000) 12760d%=365*year%+day% 12770CASEmonth%OF 12780WHEN1:m%=0 12790WHEN2:m%=31 12800WHEN3:m%=59 12810WHEN4:m%=90 12820WHEN5:m%=120 12830WHEN6:m%=151 12840WHEN7:m%=180 12850WHEN8:m%=211 12860WHEN9:m%=242 12870WHEN10:m%=272 12880WHEN11:m%=303 12890WHEN12:m%=333 12900ENDCASE 12910=d%+m% 12920 12930DEFPROClog(A$) 12940LOCALl% 12950IFrw%THEN 12960 IFA$>""ANDlogptr%<20THEN 12970 log$(logptr%)=FNctime("# %YR%MN%DY %24%MI%SE ")+A$:logptr%+=1 12980 ELSE 12990 IFlogptr%>0THEN 13000 f1%=FNopenup(basedir$+".log") 13010 IFf1%<>0THEN 13020 PTR#f1%=EXT#f1% 13030 FORl%=0TOlogptr% 13040 IFlog$(l%)>""THENBPUT#f1%,log$(l%) 13050 NEXT 13060 log$()="":logptr%=0:PROCcf(f1%):PROCsettype(basedir$+".log",&FFF) 13070 ENDIF 13080 ENDIF 13090 ENDIF 13100ENDIF 13110ENDPROC 13120 13130DEFPROCsettype(f$,t%) 13140SYS"XOS_File",18,f$,t% 13150ENDPROC 13160 13170DEFPROCstamp(f$) 13180SYS"XOS_File",9,f$ 13190ENDPROC 13200 13210DEFFNduptask 13220LOCALfound%,r0%,b%,a$:r0%=0 13230REPEAT 13240tmp%!4=0:SYS"TaskManager_EnumerateTasks",r0%,tmp%,20TOr0% 13250IFr0%>=0ANDtmp%!4>0THEN 13260 b%=tmp%!4:a$="":WHILE?b%>31ANDLENa$<255:a$+=CHR$?b%:b%+=1:ENDWHILE 13270 IFLEFT$(a$,8)=myname$THENfound%=1 13280ENDIF 13290UNTILr0%<0ORfound%<>0 13300=found% 13310 13320DEFPROCinit 13330myname$="Newsbase" 13340SYS"OS_Byte",129,0,&FF TO,osver%:dynarea%=(osver%>&A4) 13350PROCenvironment 13360msgdesc%=0:defic$="":credit$="":transport%=0 13370groups%=0:initgroups%=0:dragref%=0:autodebatch%=0 13380thisartlen%=0:nextartpos%=0:logfile%=0 13390postfetchready%=0:startupok%=0:indebatch%=0:blockexpire%=TRUE 13400null$=STRING$(200," ") 13410maxactive%=0:cancel%=0:nclient%=0:sleep%=0:forcebatch%=0 13420inbufsize%=16*1024:defartbuf%=8192:dbsize%=512 13430DIM tmp% 256 13440ibufsize%=8000:delbufsize%=2048 13450DIM ibuf% ibufsize% 13460DIM delbuf% delbufsize% 13470maxsave%=10:maxactive%=100 13480DIM outp$(maxsave%),outs%(maxsave%),outg%(maxsave%) 13490DIM log$(20),outdir$(1) 13500delbufptr%=0:delbufg%=0:logptr%=0 13510ibufptr%=0:ibufg%=0 13520type%=0:line$="":bf$="" 13530len%=0:pos%=0:bstart%=0:recpos%=0:bf$="" 13540total%=0:pause%=FALSE:checkfiles%=1 13550T%=0::T1%=0:T2%=-1:open%=FALSE 13560f00%=0:f0%=0:f1%=0:f2%=0:f3%=0:f4%=0:f5%=0:f6%=0 13570lgrp%=0:lgrp$="BLANK" 13580nopoll%=0:ngtime%=0:nglast%=0 13590findg%=0:findp$="":long%=0 13600busy$="":sep$="":seplen%=0 13610slice%=-15 13620nbcom%=&FEED10 13630nbrep%=&FEED11 13640nbupd%=&FEED12 13650srflag%=0 13660arrart%=0:arrmail$="":grpq%=0:ynchoice%=0 13670artdate%=0:modgw$="moderators.uu.net" 13680REM now all config file variables... 13690logfile%=1:keepoutg%=1:fast%=1:alert%=1:alertbeep%=0:userctrl%=0 13700alertnews%=1:defclient$="":autoexp%=1:defexp%=7:delok%=0 13710listtype%=0:remotehost$="":expmail%=0:autodebatch%=1:igexp%=0 13720keepb%=1:docanc%=1:killc%=1:doreceipt%=1:cver%=0:ngexp%=7:thread%=1 13730modgw$="":mngw$="":mngw%=0:userlist$="":initconf%=0 13740compress%=0:complimit%=2048:exptime%=0:expany%=0:mindsk%=1024 13750hostname$="":org$="":mailname$="":timezone$="" 13760ENDPROC 13770 13780DEFPROCenvironment 13790LOCALp$,A$ 13800rw%=TRUE:REM read-write access 13810SYS"OS_GetEnv"TOA$ 13820REPEAT 13830 p$=FNgetpar(A$," ") 13840 CASEp$OF 13850 WHEN"-ro":rw%=FALSE:REM read-only access to !NewsDir 13860 ENDCASE 13870UNTILA$="" 13880ENDPROC 13890 13900DEFPROCstartmemmgr 13910base%=HIMEM 13920SYS "Wimp_SlotSize",-1,-1 TO min_mem% 13930ENDPROC 13940 13950DEFFNcheckslot 13960LOCALm%,f%,minfre% 13970minfre%=&4000 13980REM if more than 2Mbytes free, insist on 32k space in wimpslot (otherwise 16k) 13990SYS"Wimp_SlotSize",-1,-1TO,,f%:IFf%>&200000 THENminfre%=&8000 14000IF(HIMEM-END)<minfre% THEN 14010 m%=minfre%:REPEATSYS"Wimp_SlotSize",-1,-1TO,,f% 14020 IFf%<m% PROCmessage0("Needmem1",1) 14030 UNTILf%>=m% 14040 ELSE 14050 m%=0 14060ENDIF 14070=m% 14080 14090DEFPROCstartwimp 14100DIM taskid%4,wmsgs%30:$taskid%="TASK" 14110!wmsgs%=3:wmsgs%!4=&400C2:wmsgs%!8=&400C3:wmsgs%!12=nbcom% 14120wmsgs%!16=2:wmsgs%!20=&400C9:wmsgs%!24=&502:wmsgs%!28=0 14130SYS "Wimp_Initialise",310,!taskid%,myname$,wmsgs% TO version%,task% 14140ONERRORPROCerrorbox(FALSE) 14150SYS"Territory_Exists",1TO;F%:IF(F%AND4)=0THENERROR0,"UK Territory module not present!" 14160DIMq% &200,ibar% &100 14170menudata%=0:indmenubuf%=0:menudataref%=0:indmenuref%=0 14180SYS"OS_ReadModeVariable",-1,5TO,,A% 14190IFA%<2THENPROCmergesprites("sprites22")ELSEPROCmergesprites("sprites") 14200SYS"Wimp_OpenTemplate",,FNresfile("Templates") 14210status%=FNloadtemp("status") 14220msgw%=FNloadtemp("message") 14230gsetup%=FNloadtemp("gensetup") 14240gwin%=FNloadtemp("groups") 14250yesno%=FNloadtemp("confirm") 14260info%=FNloadtemp("info") 14270arrive%=FNloadtemp("arrive") 14280uwin%=FNloadtemp("users") 14290sitewin%=FNloadtemp("site") 14300fwin%=FNloadtemp("filters") 14310savend%=FNloadtemp("newsdir") 14320msetup%=FNloadtemp("setup") 14330trwin%=FNloadtemp("transports") 14340ngwin%=FNloadtemp("newgroups") 14350SYS"Wimp_CloseTemplate" 14360PROCsettime 14370lastpoll%=0:lastupd%=0:stime%=time% 14380cron0%=0:cron1%=0:cron2%=0:cron3%=0:cron4%=0 14390confopen%=0:statopen%=0:msgopen%=0:ndopen%=0:ngopen%=0:arropen%=0:infoopen%=0 14400baric$="newsbase1":baricon%=FNic(baric$) 14410ver$="0.53":rev$="c":ver%=100*VALver$:groupver%=47 14420PROCupdateiconstring(info%,4,ver$+rev$+" (23-Feb-95)"):PROCcredits 14430PROCprint(FNmsg1("Sinfo1",ver$)," "," "," "):PROCgact("") 14440ENDPROC 14450 14460DEFFNloadtemp(A$) 14470LOCALb%,i%,s%,scr%,icon%,h% 14480SYS"Wimp_LoadTemplate",,-1,0,0,-1,A$,0TO,b%,i% 14490s%=FNclaim(scr%,b%,"template"):DIMicon% i% 14500SYS"Wimp_LoadTemplate",,scr%,icon%,icon%+i%,-1,A$,0 14510scr%!64=sprites%:SYS"Wimp_CreateWindow",,scr% TOh%:PROCrelease(s%) 14520=h% 14530 14540DEFPROCmergesprites(A$) 14550LOCALs%,f%,n%:A$=resdir$+"."+A$ 14560IFFNobjtype(A$)=1THEN 14570s%=FNfilesize(A$)+20 14580DIMsprites% s%:!sprites%=s%:sprites%!8=0 14590SYS "OS_SpriteOp",&109,sprites% 14600SYS"XOS_SpriteOp",&108,sprites%TO,,s%,n%,,f% 14610SYS"XOS_SpriteOp",&10B+(n%=0),sprites%,A$TO;F% 14620ELSE 14630ERROR1,A$+" not found" 14640ENDIF 14650ENDPROC 14660 14670DEFFNic(A$) 14680SYS"OS_SpriteOp",&100+40,sprites%,A$TO,,,w%,h%:!ibar%=-1 14690ibar%!4=0:ibar%!8=0:ibar%!12=w%*2:ibar%!16=100:ibar%!20=&3102 14700DIMibarname%12:$ibarname%=A$:ibar%!24=ibarname% 14710ibar%!28=sprites%:ibar%!32=11 14720SYS "Wimp_CreateIcon",0,ibar%TOic% 14730=ic% 14740 14750DEFPROCchangeic(new$) 14760LOCALw%,F% 14770IFnew$<>baric$THEN 14780 SYS "XOS_SpriteOp",&118,sprites%,new$TO,,src%;F% 14790 IF(F%AND1)=0THEN 14800 $ibarname%=new$:!q%=-1:q%!4=baricon%:q%!8=0:q%!12=0 14810 SYS"Wimp_SetIconState",,q% 14820 ENDIF 14830 baric$=new$ 14840ENDIF 14850ENDPROC 14860 14870DEFPROCpoll(idle%) 14880LOCALpol_ret%:REM idle%>0 is pollidle time, <0 is time between polls. 14890PROCsettime:IFnopoll%THENENDPROC 14900IFidle%>=0ORlastpoll%-time%<idle%THEN 14910 lastpoll%=time% 14920 REPEAT 14930 SYS "Wimp_PollIdle",6194,q%,time%+idle% TOpol_ret% 14940 CASE pol_ret% OF 14950 WHEN 0:IFstartupok%<>0THENPROCcron 14960 WHEN 2:PROCopen_window(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,q%!28) 14970 WHEN 3:PROCclosew(!q%) 14980 WHEN 6:PROCclick(q%!8,q%!12,q%!16) 14990 WHEN 7:PROCdrag 15000 WHEN 8:PROCkeypress(!q%,q%!24) 15010 WHEN 9:PROCgetpointer:PROCmenuselect(q%) 15020 WHEN 17,18:PROCreceive(q%) 15030 ENDCASE 15040 UNTILpol_ret%=0 15050ENDIF 15060ENDPROC 15070 15080DEFPROCsettime 15090SYS"OS_ReadMonotonicTime"TOtime% 15100ENDPROC 15110 15120DEFPROCcredits 15130IFcredit$=""THENcredit$=FNmsg0("Credit") 15140PROCupdateiconstring(info%,9,LEFT$(FNgetpar(credit$,";"),28)) 15150ENDPROC 15160 15170DEFPROCdrag 15180PROCgetpointer 15190!q%=52+8:q%!12=0:q%!16=1:q%!20=handle%:q%!24=icon%:q%!28=mx%:q%!32=my% 15200q%!36=0:q%!40=&1000:$(q%+44)="!NewsDir"+CHR$0 15210SYS"Wimp_SendMessage",17,q%,handle%,icon%:dragref%=q%!8 15220ENDPROC 15230 15240DEFPROCpolloff:nopoll%=TRUE:ENDPROC 15250DEFPROCpollon:nopoll%=0:ENDPROC 15260 15270DEFPROCkeypress(h%,k%) 15280LOCALc% 15290IFk%=13THEN 15300CASEh%OF 15310 WHENgsetup%,sitewin%,gwin%:c%=TRUE 15320 WHENfwin%:PROCsetfilt(cfilt%):PROCclosew(h%) 15330 WHENuwin%:PROCgetuserinfo:PROCsaveuserinfo:c%=TRUE 15340 OTHERWISE:SYS"Wimp_ProcessKey",k% 15350ENDCASE 15360IFc%THENPROCsaveconfig:PROCclosew(h%) 15370ELSE 15380SYS"Wimp_ProcessKey",k% 15390ENDIF 15400ENDPROC 15410 15420DEFFNbusyon(d$) 15430REM returns TRUE if already busy 15440IFbusy$<>""THENPROCmessage1("Busy",busy$,0):=TRUE 15450busy$=FNmsg0(d$):=FALSE 15460 15470DEFPROCbusyoff 15480busy$="" 15490ENDPROC 15500 15510DEFPROCfinish 15520PROCtidyup 15530ONERROROFF 15540IFlogfile%<>0PROClog("") 15550IFstartupok%<>0THEN 15560 IFindebatch%THENPROCwrite_recfile 15570 IFgroups%>0PROCsavegrpdata 15580 PROCsavefilters 15590ENDIF 15600PROCunlocknewsdir 15610PROCnbreply(0,0,10,0,0,"","") 15620PROCendmsgtrans 15630PROCrelease(menudataref%):PROCrelease(indmenuref%) 15640PROCtidydynareas 15650SYS"Wimp_CloseDown":END 15660ENDPROC 15670 15680DEFPROCtidyup 15690PROCcf(f00%) 15700PROCcf(f0%) 15710PROCcf(f1%) 15720PROCcf(f2%) 15730PROCcf(f3%) 15740PROCcf(f4%) 15750PROCcf(f5%) 15760PROCcf(f6%) 15770ENDPROC 15780 15790DEFPROCclick(b%,w%,i%) 15800LOCALg$,u$,s%,l% 15810CASEw% OF 15820WHEN-2: 15830 IFb%=4ANDi%=baricon%PROCfront(status%) 15840 IFb%=1ANDi%=baricon%ANDstartupok%=1ANDrw%THENPROCfront(msetup%) 15850 IFb%=2ANDi%=baricon%THEN 15860 SYS"OS_Byte",121,(2EOR&80)TO,A%:IFA%=&FF THEN 15870 g$="Debug on,Debug off" 15880 ELSE 15890 g$="|>Info,":IFrw%=0THENg$+="<" 15900 g$+="Setup...,Queues...,":IFautodebatch%<>0ORrw%=0THENg$+="<" 15910 g$+="Debatch,|":IFautoexp%<>0ORrw%=0THENg$+="<" 15920 g$+="Expire,Quit" 15930 ENDIF 15940 PROCdomenu(101,g$,myname$,1):infoopen%=TRUE 15950 ENDIF 15960WHENstatus%: 15970 IFb%=2THEN 15980 CASEpause%OF 15990 WHEN0:PROCdomenu(106,"|>Info,Pause,Cancel",myname$,0) 16000 OTHERWISE:PROCdomenu(106,"|>Info,Resume,Cancel",myname$,0) 16010 ENDCASE 16020 infoopen%=TRUE 16030 ENDIF 16040WHENuwin%:u$=FNic_str(uwin%,20) 16050 IF(b%=1ORb%=4)THEN 16060 CASEi%OF 16070 WHEN1:PROCumenu 16080 WHEN6:PROCsetuwin(u$):IFb%=4PROCclosew(uwin%) 16090 WHEN7:PROCgetuserinfo:PROCsaveuserinfo:PROCsaveconfig:IFb%=4PROCclosew(uwin%) 16100 WHEN10:s%=(FNrdinv(w%,i%)=0):PROCsetshaded(w%,3,s%):PROCsetshaded(w%,4,s%) 16110 WHEN15:PROCugmenu 16120 WHEN16,17:PROCmessage1("Hvac",u$,0) 16130 WHEN18:PROCeditvac(u$) 16140 WHEN19:PROCcancvac(u$) 16150 ENDCASE 16160 ELSE 16170 IFi%=0PROCumenu 16180 IFi%=2PROCugmenu 16190 ENDIF 16200WHENgwin%: 16210 IF(b%=1ORb%=4)THEN 16220 g$=FNic_str(gwin%,25) 16230 CASEi%OF 16240 WHEN5:IFb%=4PROCgwin(-1)ELSEPROCgwin(1) 16250 WHEN6:IFb%=4PROCgwin(1)ELSEPROCgwin(-1) 16260 WHEN7:r$="" 16270 IFFNaddgrp(g$,r$)<>0THENPROCgwin(0)ELSEPROCmessage(r$,0) 16280 WHEN8:IFFNconfirm(FNmsg1("Crem",g$))=1THEN 16290 r$="" 16300 IFFNdelgrp(g$,r$)=0THENPROCmessage(r$,0)ELSEPROCgwin(0) 16310 ENDIF 16320 WHEN17:IFFNconfirm(FNmsg1("Cdel",g$))=1PROCdelgrp(g$):PROCgwin(0) 16330 WHEN9:PROCreindex(g$) 16340 WHEN18: 16350 IFFNconfirm(FNmsg0("Cscan"))=1THENPROCfindallgroups 16360 WHEN11:PROCexpgroup(g$,0) 16370 WHEN12:IFb%=1THEN 16380 listtype%=ABS(listtype%=0) 16390 IFlisttype%=0THENg$="CList"ELSEg$="AList" 16400 PROCupdateiconstring(w%,i%,FNmsg0(g$)):PROCgwin(0) 16410 ENDIF 16420 WHEN14:PROCnummenu(0) 16430 WHEN15:PROCnummenu(1) 16440 WHEN24:PROCnummenu(2) 16450 WHEN19:PROCgrpmenu(110) 16460 WHEN26:IFngopen%=0PROCngwin 16470 WHEN16:PROCdoaltergrp(g$,ABSFNrdinv(w%,16)) 16480 WHEN10:IFFNbusyon("Bmod")=0THEN 16490 PROChgon:s%=(FNcheckmoderation(g$,1)>""):PROCbusyoff:PROChgoff 16500 PROCsetinv(w%,16,s%):PROCaltergrp(g$):IFs%THENu$="Myes"ELSEu$="Mno" 16510 PROCmessage1(u$,g$,0) 16520 ENDIF 16530 WHEN29:s%=(FNrdinv(w%,i%)=0):PROCsetshaded(w%,30,s%):PROCsetshaded(w%,31,s%) 16540 FORl%=35TO41:PROCsetshaded(gwin%,l%,s%):NEXTl%:REM expiry schedule 16550 WHEN31:PROCmessage0("Cexpmail",0) 16560 WHEN32:PROCsaveconfig:IFb%=4PROCclosew(w%) 16570 WHEN37:PROCmodexp(-1,0) 16580 WHEN38:PROCmodexp(1,0) 16590 WHEN39:PROCmodexp(0,-1) 16600 WHEN40:PROCmodexp(0,1) 16610 ENDCASE 16620 ELSE 16630 CASEi%OF 16640 WHEN25:PROCgrpmenu(110) 16650 WHEN1:PROCnummenu(1) 16660 WHEN2:PROCnummenu(0) 16670 WHEN22:PROCnummenu(2) 16680 WHEN12:PROCdomenu(111,"Current list,Active list","List type",0) 16690 ENDCASE 16700 ENDIF 16710WHENmsgw%:IF(b%=1ORb%=4)ANDi%=2THENPROCclosew(msgw%) 16720WHENgsetup%: 16730 IFb%=1ORb%=4THEN 16740 CASEi%OF 16750 WHEN2:PROCmodgwmenu 16760 WHEN4:PROCsaveconfig:IFb%=4PROCclosew(w%):REM OK 16770 WHEN5:PROCsetconfig:IFb%=4PROCclosew(w%):REM cancel 16780 WHEN10:s%=(FNrdinv(w%,i%)=0):FORl%=12TO14:PROCsetshaded(w%,l%,s%):NEXTl% 16790 WHEN19:PROCmngwmenu 16800 WHEN21:PROCrdmenu 16810 ENDCASE 16820 ELSE 16830 CASEi%OF 16840 WHEN1:PROCmodgwmenu 16850 WHEN18:PROCmngwmenu 16860 WHEN16:PROCrdmenu 16870 ENDCASE 16880 ENDIF 16890WHENsitewin%: 16900 IFb%<>2THEN 16910 CASEi%OF 16920 WHEN4:PROCtransportmenu(102) 16930 WHEN5:PROCinittransport 16940 WHEN6:PROCsaveconfig:IFb%=4PROCclosew(w%):REM OK 16950 WHEN15:PROCtzmenu 16960 WHEN16:PROCsetconfig:IFb%=4PROCclosew(w%):REM cancel 16970 ENDCASE 16980 ELSE 16990 IFi%=11THENPROCtransportmenu(102) 17000 IFi%=14THENPROCtzmenu 17010 ENDIF 17020WHENarrive%:IF(b%=1ORb%=4)ANDi%=3THENPROCstartreader 17030WHENyesno%:IF(b%=1ORb%=4)AND(i%=1ORi%=2)THENynchoice%=i%:PROCclosew(yesno%) 17040WHENngwin%: 17050 CASEi%OF 17060 WHEN1:PROCnextng 17070 WHEN2:r$="":IFFNaddgrp(FNic_str(ngwin%,6),r$)=0THENPROCmessage(r$,0) 17080 PROCnextng 17090 WHEN4:PROCcatchupng 17100 ENDCASE 17110WHENsavend%: 17120 IFi%=0THEN 17130 PROCgetpointer 17140 !q%=savend%:q%!4=5:q%!24=0:q%!28=0 17150 q%!32=FNmoderight:q%!36=FNmodetop 17160 q%!8=mx%-35:q%!12=my%-35 17170 q%!16=mx%+35:q%!20=my%+35 17180 SYS"Wimp_DragBox",,q%:dragflag%=savend% 17190 ENDIF 17200WHENmsetup%: 17210 IF(b%=1ORb%=4)THEN 17220 CASE(i%DIV5)OF 17230 WHEN0:PROCcfront(sitewin%,0,100) 17240 WHEN1:PROCsetconfig:PROCcfront(gsetup%,0,0) 17250 WHEN2:PROCcfront(trwin%,0,100) 17260 WHEN3:PROCcfront(gwin%,0,100) 17270 WHEN4:PROCcfront(uwin%,0,100) 17280 WHEN5:PROCcfront(fwin%,0,100) 17290 ENDCASE 17300 IFi%>-1ANDb%=1THENPROCclosew(msetup%) 17310 ENDIF 17320WHENfwin% 17330 IFb%=2THEN 17340 CASEi%OF 17350 WHEN1:PROCdomenu(130,"Unset,News,Mail,Any","Type",0) 17360 WHEN2,3,4:PROCdomenu(130+i%,"None,To,From,Subject,Group,Reply To,Precedence,Envelope","Condition",0) 17370 WHEN15:PROCdomenu(131,"Junk,Kill,Redirect,Submit","Action",0) 17380 ENDCASE 17390 ELSE 17400 CASEi%OF 17410 WHEN18:IFcfilt%>0THENcfilt%-=1:PROCsetfiltwin(cfilt%) 17420 WHEN19:IFcfilt%<nfilt%THENcfilt%+=1:PROCsetfiltwin(cfilt%) 17430 WHEN20:PROCsetfilt(cfilt%):IFb%=4PROCclosew(w%) 17440 WHEN21:PROCdelfilt(cfilt%) 17450 WHEN22:PROCaddfilt 17460 ENDCASE 17470 ENDIF 17480WHENtrwin%: 17490 IF(b%=1ORb%=4)THEN 17500 CASEi%OF 17510 WHEN1:PROCtransportmenu(112) 17520 WHEN3:PROCdeltrans(FNic_str(w%,0)) 17530 WHEN4:IFFNruntransportfile(17,"","","")=-3THENPROCmessage0("Tnosetup",0) 17540 ENDCASE 17550 ENDIF 17560 IFb%=2ANDi%=0THENPROCtransportmenu(112) 17570ENDCASE 17580ENDPROC 17590 17600DEFFNmodetop 17610SYS"OS_ReadModeVariable",-1,5 TO,,Yeig%:Yeig%=2^Yeig% 17620SYS"OS_ReadModeVariable",-1,12 TO,,top% 17630=top%*Yeig% 17640 17650DEFFNmoderight 17660SYS"OS_ReadModeVariable",-1,4 TO,,Xeig%:Xeig%=2^Xeig% 17670SYS"OS_ReadModeVariable",-1,11 TO,,right% 17680=right%*Xeig% 17690 17700DEFPROCstartreader 17710LOCALw% 17720srflag%=1:PROCnbreply(0,0,900,0,0,"",""):PROCclosew(arrive%) 17730FORw%=1TO5:PROCpoll(0):NEXTw% 17740IFsrflag%<>0THEN 17750 IFFNobjtype(defclient$)>0THEN 17760 SYS"Wimp_StartTask",defclient$ 17770 ELSE 17780 PROCmessage1("Clfail",defclient$,0) 17790 ENDIF 17800ENDIF 17810ENDPROC 17820 17830DEFPROCdeltrans(t$) 17840LOCALt%:t%=FNtransno(t$) 17850CASEt%OF 17860WHEN0:VDU7:PROCmessage0("Tdel1",0) 17870WHENtransport%:VDU7:PROCmessage0("Tdel2",0) 17880OTHERWISE: 17890 IFFNconfirm(FNmsg1("Ctransdel",t$))=1THEN 17900 PROChgon:PROCwipe(transdir$+"."+t$):PROCwipe(nbdir$+".support."+t$) 17910 PROChgoff:trans$(t%)="":PROCsettrans2(transport%) 17920 ENDIF 17930ENDCASE 17940ENDPROC 17950 17960DEFPROCaltergrp(g$) 17970LOCALg%,l1% 17980FORl1%=1TOgroups% 17990 IFFNgmatch(g$,l1%)THENg%=l1%:l1%=groups% 18000NEXTl1% 18010REMl1%=0:IFFNspecialgrp(g$)>0THENl1%=1 18020PROCupdateiconstring(gwin%,25,g$) 18030IFg%>0THENg%=grpmod%(g%)ELSEg%=0 18040PROCsetinv(gwin%,16,g%) 18050ENDPROC 18060 18070DEFPROCdoaltergrp(g$,m%) 18080LOCALl1% 18090FORl1%=1TOgroups% 18100 IFFNgmatch(g$,l1%)THENgrpmod%(l1%)=m% 18110NEXTl1% 18120ENDPROC 18130 18140DEFPROCnummenu(c%) 18150CASEc%OF 18160WHEN0:PROCdomenu(103,"3,5,7,10,14,21,30,\---","Default",0) 18170WHEN1:PROCdomenu(104,"Default,3,7,14,21,30,Never,\---","Expiry",0) 18180WHEN2:PROCdomenu(105,"3,5,7,10,14,21,30,\---","Days",0) 18190ENDCASE 18200ENDPROC 18210 18220DEFPROCtzmenu 18230LOCALl%,a$:a$="" 18240FORl%=-12TO14:b$=RIGHT$("0000"+STR$ABS(l%*100),4):IFl%<0THENb$="-"+b$ELSEb$="+"+b$ 18250a$+=","+b$:NEXTl%:a$=MID$(a$,2) 18260PROCdomenu(121,a$,"Timezone",0) 18270ENDPROC 18280 18290DEFPROCtransportmenu(m%) 18300LOCALA$,l% 18310FORl%=0TOntrans%:IFtrans$(l%)>""THEN 18320 A$=A$+trans$(l%)+"," 18330ENDIF 18340NEXTl% 18350PROCdomenu(m%,LEFT$(A$),"Transport",0) 18360ENDPROC 18370 18380DEFPROCinittransport 18390timezone$=FNtimezone 18400IFFNruntransportfile(14,"","","")=0THENPROCreadnewsrc 18410IFFNruntransportfile(11,"","","")=0THEN 18420 a$=FNvarval("Newsbase$ReturnInfo") 18430 IFa$>""THENhostname$=a$ ELSEPROCmessage0("Nohost",0) 18440ENDIF 18450mailname$=hostname$ 18460IFFNruntransportfile(12,"","","")=0THEN 18470 a$=FNvarval("Newsbase$ReturnInfo"):IFa$>""THENremotehost$=a$ 18480ENDIF 18490PROCsethost 18500ENDPROC 18510 18520DEFFNruntransportfile(c%,fi$,us$,nu$) 18530LOCALF%,f$,a$,b$,n%,mem% 18540REM special return codes: 18550REM -1 not enough memory 18560REM -2 command failed 18570REM -3 command not found 18580a$=transc$(transport%,c%):mem%=transm%(transport%,c%):IFmem%=0THENmem%=32 18590SYS"OS_CLI","unset Newsbase$ReturnCode" 18600SYS"OS_CLI","unset Newsbase$ReturnInfo" 18610IFa$>""THEN 18620 REM substitute parameters %0...%2 18630 n%=INSTR(a$,"%") 18640 WHILEn%>0:b$="" 18650 CASEMID$(a$,n%+1,1)OF 18660 WHEN"f":b$=fi$ 18670 WHEN"u","g":b$=us$ 18680 WHEN"n":b$=nu$:IFb$=""THENb$="0" 18690 WHEN"h":b$=hostname$ 18700 WHEN"m":b$=mailname$ 18710 WHEN"r":b$=remotehost$ 18720 WHEN"%":b$="%" 18730 ENDCASE 18740 a$=LEFT$(a$,n%-1)+b$+MID$(a$,n%+2):n%+=LENb$-1 18750 n%=INSTR(a$,"%",n%) 18760 ENDWHILE 18770 IFFNfreemem(0)<mem%*1024 THEN 18780 PROCmessage1("Needmem2",m$,0) 18790 SYS"OS_CLI","set Newsbase$ReturnCode -1" 18800 ELSE 18810 f$=FNtransportfile(a$) 18820 IFf$>""THEN 18830 PROChgon 18840 SYS"XWimp_SlotSize",-1,-1TO,n%:SYS"XWimp_SlotSize",-1,mem%*1024 18850 SYS"XWimp_StartTask",f$TO;F% 18860 SYS"XWimp_SlotSize",-1,n% 18870 PROChgoff 18880 IF(F%AND1) THEN 18890 SYS"OS_CLI","set Newsbase$ReturnInfo "+FNmsg0("Tfail3") 18900 SYS"OS_CLI","set Newsbase$ReturnCode -2" 18910 ENDIF 18920 ELSE 18930 SYS"OS_CLI","set Newsbase$ReturnInfo "+FNmsg1("Tfail4",a$) 18940 SYS"OS_CLI","set Newsbase$ReturnCode -3" 18950 ENDIF 18960 ENDIF 18970ENDIF 18980n%=VALFNvarval("Newsbase$ReturnCode") 18990f$=FNvarval("Newsbase$ReturnInfo"):IFn%<>0ANDf$>""THENPROClog(a$+" -> "+f$) 19000=n% 19010 19020DEFPROCrunsupport(f$) 19030IFFNfreemem(0)<64*1024THEN 19040 PROCmessage1("Needmem2",f$,0) 19050 ELSE 19060 SYS"XWimp_StartTask",support$+"."+f$ 19070ENDIF 19080ENDPROC 19090 19100DEFFNfreemem(c%) 19110LOCALf%:SYS"Wimp_SlotSize",-1,-1TO,,f% 19120IF(f%+(c%*1024))>0THENf%+=(c%*1024) 19130=f% 19140 19150DEFFNtransportfile(f$) 19160IFLEFT$(f$,1)="*"THEN 19170 f$=MID$(f$,2) 19180 ELSE 19190 f$="<newsbase$dir>.transports."+trans$(transport%)+"."+f$ 19200 IFFNobjtype(f$)=0THENf$="" 19210ENDIF 19220=f$ 19230 19240DEFPROCgwin(n%) 19250LOCALt%,e$,max%,cur$,new$ 19260CASElisttype%OF 19270 WHEN0:max%=groups%+1:cur$=grp$(gwin_g%) 19280 OTHERWISE:max%=maxactive%:cur$=active$(gwin_g%) 19290ENDCASE 19300IFcur$=""ANDn%>0THENENDPROC 19310t%=gwin_g%+n% 19320IFt%>max%THENt%=max% 19330IFt%<1THENt%=1 19340IFlisttype%=0THEN 19350 new$=grp$(t%) 19360 ELSE 19370 new$=active$(t%) 19380ENDIF 19390gwin_g%=t%:PROCupdateiconstring(gwin%,25,new$) 19400SYS"XWimp_SetCaretPosition",gwin%,25,,,-1,LENnew$ 19410IFlisttype%=0THEN 19420 PROCsetexpicon(t%):PROCsetinv(gwin%,16,grpmod%(t%)):PROCsetshaded(gwin%,16,0) 19430 ELSE 19440 PROCupdateiconstring(gwin%,1,"--"):PROCsetshaded(gwin%,16,1) 19450ENDIF 19460ENDPROC 19470 19480DEFPROCgact(A$) 19490PROCupdateiconstring(gwin%,21,LEFT$(A$,55)) 19500ENDPROC 19510 19520DEFPROCerrorbox(R%) 19530LOCAL ERROR 19540ON ERROR LOCAL PROCerrorerror:END 19550!tmp%=ERR:$(tmp%+4)="An error has occurred: "+REPORT$+" (code "+STR$ERL+")."+CHR$0 19560SYS"Wimp_ReportError",tmp%,1,myname$ 19570REM try to write error to logfile 19580PROClog(ver$+rev$+" error: "+REPORT$+" at "+STR$ERL):PROClog("") 19590CASER%OF 19600 WHEN0:PROCerrorerror 19610 OTHERWISE:!tmp%=ERR:$(tmp%+4)="Press OK to continue or Cancel to quit"+CHR$0 19620 SYS "Wimp_ReportError",tmp%,3,myname$TO,R% 19630 IFR%=2THENPROCerrorerror 19640ENDCASE 19650RESTORE ERROR 19660PROCtidyup 19670ENDPROC 19680 19690DEFPROCerrorerror 19700ONERROROFF 19710PROCfinish:END 19720ENDPROC 19730 19740DEFPROCopwinvar(h%) 19750CASEh%OF 19760WHENmsetup%:confopen%=TRUE 19770WHENmsgw%:msgopen%=TRUE 19780WHENstatus%:statopen%=TRUE 19790WHENsavend%:ndopen%=TRUE 19800WHENngwin%:ngopen%=TRUE 19810WHENarrive%:arropen%=TRUE 19820ENDCASE 19830ENDPROC 19840 19850DEFPROCfront(h%) 19860!q%=h%:SYS"Wimp_GetWindowState",,q% 19870q%!20=0:q%!24=0:q%!28=-1:SYS"Wimp_OpenWindow",,q% 19880PROCopwinvar(h%) 19890ENDPROC 19900 19910DEFPROCcfront(h%,xoff%,yoff%) 19920LOCALx%,y%,wx%,wy% 19930PROCopwinvar(h%) 19940!q%=h%:SYS"Wimp_GetWindowState",,q% 19950x%=FNmoderight:y%=FNmodetop:wx%=q%!12-q%!4:wy%=q%!16-q%!8 19960q%!4=(x%-wx%)DIV2-xoff%:q%!12=q%!4+wx%:q%!8=(y%-wy%)DIV2-yoff%:q%!16=q%!8+wy% 19970q%!20=0:q%!24=0:q%!28=-1:SYS"Wimp_OpenWindow",,q% 19980ENDPROC 19990 20000DEFFNic_str(H%,I%) 20010!q%=H%:q%!4=I%:SYS"XWimp_GetIconState",,q%TO;F% 20020=FNstr(q%!28) 20030 20040DEFPROCseticonstring(H%,I%,A$) 20050!q%=H%:q%!4=I%:SYS"XWimp_GetIconState",,q%TO;F% 20060$(q%!28)=A$+CHR$0 20070ENDPROC 20080: 20090DEFPROCupdateiconstring(H%,I%,A$) 20100PROCseticonstring(H%,I%,A$):!q%=H%:q%!4=I%:q%!8=0:q%!12=0 20110SYS"XWimp_SetIconState",,q%TO;F% 20120ENDPROC 20130 20140DEFPROCsetinv(H%,I%,S%) 20150S%=ABS(S%=0):!q%=H%:q%!4=I%:q%!8=((1)<<21)*ABS(S%=0):q%!12=(1<<21) 20160SYS"XWimp_SetIconState",,q%TO;F% 20170ENDPROC 20180 20190DEFPROCsetshaded(H%,I%,S%) 20200!q%=H%:q%!4=I%:q%!8=((1)<<22)*ABSS%:q%!12=(1<<22) 20210SYS"Wimp_SetIconState",,q% 20220ENDPROC 20230 20240DEFFNrdinv(H%,I%) 20250!q%=H%:q%!4=I%:SYS"Wimp_GetIconState",,q% 20260=-(((q%!24)AND(1<<21))DIV2097152<>0) 20270 20280DEFPROCmodgwmenu 20290LOCALA$,l% 20300FORl%=0TO20:IFmodgw$(l%)>""ANDLEN(A$+modgw$(l%))<253THENA$=A$+modgw$(l%)+"," 20310NEXTl% 20320IFA$>""PROCdomenu(120,LEFT$(A$),"Modpaths",0) 20330ENDPROC 20340 20350DEFPROCmngwmenu 20360LOCALA$,l% 20370FORl%=0TO10:IFmngw$(l%)>""ANDLEN(A$+mngw$(l%))<253THENA$=A$+mngw$(l%)+"," 20380NEXTl% 20390IFA$>""PROCdomenu(122,LEFT$(A$),"Gateways",0) 20400ENDPROC 20410 20420DEFPROCrdmenu 20430LOCALA$,a$,c%,l%,t%,F%:c%=0 20440REPEATSYS"XOS_ReadVarVal","Newsbase$Client*",tmp%,255,c%TO,,l%,c%,t%;F% 20450IFt%=0AND(F%AND1)=0THENtmp%?l%=13:a$=FNstr(tmp%):IFLENA$+LENa$<255THENA$+=a$+"," 20460UNTIL(F%AND1)<>0:IFA$>""THENPROCdomenu(123,LEFT$(A$),"Readers",0) 20470ENDPROC 20480 20490DEFPROCgrpmenu(handle%) 20500LOCALmbuf%,tbuf%,tbufp%,w%,wp%,msiz%,tsiz%,no% 20510PROCrelease(menudataref%):PROCrelease(indmenuref%) 20520REMIFlisttype%=1ANDactive$(1)=""THENVDU7:ENDPROC 20530PROChgon 20540CASElisttype%OF 20550 WHEN0:msiz%=28+24*(groups%+1):tsiz%=groups%*2 20560 FORw%=1TOgroups%:tsiz%+=LENgrp$(w%):NEXTw% 20570 OTHERWISE:msiz%=28+24*(maxactive%+1):tsiz%=maxactive%*3 20580 FORw%=1TOmaxactive%:tsiz%+=LENactive$(w%):NEXTw% 20590ENDCASE 20600menudataref%=FNclaim(menudata%,msiz%,"menu") 20610indmenuref%=FNclaim(indmenubuf%,tsiz%,"menudata") 20620IFmenudata%>0ANDindmenubuf%>0THEN 20630 mbuf%=menudata%:tbuf%=indmenubuf% 20640 tbufp%=tbuf% 20650 menuhandle%=handle% 20660 menuptr%=mbuf% 20670 menuptr%!20=44 20680 $menuptr%="Groups":w%=6 20690 menuptr%!12=&70207 20700 wp%=menuptr%+16:menuptr%!24=0 20710 menuptr%+=28:no%=1 20720 REPEAT 20730 IFlisttype%=0THEN 20740 item$=grp$(no%) 20750 ELSE 20760 item$=active$(no%) 20770 ENDIF 20780 IFLENitem$>w% THENw%=LENitem$ 20790 IFitem$>""THEN 20800 !menuptr%=0:menuptr%!4=0 20810 menuptr%!8=&07000121 20820 menuptr%!12=tbufp%:menuptr%!16=0:menuptr%!20=LENitem$+1 20830 $tbufp%=item$+CHR$0:tbufp%+=(LENitem$+1) 20840 menuptr%+=24 20850 ENDIF 20860 no%+=1:UNTILitem$="" 20870 !wp%=w%*16+32:menuptr%!-24=(menuptr%!-24)OR&80 20880 IFno%>2PROCgetpointer:menux%=mx%-64:menuy%=my%:SYS"Wimp_CreateMenu",,mbuf%,menux%,my% 20890ENDIF 20900PROChgoff 20910ENDPROC 20920 20930DEFPROCumenu 20940LOCALA$,l% 20950l%=0:WHILEl%<maxusr%ANDuser$(l%)>"":A$+=user$(l%)+",":l%+=1:ENDWHILE 20960IFLENA$>1THENA$=LEFT$(A$):PROCdomenu(107,A$,"Users",0) 20970ENDPROC 20980 20990DEFPROCugmenu 21000PROCdomenu(108,"0,1,2,3,10,11,12,13,14,15,\---","Groups",0):ENDPROC 21010 21020DEFPROCdomenu(handle%,menu$,menutitle$,I%) 21030LOCALw%,wp%,l%,a$,item$,fudge%,tbufp%,ilen% 21040PROCrelease(menudataref%):PROCrelease(indmenuref%) 21050menudataref%=FNclaim(menudata%,&400,"menu") 21060indmenuref%=FNclaim(indmenubuf%,&400,"menudata") 21070IFmenu$=""THENENDPROC 21080menuItems%=0:fudge%=0 21090menuhandle%=handle% 21100menuptr%=menudata% 21110menuptr%!20=44 21120$menuptr%=menutitle$:w%=LENmenutitle$ 21130menuptr%!12=&70207 21140wp%=menuptr%+16:menuptr%!24=0 21150menuptr%+=28:tbufp%=indmenubuf% 21160REPEAT 21170 l%=INSTR(menu$,",") 21180 IFl%>0THEN 21190 item$=LEFT$(menu$,l%-1):menu$=MID$(menu$,l%+1) 21200 ELSE 21210 item$=menu$:menu$="" 21220 ENDIF 21230 IFLENitem$>w% THENw%=LENitem$ 21240 IFitem$>""THEN 21250 !menuptr%=0 21260 IFLEFT$(item$,1)="|"THENitem$=MID$(item$,2):!menuptr%=2:fudge%+=1 21270 IFLEFT$(item$,1)="!"THENitem$=MID$(item$,2):!menuptr%=!menuptr%+1 21280 menuptr%!4=-1:menuptr%!8=&07000121:ilen%=1+LENitem$ 21290 CASELEFT$(item$,1)OF 21300 WHEN">":menuptr%!4=info%:item$=MID$(item$,2) 21310 WHEN"<":menuptr%!8=menuptr%!8 OR(1<<22):item$=MID$(item$,2) 21320 WHEN"\":menuptr%!8=menuptr%!8 OR(1<<8):!menuptr%=!menuptr%OR4:item$="" 21330 ENDCASE 21340 menuptr%!12=tbufp%:menuptr%!16=0:menuptr%!20=ilen% 21350 $tbufp%=item$+CHR$0:tbufp%+=ilen% 21360 ENDIF 21370 menuptr%+=24:menuItems%+=1 21380UNTILmenu$="" 21390menuptr%!-24=(menuptr%!-24)OR&80 21400!wp%=w%*16+32:PROCgetpointer 21410menux%=mx%-64:IFI%<>0THENmenuy%=96+menuItems%*44+fudge%*24ELSEmenuy%=my% 21420SYS "Wimp_CreateMenu",,menudata%,menux%,menuy% 21430ENDPROC 21440 21450DEFPROCmenuselect(menus%) 21460LOCALl%,g$:SYS"Wimp_DecodeMenu",,menudata%,menus%,tmp% 21470A$=FNstr(tmp%) 21480IFb%AND1THEN 21490 SYS"Wimp_CreateMenu",,menudata%,menux%,menuy% 21500 ELSE 21510 PROCrelease(menudataref%):PROCrelease(indmenuref%) 21520ENDIF 21530CASEmenuhandle%OF 21540 WHEN101: 21550 CASE A$ OF 21560 WHEN"Setup...":IFstartupok%THENPROCfront(msetup%)ELSEPROCstillstart 21570 WHEN"Debatch":IFstartupok%THENcheckfiles%=1:forcebatch%=TRUE 21580 WHEN"Expire":IFstartupok%THENPROCexpgroup("*",0) 21590 WHEN"Queues...":IFstartupok%THENl%=FNruntransportfile(3,"","","") 21600 WHEN"Quit":IFFNcheckquit PROCfinish:END 21610 ENDCASE 21620 WHEN102:PROCsettrans(FNtransno(A$)) 21630 WHEN112:PROCsettrans2(FNtransno(A$)) 21640 WHEN103:IFVALA$>0PROCupdateiconstring(gwin%,2,A$):defexp%=VALA$ 21650 WHEN104: 21660 g$=FNic_str(gwin%,25):CASEA$OF 21670 WHEN"Default":PROCsetexpiry(g$,0) 21680 WHEN"Never":PROCsetexpiry(g$,1E6) 21690 OTHERWISE:IFVALA$>0PROCsetexpiry(g$,VALA$) 21700 ENDCASE 21710 PROCupdateiconstring(gwin%,1,A$) 21720 WHEN105:IFVALA$>0PROCupdateiconstring(gwin%,22,A$):ngexp%=VALA$ 21730 WHEN106:CASEA$OF 21740 WHEN"Pause":PROCpause 21750 WHEN"Resume":pause%=0:PROCprint("",""," ","") 21760 WHEN"Cancel":cancel%=TRUE 21770 ENDCASE 21780 WHEN107:PROCgetuserinfo:PROCsaveuserinfo:PROCsetuwin(A$) 21790 WHEN108:CASEA$OF 21800 WHEN"0":PROCupdateiconstring(uwin%,2,A$) 21810 OTHERWISE:IFVALA$>0THENPROCupdateiconstring(uwin%,2,A$) 21820 ENDCASE 21830 WHEN110:IFlisttype%=0THEN 21840 gwin_g%=FNnametono(A$,FALSE):PROCgwin(0) 21850 ELSE 21860 gwin_g%=0:REPEATgwin_g%+=1:UNTILactive$(gwin_g%)=A$ORgwin_g%>maxactive%:PROCgwin(0) 21870 ENDIF 21880 WHEN111:PROCupdateiconstring(gwin%,12,A$):listtype%=ABS(LEFT$(A$,1)="A"):PROCgwin(0) 21890 WHEN120:modgw$=A$:PROCsetmodgw(A$) 21900 WHEN121:timezone$=A$:PROCsethost 21910 WHEN122:mngw$=A$:PROCsetmngw(A$) 21920 WHEN123:PROCupdateiconstring(gsetup%,16,A$) 21930 WHEN130:PROCupdateiconstring(fwin%,1,A$) 21940 WHEN131:PROCupdateiconstring(fwin%,15,A$):PROCsetcaret(fwin%,16,0) 21950 WHEN132,133,134:PROCupdateiconstring(fwin%,menuhandle%-130,A$) 21960 PROCsetcaret(fwin%,menuhandle%-127,0) 21970ENDCASE 21980ENDPROC 21990 22000DEFPROCstillstart:PROCmessage0("Bstart",0):ENDPROC 22010 22020DEFPROCpause 22030pause%=1:REPEATPROCprint("","",FNmsg0("Paused"),""):PROCpoll(200):UNTILpause%=0 22040ENDPROC 22050 22060DEFPROCsetexpiry(g$,a%) 22070LOCALl%:IFg$=""ENDPROC 22080FORl%=1TOgroups% 22090 IFFNsmatch(g$,grp$(l%))<>0THENgrpexp%(l%)=a% 22100NEXTl% 22110ENDPROC 22120 22130DEFPROCprint(A$,B$,C$,D$) 22140IFA$>""PROCupdateiconstring(status%,1,LEFT$(A$,36)) 22150IFB$>""PROCupdateiconstring(status%,2,LEFT$(B$,36)) 22160IFC$>""PROCupdateiconstring(status%,3,LEFT$(C$,36)) 22170IFD$>""PROCupdateiconstring(status%,4,LEFT$(D$,36)) 22180ENDPROC 22190 22200DEFPROCopen_window(handle%,x0%,y0%,x1%,y1%,scx%,scy%,bhandle%) 22210IFhandle%=-1THENENDPROC 22220q%!0=handle%:q%!28=bhandle% 22230q%!4=x0%:q%!8=y0%:q%!12=x1%:q%!16=y1% 22240q%!20=scx%:q%!24=scy% 22250SYS "Wimp_OpenWindow",,q% 22260ENDPROC 22270: 22280DEFPROCgetpointer 22290SYS "Wimp_GetPointerInfo",,tmp% 22300mx%=!tmp%:my%=tmp%!4:b%=tmp%!8:handle%=tmp%!12:icon%=tmp%!16 22310ENDPROC 22320 22330DEFPROCclosew(h%) 22340PROCgetpointer 22350CASEh%OF 22360WHENmsetup%:confopen%=FALSE 22370WHENmsgw%:msgopen%=FALSE 22380WHENstatus%:statopen%=FALSE 22390WHENngwin%:ngopen%=FALSE:PROCcloseng 22400WHENarrive%:IFarropen%THENarropen%=FALSE:arrart%=0:arrmail$="" 22410WHENsavend%:ndopen%=FALSE 22420WHENyesno%,info%:REM dummys for otherwise clause... 22430OTHERWISE:IFb%=1THENPROCfront(msetup%) 22440ENDCASE 22450!q%=h%:SYS"Wimp_CloseWindow",,q% 22460ENDPROC 22470 22480DEFFNvarval(A$) 22490LOCALL%,F% 22500SYS"XOS_ReadVarVal",A$,tmp%,256,0,3 TO,,L%;F% 22510IF(F%AND1) ORL%>256 THEN:="" 22520tmp%?L%=13:=$tmp% 22530 22540DEFPROCngwin 22550REM handle f4% is reserved for use by newgroups handler 22560nglast%=0:ngtime%=0 22570f1%=FNopenin(lastng$) 22580IFf1%>0THENngtime%=VALGET$#f1%:PROCcf(f1%) 22590f4%=FNopenin(newgrp$) 22600IFf4%>0THEN 22610 PROCcfront(ngwin%,0,-100):PROCnextng 22620 ELSE 22630 PROCmessage0("NGnone",0) 22640ENDIF 22650ENDPROC 22660 22670DEFPROCnextng 22680LOCALa$,b$,ok%:IFf4%=0THENPROCclosew(ngwin%):ENDPROC 22690REPEATa$=GET$#f4%:IFEOF#f4%THENPROCcf(f4%):ok%=2 22700 IFLEFT$(a$,1)="#"THEN 22710 nglast%=VAL(MID$(a$,3,6)+MID$(a$,10,2)) 22720 IFnglast%>ngtime%THENf1%=FNopenout(lastng$):IFf1%>0THENBPUT#f1%,STR$nglast%:PROCcf(f1%):PROCsettype(lastng$,&FFF):ngtime%=nglast% 22730 ELSE 22740 IFnglast%>=ngtime%THENb$=FNgetpar(a$," "):a$=b$:IFFNactive(a$)=0ANDFNisachef(a$)=0THENok%=1 22750 ENDIF 22760UNTILok%<>0 22770IFok%=1THEN 22780 b$=STR$nglast%:b$=MID$(b$,5,2)+"-"+MID$(b$,3,2)+"-"+LEFT$(b$,2) 22790 PROCupdateiconstring(ngwin%,5,"Created "+b$) 22800 PROCupdateiconstring(ngwin%,6,LEFT$(a$,45)) 22810 ELSE 22820 PROCclosew(ngwin%):PROCmessage0("NGend",0) 22830ENDIF 22840ENDPROC 22850 22860DEFPROCcatchupng 22870f1%=FNopenout(lastng$) 22880IFf1%>0THENBPUT#f1%,FNctime("%YR%MN%DY%24"):PROCcf(f1%):PROCsettype(lastng$,&FFF) 22890PROCclosew(ngwin%) 22900ENDPROC 22910 22920DEFPROCcloseng 22930PROCcf(f4%) 22940ENDPROC 22950 22960DEFPROCgettransports 22970LOCALl%,r3%,t%,dirbuf%,dbr%,a$,b$,F% 22980dbr%=FNclaim(dirbuf%,dbsize%,"dbuf") 22990ntrans%=1:REPEAT 23000 SYS"XOS_GBPB",10,transdir$,dirbuf%,1,n%,dbsize%,"*"TO,,,r3%,n%;F% 23010 IFr3%>0AND(dirbuf%!16)=2THENntrans%+=1 23020UNTILn%=-1OR(F%AND1)>0 23030DIMtrans$(ntrans%),transd$(ntrans%),transc$(ntrans%,20),transm%(ntrans%,20) 23040DIMtransi$(ntrans%,10),transo$(ntrans%,10) 23050trans$(0)="none":transi$(0,0)=workdir$+".*":transi$(0,1)=lindir$+".*" 23060l%=1:n%=0 23070REPEAT 23080 SYS"XOS_GBPB",10,transdir$,dirbuf%,1,n%,dbsize%,"*"TO,,,r3%,n%,F% 23090 IFr3%>0AND(dirbuf%!16)=2THEN 23100 a$=FNlower(FNstr(dirbuf%+20)):b$=transdir$+"."+a$ 23110 IFFNobjtype(b$+".params")=1THEN 23120 trans$(l%)=a$ 23130 PROCreadtrans(b$+".params",l%) 23140 IFFNruntransportfile(18,"","","")=0ANDtransport%=0THENtransport%=l% 23150 l%+=1 23160 ENDIF 23170 ENDIF 23180UNTILn%=-1OR(F%AND1)>0 23190PROCsettrans2(transport%) 23200PROCrelease(dbr%) 23210ENDPROC 23220 23230DEFPROCreadtrans(f$,n%) 23240LOCALa$,b$,c$,i%,o%,l%,p%,dm%:dm%=32 23250f1%=FNopenin(f$):IFf1%<>0THEN 23260 REPEATa$=GET$#f1%:b$=FNgetpar(a$," ") 23270 CASEb$OF 23280 WHEN"in":IFi%<11THENtransi$(n%,i%)=a$:i%+=1 23290 WHEN"out":IFo%<11THENtranso$(n%,o%)=a$:o%+=1 23300 WHEN"dir":PROCensuredir(a$) 23310 WHEN"info":transd$(n%)=a$ 23320 WHEN"defmem":dm%=VALa$:IFdm%<0THENdm%=0ELSEIFdm%>2048THENdm%=2048 23330 OTHERWISE: 23340 p%=0:c$=FNgetpar(a$," ") 23350 l%=VALFNclean(c$):IFl%<=0THENl%=dm%ELSEIFl%>2048THENl%=2048 23360 CASELEFT$(b$,5)OF 23370 WHEN"sendm":p%=1 23380 WHEN"sendn":p%=2 23390 WHEN"showq":p%=3 23400 WHEN"prefe":p%=4 23410 WHEN"postf":p%=5 23420 WHEN"addus":p%=6 23430 WHEN"delus":p%=7 23440 WHEN"modus":p%=8 23450 WHEN"addgr":p%=9 23460 WHEN"delgr":p%=10 23470 WHEN"getho","setho":p%=11 23480 WHEN"getre","setre":p%=12 23490 WHEN"getin":p%=13 23500 WHEN"mkgro":p%=14 23510 WHEN"statu":p%=15 23520 WHEN"start":p%=16 23530 WHEN"setup":p%=17 23540 WHEN"detec":p%=18 23550 ENDCASE 23560 IFp%>0THENtransc$(n%,p%)=a$:transm%(n%,p%)=l% 23570 ENDCASE 23580 UNTIL(EOF#f1%):PROCcf(f1%) 23590ENDIF 23600ENDPROC 23610 23620DEFPROCreadnewsrc 23630LOCALcount% 23640active$()="":active$(0)="junk*" 23650f1%=FNopenin(confdir$+"."+trans$(transport%)+".groups") 23660IFf1%<>0THEN 23670 count%=1 23680 REPEATA$=FNlower(FNsget(f1%)) 23690 active$(count%)=A$:count%+=1 23700 UNTILEOF#f1%ORcount%>maxactive% 23710 PROCcf(f1%) 23720ENDIF 23730maxactive%=count% 23740ENDPROC 23750 23760DEFFNactive(group$) 23770LOCALg$,flag%,count%,neg% 23780IFgroup$=""THEN:=FALSE 23790IFFNspecialgrp(group$)>0THEN:=TRUE 23800group$=FNlower(group$) 23810flag%=0:count%=0 23820REPEAT 23830 g$=FNlower(active$(count%)):neg%=0 23840 IFASCg$=33THENg$=MID$(g$,2):neg%=1 23850 IFFNsmatch(g$,group$)<>0 THENflag%=1+3*neg% 23860 count%+=1:IFflag%=1THENflag%+=1 23870UNTILg$=""ORflag%>3 23880IFneg%=1THENflag%=0 23890=flag% 23900 23910DEFFNisachef(g$) 23920LOCALyes%,a1$,a2$,a3$,a4$,a5$,a6$:yes%=0 23930IFkillc%<>0THEN 23940a1$=FNgetpar(g$,".") 23950IFa1$="alt"THEN 23960 a2$=FNgetpar(g$,"."):a3$=FNgetpar(g$,".") 23970 a4$=FNgetpar(g$,"."):a5$=FNgetpar(g$,".") 23980 IFa3$=a4$ANDa4$=a5$ANDa5$>""ORa5$=a6$ANDa4$=a5$ANDa6$>""THENyes%=TRUE 23990ENDIF 24000ENDIF 24010=yes% 24020 24030DEFPROCmessage0(A$,w%) 24040PROCmessage(FNmsg0(A$),w%) 24050ENDPROC 24060 24070DEFPROCmessage1(A$,B$,w%) 24080PROCmessage(FNmsg1(A$,B$),w%) 24090ENDPROC 24100 24110DEFPROCmessage2(A$,B$,C$,w%) 24120PROCmessage(FNmsg2(A$,B$,C$),w%) 24130ENDPROC 24140 24150DEFPROCmessage(A$,wait%) 24160IFA$=""PROCclosew(msgw%):ENDPROC 24170PROCupdateiconstring(msgw%,0,LEFT$(A$,127)) 24180IFwait%=0THENPROCupdateiconstring(msgw%,2,"Dismiss")ELSEPROCupdateiconstring(msgw%,2,"Continue") 24190IFmsgopen%=0THENPROCcfront(msgw%,0,-110)ELSEPROCfront(msgw%) 24200msgopen%=1 24210IFwait%THEN 24220 REPEATPROCpoll(200):UNTILmsgopen%=FALSE 24230ENDIF 24240ENDPROC 24250 24260DEFPROCreadconfig 24270LOCALcver% 24280f1%=FNopenin(confdir$+".!nbconfig") 24290IFf1%<>0THEN 24300 cver%=100*VALGET$#f1% 24310 IFcver%>46THEN 24320 hostname$=GET$#f1% 24330 remotehost$=GET$#f1%:IFLENremotehost$<2THENremotehost$="" 24340 transport%=FNtransno(FNlower(GET$#f1%)) 24350 org$=GET$#f1% 24360 defclient$=GET$#f1% 24370 modgw$=GET$#f1% 24380 timezone$=GET$#f1%:IFtimezone$=""THENtimezone$=FNtimezone 24390 mailname$=GET$#f1%:IFmailname$=""THENmailname$=hostname$ 24400 mngw$=GET$#f1% 24410 A$=GET$#f1% 24420 A$=GET$#f1% 24430 A$=GET$#f1% 24440 A$=GET$#f1% 24450 logfile%=VALGET$#f1% 24460 autoexp%=VALGET$#f1% 24470 keepoutg%=VALGET$#f1% 24480 defexp%=VALGET$#f1% 24490 keepb%=VALGET$#f1% 24500 delok%=VALGET$#f1% 24510 fast%=VALGET$#f1% 24520 alert%=VALGET$#f1% 24530 alertbeep%=VALGET$#f1% 24540 alertnews%=VALGET$#f1% 24550 userctrl%=VALGET$#f1% 24560 expmail%=VALGET$#f1% 24570 autodebatch%=VALGET$#f1% 24580 mngw%=VALGET$#f1% 24590 ngexp%=VALGET$#f1%:IFngexp%=0THENngexp%=7 24600 IFcver%>49THEN 24610 docanc%=VALGET$#f1% 24620 killc%=VALGET$#f1% 24630 doreceipt%=VALGET$#f1% 24640 igexp%=VALGET$#f1% 24650 IFcver%>51THEN 24660 thread%=VALGET$#f1% 24670 compress%=VALGET$#f1% 24680 complimit%=VALGET$#f1%:IFcomplimit%=0THENcomplimit%=2048 24690 expany%=VALGET$#f1% 24700 exptime%=VALGET$#f1% 24710 mindsk%=VALGET$#f1%:IFmindsk%=0THENmindsk%=1024 24720 ENDIF 24730 ENDIF 24740 ENDIF 24750 PROCcf(f1%) 24760ENDIF 24770PROCsetconfig:PROCsetsysvars 24780SYS"OS_Byte",121,(2EOR&80)TO,A% 24790IFcver%<ver%ANDrw%THENPROCnewuser(cver%) 24800IFA%=&FF THENinitconf%=1 24810IFcver%<47ANDrw%THENPROCinittransport:initconf%=2 24820ENDPROC 24830 24840DEFPROCnewuser(t%) 24850LOCALF%,t$:IFt%>0ANDt%<47THENt%=1 24860PROCnucp(t%):t$=FNmsg1("Swelcome1",ver$) 24870CASEt%OF 24880WHEN0:PROCmessage1("Swelcome2",t$,0) 24890WHEN1:PROCmessage1("Swelcome3",t$,1) 24900OTHERWISE:PROCmessage1("Swelcome4",t$,1):PROCsaveconfig 24910ENDCASE 24920PROCpoll(0) 24930ENDPROC 24940 24950DEFPROCnucp(t%) 24960LOCALf1$,F% 24970REM copy newuser/update messages to work dir 24980REM but delete them if decompression fails...! 24990IFt%=0THENs$=".welcome.new_"ELSEs$=".welcome.upd_" 25000f1$=workdir$+".postmaster" 25010F%=FNcopyfile(support$+s$+"mail",f1$) 25020f1$=workdir$+".localnews" 25030F%=FNcopyfile(support$+s$+"news",f1$) 25040ENDPROC 25050 25060DEFPROCsetconfig 25070LOCALl% 25080PROCsetinv(gwin%,27,docanc%) 25090PROCsetinv(gwin%,28,killc%) 25100PROCsetinv(gwin%,29,autoexp%) 25110PROCsetinv(gwin%,33,igexp%) 25120PROCsetinv(gwin%,34,thread%) 25130PROCsetinv(gwin%,31,expmail%):PROCsetinv(gwin%,30,-(expmail%=0)) 25140PROCsetinv(gwin%,36,expany%):PROCsetinv(gwin%,35,-(expany%=0)) 25150PROCupdateiconstring(gwin%,2,STR$defexp%) 25160PROCupdateiconstring(gwin%,22,STR$ngexp%) 25170PROCsetinv(uwin%,10,keepoutg%) 25180PROCsetinv(uwin%,11,userctrl%) 25190PROCsetinv(uwin%,12,delok%) 25200PROCsetinv(gsetup%,3,fast%) 25210PROCsetinv(gsetup%,6,logfile%) 25220PROCsetinv(gsetup%,7,doreceipt%) 25230PROCsetinv(gsetup%,8,compress%) 25240PROCsetinv(gsetup%,9,keepb%) 25250PROCsetinv(gsetup%,10,alert%) 25260PROCsetinv(gsetup%,11,autodebatch%):checkfiles%=autodebatch% 25270PROCsetinv(gsetup%,12,alertbeep%) 25280PROCsetinv(gsetup%,14,alertnews%):PROCsetinv(gsetup%,13,-(alertnews%=0)) 25290PROCsetinv(gsetup%,20,mngw%) 25300PROCupdateiconstring(gsetup%,23,STR$complimit%) 25310PROCupdateiconstring(gsetup%,26,STR$mindsk%) 25320PROCseticonstring(gwin%,12,"Current list") 25330FORl%=3TO4:PROCsetshaded(uwin%,l%,(keepoutg%=0)):NEXTl%:REM keep outgoing m/n 25340FORl%=30TO31:PROCsetshaded(gwin%,l%,(autoexp%=0)):NEXTl%:REM mail/news expiry 25350FORl%=35TO41:PROCsetshaded(gwin%,l%,(autoexp%=0)):NEXTl%:REM expiry schedule 25360FORl%=12TO14:PROCsetshaded(gsetup%,l%,(alert%=0)):NEXTl%:REM new mail/news 25370PROCsettrans(transport%) 25380IFmodgw$=""THENmodgw$=modgw$(0) 25390PROCsetmodgw(modgw$) 25400PROCsetmngw(mngw$) 25410PROCdispexptime 25420PROCupdateiconstring(sitewin%,3,org$) 25430PROCsethost:PROCsetclient 25440slice%=FNcpu(fast%) 25450ENDPROC 25460 25470DEFPROCmodexp(ch%,cm%) 25480LOCALh%,m% 25490h%=exptime%DIV100:m%=exptime%MOD100 25500m%+=cm% 25510IFm%>59THENch%=1:m%=0 25520IFm%<0THENch%=-1:m%=59 25530h%+=ch% 25540IFh%<0THENh%=23 25550IFh%>23THENh%=0 25560exptime%=h%*100+m%:PROCdispexptime 25570ENDPROC 25580 25590DEFPROCdispexptime 25600LOCALa$,h$,m$ 25610h$=RIGHT$("0"+STR$(exptime%DIV100),2):m$=RIGHT$("0"+STR$(exptime%MOD100),2) 25620IFh$="00"THENh$="12" 25630a$=h$+":"+m$ 25640IFexptime%>1159THENa$+=" pm"ELSEa$+=" am" 25650PROCupdateiconstring(gwin%,41,a$) 25660ENDPROC 25670 25680DEFPROCsetmodgw(g$) 25690PROCupdateiconstring(gsetup%,1,LEFT$(g$,41)) 25700ENDPROC 25710 25720DEFPROCsetmngw(g$) 25730PROCupdateiconstring(gsetup%,18,LEFT$(g$,41)) 25740ENDPROC 25750 25760DEFPROCsettrans(t%) 25770IFt%<0THENt%=0 25780PROCupdateiconstring(sitewin%,11,LEFT$(trans$(t%)+" - "+transd$(t%),40)) 25790ENDPROC 25800 25810DEFPROCsettrans2(t%) 25820IFt%<0THENt%=0 25830PROCupdateiconstring(trwin%,0,trans$(t%)) 25840PROCupdateiconstring(trwin%,2,LEFT$(transd$(t%),38)) 25850ENDPROC 25860 25870DEFFNtransno(t$) 25880LOCALt% 25890t%=0:WHILEt%<ntrans%ANDt$<>trans$(t%):t%+=1:ENDWHILE 25900IFt$<>trans$(t%)THENt%=0 25910=t% 25920 25930DEFPROCsetclient 25940PROCupdateiconstring(gsetup%,16,defclient$) 25950ENDPROC 25960 25970DEFPROCsethost 25980PROCupdateiconstring(sitewin%,0,hostname$) 25990PROCupdateiconstring(sitewin%,1,mailname$) 26000PROCupdateiconstring(sitewin%,2,remotehost$) 26010PROCupdateiconstring(sitewin%,14,timezone$) 26020ENDPROC 26030 26040DEFPROCgetconfig 26050LOCALt$,l% 26060docanc%=FNrdinv(gwin%,27) 26070killc%=FNrdinv(gwin%,28) 26080autoexp%=FNrdinv(gwin%,29) 26090igexp%=FNrdinv(gwin%,33) 26100thread%=FNrdinv(gwin%,34) 26110defexp%=VALFNic_str(gwin%,2) 26120ngexp%=VALFNic_str(gwin%,22) 26130expmail%=FNrdinv(gwin%,31) 26140expany%=FNrdinv(gwin%,36) 26150logfile%=FNrdinv(gsetup%,6) 26160doreceipt%=FNrdinv(gsetup%,7) 26170fast%=FNrdinv(gsetup%,3) 26180autodebatch%=FNrdinv(gsetup%,11):checkfiles%=autodebatch% 26190compress%=FNrdinv(gsetup%,8) 26200keepb%=FNrdinv(gsetup%,9) 26210alert%=FNrdinv(gsetup%,10) 26220alertbeep%=FNrdinv(gsetup%,12) 26230alertnews%=FNrdinv(gsetup%,14) 26240mngw%=FNrdinv(gsetup%,20) 26250modgw$=FNic_str(gsetup%,1) 26260mngw$=FNic_str(gsetup%,18) 26270defclient$=FNic_str(gsetup%,16) 26280complimit%=VALFNic_str(gsetup%,23) 26290mindsk%=VALFNic_str(gsetup%,26) 26300keepoutg%=FNrdinv(uwin%,10) 26310userctrl%=FNrdinv(uwin%,11) 26320delok%=FNrdinv(uwin%,12) 26330hostname$=FNic_str(sitewin%,0) 26340t$=FNic_str(sitewin%,11):l%=INSTR(t$," "):IFl%>0THENt$=LEFT$(t$,l%-1) 26350IFtransport%<>FNtransno(t$)THENtransport%=FNtransno(t$):PROCstarttransport 26360org$=FNic_str(sitewin%,3) 26370remotehost$=FNic_str(sitewin%,2) 26380mailname$=FNic_str(sitewin%,1) 26390timezone$=FNic_str(sitewin%,14) 26400slice%=FNcpu(fast%) 26410PROCsetsysvars 26420FORl%=0TO6:PROCnbsiteinfo(30,0,0,l%):ENDPROC 26430ENDPROC 26440 26450DEFPROCsetsysvars 26460PROCsetvar("Newsbase$HostName",hostname$) 26470PROCsetvar("Newsbase$MailName",mailname$) 26480PROCsetvar("Newsbase$RemoteHost",remotehost$) 26490PROCsetvar("Newsbase$Transport",trans$(transport%)) 26500ENDPROC 26510 26520DEFPROCsetvar(A$,B$) 26530SYS"XOS_CLI","set "+A$+" "+B$ 26540ENDPROC 26550 26560DEFPROCsaveconfig 26570PROCgetconfig 26580IFrw%THEN 26590 f1%=FNopenout(confdir$+".!nbconfig"):IFf1%<>0THEN 26600 BPUT#f1%,STR$(ver%/100) 26610 BPUT#f1%,hostname$ 26620 BPUT#f1%,remotehost$ 26630 BPUT#f1%,trans$(transport%) 26640 BPUT#f1%,org$ 26650 BPUT#f1%,defclient$ 26660 BPUT#f1%,modgw$ 26670 BPUT#f1%,timezone$ 26680 BPUT#f1%,mailname$ 26690 BPUT#f1%,mngw$ 26700 BPUT#f1%,"" 26710 BPUT#f1%,"" 26720 BPUT#f1%,"" 26730 BPUT#f1%,"" 26740 BPUT#f1%,STR$logfile% 26750 BPUT#f1%,STR$autoexp% 26760 BPUT#f1%,STR$keepoutg% 26770 BPUT#f1%,STR$defexp% 26780 BPUT#f1%,STR$keepb% 26790 BPUT#f1%,STR$delok% 26800 BPUT#f1%,STR$fast% 26810 BPUT#f1%,STR$alert% 26820 BPUT#f1%,STR$alertbeep% 26830 BPUT#f1%,STR$alertnews% 26840 BPUT#f1%,STR$userctrl% 26850 BPUT#f1%,STR$expmail% 26860 BPUT#f1%,STR$autodebatch% 26870 BPUT#f1%,STR$mngw% 26880 BPUT#f1%,STR$ngexp% 26890 BPUT#f1%,STR$docanc% 26900 BPUT#f1%,STR$killc% 26910 BPUT#f1%,STR$doreceipt% 26920 BPUT#f1%,STR$igexp% 26930 BPUT#f1%,STR$thread% 26940 BPUT#f1%,STR$compress% 26950 BPUT#f1%,STR$complimit% 26960 BPUT#f1%,STR$expany% 26970 BPUT#f1%,STR$exptime% 26980 BPUT#f1%,STR$mindsk% 26990 BPUT#f1%,"0" 27000 BPUT#f1%,"0" 27010 BPUT#f1%,"0" 27020 BPUT#f1%,"0" 27030 PROCcf(f1%):PROCsettype(confdir$+".!nbconfig",&FFF) 27040 ENDIF 27050ENDIF 27060ENDPROC 27070 27080DEFFNtimezone 27090LOCALb%,m%,b$ 27100SYS"Territory_ReadCurrentTimeZone"TO,b% 27110m%=(b%MOD360000)DIV6000:b%=b%DIV360000 27120b$=LEFT$(STR$ABSm%+"00",2):b$=STR$ABSb%+b$ 27130IFLENb$=3THENb$="0"+b$ 27140IFb%<0THENb$="-"+b$ELSEb$="+"+b$ 27150=b$ 27160 27170DEFPROCstarttransport 27180LOCALf$,l%,a$,b$,t$ 27190t$=trans$(transport%) 27200l%=FNruntransportfile(16,"","","") 27210IFl%<>0ANDtransport%>0THEN 27220 PROCmessage1("Tfail1",t$,1):l%=FNruntransportfile(16,"","","") 27230 IFl%<>0PROCmessage0("Tfail2",1):transport%=0 27240ENDIF 27250PROCreadnewsrc 27260ENDPROC 27270 27280DEFFNopenin(f$) 27290=FNfopen(f$,&4F) 27300 27310DEFFNopenout(f$) 27320=FNfopen(f$,&8F) 27330 27340DEFFNopenup(f$) 27350LOCALh% 27360h%=FNfopen(f$,&CF) 27370IFh%=0THENh%=FNfopen(f$,&8F) 27380=h% 27390 27400DEFFNfopen(f$,r%) 27410LOCALh%,F% 27420SYS"XOS_Find",r%,f$TOh%;F% 27430IF(F%AND1)THENh%=0 27440=h% 27450 27460DEFFNcanon(A$) 27470LOCALr%,F% 27480IFA$>""THENSYS"XOS_FSControl",37,A$,tmp%,,,256 TO,,,,,r%;F% 27490IFr%>0AND(F%AND1)=0THEN:=FNstr(tmp%) 27500="" 27510 27520DEFPROCcf(RETURN h%) 27530IFh%<>0 SYS"XOS_Find",0,h%:h%=0 27540ENDPROC 27550 27560DEFFNcountgroups(total%,d$) 27570LOCALf$,t%,r3%,nread%,f%,dirbuf%,dbr%,addr%,floop% 27580dbr%=FNclaim(dirbuf%,dbsize%,"dbuf") 27590REPEATPROCpoll(slice%) 27600addr%=dirbuf%:SYS"OS_GBPB",10,d$,dirbuf%,20,nread%,dbsize%,"*"TO,,,r3%,nread% 27610IFr3%>0THEN 27620 FORfloop%=1TOr3% 27630 t%=addr%!16:f$=FNstr(addr%+20) 27640 CASEt%OF 27650 WHEN1:IFf%=0AND(VALf$>0ORf$="~index")THENtotal%+=1:f%=1:PROCprint("","",FNmsg1("Gfound",STR$total%),""):IFtotal%=1THENPROCmessage0("Gcount",0) 27660 WHEN2,3:IFINSTR(RIGHT$(d$,3),"~")<1THENtotal%=FNcountgroups(total%,d$+"."+f$) 27670 ENDCASE 27680 addr%=addr%+(LENf$+24)ANDNOT3:NEXTfloop% 27690ENDIF 27700UNTILnread%=-1 27710PROCrelease(dbr%) 27720=total% 27730 27740DEFFNfindhighest(d$,high%) 27750LOCALf$,t%,r3%,dptr%,f%,dirbuf%,dbr%,addr%,F% 27760dbr%=FNclaim(dirbuf%,dbsize%,"dbuf") 27770dptr%=0 27780REPEATPROCpoll(slice%*3) 27790 SYS"XOS_GBPB",10,d$,dirbuf%,1,dptr%,dbsize%,"*"TO,,,r3%,dptr%;F% 27800 IFr3%>0AND(F%AND1)=0THEN 27810 addr%=dirbuf% 27820 t%=addr%!16:f$=FNstr(addr%+20):addr%=addr%+(25+LENf$)ANDNOT3 27830 CASEt%OF 27840 WHEN1:IFVALf$>high%THENhigh%=VALf$ 27850 WHEN2,3:IFLEFT$(f$,1)="~"THENhigh%=FNfindhighest(d$+"."+f$,high%) 27860 ENDCASE 27870 ENDIF 27880UNTILdptr%=-1OR(F%AND1)<>0 27890PROCrelease(dbr%) 27900=high% 27910 27920DEFPROCfindallgroups 27930LOCALg1%,l% 27940IFFNbusyon("Bscan")=0 THEN 27950PROCprint(FNmsg0("Gsearch")," "," "," ") 27960PROCfindgroups(newsroot$+".News") 27970IFgroups%>1THEN 27980 IFstartupok%=0PROCmessage0("Gcheck",0) 27990 FORg1%=1TOgroups% 28000 IFgrpseq%(g1%)=0ANDgrp$(g1%)>""THEN 28010 PROCprint(FNmsg0("Gcheck"),FNmsg1("Glast",grp$(g1%))," "," ") 28020 grpseq%(g1%)=FNseq(g1%):l%=FNfirstart(g1%) 28030 ENDIF 28040 NEXTg1% 28050ENDIF 28060PROCseticonstring(gwin%,25,grp$(1)):gwin_g%=1:PROCsetexpicon(1) 28070PROCbusyoff 28080PROCwritegrpdata 28090ENDIF 28100PROCgact("") 28110ENDPROC 28120 28130DEFPROCfindgroups(d$) 28140LOCALn%,f$,t%,r3%,nread%,gf$,l%,dirbuf%,dbr%,addr%,floop%,F% 28150dbr%=FNclaim(dirbuf%,dbsize%,"dbuf") 28160PROCgact("Scanning for groups") 28170REPEAT 28180SYS"XOS_GBPB",10,d$,dirbuf%,10,n%,dbsize%,"*"TO,,,r3%,n%;F%:nread%=n% 28190PROCpoll(slice%):addr%=dirbuf% 28200IFr3%>0AND(F%AND1)=0THEN 28210 FORfloop%=1TOr3% 28220 t%=addr%!16:f$=FNstr(addr%+20):addr%=addr%+(24+LENf$)ANDNOT3 28230 CASEt%OF 28240 WHEN1:IFgf$=""AND(VALf$>0ORf$="~index")THEN 28250 gf$=FNpathtogroup(d$):PROCaddifnotinlist(gf$):PROCscanmsg 28260 ENDIF 28270 WHEN2,3:IFLEFT$(f$,1)="~"THEN 28280 IFgf$=""THENgf$=FNpathtogroup(d$):PROCaddifnotinlist(gf$):PROCscanmsg 28290 ELSE 28300 PROCfindgroups(d$+"."+f$) 28310 ENDIF 28320 ENDCASE 28330 NEXTfloop% 28340ENDIF 28350UNTILnread%=-1OR(F%AND1)<>0 28360PROCrelease(dbr%) 28370ENDPROC 28380 28390DEFPROCconvrn(d$) 28400REM convert a readnews group by moving all files to ~x subdirectory 28410LOCALn%,f$,t%,r3%,nread%,f1$,l%,dirbuf%,dbr%,addr%,floop%,F%,mk% 28420dbr%=FNclaim(dirbuf%,dbsize%,"dbuf"):PROCprint("","",FNmsg0("Gconvert"),"") 28430REPEAT 28440SYS"XOS_GBPB",10,d$,dirbuf%,10,n%,dbsize%,"*"TO,,,r3%,n%;F%:nread%=n% 28450PROCpoll(slice%):addr%=dirbuf% 28460IFr3%>0AND(F%AND1)=0THEN 28470 FORfloop%=1TOr3% 28480 t%=addr%!16:f$=FNstr(addr%+20):addr%=addr%+(24+LENf$)ANDNOT3 28490 CASEt%OF 28500 WHEN1:IFVALf$<>0THEN 28510 IFmk%THEN 28520 F%=FNmovefile(d$+"."+f$,d$+".~x.~x."+f$):IFF%=0THENn%-=1 28530 ELSE 28540 f1$=FNtmpfile:F%=FNmovefile(d$+"."+f$,f1$):IFF%=0THEN 28550 IFFNensuredir(d$+".~x.~x")>1ANDFNmovefile(f1$,d$+".~x.~x."+f$)=0THENmk%=TRUE:n%-=1 28560 ENDIF 28570 ENDIF 28580 ENDIF 28590 ENDCASE 28600 NEXTfloop% 28610ENDIF 28620UNTILnread%=-1OR(F%AND1)<>0 28630PROCrelease(dbr%) 28640ENDPROC 28650 28660DEFPROCscanmsg 28670IFstartupok%=0ANDgrp$(1)=""PROCmessage0("Gscan",0) 28680ENDPROC 28690 28700DEFPROCaddifnotinlist(g$) 28710LOCALl% 28720IFg$>""THEN 28730 PROCprint("",FNmsg1("Gfound",g$),FNmsg1("Gtotal",STR$groups%),"") 28740 IFFNnametono(g$,0)=0THENl%=FNaddgrptolist(g$,TRUE):IFl%=0THENPROCtoomanyg 28750 IFl%>0PROCprint("","","","("+g$+" added)") 28760ENDIF 28770ENDPROC 28780 28790DEFFNpathtogroup(p$) 28800LOCALl%:p$=MID$(p$,LENdpath$+1) 28810REPEATl%=INSTR(p$,"~.") 28820 IFl%>0THENp$=LEFT$(p$,l%-1)+MID$(p$,l%+2) 28830UNTILl%=0 28840=p$ 28850 28860DEFPROCinitfilters 28870nfilt%=0:cfilt%=0 28880maxfilt%+=FNflines(confdir$+".filters") 28890DIMflt%(maxfilt%),fla$(maxfilt%),fla%(maxfilt%),filt%(1) 28900DIMflc%(maxfilt%,2),flc$(maxfilt%,2),fln%(maxfilt%,2),flj%(maxfilt%,2),fl_ok%(2) 28910f1%=FNopenin(confdir$+".filters") 28920IFf1%<>0THEN 28930 REPEATa$=GET$#f1% 28940 flt%(nfilt%)=VALFNgetpar(a$,";") 28950 FORl%=0TO2 28960 flj%(nfilt%,l%)=VALFNgetpar(a$,";") 28970 flc%(nfilt%,l%)=VALFNgetpar(a$,";") 28980 flc$(nfilt%,l%)=FNgetpar(a$,";") 28990 fln%(nfilt%,l%)=VALFNgetpar(a$,";") 29000 NEXTl% 29010 fla%(nfilt%)=VALFNgetpar(a$,";") 29020 fla$(nfilt%)=FNgetpar(a$,";") 29030 IFflc$(nfilt%,0)>""ANDfla%(nfilt%)>0THENnfilt%+=1:ELSEflt%(nfilt%)=0 29040 UNTILEOF#f1%:PROCcf(f1%):IFnfilt%>0THENnfilt%-=1 29050ENDIF 29060PROCsetfiltwin(0) 29070ENDPROC 29080 29090DEFPROCsavefilters 29100LOCALl%,l1% 29110IFrw%THEN 29120 f1%=FNopenout(confdir$+".filters") 29130 IFf1%>0THEN 29140 FORl%=0TOmaxfilt% 29150 IFflt%(l%)>0THEN 29160 A$=STR$flt%(l%)+";" 29170 FORl1%=0TO2:A$+=STR$flj%(l%,l1%)+";"+STR$flc%(l%,l1%)+";"+flc$(l%,l1%)+";"+STR$fln%(l%,l1%)+";":NEXTl1% 29180 A$+=STR$fla%(l%)+";"+fla$(l%) 29190 BPUT#f1%,A$ 29200 ENDIF 29210 NEXTl%:PROCcf(f1%):PROCsettype(confdir$+".filters",&FFF) 29220 ENDIF 29230ENDIF 29240ENDPROC 29250 29260DEFPROCsetfiltwin(n%) 29270LOCALa$,g$,l%,l1% 29280CASEflt%(n%)OF 29290 WHEN1:g$="News" 29300 WHEN2:g$="Mail" 29310 WHEN3:g$="Any" 29320 OTHERWISE:g$="Unset" 29330ENDCASE 29340PROCupdateiconstring(fwin%,1,g$) 29350FORl1%=0TO2 29360 CASEflc%(n%,l1%)OF 29370 WHEN1:g$="From" 29380 WHEN2:g$="To" 29390 WHEN3:g$="Subject" 29400 WHEN4:g$="Group" 29410 WHEN5:g$="Reply To" 29420 WHEN6:g$="Precedence" 29430 WHEN7:g$="Envelope" 29440 OTHERWISE:g$="None":flc$(n%,l1%)="" 29450 ENDCASE 29460 PROCupdateiconstring(fwin%,2+l1%,g$) 29470 PROCupdateiconstring(fwin%,5+l1%,LEFT$(flc$(n%,l1%),18)) 29480 PROCsetinv(fwin%,8+l1%,fln%(n%,l1%)) 29490NEXTl1% 29500FORl1%=11TO14:PROCsetinv(fwin%,l1%,0):NEXT 29510IFflc%(n%,1)>0THEN 29520 IFflj%(n%,1)=0THENPROCsetinv(fwin%,11,1)ELSEPROCsetinv(fwin%,12,1) 29530 IFflc%(n%,2)>0THEN 29540 IFflj%(n%,2)=0THENPROCsetinv(fwin%,13,1)ELSEPROCsetinv(fwin%,14,1) 29550 ENDIF 29560ENDIF 29570CASEfla%(n%)OF 29580 WHEN1:g$="Junk" 29590 WHEN2:g$="Kill" 29600 WHEN3:g$="Redirect" 29610 WHEN4:g$="Submit" 29620 OTHERWISE:g$="":fla$(n%)="" 29630ENDCASE 29640PROCupdateiconstring(fwin%,15,g$) 29650PROCupdateiconstring(fwin%,16,LEFT$(fla$(n%),98)) 29660PROCupdateiconstring(fwin%,17,"Filter "+STR$(n%+1)) 29670PROClosecaret 29680filt%()=0:FORl%=0TOnfilt% 29690 CASEflt%(l%)OF 29700 WHEN1:filt%(1)+=1 29710 WHEN2:filt%(0)+=1 29720 WHEN3:filt%(0)+=1:filt%(1)+=1 29730 ENDCASE 29740NEXTl% 29750ENDPROC 29760 29770DEFPROCdelfilt(n%) 29780LOCALl%,l1%:FORl%=n%TOnfilt%-1 29790 flt%(l%)=flt%(l%+1):fla%(l%)=fla%(l%+1):fla$(l%)=fla$(l%+1) 29800 FORl1%=0TO2:flc%(l%,l1%)=flc%(l%+1,l1%):flc$(l%,l1%)=flc$(l%+1,l1%):fln%(l%,l1%)=fln%(l%+1,l1%):NEXTl1% 29810NEXTl% 29820flt%(nfilt%)=0:fla%(nfilt%)=0:fla$(nfilt%)="" 29830FORl1%=0TO2:flc%(nfilt%,l1%)=0:flc$(nfilt%,l1%)="":fln%(nfilt%,l1%)=0:flj%(nfilt%,l1%)=0:NEXTl1% 29840IFnfilt%>0THENnfilt%-=1 29850IFcfilt%>nfilt%THENcfilt%-=1 29860PROCsetfiltwin(cfilt%):PROCsavefilters 29870ENDPROC 29880 29890DEFPROCaddfilt 29900IFnfilt%=maxfilt%THEN 29910 PROCmessage0("Ffull",0) 29920 ELSE 29930 IFflt%(nfilt%)>0THENnfilt%+=1 29940 flt%(nfilt%)=0:cfilt%=nfilt%:PROCsetfiltwin(cfilt%) 29950 PROCupdateiconstring(fwin%,17,"Edit Filter "+STR$(nfilt%+1)) 29960ENDIF 29970ENDPROC 29980 29990DEFPROCsetfilt(n%) 30000LOCALa%,l1%,t$,a$,b$,A$ 30010a%=INSTR("NMA",LEFT$(FNic_str(fwin%,1),1)) 30020flt%(n%)=a%:IFa%<1THENPROCdelfilt(n%):PROCmessage0("Fbadt",0):ENDPROC 30030FORl1%=0TO2 30040 a%=INSTR("FTSGRPE",LEFT$(FNic_str(fwin%,2+l1%),1)) 30050 flc%(n%,l1%)=a%:IFa%>0THEN 30060 flc$(n%,l1%)=FNic_str(fwin%,5+l1%):fln%(n%,l1%)=FNrdinv(fwin%,8+l1%) 30070 ELSE 30080 flc$(n%,l1%)="":fln%(n%,l1%)=0 30090 ENDIF 30100NEXTl1% 30110IFFNrdinv(fwin%,12)THENflj%(n%,1)=1ELSEflj%(n%,1)=0 30120IFFNrdinv(fwin%,14)THENflj%(n%,2)=1ELSEflj%(n%,2)=0 30130fla%(n%)=INSTR("JKRS",LEFT$(FNic_str(fwin%,15),1)) 30140fla$(n%)=FNic_str(fwin%,16) 30150PROCsetfiltwin(n%):PROCsavefilters 30160ENDPROC 30170 30180DEFPROCinitgrpdata 30190LOCALl%,add%,ok% 30200l%=0:l%=FNflines(grpinfo$) 30210IFl%=0THEN 30220 PROCprint(FNmsg0("Gcount")," "," "," ") 30230 l%=FNcountgroups(0,newsroot$+".News") 30240 ENDIF 30250PROCdimgrp(l%) 30260DIMuser$(maxusr%),userf$(maxusr%) 30270DIMupost%(maxusr%),ukm%(maxusr%),ukn%(maxusr%),ugrp%(maxusr%) 30280PROCgetmodgw 30290PROCreadgrpdata 30300ENDPROC 30310 30320DEFFNflines(f$) 30330LOCALa$,l% 30340f1%=FNopenin(f$) 30350IFf1%<>0THEN 30360 REPEATa$=GET$#f1%:l%+=1:UNTILEOF#f1%:PROCcf(f1%) 30370ENDIF 30380=l% 30390 30400DEFPROCdimgrp(n%) 30410maxgroup%=n%+addgrp%:IFmaxgroup%<mingrp%THENmaxgroup%=mingrp% 30420groups%=n%:n%=maxgroup%:maxactive%=n%*2 30430DIMactive$(maxactive%) 30440DIMgrpexp%(n%),grpmod%(n%) 30450DIMgrp$(n%),grpf%(n%):grp$()=STRING$(40," "):grp$()="":grpf%()=-1 30460DIMgrpseq%(n%),grpa%(n%):grpa%()=-1 30470ENDPROC 30480 30490DEFPROCgetmodgw 30500LOCALl% 30510DIMmodgw$(20),mngw$(10):modgw$(0)="moderators.uu.net" 30520f1%=FNopenin(support$+".modpaths") 30530IFf1%>0THEN 30540 l%=0:REPEAT:l%+=1:modgw$(l%)=GET$#f1%:UNTILl%=20OREOF#f1%:PROCcf(f1%) 30550ENDIF 30560f1%=FNopenin(support$+".mail2news") 30570IFf1%>0THEN 30580 l%=0:REPEAT:l%+=1:mngw$(l%)=GET$#f1%:UNTILl%=10OREOF#f1%:PROCcf(f1%) 30590ENDIF 30600ENDPROC 30610 30620DEFPROCsetuwin(u$) 30630LOCALu%,f$:u%=FNuserno(u$) 30640IFu%>-1THEN 30650 PROCupdateiconstring(uwin%,20,u$) 30660 PROCupdateiconstring(uwin%,2,STR$ugrp%(u%)) 30670 PROCupdateiconstring(uwin%,13,LEFT$(userf$(u%),32)) 30680 PROCsetinv(uwin%,3,ukm%(u%)) 30690 PROCsetinv(uwin%,4,ukn%(u%)) 30700 PROCsetinv(uwin%,5,upost%(u%)) 30710 f$=FNupath(u$)+".vacation":PROCupdateiconstring(uwin%,21,FNmsg0("Inactive")) 30720 IFFNobjtype(f$)=1ANDFNfilesize(f$)>0PROCupdateiconstring(uwin%,21,FNmsg0("Active")) 30730ENDIF 30740ENDPROC 30750 30760DEFPROCeditvac(u$):IFFNbadvac(u$)THENENDPROC 30770LOCALf$:f$=FNupath(u$)+".vacation" 30780IFFNobjtype(f$)=0THENf2%=FNopenout(f$):IFf2%>0THENBPUT#f2%,u$+" is away":PROCcf(f2%):PROCvacset(u$) 30790PROCsettype(f$,&FFF):SYS"XWimp_StartTask","Filer_Run "+f$:PROCupdateiconstring(uwin%,21,"Active") 30800ENDPROC 30810 30820DEFPROCnewvac(u$,s$):IFFNbadvac(u$)THENENDPROC 30830LOCALf$,F%:f$=FNupath(u$)+".vacation" 30840F%=FNdelfile(f$):F%=FNcopyfile(s$,f$) 30850IFF%=0THENPROCupdateiconstring(uwin%,21,FNmsg0("Active")):PROCvacset(u$) 30860ENDPROC 30870 30880DEFPROCvacset(u$) 30890PROCmessage1("Uvacset",u$,0) 30900ENDPROC 30910 30920DEFPROCcancvac(u$) 30930LOCALF%:F%=FNdelfile(FNupath(u$)+".vacation") 30940IFF%=0PROCupdateiconstring(uwin%,21,FNmsg0("Inactive")) 30950ENDPROC 30960 30970DEFFNbadvac(u$) 30980LOCALf%:f%=0:u$=FNlower(u$) 30990f%=(u$="root"ORu$="postmaster"ORu$="default") 31000IFf%THENVDU7:PROCmessage0("Ubadvac",0) 31010=f% 31020 31030DEFFNuserno(u$) 31040LOCALl%,r%:r%=0:l%=0 31050WHILEl%<maxusr%ANDu$<>user$(l%):l%+=1:ENDWHILE 31060IFu$=user$(l%)ANDu$>""THENr%=l% 31070=r% 31080 31090DEFPROCinituserdata 31100LOCALok%,next%,n%,u%,uc%,err%,u$,p$ 31110WHILEFNvarval("UserHome$Dir")="" 31120 ok%=FNconfirm(FNmsg0("Unohome")) 31130 IFok%=1THENSYS"OS_CLI","set UserHome$Dir "+newsroot$+".UserHome" 31140ENDWHILE 31150userhome$=FNvarval("UserHome$Dir") 31160user$(0)="default":ugrp%(0)=10:ukm%(0)=1:ukn%(0)=1:upost%(0)=1 31170IFFNobjtype(userhome$)<2THEN 31180 PROCensuredir(userhome$):PROCfindallusers 31190 ELSE 31200 next%=0:uc%=1:REPEAT 31210 SYS"XOS_GBPB",9,userhome$,tmp%,1,next%,255,"*"TO ,,,n%,next%;err% 31220 u$=FNstr(tmp%):IFFNlower(u$)="default"THENu%=0ELSEu%=uc%:uc%+=1 31230 IF(err%AND1)=0ANDn%>0ANDu%<maxusr%THEN 31240 user$(u%)=u$:p$=FNupath(u$) 31250 f0%=FNopenin(p$+".userinfo") 31260 IFf0%>0THEN 31270 ugrp%(u%)=VALGET$#f0%:upost%(u%)=VALGET$#f0% 31280 ukm%(u%)=VALGET$#f0%:ukn%(u%)=VALGET$#f0%:PROCcf(f0%) 31290 ELSE 31300 PROCcpdefusr(u%) 31310 ENDIF 31320 f0%=FNopenin(p$+".forward") 31330 IFf0%>0THENuserf$(u%)=GET$#f0%:PROCcf(f0%)ELSEuserf$(u%)="" 31340 ENDIF 31350 UNTILnext%<0OR(err%AND1)<>0 31360ENDIF 31370PROCsetuwin("default") 31380ENDPROC 31390 31400DEFPROCcpdefusr(u%) 31410IFu%>0THEN 31420ugrp%(u%)=ugrp%(0):ukm%(u%)=ukm%(0):ukn%(u%)=ukn%(0):upost%(u%)=upost%(0) 31430CASEuser$(u%)OF 31440 WHEN"root":ugrp%(u%)=0 31450 WHEN"postmaster":ugrp%(u%)=1 31460ENDCASE 31470ENDIF 31480PROCsaveuserinfobyno(u%) 31490ENDPROC 31500 31510DEFPROCgetuserinfo 31520LOCALu%:u%=FNuserno(FNic_str(uwin%,20)) 31530IFu%>-1THEN 31540 ugrp%(u%)=VALFNic_str(uwin%,2) 31550 ukm%(u%)=FNrdinv(uwin%,3) 31560 ukn%(u%)=FNrdinv(uwin%,4) 31570 upost%(u%)=FNrdinv(uwin%,5) 31580 userf$(u%)=FNic_str(uwin%,13) 31590ENDIF 31600ENDPROC 31610 31620DEFPROCsaveuserinfo 31630LOCALu%:u%=FNuserno(FNic_str(uwin%,20)) 31640PROCsaveuserinfobyno(u%) 31650ENDPROC 31660 31670DEFPROCsaveuserinfobyno(u%) 31680LOCALf$,l% 31690IFu%>-1THEN 31700 f$=FNupath(user$(u%)):PROCensuredir(f$):f$+=".userinfo" 31710 f0%=FNopenout(f$) 31720 IFf0%>0THEN 31730 BPUT#f0%,STR$ugrp%(u%):BPUT#f0%,STR$upost%(u%) 31740 BPUT#f0%,STR$ukm%(u%):BPUT#f0%,STR$ukn%(u%) 31750 PROCcf(f0%):PROCsettype(f$,&FFF) 31760 ENDIF 31770 f$=FNupath(user$(u%))+".forward" 31780 f0%=FNopenout(f$) 31790 IFf0%>0THENBPUT#f0%,userf$(u%):PROCcf(f0%):PROCsettype(f$,&FFF) 31800 l%=FNruntransportfile(8,"",user$(u%),STR$ugrp%(u%)) 31810ENDIF 31820ENDPROC 31830 31840DEFFNconfirm(A$) 31850LOCALynchoice%:REM 1=yes, no=2 31860PROCsetconfirm(FNmsg0("Yes"),FNmsg0("No")) 31870PROCupdateiconstring(yesno%,0,LEFT$(A$,78)):PROCcfront(yesno%,0,0) 31880ynchoice%=0:REPEATPROCpoll(100):UNTILynchoice%>0 31890=ynchoice% 31900 31910DEFFNconfirm2(A$) 31920LOCALynchoice%:REM 1=continue, 2=defer 31930PROCsetconfirm(FNmsg0("Continue"),FNmsg0("Skip")) 31940PROCupdateiconstring(yesno%,0,LEFT$(A$,78)):PROCcfront(yesno%,0,0) 31950ynchoice%=0:REPEATPROCpoll(100):UNTILynchoice%>0 31960=ynchoice% 31970 31980DEFPROCsetconfirm(A$,B$) 31990PROCupdateiconstring(yesno%,1,A$):PROCupdateiconstring(yesno%,2,B$) 32000ENDPROC 32010 32020DEFPROCautoconfigure 32030IFgrp$(1)=""PROCfindallgroups:PROCmessage("",0) 32040IFuser$(3)=""PROCfindallusers:PROCmessage("",0) 32050ENDPROC 32060 32070DEFPROCfindallusers 32080LOCALn%,l%,g$:n%=0 32090l%=FNadduser("default"):l%=FNadduser("root"):l%=FNadduser("postmaster") 32100REPEATg$=grp$(n%) 32110IFLEFT$(g$,6)="Email."ANDINSTR(g$,".",7)<1THENl%=FNadduser(MID$(g$,7)) 32120n%+=1:UNTILn%>groups% 32130ENDPROC 32140 32150DEFFNadduser(A$) 32160LOCALn%,ok% 32170IFrw%THEN 32180 WHILEuser$(n%)<>A$ANDuser$(n%)>""ANDn%<maxusr%:n%+=1:ENDWHILE 32190 IFuser$(n%)=""THEN 32200 user$(n%)=A$:PROCensuredir(FNupath(A$)) 32210 PROClog("Added user: "+A$):ok%=TRUE 32220 PROCcpdefusr(n%) 32230 PROCnbupdate(4,A$,0,"","") 32240 n%=FNruntransportfile(6,"",A$,STR$ugrp%(n%)) 32250 ENDIF 32260ENDIF 32270=ok% 32280 32290DEFFNupath(u$) 32300=userhome$+"."+u$ 32310 32320DEFFNdeluser(A$) 32330LOCALp$,n%,ok%,l% 32340IFrw%THEN 32350 WHILEcl_user$(n%)<>A$ANDn%<maxcl%:n%+=1:ENDWHILE 32360 IFcl_user$(n%)=A$ORA$="root"ORA$="postmaster"THEN=0 32370 p$=FNupath(A$) 32380 IFFNobjtype(p$)>1THEN 32390 PROCwipe(p$):IFFNobjtype(p$)=0THENok%=TRUE 32400 ENDIF 32410 IFok%THEN 32420 PROCnbupdate(5,A$,0,"",""):PROClog("Removed user: "+A$) 32430 n%=FNruntransportfile(7,"",A$,"") 32440 n%=0:WHILEuser$(n%)<>A$ANDuser$(n%)<>"":n%+=1:ENDWHILE 32450 IFuser$(n%)=A$THENFORl%=n%+1TOmaxusr%:user$(l%-1)=user$(l%):NEXTl% 32460 user$(maxusr%)="" 32470 ENDIF 32480ENDIF 32490=ok% 32500 32510DEFFNuserok(A$) 32520LOCALn%:A$=FNlower(A$) 32530WHILEFNlower(user$(n%))<>A$ANDuser$(n%)>"":n%+=1:ENDWHILE 32540IFuser$(n%)=""THEN=0 32550=TRUE 32560 32570DEFPROCreadgrpdata 32580LOCALa$,b$,g$,lg$,ty%,no%,resave% 32590PROChgon:grpexp%()=0:grpmod%()=0:resave%=0:groups%=0 32600f1%=FNopenin(grpinfo$) 32610v%=0:IFf1%>0THENv%=VALGET$#f1% 32620IF(v%>=groupver%ORv%=13)ANDf1%<>0 THEN 32630 WHILEEOF#f1%=FALSE ANDgroups%<maxgroup% 32640 a$=GET$#f1%:g$=FNcheckcase(FNgetpar(a$," ")) 32650 IFg$>""ANDINSTR(g$,"*")<1THEN 32660 REM discard duplicates... 32670 IFg$<>lg$THEN 32680 IFg$>lg$THEN 32690 groups%+=1:no%=groups%:lg$=g$ 32700 ELSE 32710 no%=FNaddgrptolist(g$,FALSE) 32720 ENDIF 32730 grp$(no%)=g$:ty%=FNspecialgrp(g$) 32740 grpseq%(no%)=-VALFNgetpar(a$," ") 32750 A%=VALFNgetpar(a$," ") 32760 grpexp%(no%)=VALFNgetpar(a$," ") 32770 b$=FNgetpar(a$," "):grpmod%(no%)=VALb$ 32780 IFb$=""ANDty%=0THENPROCmessage1("Mcheck",g$,0):grpmod%(no%)=FNisgrpmod(g$):resave%=TRUE:PROCpoll(4*slice%) 32790 IFty%>1ANDv%<groupver%THENgrpexp%(no%)=1E6:resave%=TRUE 32800 ENDIF 32810 ENDIF 32820 ENDWHILE 32830 PROCcf(f1%):PROCmessage("",0) 32840ENDIF 32850IFresave%THENPROCwritegrpdata 32860PROCseticonstring(gwin%,25,grp$(1)):gwin_g%=1:PROCsetexpicon(1):PROChgoff 32870ENDPROC 32880 32890DEFFNisgrpmod(g$) 32900g$=FNcheckmoderation(g$,1) 32910=ABS(g$>"") 32920 32930DEFFNgetpar(RETURN A$,s$) 32940LOCALB$,l% 32950l%=INSTR(A$,s$) 32960IFl%>0THEN 32970 B$=LEFT$(A$,l%-1):A$=MID$(A$,l%+1) 32980 ELSE 32990 B$=A$:A$="" 33000ENDIF 33010=B$ 33020 33030DEFPROCsetexpicon(g%) 33040LOCALn%,a$:n%=grpexp%(g%) 33050IFn%>10000THEN 33060 a$="Never" 33070 ELSE 33080 IFn%=0THENa$="Default"ELSEa$=STR$n% 33090ENDIF 33100PROCupdateiconstring(gwin%,1,a$) 33110ENDPROC 33120 33130DEFPROCwritegrpdata 33140LOCALA$,F%,l% 33150IFrw%THEN 33160 F%=FNdelfile(grpinfo$+"~") 33170 F%=FNrename(grpinfo$,grpinfo$+"~") 33180 f1%=FNopenout(grpinfo$) 33190 IFf1%=0THENPROCclosefilebyname(grpinfo$):f1%=FNopenout(grpinfo$) 33200 IFf1%<>0THEN 33210 BPUT#f1%,STR$groupver% 33220 FORl%=1TOgroups% 33230 IFgrp$(l%)>""THEN 33240 BPUT#f1%,grp$(l%)+" "+STR$(ABSgrpseq%(l%))+" 0 "+STR$grpexp%(l%)+" "+STR$grpmod%(l%) 33250 ENDIF 33260 NEXTl% 33270 PROCcf(f1%):PROCsettype(grpinfo$,&FFF) 33280 ELSE 33290 VDU7:PROCmessage0("Grpinfo",1) 33300 ENDIF 33310ENDIF 33320ENDPROC 33330 33340DEFPROCcreatedirs 33350PROChgon 33360newsroot$=FNvarval("Newsdir$dir") 33370IFFNobjtype(newsroot$)<2THENnewsroot$="" 33380nbdir$=FNvarval("Newsbase$dir") 33390transdir$=nbdir$+".transports" 33400support$=nbdir$+".support.newsbase" 33410resdir$=nbdir$+".resources" 33420dpath$=newsroot$+".news." 33430basedir$=newsroot$+".newsbase" 33440workdir$=basedir$+".work" 33450confdir$=basedir$+".config" 33460baddir$=basedir$+".debug" 33470tmpdir$=basedir$+".scratch" 33480outdir$=basedir$+".spool" 33490lindir$=outdir$+".local" 33500outdir$(0)=outdir$+".mail" 33510outdir$(1)=outdir$+".news" 33520IFnewsroot$>""THEN 33530PROCensuredir(basedir$) 33540PROCensuredir(confdir$) 33550PROCensuredir(baddir$) 33560PROCensuredir(workdir$) 33570PROCensuredir(LEFT$(dpath$)) 33580PROCensuredir(tmpdir$) 33590PROCensuredir(outdir$) 33600PROCensuredir(lindir$) 33610PROCensuredir(outdir$(0)) 33620PROCensuredir(outdir$(1)) 33630ENDIF 33640SYS"XOS_CLI","set Newsbase$Support "+nbdir$+".support" 33650SYS"XOS_CLI","set Newsbase$Data "+basedir$ 33660SYS"XOS_CLI","set Newsbase$Config "+confdir$ 33670SYS"XOS_CLI","set Newsbase$Local "+lindir$ 33680grpinfo$=basedir$+".grpinfo" 33690newgrp$=basedir$+".newgroups" 33700lastng$=confdir$+".ngtime" 33710lockfile$=basedir$+".lock" 33720PROChgoff 33730ENDPROC 33740 33750DEFPROCensuredir(f$) 33760LOCALt%:IFf$>""THEN 33770 t%=FNobjtype(f$):IFt%<2ORt%>3THENIFrw%THENSYS"XOS_File",8,f$TO;t% 33780ENDIF 33790ENDPROC 33800 33810DEFFNrename(s$,d$) 33820LOCALF%:SYS"XOS_FSControl",25,s$,d$TOerr%;F% 33830IF(F%AND1) AND(!err%MOD&FF)=&C4 THEN 33840 F%=FNdelfile(d$) 33850 SYS"XOS_FSControl",25,s$,d$TOerr%;F% 33860ENDIF 33870=(F%AND1) 33880 33890DEFFNcopyfile(s$,d$) 33900LOCALF% 33910SYS"XOS_FSControl",26,s$,d$ TO;F% 33920=(F%AND1) 33930 33940DEFFNmovefile(s$,d$) 33950LOCALF%:F%=FNrename(s$,d$) 33960IFF%<>0SYS"XOS_FSControl",26,s$,d$,(1<<7) TO;F% 33970=(F%AND1) 33980 33990DEFFNdelfile(f$) 34000LOCALF%:SYS"XOS_File",6,f$TO;F% 34010=(F%AND1) 34020 34030DEFFNforcedelfile(f$) 34040LOCALF%:F%=FNdelfile(f$) 34050IFF%<>0PROCclosefilebyname(f$):F%=FNdelfile(f$) 34060=F% 34070 34080DEFPROCwipe(f$) 34090SYS"XOS_FSControl",27,f$,,3 34100ENDPROC 34110 34120DEFFNfilesize(f$) 34130LOCALs%,F%:SYS"XOS_File",17,f$TO,,,,s%;F% 34140IF(F%AND1)THENs%=-1 34150=s% 34160 34170DEFFNfileattr(f$) 34180LOCALs%:SYS"XOS_File",17,f$TO,,,,,s%;F% 34190IF(F%AND1)THENs%=-1 34200=s% 34210 34220DEFPROCclosefilebyname(f$) 34230LOCALa$,l%,r%,F% 34240IFFNobjtype(f$)<>1THENENDPROC 34250f$=FNcanon(f$) 34260FORl%=1TO255:SYS"XOS_Args",7,l%,tmp%,,,256TO,,,,,r%;F% 34270IF(F%AND1)=0THENa$=FNstr(tmp%):IFa$=f$THENCLOSE#l% 34280NEXTl% 34290ENDPROC 34300 34310DEFPROCaddtoindex(g%,n%) 34320LOCALp%,p1%,lm%,lf%,ls%,lr% 34330IFg%<>ibufg%ORibufptr%>=ibufsize%THENPROCwriteindexbuf 34340IFgrpa%(g%)>=0THENgrpa%(g%)+=1:REM increment article total 34350p%=ibuf%+ibufptr%:$p%=null$ 34360!p%=n%:p%!8=artdate% 34370p%!12=0:p%!16=0:p1%=p%+20 34380REM 3 cases: 34390REM 1 is, all of messid, from, subj, refs fit in 176 bytes (-> type 1) 34400REM 2 is, all of messid, from, subj fit; refs go separately (-> type 0+2) 34410REM 3 is, from & subj need truncating to fit; refs go separately (-> type 0+2) 34420IFmessid$=""THENmessid$="<0>" 34430IFsubject$=""THENsubject$="(no subject)" 34440IFfrom$=""THENfrom$="(no sender)" 34450lm%=LENmessid$:lf%=LENfrom$:ls%=LENsubject$:lr%=LENreference$ 34460IF(lm%+lf%+ls%+lr%)<176THEN 34470 $p1%=messid$:$(p1%+lm%+1)=from$:$(p1%+lm%+lf%+2)=subject$ 34480 $(p1%+lm%+lf%+ls%+3)=reference$:p%!4=1 34490 ibufptr%+=200:ibufg%=g% 34500 ELSE 34510 p%!4=0 34520 IF(lm%+lf%+ls%)<177THEN 34530 $p1%=messid$:$(p1%+lm%+1)=from$:$(p1%+lm%+lf%+2)=subject$ 34540 ELSE 34550 messid$=LEFT$(messid$,60):$p1%=messid$:p1%=p1%+LENmessid$+1 34560 from$=LEFT$(from$,40):$p1%=from$:p1%=p1%+LENfrom$+1 34570 $p1%=LEFT$(subject$,176-(p%+20-p1%)) 34580 p1%?199=13 34590 ENDIF 34600 ibufptr%+=200:ibufg%=g% 34610 IFthread%<>0ANDreference$>""THEN 34620 IFibufptr%>=ibufsize%THENPROCwriteindexbuf 34630 p%=ibuf%+ibufptr%:$p%=null$:!p%=n%:p%!4=2:p%!8=0 34640 p%!12=0:p%!16=0:p%+=20:$p%=LEFT$(reference$,176):p%?199=13 34650 ibufptr%+=200 34660 ENDIF 34670ENDIF 34680ENDPROC 34690 34700DEFPROCwriteindexbuf 34710LOCALp%,err%,F% 34720IFibufptr%=0ORibufg%=0THENENDPROC 34730REPEAT 34740 f1%=FNopenup(FNnotopath(ibufg%)+".~index") 34750 IFf1%=0THENf1%=FNmakeindexfile(ibufg%) 34760 IFf1%<>0THEN 34770 p%=EXT#f1% 34780 SYS"XOS_GBPB",1,f1%,ibuf%,ibufptr%,p%TOerr%;F% 34790 PROCcf(f1%) 34800 ENDIF 34810 IF(F%AND1)THEN 34820 IF(!err%AND&FF)=&C6THENPROCcheckdisk:ELSESYS"OS_GenerateError",err% 34830 ENDIF 34840UNTIL(F%AND1)=0 34850ibufptr%=0 34860ENDPROC 34870 34880DEFFNifile(g%) 34890=FNnotopath(g%)+".~index" 34900 34910DEFFNfindartid(g%,a$) 34920LOCALg$,f%,f$,A$,r3%:f%=0 34930IFg%>0THEN 34940 a$=FNlower(a$):a$=FNclean(a$) 34950 f$=FNifile(g%) 34960 f1%=FNopenin(f$) 34970 IFf1%<>0THEN 34980 p%=0:PROChgon 34990 REPEAT 35000 SYS"OS_GBPB",3,f1%,tmp%,200,p%TO,,,r3%,p% 35010 A$=FNlower(FNstr(tmp%+20)):IFA$=a$THENf%=!tmp% 35020 UNTILr3%>0ORf%<>0 35030 PROCcf(f1%):PROChgoff 35040 ENDIF 35050ENDIF 35060=f% 35070 35080DEFFNmakeindexfile(g%) 35090LOCALp$,f$:p$=FNnotopath(g%):f$=FNifile(g%) 35100PROCcheckdisk 35110IFFNobjtype(p$+".~x")<2THENPROCconvrn(p$) 35120f1%=FNopenout(f$) 35130IFf1%=0THENPROCmessage1("Ifail",p$,1) 35140=f1% 35150 35160DEFFNfindfile(g%,n%,expand%) 35170LOCALf$,d$,a$,o%,l$ 35180f$="":a$=RIGHT$("00000000"+STR$n%,8) 35190IFg%=findg%ANDfindp$>""THEN 35200 IFFNobjtype(findp$+"."+a$)=1THENf$=findp$+"."+a$ 35210ENDIF 35220IFf$=""THEN 35230 l$=FNartdir(n%) 35240 d$=FNnotopath(g%)+".~x."+l$ 35250 REPEAT 35260 o%=FNobjtype(d$+"."+a$) 35270 IFo%=1THENf$=d$+"."+a$ 35280 IFo%=0THENo%=FNobjtype(d$+"."+l$):IFo%=2 d$=d$+"."+l$ 35290 UNTILf$>""ORo%<2 35300 IFf$=""THEN 35310 d$=FNnotopath(g%) 35320 REPEAT 35330 o%=FNobjtype(d$+"."+a$) 35340 IFo%=1THENf$=d$+"."+a$ 35350 IFo%=0THENo%=FNobjtype(d$+".~x"):IFo%=2 d$=d$+".~x" 35360 UNTILf$>""ORo%<2 35370 ENDIF 35380 IFf$>""THENfindp$=d$:findg%=g% 35390ENDIF 35400IFf$>""ANDexpand%THENPROCdecompress(f$) 35410=f$ 35420 35430DEFFNdecompheader(ib%,ibs%,ob%,obs%) 35440LOCALws%,curslot%,n%,f%,size% 35450SYS"Squash_Decompress",8,ibs% TOws% 35460SYS"Wimp_SlotSize",-1,-1TOcurslot%,n%,f% 35470IFn%+f%>ws%THEN 35480 REM take workspace in top of wimpslot 35490 SYS"Wimp_SlotSize",curslot%+ws%,-1 35500 SYS"Squash_Decompress",0,curslot%+&8000,ib%,ibs%,ob%,obs%TO,,,,,size% 35510 size%=obs%-size% 35520 SYS"Wimp_SlotSize",curslot%,-1 35530ENDIF 35540REM return size of data in output buffer 35550=size% 35560 35570DEFPROCdecompress(RETURN f$) 35580LOCALr4%,s%,ns%,attr%,t$,F% 35590IFFNfiletype(f$)=&FCA THEN 35600 PROChgon 35610 IFrw%=0THEN 35620 F%=FNcopyfile(f$,"<Wimp$Scrap>"):IFF%=0THENf$="<Wimp$Scrap>" 35630 ENDIF 35640 REM get file attributes & set to RW access 35650 SYS"XOS_File",17,f$TO,,,,s%,attr%:SYS"XOS_File",4,f$,,,,3 35660 f1%=FNopenin(f$):r4%=0 35670 IFf1%<>0THENSYS"XOS_GBPB",4,f1%,tmp%,8TO,,,,r4%:PROCcf(f1%) 35680 IFr4%>0THEN 35690 ns%=tmp%!4 35700 IFFNdecompressfile(f$,s%,ns%)=0THEN 35710 t$=FNtmpfile 35720 PROCrunsupport("squash "+f$+" "+t$):s%=FNfilesize(t$) 35730 REM test that the size is right... 35740 IFs%=ns%THEN 35750 PROCprint("",FNmsg0("CompArt1"),"","") 35760 F%=FNdelfile(f$):F%=FNrename(t$,f$) 35770 ELSE 35780 PROCmessage0("CompFail2",0):F%=FNdelfile(t$) 35790 ENDIF 35800 ENDIF 35810 ELSE 35820 PROCmessage0("CompFail1",0) 35830 ENDIF 35840 REM reset original file attributes 35850 SYS"XOS_File",4,f$,,,,attr% 35860 PROChgoff 35870ENDIF 35880ENDPROC 35890 35900DEFPROCcompress(f$,os%) 35910LOCALr4%,ns%,t$,attr%,F%,art$ 35920IFos%<0THENos%=FNfilesize(f$) 35930IFos%>complimit%THEN 35940 art$=STR$VAL(FNleaf(f$)):IFart$="0"THENart$="..." 35950 IFFNfiletype(f$)=&FFF THEN 35960 PROChgon 35970 REM get file attributes & set to RW access 35980 SYS"XOS_File",17,f$TO,,,,,attr%:SYS"XOS_File",4,f$,,,,3 35990 REM first try built-in routine... 36000 IFFNcompressfile(f$)=0THEN 36010 IFFNobjtype(support$+".squash")=1THEN 36020 t$=FNtmpfile:PROCrunsupport("squash "+f$+" "+t$) 36030 f1%=FNopenin(t$):r4%=0 36040 IFf1%<>0THENSYS"XOS_GBPB",4,f1%,tmp%,8TO,,,,r4%:PROCcf(f1%) 36050 IFr4%>0THEN 36060 ns%=tmp%!4 36070 IFos%=ns%THEN 36080 F%=FNdelfile(f$):F%=FNrename(t$,f$) 36090 PROCprint("",FNmsg1("CompArt2",art$),"","") 36100 ELSE 36110 F%=FNdelfile(t$) 36120 ENDIF 36130 ELSE 36140 F%=FNdelfile(t$) 36150 ENDIF 36160 ENDIF 36170 ELSE 36180 PROCprint("",FNmsg1("CompArt3",art$),"","") 36190 ENDIF 36200 REM reset original file attributes 36210 SYS"XOS_File",4,f$,,,,attr% 36220 PROChgoff 36230 ENDIF 36240ENDIF 36250ENDPROC 36260 36270DEFFNcompressfile(RETURN f$) 36280LOCALws%,wss%,curslot%,f%,size%,out%,last%,ok%,buf% 36290LOCALibuf%,ibufs%,obuf%,obufs%,left%,r1%,r2%,r3%,r4%,r5%,F% 36300LOCALo%,l%,e%,s%,attr%,avail%,fast%,F%:fast%=TRUE 36310LOCALf2$ 36320REM get file attributes 36330SYS"XOS_File",17,f$TOo%,,l%,e%,s% 36340SYS"Squash_Compress",8,s%TOwss% 36350SYS"Wimp_SlotSize",-1,-1TOcurslot%,,f% 36360ibufs%=20+(s%DIV4*4+4):obufs%=ibufs%:avail%=f%-wss% 36370IFavail%>&4000 THEN 36380 REM calc available & needed memory... 36390 IF(ibufs%+obufs%)>avail%THEN 36400 ibufs%=avail%DIV2:obufs%=avail%DIV2:fast%=FALSE 36410 ENDIF 36420 REM now get the RAM... 36430 SYS"Wimp_SlotSize",curslot%+ibufs%+obufs%+wss%,-1 36440 ws%=&8000+curslot%:ibuf%=ws%+wss%:obuf%=ibuf%+ibufs% 36450 IFfast%THEN 36460 SYS"XOS_File",16,f$,ibuf%,0TO;F% 36470 IF(F%AND1)=0THEN 36480 SYS"XSquash_Compress",0,ws%,ibuf%,s%,obuf%+20,obufs%-20TOok%,,,,last%;F% 36490 $obuf%="SQSH":obuf%!4=s%:obuf%!8=l%:obuf%!12=e%:obuf%!16=0:ok%=(ok%=0) 36500 IF(F%AND1)THENok%=0:REM there was an error 36510 IFok%THENSYS"OS_File",0,f$,l%,e%,obuf%,last% 36520 ENDIF 36530 ELSE 36540 REM slow procedure... 36550 f1%=FNopenin(f$):ok%=0 36560 IFf1%>0THEN 36570 f2$=FNtmpfile:f2%=FNopenout(f2$):ptr1%=0:started%=0 36580 IFf2%>0THEN 36590 REM first write out squashfile header 36600 $obuf%="SQSH":obuf%!4=s%:obuf%!8=l%:obuf%!12=e%:obuf%!16=0 36610 SYS"OS_GBPB",2,f2%,obuf%,20 36620 REPEAT 36630 SYS"XOS_GBPB",3,f1%,ibuf%,ibufs%,ptr1%TO,,,left%,ptr1%;F% 36640 r1%=ws%:r2%=ibuf%:r3%=ibufs%-left%:r4%=obuf%:r5%=obufs% 36650 IFr3%>0AND(F%AND1)=0THEN 36660 REPEAT 36670 r0%=started%-2*(left%=0):started%=1 36680 SYS"XSquash_Compress",r0%,ws%,r2%,r3%,obuf%,obufs%TOok%,,r2%,r3%,r4%,r5%;F% 36690 IF(F%AND1)=0THENSYS"XOS_GBPB",2,f2%,obuf%,r4%-obuf%TO;F% 36700 UNTILok%<2OR(F%AND1)>0 36710 ptr1%-=r3%:REM rewind unused data 36720 ENDIF 36730 UNTIL(left%>0ANDok%=0)OR(F%AND1)>0 36740 ok%=(ok%=0):IF(F%AND1)>0THENok%=0:REM not okay if error 36750 PROCcf(f2%) 36760 ENDIF 36770 PROCcf(f1%) 36780 IFok%THEN 36790 F%=FNdelfile(f$):F%=FNrename(f2$,f$) 36800 SYS"OS_File",1,f$,l%,e%,attr% 36810 ENDIF 36820 ENDIF 36830 ENDIF 36840 SYS"Wimp_SlotSize",curslot%,-1 36850 IFok%THENPROCsettype(f$,&FCA) 36860ENDIF 36870REM return success status 36880=ok% 36890 36900DEFFNdecompressfile(f$,cs%,ds%) 36910REM cs% is comp size%, ds% is decomp size 36920LOCALws%,wss%,curslot%,f%,size%,out%,last%,ok%,buf% 36930LOCALo%,l%,e%,s%,attr%,avail%,fast%,F%:fast%=TRUE 36940LOCALibuf%,ibufs%,obuf%,obufs%,left%,r1%,r2%,r3%,r4%,r5% 36950LOCALf2$ 36960REM variables are: 36970REM ws%,wss% are workspace base & size 36980REM ibuf%,ibufs%,obuf%,obufs% are input/output base & size 36990REM get file attributes 37000SYS"XOS_File",17,f$TOo%,,l%,e%,s%,attr% 37010SYS"Wimp_SlotSize",-1,-1TOcurslot%,,f% 37020SYS"Squash_Decompress",8,cs%-20TOwss% 37030avail%=f%-wss%:ibufs%=(cs%DIV4*4+4):obufs%=(ds%DIV4*4+4) 37040REM need at least workspace+16k to work, ok? 37050IFavail%>&4000 THEN 37060 REM calc available & needed memory... 37070 IF(ibufs%+obufs%)>avail%THEN 37080 ibufs%=avail%DIV2:obufs%=avail%DIV2:fast%=FALSE 37090 ENDIF 37100 REM now get the RAM... 37110 SYS"Wimp_SlotSize",curslot%+wss%+ibufs%+obufs%,-1,-1 37120 ws%=curslot%+&8000:ibuf%=ws%+wss%:obuf%=ibuf%+ibufs% 37130 IFfast%THEN 37140 REM fast case (enough RAM) 37150 SYS"XOS_File",16,f$,ibuf%,0TO;F% 37160 IF(F%AND1)=0THEN 37170 SYS"XSquash_Decompress",0,ws%,ibuf%+20,cs%-20,obuf%,obufs%TOok%,,,,last%;F% 37180 ok%=(ok%=0) 37190 IFok%AND(F%AND1)=0THENSYS"XOS_File",0,f$,l%,e%,obuf%,last% 37200 ENDIF 37210 ELSE 37220 REM slow case... 37230 f1%=FNopenin(f$):ok%=0 37240 IFf1%>0THEN 37250 f2$=FNtmpfile:f2%=FNopenout(f2$):ptr1%=20:started%=0 37260 IFf2%>0THEN 37270 REPEAT 37280 SYS"XOS_GBPB",3,f1%,ibuf%,ibufs%,ptr1%TO,,,left%,ptr1%;F% 37290 r1%=ws%:r2%=ibuf%:r3%=ibufs%-left%:r4%=obuf%:r5%=obufs% 37300 IFr3%>0AND(F%AND1)=0THEN 37310 REPEAT 37320 r0%=started%-2*(left%=0):started%=1 37330 SYS"XSquash_Decompress",r0%,ws%,r2%,r3%,obuf%,obufs%TOok%,,r2%,r3%,r4%,r5%;F% 37340 IF(F%AND1)=0THENSYS"XOS_GBPB",2,f2%,obuf%,r4%-obuf%TO;F% 37350 UNTILok%<2OR(F%AND1)>0 37360 ptr1%-=r3%:REM rewind unused data 37370 ENDIF 37380 UNTIL(left%>0ANDok%=0)OR(F%AND1)>0 37390 PROCcf(f2%):IF(F%AND1)>0THENok%=1:REM not okay if error 37400 ok%=(ok%=0):IFFNfilesize(f2$)<>ds%THENok%=0 37410 ENDIF 37420 PROCcf(f1%) 37430 IFok%THEN 37440 F%=FNdelfile(f$):F%=FNrename(f2$,f$) 37450 SYS"OS_File",1,f$,l%,e%,attr% 37460 ENDIF 37470 ENDIF 37480 ENDIF 37490 SYS"Wimp_SlotSize",curslot%,-1,-1 37500 IFok%THENPROCsettype(f$,&FFF):PROCprint("",FNmsg0("CompArt4"),"","") 37510ENDIF 37520REM return success status 37530=ok% 37540 37550DEFFNfirstart(g%) 37560LOCALf1%,rebuild%,p$,f$,s%,a%,F% 37570rebuild%=0 37580IFgrpf%(g%)<0ORgrpf%(g%)>ABSgrpseq%(g%)THEN 37590 grpf%(g%)=0:p$=FNnotopath(g%):f$=p$+".~index" 37600 f1%=FNopenin(f$) 37610 IFf1%<>0THEN 37620 !tmp%=0:SYS"XOS_GBPB",3,f1%,tmp%,8,0TO;F% 37630 IF(F%AND1)=0THENgrpf%(g%)=!tmp% 37640 PROCcf(f1%):IFABSgrpf%(g%)>ABSgrpseq%(g%)THENrebuild%=1 37650 ELSE 37660 rebuild%=1 37670 ENDIF 37680 IFrebuild%>0THEN 37690 IFFNobjtype(p$+".~x.~x*")>1THENPROCmessage1("Irebuild",grp$(g%),0):PROCreindex(grp$(g%)):PROCmessage("",0) 37700 ENDIF 37710 REM now estimate number of articles in group... 37720 SYS"XOS_File",17,f$TO,,,,s%;F%:IF(F%AND1)=0THENs%=s%DIV200ELSEs%=0 37730 a%=0:IFgrpf%(g%)>0THENa%=ABSgrpseq%(l1%)-grpf%(g%)+1 37740 IFs%<a%THENa%=s% 37750 grpa%(g%)=a% 37760ENDIF 37770=ABSgrpf%(g%) 37780 37790DEFFNcheckmoderation(g$,force%) 37800LOCALg1$,l$,m$,mg$,out$,l%,f%:f%=0:out$="" 37810REM force% forces check in the actual file... 37820REM first check internal list, if not force% 37830g$=FNlower(g$):PROCprint("",FNmsg0("Bmod"),g$,"") 37840IFforce%=1ANDINSTR(g$,",")=0THEN:=FNfastcheckmod(FNclean(g$)) 37850IFforce%=0THEN 37860 l$=g$:REPEATg1$=FNgetpar(l$,",") 37870 IFg1$>""THENl%=FNnametono(g1$,0):IFl%>0THENf%=1:IFgrpmod%(l%)<>0 out$=g1$ 37880 UNTILl$=""ORout$>"" 37890ENDIF 37900REM otherwise check the file 37910IFout$=""ORINSTR(g$,",")>0THEN 37920 f3%=FNopenin(support$+".modgroups") 37930 IFf3%>0THEN 37940 REPEATm$=GET$#f3% 37950 l$=g$:REPEAT 37960 g1$=FNclean(FNgetpar(l$,",")) 37970 IFg1$>""ANDFNsmatch(m$,g1$)>0THENout$=g1$ 37980 UNTILl$=""ORout$>"":PROCpoll(slice%*4) 37990 UNTILEOF#f3%ORout$>"" 38000 PROCcf(f3%) 38010 ENDIF 38020ENDIF 38030=out$ 38040 38050DEFFNfastcheckmod(g$) 38060REMIFLEFT$(g$,6)="clari."THEN:=g$ 38070f3%=FNopenin(support$+".modgroups") 38080IFf3%>0THEN 38090 out$="" 38100 REPEATm$=GET$#f3% 38110 IFFNsmatch(m$,g$)>0THENout$=g$ 38120 UNTILEOF#f3%ORout$>"" 38130 PROCcf(f3%) 38140ENDIF 38150=out$ 38160 38170DEFPROCadddelbuf(g%,n%) 38180IFrw%THEN 38190 IFdelbufptr%+4>delbufsize%ORg%<>delbufg%THENPROCdodelindex(delbufg%) 38200 IFg%>0 THEN 38210 delbuf%!delbufptr%=n%:delbufptr%+=4:delbufg%=g% 38220 IFgrpa%(g%)>0THENgrpa%(g%)-=1 38230 ENDIF 38240ENDIF 38250ENDPROC 38260 38270DEFPROCdodelindex(g%) 38280LOCALF$,T$,F%,p1%,p2%,r3%,addr%,s1%,l%,dbuf%,artno%,flag% 38290LOCALcurslot%,f%,ibsize% 38300IFdelbufptr%=0 ORg%=0 ORrw%=0THENENDPROC 38310IFdelbufptr%>0 THEN 38320 delbuf%!delbufptr%=0 38330 PROCprint("",FNmsg0("Iupdate"),"",""):PROCcheckdisk 38340 F$=FNifile(g%):T$=basedir$+".~index":F%=FNdelfile(T$) 38350 SYS"Wimp_SlotSize",-1,-1TOcurslot%,,f% 38360 ibsize%=(f%DIV200)*200:IFibsize%>&19000 THENibsize%=&19000 38370 SYS"Wimp_SlotSize",curslot%+ibsize%,-1TOl%:dbuf%=curslot%+&8000 38380 IFl%<curslot%+ibsize%THEN 38390 PROCmessage0("Ibuffer",1) 38400 ELSE 38410 f1%=FNopenin(F$) 38420 IFf1%=0THEN 38430 PROCmessage1("Iopen",F$,1) 38440 ELSE 38450 f2%=FNopenout(T$) 38460 IFf2%=0THEN 38470 PROCcf(f1%):PROCmessage0("Itmp",1) 38480 ELSE 38490 F%=0:p1%=0:p2%=0:r3%=0:s1%=EXT#f1%:PROChgon 38500 WHILEr3%=0AND(F%AND1)=0 38510 !dbuf%=0:SYS"XOS_GBPB",3,f1%,dbuf%,ibsize%,p1%TO,,,r3%,p1%;F% 38520 IFr3%<ibsize%AND(F%AND1)=0THEN 38530 addr%=dbuf% 38540 FORl%=1TO(ibsize%-r3%)DIV200 38550 artno%=!addr%:flag%=0:CALLchkdelart%,artno%,delbuf%,flag% 38560 IFflag%=0AND!addr%>0THENSYS"OS_GBPB",1,f2%,addr%,200,p2%TO,,,,p2% 38570 addr%+=200 38580 IFl%MOD10=0ANDs1%>0THENSYS"Hourglass_Percentage",((p1%+addr%-dbuf%)*100)DIVs1% 38590 NEXTl% 38600 ENDIF 38610 ENDWHILE 38620 PROChgoff:PROCcf(f1%):PROCcf(f2%) 38630 grpf%(g%)=-1 38640 F%=FNdelfile(F$):F%=FNmovefile(T$,F$) 38650 delbufptr%=0 38660 ENDIF 38670 ENDIF 38680 ENDIF 38690 SYS"Wimp_SlotSize",curslot%,-1 38700ENDIF 38710ENDPROC 38720 38730DEFPROCexpgroup(g$,pto%) 38740LOCALl1%:l1%=0 38750REPEATl1%+=1 38760 IFFNsmatch(g$,grp$(l1%))<>0THENPROCexpiregroup(l1%,pto%,1) 38770 IFcancel%ANDINSTR(g$,"*")>0THEN 38780 IFFNconfirm(FNmsg1("Ccancexp",g$))=2THENcancel%=0ELSEcancel%=TRUE 38790 ENDIF 38800UNTILl1%=groups%ORcancel%<>0 38810ENDPROC 38820 38830DEFPROCreindex(g$) 38840LOCALw%,l1%:w%=0 38850IFrw%ANDFNbusyon("Bindex")=0THEN 38860 PROClog("Rebuilding index for "+g$) 38870 FORl1%=1TOgroups% 38880 IFFNsmatch(g$,grp$(l1%))<>0THENPROCgenindex(l1%) 38890 NEXTl1% 38900 PROCbusyoff 38910ENDIF 38920ENDPROC 38930 38940DEFPROCgenindex(ng%) 38950LOCALaC%,f$,A$,p$,a%,loc%,nobuf%,nobufsize%,nobufptr%,nbr%,pc%,lpc%:lpc%=-1 38960IFFNactive(grp$(ng%))=0 ENDPROC 38970PROCcheckdisk:PROCadddelbuf(0,0) 38980nobufsize%=12*1024:nbr%=FNclaim(nobuf%,nobufsize%,"index") 38990IFnbr%=0THENPROCmessage0("Greindex",0):ENDPROC 39000nobufptr%=0:p$=FNpath(grp$(ng%)):F%=FNdelfile(p$+".~index") 39010PROCprint(FNmsg0("Ibuild"),FNmsg1("Glast",grp$(ng%))," "," ") 39020f$=FNnotopath(g%)".~index" 39030F%=FNdelfile(f$):SYS"XOS_File",11,f$,&FFD 39040PROCgenindexdir(p$,ng%) 39050SYS"OS_HeapSort",nobufptr%DIV4,nobuf%,1 39060IFnobufptr%>4 THEN 39070 grpf%(ng%)=!nobuf% 39080 grpseq%(ng%)=ABS(nobuf%!(nobufptr%-4)) 39090 grpa%(ng%)=nobufptr%DIV4 39100 ELSE 39110 grpf%(ng%)=0:grpa%(ng%)=0 39120ENDIF 39130pc%=0 39140FORloc%=0TO(nobufptr%-4)STEP4 39150 IFnobufptr%>0 THENpc%=(loc%*100)DIVnobufptr% 39160 IFpc%<>lpc%THENPROCprint("",FNmsg0("Iread"),FNmsg3("Idone",STR$(loc%DIV4),STR$(nobufptr%DIV4),STR$pc%),""):PROCgact(FNmsg1("Iper",STR$pc%)):lpc%=pc% 39170 a%=nobuf%!loc% 39180 f$=FNfindfile(ng%,a%,FALSE) 39190 IFf$>""PROCprocessheader(f$,ng%,a%) 39200 PROCpoll(slice%*2) 39210NEXTloc% 39220PROCrelease(nbr%):PROCwriteindexbuf 39230PROCgact(""):PROCprint(FNmsg0("Done")," "," "," ") 39240ENDPROC 39250 39260DEFPROCprocessheader(f$,ng%,a%) 39270IFFNgetheaderinfo(f$)<>0THEN 39280 IFFNspecialgrp(grp$(ng%))ANDINSTR(grp$(ng%),"outgoing")>0THEN 39290 from$=to$:IFRIGHT$(grp$(ng%),4)="news"THENfrom$=newsgroup$ 39300 ENDIF 39310 PROCaddtoindex(ng%,a%):a%=0 39320ENDIF 39330ENDPROC 39340 39350DEFFNgetheaderinfo(f$) 39360LOCALr4%,A$,pos%,ok%,mem%,mbr%,len%,t%:ok%=0 39370PROCclearheader 39380t%=FNfiletype(f$) 39390len%=2048 39400CASEt%OF 39410 WHEN&FCA:mbr%=FNclaim(mem%,len%*2,"header") 39420 WHEN&FFF:mbr%=FNclaim(mem%,len%,"header") 39430 OTHERWISE:mem%=0 39440ENDCASE 39450IFmem%>0THEN 39460 f1%=FNopenin(f$):IFf1%>0THEN 39470 IFt%=&FCA THEN 39480 SYS"OS_GBPB",3,f1%,mem%+len%,len%,20 TO,,,,r4% 39490 IFr4%>20THEN 39500 PROCprint("",FNmsg0("CompHead"),"","") 39510 r4%=FNdecompheader(mem%+len%,r4%-20,mem%,len%) 39520 ENDIF 39530 ELSE 39540 SYS"OS_GBPB",4,f1%,mem%,len% TO,,,,r4% 39550 ENDIF 39560 PROCcf(f1%) 39570 IFr4%>0THEN 39580 pos%=0:ok%=1 39590 REPEATA$="":REM next line was < len% 39600 IFpos%+254<len%THEN 39610 A$=FNstr(mem%+pos%):pos%+=LENA$+1 39620 ENDIF 39630 PROCsetheadervar(A$) 39640 UNTILA$="" 39650 ENDIF 39660 ENDIF 39670 PROCrelease(mbr%) 39680ENDIF 39690=ok% 39700 39710DEFPROCgenindexdir(p$,g%) 39720LOCALdloop%,n%,f%,f$,t%,r3%,addr%,v%,g$,dirbuf%,dbr% 39730n%=0:g$=grp$(g%):dbr%=FNclaim(dirbuf%,dbsize%,"dbuf") 39740PROCpoll(slice%*4):PROCgact(FNmsg1("Glast",grp$(g%))) 39750REPEAT 39760SYS"XOS_GBPB",10,p$,dirbuf%,20,n%,dbsize%,"*"TO,,,r3%,n%;F% 39770IF(F%AND1)THENr3%=0:n%=-1 39780IFr3%>0THEN 39790 addr%=dirbuf% 39800 FORdloop%=1TOr3% 39810 t%=addr%!16:f$=FNstr(addr%+20) 39820 v%=VALf$ 39830 CASEt%OF 39840 WHEN1: 39850 IFv%>0THEN 39860 IFnobufptr%<(nobufsize%-4)THENnobuf%!nobufptr%=v%:nobufptr%+=4 ELSEn%=-1 39870 ENDIF 39880 WHEN2,3:IFLEFT$(f$,1)="~"PROCgenindexdir(p$+"."+f$,g%) 39890 ENDCASE 39900 addr%=addr%+(24+LENf$)ANDNOT3:NEXTdloop% 39910ENDIF 39920UNTILn%=-1 39930PROCrelease(dbr%) 39940ENDPROC 39950 39960DEFPROChgon 39970SYS"Hourglass_On" 39980ENDPROC 39990 40000DEFPROChgoff 40010SYS"Hourglass_Off" 40020ENDPROC 40030 40040DEFPROCreceive(q%) 40050LOCALs1$,s2$,w%,i%,to%,ref% 40060w%=q%!20:i%=q%!24 40070CASEq%!16 OF 40080 WHEN0:IFFNcheckquit THENPROCfinish:END 40090 WHEN2:IFq%!12=dragref%ANDq%!36<>-1THENPROCmakenewsdir(FNstr(q%+44)):dragref%=0:PROCclosew(savend%) 40100 WHEN3:s1$=FNstr(q%+44): 40110 IFw%=gsetup%ANDi%=16ANDq%!40=&2000THEN 40120 IFLENs1$<100PROCupdateiconstring(gsetup%,16,s1$):PROCsetcaret(gsetup%,16,LENs1$):ELSEVDU7 40130 ENDIF 40140 IFw%=uwin%AND(i%=16ORi%=17)THEN 40150 PROCnewvac(FNic_str(w%,0),s1$) 40160 ENDIF 40170 WHEN&502:to%=q%!4:ref%=q%!8:s1$=FNhelp(q%!32,q%!36) 40180 IFs1$>""THEN 40190 q%!16=&503:q%!12=ref%:$(q%+20)=s1$:q%?(20+LENs1$)=0:!q%=((25+LENs1$)DIV4)*4 40200 SYS"XWimp_SendMessage",17,q%,to% 40210 ENDIF 40220 WHEN&400C2:s1$=FNstr(q%+28):IFs1$=myname$ANDq%!4<>task% THEN 40230 !q%=20:q%!16=0:q%!12=0:SYS"Wimp_SendMessage",17,q%,q%!4 40240 ENDIF 40250 WHEN&400C3:PROCrmcl(q%!4) 40260 WHEN&400C9:PROCrelease(menudataref%):PROCrelease(indmenuref%):infoopen%=FALSE 40270 WHENnbcom%: 40280 s1$=FNstr(q%+&20):s2$=FNstr(q%+&21+LENs1$) 40290 PROCnbcommand(q%!4,q%!8,q%!&14,q%!&18,q%!&1C,s1$,s2$) 40300ENDCASE 40310ENDPROC 40320 40330DEFFNhelp(w%,i%) 40340LOCALA$,P$ 40350CASEw%OF 40360 WHEN-2:A$="Hbar" 40370 WHENmsetup%: 40380 CASE(i%DIV5)OF 40390 WHEN0:A$="Hsite" 40400 WHEN1:A$="Hgen" 40410 WHEN2:A$="Htrans" 40420 WHEN3:A$="Hgrps" 40430 WHEN4:A$="Husers" 40440 WHEN5:A$="Hfilt" 40450 ENDCASE 40460 WHENsitewin%: 40470 CASEi%OF 40480 WHEN0:A$="HShost" 40490 WHEN1:A$="HSmail" 40500 WHEN2:A$="HSrem" 40510 WHEN3:A$="HSorg" 40520 WHEN4,11:A$="HStr" 40530 WHEN14,15:A$="HStz" 40540 WHEN5:A$="HSinit" 40550 WHEN16:A$="Hcancel" 40560 WHEN6:A$="Hsave" 40570 OTHERWISE:A$="HSgen" 40580 ENDCASE 40590 WHENgsetup%: 40600 CASEi%OF 40610 WHEN11:A$="HMauto" 40620 WHEN3:A$="HMfast" 40630 WHEN9:A$="HMkeep" 40640 WHEN7:A$="HMrr" 40650 WHEN6:A$="HMlog" 40660 WHEN8:A$="HMcomp" 40670 WHEN23:A$="HMcomp2" 40680 WHEN1,2:A$="HMmodp" 40690 WHEN20:A$="HMgate1" 40700 WHEN18,19:A$="HMgate2" 40710 WHEN10,12,13,14:A$="HMann" 40720 WHEN16.21:A$="HMdef" 40730 WHEN25,26:A$="HMmindsk" 40740 OTHERWISE:A$="HMgen" 40750 ENDCASE 40760 WHENtrwin%: 40770 CASEi%OF 40780 WHEN0,1:A$="HTname" 40790 WHEN3:A$="HTrem" 40800 WHEN4:A$="HTset" 40810 OTHERWISE:A$="HTgen" 40820 ENDCASE 40830 WHENgwin%:P$=FNic_str(w%,25) 40840 CASEi%OF 40850 WHEN2,14:A$="HGdef" 40860 WHEN22,24:A$="HGhist" 40870 WHEN18:A$="HGscan" 40880 WHEN26:A$="HGnew" 40890 WHEN33:A$="HGexph" 40900 WHEN27:A$="HGcanc" 40910 WHEN28:A$="HGchef" 40920 WHEN34:A$="HGthread" 40930 WHEN29:A$="HGauto" 40940 WHEN30:A$="HGexpn" 40950 WHEN31:A$="HGexpb" 40960 WHEN36,35,41:A$="HGexpt" 40970 WHEN19,25:A$="HGname" 40980 WHEN1,15:A$="HGtime" 40990 WHEN16:A$="HGmod" 41000 WHEN5,6,12:A$="HGtype" 41010 WHEN7:A$="HGadd" 41020 WHEN8:A$="HGrem" 41030 WHEN17:A$="HGdel" 41040 WHEN10:A$="HGinfo" 41050 WHEN9:A$="HGind" 41060 WHEN11:A$="HGdoexp" 41070 WHEN32:A$="Hsave" 41080 OTHERWISE:A$="HGgen" 41090 ENDCASE 41100 WHENuwin%: 41110 CASEi%OF 41120 WHEN1,20:A$="HUname" 41130 WHEN2,15:A$="HUgrp" 41140 WHEN21:A$="HUvac" 41150 WHEN17:A$="HUvset" 41160 WHEN18:A$="HUedit" 41170 WHEN19:A$="HUclear" 41180 WHEN13:A$="HUfwd" 41190 WHEN6:A$="Hcancel" 41200 WHEN7:A$="Hsave" 41210 OTHERWISE:A$="HUgen" 41220 ENDCASE 41230 WHENfwin%: 41240 CASEi%OF 41250 WHEN22:A$="HFnew" 41260 WHEN21:A$="HFdel" 41270 WHEN20:A$="HFset" 41280 WHEN1:A$="HFtype" 41290 WHEN2,3,4,5,6,7,8,9,10:A$="HFcond" 41300 WHEN15,16:A$="HFact" 41310 OTHERWISE:A$="HFgen" 41320 ENDCASE 41330 WHENstatus%:A$="Hstatus" 41340 OTHERWISE:A$="Hany" 41350ENDCASE 41360IFA$>""THEN 41370 A$=FNmsg1(A$,P$) 41380ENDIF 41390=A$ 41400 41410DEFPROCsetcaret(w%,i%,n%) 41420SYS"XWimp_SetCaretPosition",w%,i%,,,-1,n% 41430ENDPROC 41440 41450DEFPROClosecaret 41460SYS"XWimp_SetCaretPosition",-1 41470ENDPROC 41480 41490DEFPROCmakenewsdir(f$) 41500LOCALf1$,d$,n%,next%,err% 41510PROCensuredir(f$) 41520IFFNobjtype(f$)>1THEN 41530 d$=support$+".newsdir.*" 41540 SYS"OS_FSControl",26,d$,f$+".*",3 41550 SYS"XWimp_StartTask",f$+".!boot" 41560 PROCcreatedirs 41570 ELSE 41580 PROCmessage0("Mdirfail",1) 41590ENDIF 41600ENDPROC 41610 41620DEFPROCnbupdate(type%,g$,n%,f$,s$) 41630IFnclient%>0ORtype%=11THEN 41640 CASEtype%OF 41650 WHEN0:f$="L1":IFFNdelok(g$)THENf$="L0" 41660 PROCnbupd(type%,0,g$,f$,"") 41670 WHEN1,5:PROCnbupd(type%,0,g$,"","") 41680 WHEN4:PROCnbupd(type%,n%,g$,"","") 41690 WHEN2,3:PROCnbupd(type%,n%,g$,f$,s$) 41700 WHEN10:PROCnbupd(type%,0,"","","") 41710 WHEN11:PROCnbupd(type%,n%,trans$(transport%),"","") 41720 ENDCASE 41730ENDIF 41740ENDPROC 41750 41760DEFFNcheckquit 41770LOCALok% 41780IFindebatch%=0THEN 41790 ok%=TRUE 41800 ELSE 41810 ok%=(FNconfirm(FNmsg0("Cquit"))=1) 41820ENDIF 41830=ok% 41840 41850DEFPROCnbcommand(nbfrom%,nbref%,com%,p1%,p2%,str$,str2$) 41860IFstartupok%THEN 41870 IFbusy$=""THEN 41880 IFFNfindcl(nbfrom%)<0PROCaddcl(nbfrom%) 41890 IFcom%<500ANDarropen%THENPROCclosew(arrive%) 41900 PROCwriteindexbuf:REM ensure up-to-date... 41910 CASEcom%MOD65536OF 41920 WHEN0:PROCnbstartup(com%,nbfrom%,nbref%) 41930 WHEN10:PROCnbreply(nbfrom%,nbref%,com%,0,0,"",""):PROCrmcl(nbfrom%) 41940 WHEN20:PROCsetuser(com%,nbfrom%,nbref%,str$) 41950 WHEN30:PROCnbsiteinfo(com%,nbfrom%,nbref%,p1%) 41960 WHEN100:PROCadddelbuf(0,0):PROCsendgrouplist(com%,nbfrom%,nbref%,str$) 41970 WHEN110:PROCnewgrouplist(com%,nbfrom%,nbref%,p1%,p2%) 41980 WHEN120:PROCaddgroupcom(com%,nbfrom%,nbref%,str$) 41990 WHEN130:PROCdelgroupcom(com%,nbfrom%,nbref%,str$) 42000 WHEN140:PROCexpgrpcom(com%,nbfrom%,nbref%,str$,p1%) 42010 WHEN200,210:PROCsendindexlist(com%,nbfrom%,nbref%,str$,p1%,p2%) 42020 WHEN220:PROCsendartname(com%,nbfrom%,nbref%,str$,p1%) 42030 WHEN230,240:PROClockartlist(com%,nbfrom%,nbref%,str$,p1%,p2%) 42040 WHEN250:PROCdelartlist(com%,nbfrom%,nbref%,str$,p1%,p2%) 42050 WHEN260,270:PROCfolderop(com%,nbfrom%,nbref%,str$,str2$,p1%,p2%) 42060 WHEN280:PROCcancelart(com%,nbfrom%,nbref%,str$,str2$) 42070 WHEN300,310:PROCclientsendfile(com%,nbfrom%,nbref%,str$) 42080 WHEN400:PROClistusers(com%,nbfrom%,nbref%,str$) 42090 WHEN410:PROCadduser(com%,nbfrom%,nbref%,str$) 42100 WHEN420:PROCdeluser(com%,nbfrom%,nbref%,str$) 42110 WHEN450:IFrw%THENPROCsetforward(com%,nbfrom%,nbref%,str$,str2$,p1%) 42120 WHEN460:IFrw%THENPROCsetvacation(com%,nbfrom%,nbref%,str$,str2$,p1%) 42130 WHEN900:srflag%=0 42140 OTHERWISE:PROCnbcomfail(nbfrom%,nbref%,com%,9,FNmsg0("Badcom")) 42150 ENDCASE 42160 ELSE 42170 PROCnbcomfail(nbfrom%,nbref%,com%,2,FNmsg1("Busy",busy$)) 42180 ENDIF 42190ENDIF 42200ENDPROC 42210 42220DEFPROCsetforward(com%,nbfrom%,nbref%,u$,f$,a%) 42230LOCALu%,a$:u%=FNuserno(u$) 42240IFu%>0THEN 42250 CASEa%OF 42260 WHEN0:a$=userf$(u%) 42270 WHEN1:userf$(u%)=f$:PROCsetuwin(u$):PROCsaveuserinfobyno(u%) 42280 WHEN2:userf$(u%)="":PROCsetuwin(u$):PROCsaveuserinfobyno(u%) 42290 ENDCASE 42300 PROCnbreply(nbfrom%,nbref%,com%,a%,0,u$,a$) 42310 ELSE 42320 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Ufail")) 42330ENDIF 42340ENDPROC 42350 42360DEFPROCsetvacation(com%,nbfrom%,nbref%,u$,p$,a%) 42370LOCALu%,a$,f$:u%=FNuserno(u$):f$=FNupath(u$)+".vacation" 42380IFu%>0THEN 42390 CASEa%OF 42400 WHEN0:IFFNobjtype(f$)=1THENa$=f$ELSEa$="" 42410 WHEN1:IFFNobjtype(p$)=1THENF%=FNdelfile(f$):F%=FNcopyfile(p$,f$):a$=f$ 42420 WHEN2:F%=FNdelfile(f$):a$="" 42430 ENDCASE 42440 PROCnbreply(nbfrom%,nbref%,com%,a%,0,u$,a$) 42450 ELSE 42460 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Ufail")) 42470ENDIF 42480ENDPROC 42490 42500DEFPROCnbstartup(com%,nbfrom%,nbref%) 42510PROCnbreply(nbfrom%,nbref%,com%,100*VALver$,userctrl%,"","") 42520ENDPROC 42530 42540DEFPROCsetuser(com%,id%,nbref%,a$) 42550LOCALl% 42560IFFNuserok(a$)=0PROCnbcomfail(id%,nbref%,20,1,FNmsg0("Ufail")):ENDPROC 42570l%=FNfindcl(id%) 42580IFl%>-1THEN 42590 cl_user$(l%)=a$:PROCnbreply(id%,nbref%,com%,0,0,a$,"") 42600 ELSE 42610 PROCnbcomfail(id%,nbref%,com%,1,FNmsg0("Clunreg")) 42620ENDIF 42630ENDPROC 42640 42650DEFPROCaddcl(id%) 42660LOCALl% 42670WHILEcl_id%(l%)<>0ANDl%<maxcl%:l%+=1:ENDWHILE 42680IFcl_id%(l%)=0THENcl_id%(l%)=id%:nclient%+=1:ELSEPROCmessage0("Clfull",0) 42690ENDPROC 42700 42710DEFFNfindcl(id%) 42720LOCALl% 42730WHILEcl_id%(l%)<>id%ANDl%<maxcl%:l%+=1:ENDWHILE 42740IFcl_id%(l%)<>id%THENl%=-1 42750=l% 42760 42770DEFPROCrmcl(id%) 42780LOCALl%:l%=FNfindcl(id%) 42790IFl%>=0THENcl_id%(l%)=0:IFnclient%>0THENnclient%-=1 42800ENDPROC 42810 42820DEFPROCnbreply(fid%,ref%,code%,p1%,p2%,s1$,s2$) 42830q%!12=ref%:q%!16=nbrep% 42840q%!&14=code%:q%!&18=p1%:q%!&1C=p2% 42850$(q%+&20)=s1$+CHR$0:$(q%+&21+LENs1$)=s2$+CHR$0 42860!q%=4+(&22+LENs1$+LENs2$)DIV4*4 42870SYS"Wimp_SendMessage",17,q%,fid% 42880ENDPROC 42890 42900DEFPROCnblongreply(fid%,ref%,code%,p1%,p2%,p3%,s1$,s2$) 42910q%!12=ref%:q%!16=nbrep% 42920q%!&14=code%:q%!&18=p1%:q%!&1C=p2%:q%!&20=p3% 42930$(q%+&24)=s1$+CHR$0:$(q%+&25+LENs1$)=s2$+CHR$0 42940!q%=4+(&26+LENs1$+LENs2$)DIV4*4 42950SYS"Wimp_SendMessage",17,q%,fid% 42960ENDPROC 42970 42980DEFPROCnblongreply2(fid%,ref%,code%,p1%,p2%,s1$,s2$,s3$) 42990q%!12=ref%:q%!16=nbrep% 43000q%!&14=code%:q%!&18=p1%:q%!&1C=p2% 43010$(q%+&20)=s1$+CHR$0:$(q%+&21+LENs1$)=s2$+CHR$0:$(q%+&22+LENs1$+LENs2$)=s3$+CHR$0 43020!q%=4+(&23+LENs1$+LENs2$+LENs3$)DIV4*4 43030SYS"Wimp_SendMessage",17,q%,fid% 43040ENDPROC 43050 43060DEFPROCnbupd(code%,p1%,s1$,s2$,s3$) 43070q%!12=0:q%!16=nbupd% 43080q%!&14=code%:q%!&18=p1% 43090$(q%+&20)=s1$+CHR$0 43100$(q%+&21+LENs1$)=s2$+CHR$0 43110$(q%+&22+LENs1$+LENs2$)=s3$+CHR$0 43120!q%=256 43130SYS"Wimp_SendMessage",17,q%,0 43140ENDPROC 43150 43160DEFPROCnbcomfail(nbfrom%,nbref%,c%,c1%,A$) 43170c%=(c%DIV10)*10+c1%:PROCnbreply(nbfrom%,nbref%,c%,0,0,A$,"") 43180ENDPROC 43190 43200DEFPROCnbsiteinfo(com%,nbfrom%,nbref%,p1%) 43210LOCALa$ 43220CASEp1%OF 43230 WHEN0:a$=hostname$ 43240 WHEN1:a$=org$ 43250 WHEN2:a$=trans$(transport%) 43260 WHEN3:a$=FNvarval("Newsbase$TransportType"):IFa$=""THENa$="batch" 43270 WHEN4:a$=timezone$ 43280 WHEN5:a$=remotehost$ 43290 WHEN6:a$=mailname$ 43300 WHEN100:a$=STR$userctrl% 43310 WHEN101:a$=STR$defexp% 43320ENDCASE 43330PROCnbreply(nbfrom%,nbref%,com%,p1%,0,a$,"") 43340ENDPROC 43350 43360DEFPROCsendgrouplist(com%,nbfrom%,nbref%,g1$) 43370LOCALl1%,g2$,cnt%,arts%,arts2%,flg$,F%,t%,s%,first% 43380PROCprint("",FNmsg0("Glist")," "," ") 43390FORl1%=1TOgroups% 43400 IFFNgmatch(g1$,l1%) THEN 43410 g2$=grp$(l1%):arts%=0:first%=FNfirstart(l1%) 43420 flg$="L1":IFFNdelok(g2$)THENflg$="L0" 43430 PROCnblongreply(nbfrom%,nbref%,com%,first%,ABSgrpseq%(l1%),ABSgrpa%(l1%),g2$,flg$) 43440 cnt%+=1:IFcnt%MOD6=0 PROCpoll(slice%*2) 43450 ENDIF 43460NEXTl1% 43470PROCnbreply(nbfrom%,nbref%,com%,0,0,"","") 43480ENDPROC 43490 43500DEFPROCnewgrouplist(com%,nbfrom%,nbref%,p1%,p2%) 43510LOCALlastd%,lastt%,a$,c% 43520PROCprint("",FNmsg0("Glist")," "," ") 43530f1%=FNopenin(newgrp$) 43540IFf1%=0THEN 43550 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("NGnone")) 43560 ELSE 43570 lastd%=0:lastt%=0:c%=0 43580 REPEATa$=GET$#f1% 43590 IFLEFT$(a$,1)="#"THEN 43600 lastd%=VALMID$(a$,3,6):lastt%=VALMID$(a$,10,6) 43610 ELSE 43620 IFlastd%>p1%ANDlastt%>p2%THENPROCnbreply(nbfrom%,nbref%,com%,0,0,a$,"") 43630 c%+=1:IFc%MOD10=0THENPROCpoll(slice%) 43640 ENDIF 43650 UNTILEOF#f1% 43660PROCnbreply(nbfrom%,nbref%,com%,0,0,"","") 43670ENDIF 43680ENDPROC 43690 43700DEFPROCaddgroupcom(com%,nbfrom%,nbref%,g1$) 43710LOCALr$ 43720IFFNaddgrp(g1$,r$)THEN 43730 PROCnbreply(nbfrom%,nbref%,com%,0,0,r$,"") 43740 ELSE 43750 PROCnbcomfail(nbfrom%,nbref%,com%,1,r$) 43760ENDIF 43770ENDPROC 43780 43790DEFFNaddgrp(g$,RETURN r$) 43800LOCALr% 43810g$=FNclean(g$) 43820r$=FNmsg0("Readonly"):IFrw%=0THEN:=0 43830r$=FNmsg0("Gbad"):IFINSTR(g$,",")>0ORINSTR(g$," ")>0THEN=0 43840r$=FNmsg0("Gneg"):IFLEFT$(g$,1)="!"THEN=0 43850r$=FNmsg0("Gact"):IFFNactive(g$)<>0THEN=0 43860r%=FNruntransportfile(9,"",g$,"") 43870r$=FNvarval("Newsbase$ReturnInfo") 43880CASEr%OF 43890 WHEN0:IFFNruntransportfile(14,"","","")=0THENPROCreadnewsrc:PROClog(FNmsg1("Laddgrp",g$)) 43900ENDCASE 43910=(r%=0) 43920 43930DEFPROCdelgroupcom(com%,nbfrom%,nbref%,g1$) 43940LOCALr$ 43950IFFNdelgrp(g1$,r$)THEN 43960 PROCnbreply(nbfrom%,nbref%,com%,0,0,r$,"") 43970 ELSE 43980 PROCnbcomfail(nbfrom%,nbref%,com%,1,r$) 43990ENDIF 44000ENDPROC 44010 44020DEFFNdelgrp(g$,RETURN r$) 44030LOCALgrpdel%,l1%,F%,p$,g1$ 44040g$=FNclean(g$) 44050r$=FNmsg0("Readonly"):IFrw%=0THEN:=0 44060r$=FNmsg0("Gbad"):IFINSTR(g$,",")>0ORINSTR(g$," ")>0THEN=0 44070r$=FNmsg0("Gneg"):IFLEFT$(g$,1)="!"THEN=0 44080r$=FNmsg0("Gnotact"):IFFNactive(g$)=0THEN=0 44090r$=FNmsg0("Gspecial"):IFFNspecialgrp(g$)>0THEN=0 44100grpdel%=FNruntransportfile(10,"",g$,"") 44110r$=FNvarval("Newsbase$ReturnInfo") 44120IFgrpdel%=0THEN 44130 PROClog(FNmsg1("Lrmgrp",g$)) 44140 IFFNruntransportfile(14,"","","")=0THENPROCreadnewsrc 44150 IFFNconfirm(FNmsg0("Gremove"))=1THENPROCdelgrp(g$) 44160ENDIF 44170=(grpdel%=0) 44180 44190DEFPROCdelgrp(g$) 44200LOCALl1%,F%,g1$,p$ 44210IFFNbusyon("Bdel")=0THEN 44220 l1%=0:WHILEl1%<groups%:l1%+=1 44230 IFFNgmatch(g$,l1%) THEN 44240 g1$=grp$(l1%):p$=FNpath(g1$) 44250 F%=FNexpiredir(p$,l1%,0,TRUE,0) 44260 IFFNobjtype(p$+".~x")=0ORFNobjtype(p$+".~index")=0THEN 44270 F%=FNdelfile(p$+".~index"):F%=FNdelfile(p$+".~seq") 44280 F%=FNdelfile(p$) 44290 F%=0:WHILEF%=0:p$=FNdir(p$):F%=FNdelfile(p$):ENDWHILE 44300 l1%-=1:PROCrmgrplist(g1$):PROCnbupdate(1,g1$,0,"","") 44310 PROClog(FNmsg1("Ldelgrp",g1$)) 44320 ENDIF 44330 ENDIF 44340 ENDWHILE 44350 PROCbusyoff 44360ENDIF 44370ENDPROC 44380 44390DEFPROCexpgrpcom(com%,nbfrom%,nbref%,g1$,p%) 44400PROCnbreply(nbfrom%,nbref%,com%,0,0,"","") 44410IFrw%THENPROCexpgroup(g1$,0) 44420ENDPROC 44430 44440DEFPROCsendindexlist(com%,nbfrom%,nbref%,g1$,n1%,n2%) 44450LOCALfptr%,imem%,ibr%,r3%,u%,u$,art%,imp%,aloop%,endl%,rectype%,total% 44460LOCALrcom%,route%,ifile$ 44470REM local f6% filehandle not really desirable but permits re-entrancy. 44480LOCALf6% 44490LOCALA$,B$,C$,D$ 44500PROCadddelbuf(0,0):IFn2%=0THENn2%=1E6 44510rcom%=com%MOD65536:route%=65536*(com%DIV65536) 44520IFuserctrl%<>0ANDFNspecialgrp(g1$)=2THEN 44530 u%=FNfindcl(nbfrom%):IFu%>=0THENu%=FNuserno(cl_user$(u%)) 44540 IFu%>0THEN 44550 u$="email."+FNlower(user$(u%)) 44560 IFu$<>LEFT$(FNlower(g1$),LENu$)ANDugrp%(u%)>9THENPROCnbcomfail(nbfrom%,nbref%,c%,1,FNmsg0("Gdeny")):ENDPROC 44570 ENDIF 44580ENDIF 44590ifile$=FNpath(g1$)+".~index" 44600f6%=FNopenin(ifile$) 44610IFf6%=0THEN 44620 IFFNobjtype(ifile$)=1THEN 44630 PROCmessage1("Ireadfail",g1$,1) 44640 ELSE 44650 PROCmessage1("Irebuild",g1$,0):PROCreindex(g1$) 44660 PROCmessage("",0) 44670 f6%=FNopenin(ifile$) 44680 ENDIF 44690ENDIF 44700IFf6%<>0THEN 44710 fptr%=0 44720 IFrcom%=200THENA$="Alist1"ELSEA$="Alist2" 44730 PROCprint("",FNmsg0(A$)," "," ") 44740 ibr%=FNclaim(imem%,4000,"list"):IFibr%>0THEN 44750 REPEAT 44760 !imem%=0:SYS"XOS_GBPB",3,f6%,imem%,4000,fptr%TO,,,r3%,fptr%;F% 44770 IF(F%AND1)THEN 44780 PROCmessage1("Ireadfail",g1$,1):r3%=1 44790 ELSE 44800 imp%=imem%:endl%=(4000-r3%)DIV200 44810 FORaloop%=1TOendl%:art%=!imp% 44820 IF(art%>=n1%ANDart%<=n2%)ANDart%>0THEN 44830 imp%?199=0:A$=FNstr(imp%+20):rectype%=imp%!4 44840 CASErectype%OF 44850 WHEN1:B$=FNstr(imp%+21+LENA$):C$=FNstr(imp%+22+LENA$+LENB$) 44860 D$=FNstr(imp%+23+LENA$+LENB$+LENC$):total%+=1 44870 PROCnblongreply2(nbfrom%,nbref%,200+route%,art%,imp%!8,B$,C$,A$) 44880 IFrcom%=210THENPROCnbreply(nbfrom%,nbref%,com%,art%,0,D$,"") 44890 WHEN2:IFrcom%=210THENPROCnbreply(nbfrom%,nbref%,com%,art%,0,A$,"") 44900 OTHERWISE:B$=FNstr(imp%+21+LENA$) 44910 C$=FNstr(imp%+22+LENA$+LENB$):total%+=1 44920 PROCnblongreply2(nbfrom%,nbref%,200+route%,art%,imp%!8,B$,C$,A$) 44930 ENDCASE 44940 ENDIF 44950 imp%+=200:NEXTaloop%:PROCpoll(slice%) 44960 ENDIF 44970 UNTILr3%>0ORart%>n2% 44980 PROCrelease(ibr%):grpa%(FNnametono(g1$,0))=total% 44990 ENDIF 45000 PROCcf(f6%) 45010 PROCnbreply(nbfrom%,nbref%,200+route%,0,0,"","") 45020 ELSE 45030 REM no articles available... 45040 REM used to use PROCnbcomfail(nbfrom%,nbref%,200+route%,2,FNmsg0("Anone")) 45050 PROCnbreply(nbfrom%,nbref%,200+route%,0,0,"","") 45060ENDIF 45070ENDPROC 45080 45090DEFPROCsendartname(com%,nbfrom%,nbref%,g$,a%) 45100LOCALf$,s%,f%,t%,info$:info$="L" 45110g%=FNnametono(g$,0) 45120IFg%>0ANDa%>0 THEN 45130 f$=FNfindfile(g%,a%,TRUE):t%=FNfiletype(f$) 45140 IFt%=&FCA THEN 45150 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("CompFail3")) 45160 ELSE 45170 IFf$>""THEN 45180 s%=FNfilesize(f$):f%=FNfileattr(f$) 45190 IF(f%AND8)<>0THENinfo$+="1"ELSEinfo$+="0" 45200 PROCnbreply(nbfrom%,nbref%,com%,a%,s%,f$,info$) 45210 ELSE 45220 PROCadddelbuf(g%,a%):PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Afail")) 45230 ENDIF 45240 ENDIF 45250 ELSE 45260 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Afail2")) 45270ENDIF 45280ENDPROC 45290 45300DEFPROClockartlist(com%,nbfrom%,nbref%,g1$,n1%,n2%) 45310LOCALl%,g%,a$,f$,act$ 45320IFrw%THEN 45330 g%=FNnametono(g1$,0):a$="R":act$="":n2%=FNuplim(g%,n2%) 45340 IFcom%MOD65536=230a$+="L"ELSEact$="un" 45350 IFg%>0THEN 45360 FORl%=n1%TOn2% 45370 f$=FNfindfile(g%,l%,FALSE):IFf$>""SYS"XOS_FSControl",24,f$,a$ 45380 NEXTl% 45390 PROCnbreply(nbfrom%,nbref%,com%,0,0,"","") 45400 ELSE 45410 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Gfail")) 45420 ENDIF 45430 ELSE 45440 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Readonly")) 45450ENDIF 45460ENDPROC 45470 45480DEFPROCdelartlist(com%,nbfrom%,nbref%,g1$,n1%,n2%) 45490LOCALl%,g%,f% 45500IFFNdelok(g1$)THEN 45510 g%=FNnametono(g1$,0) 45520 IFg%>0THEN 45530 f%=FNfirstart(g%):IFn1%<f%THENn1%=f% 45540 n2%=FNuplim(g%,n2%):PROChgon 45550 FORl%=n1%TOn2%:PROCdelart(g%,l%):IFl%MOD10=0PROCpoll(slice%) 45560 NEXTl%:PROChgoff 45570 PROCnbreply(nbfrom%,nbref%,com%,0,0,"","") 45580 ELSE 45590 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Gfail")) 45600 ENDIF 45610 ELSE 45620 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Anodel")) 45630ENDIF 45640ENDPROC 45650 45660DEFPROCdelart(g%,n%) 45670LOCALf$ 45680f$=FNfindfile(g%,n%,FALSE) 45690F%=FNdelfile(f$) 45700IFF%=0THENPROCartdeleted(g%,n%) 45710ENDPROC 45720 45730DEFPROCfolderop(com%,nbfrom%,nbref%,g1$,g2$,n1%,n2%) 45740LOCALg1%,g2%,a%,f%,p$,F%,f$ 45750LOCALto$,from$,subject$,messid$,newsgroup$,expires%,artdate%,supersede$,receipt$,lasth%,control$,precedence$,replyto$,approved$,reference$,cc$,origto$ 45760IFrw%THEN 45770 IFFNspecialgrp(g2$)<2THEN 45780 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Gbad")) 45790 ELSE 45800 g1%=FNnametono(g1$,0):g2%=FNnametono(g2$,TRUE):PROCpolloff 45810 IFg1%=0ORg2%=0THEN 45820 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Gfail")) 45830 ELSE 45840 PROChgon 45850 f%=FNfirstart(g1%):IFn1%<f%THENn1%=f% 45860 n2%=FNuplim(g1%,n2%):p$=FNnotopath(g2%) 45870 IFp$>""THEN 45880 s%=FNseq(g2%) 45890 FORa%=n1%TOn2% 45900 f$=FNfindfile(g1%,a%,TRUE):IFf$>""THEN 45910 IFFNgetheaderinfo(f$)<>0THEN 45920 F%=FNartcopy(g2%,s%,f$):IFa%MOD5=0THENPROCpoll(slice%) 45930 IFF%=0ANDcom%MOD65536=260ANDFNdelok(g1$)<>0THENPROCdelart(g1%,a%) 45940 ENDIF 45950 ENDIF 45960 NEXTa% 45970 PROChgoff 45980 ENDIF 45990 PROCnbreply(nbfrom%,nbref%,com%,0,0,FNmsg0("Amove"),"") 46000 ENDIF 46010 PROCpollon 46020 ENDIF 46030 ELSE 46040 PROCnbreply(nbfrom%,nbref%,com%,0,0,FNmsg0("Readonly"),"") 46050ENDIF 46060ENDPROC 46070 46080DEFPROCcancelart(com%,nbfrom%,nbref%,g$,m$) 46090LOCALr%,r$,u$,f$ 46100r%=FNfindcl(nbfrom%):IFr%<0THENu$="news"ELSEu$=cl_user$(r%) 46110r%=INSTR(m$,"@"):r$=LEFT$(MID$(m$,r%+1)):IFu$=""THENu$="news" 46120PROClog("Cancel request for "+m$+" from user "+u$) 46130IFrw%ANDr$=hostname$THEN 46140 f$=FNtmpfile:f1%=FNopenout(f$):IFf1%>0THEN 46150 BPUT#f1%,"Control: cancel "+m$ 46160 BPUT#f1%,"Newsgroups: "+g$ 46170 BPUT#f1%,"Path: "+hostname$+"!not-for-mail" 46180 BPUT#f1%,"From: "+u$+"@"+mailname$ 46190 BPUT#f1%,"Subject: cmsg cancel "+m$ 46200 BPUT#f1%,"Message-ID: <"+FNid_date+"@"+hostname$+">" 46210 BPUT#f1%,"Sender: news@"+hostname$+" (RISC OS Newsbase "+ver$+")" 46220 IForg$>""BPUT#f1%,"Organization: "+org$ 46230 BPUT#f1%,"Date: "+FNrfc_date 46240 BPUT#f1%,"Approved: news@"+hostname$ 46250 BPUT#f1%,"Lines: 1":BPUT#f1%,"":BPUT#f1%,"cancel "+m$ 46260 PROCcf(f1%):PROCsettype(f$,&FFF) 46270 r$=FNsendnews(f$,"",u$) 46280 CASEr$OF 46290 WHEN"":PROCnbreply(nbfrom%,nbref%,com%,0,0,"","") 46300 OTHERWISE:PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Anocancel")) 46310 ENDCASE 46320 ELSE 46330 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Scrap")) 46340 ENDIF 46350 SYS"XOS_CLI","remove "+f$ 46360 ELSE 46370 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Anocancel")) 46380ENDIF 46390ENDPROC 46400 46410DEFFNrfc_date 46420=FNctime("%W3, %DY %M3 %CE%YR %24:%MI:%SE")+" "+timezone$ 46430 46440DEFFNid_date 46450=FNctime("%CE%YR%MN%DY.%24%MI%SE.%CS") 46460 46470DEFFNctime(a$) 46480LOCALb%:?tmp%=3:SYS"OS_Word",14,tmp% 46490SYS"Territory_ConvertDateAndTime",1,tmp%,tmp%+128,128,a$TOb% 46500=FNstr(b%) 46510 46520DEFPROCclientsendfile(com%,nbfrom%,nbref%,f$) 46530LOCALr%,r$,d$,u%,u$,F%,info$,m%,rcom% 46540u%=FNfindcl(nbfrom%):rcom%=com%MOD65536 46550IFu%>=0THENu%=FNuserno(cl_user$(u%)) 46560IFu%<0THENu%=0 46570u$=user$(u%):PROCsettype(f$,&FFF) 46580IFrw%AND(upost%(u%)<>0ORrcom%=310)THEN 46590 IFFNobjtype(f$)=1 THEN 46600 m%=transm%(transport%,1):IFrcom%=300THENm%=transm%(transport%,1) 46610 IFFNfreemem(0)<m%*1024THEN 46620 REM spool file for later processing 46630 r$=outdir$(0):IFrcom%=300THENr$=outdir$(1) 46640 REPEATd$=r$+".nb"+STR$RND(99999):UNTILFNobjtype(d$)=0 46650 r$="":F%=FNmovefile(f$,d$):IFF%<>0THENr$=FNmsg0("Qfail") 46660 ELSE 46670 d$=FNtmpfile:F%=FNmovefile(f$,d$) 46680 IFF%<>0THENd$=f$ 46690 CASErcom%OF 46700 WHEN300:info$=FNkeepfile(1,d$,u$):r$=FNsendnews(d$,info$,u$) 46710 WHEN310:info$=FNkeepfile(0,d$,u$):r$=FNsendmail(d$,u$) 46720 ENDCASE 46730 ENDIF 46740 CASEr$OF 46750 WHEN"":PROCnbreply(nbfrom%,nbref%,com%,0,0,"","") 46760 OTHERWISE:PROCnbcomfail(nbfrom%,nbref%,com%,1,r$) 46770 ENDCASE 46780 ELSE 46790 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg1("NoFile",f$)) 46800 ENDIF 46810 ELSE 46820 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Qnopost")) 46830ENDIF 46840ENDPROC 46850 46860DEFFNsendnews(d$,g$,u$) 46870LOCALr%,r$,local%,m$,approved%:local%=0:approved%=0 46880IFLEFT$(g$)="!"THENapproved%=TRUE:g$=MID$(g$,2) 46890r$=FNcheckgrpsline(g$,local%):IFr$>""THEN=r$ 46900IFINSTR(FNclean(g$)," ")>1THENd$=FNrepost(d$) 46910PROCprint("",FNmsg0("Qpost")," "," ") 46920IFg$>""ANDlocal%=0ANDapproved%=0THENm$=FNcheckmoderation(g$,0) 46930r%=0 46940IFm$>""ANDlocal%=0THEN 46950 r$=FNremail(FNmoddest(m$),d$,u$) 46960 ELSE 46970 IFlocal%THEN 46980 r$=FNlocalnews(d$) 46990 ELSE 47000 IFmngw%<>0ANDmngw$>""THEN 47010 r$=FNgateway(g$) 47020 r$=FNremail(r$,d$,u$) 47030 ELSE 47040 PROClog("Queuing article sent by "+u$) 47050 r%=FNruntransportfile(2,d$,u$,"") 47060 IFr%=0THENPROCnbupdate(11,"",1,"",""):F%=FNdelfile(d$) 47070 ENDIF 47080 ENDIF 47090ENDIF 47100IFr%<>0THENr$=FNvarval("Newsbase$ReturnInfo") 47110=r$ 47120 47130DEFFNgateway(g$) 47140LOCALn%,a$,b$,g1$ 47150a$=mngw$:g1$=FNlower(FNgetpar(g$,",")) 47160n%=INSTR(a$,"%") 47170WHILEn%>0:b$="" 47180 CASEMID$(a$,n%+1,1)OF 47190 WHEN"g":b$=g1$ 47200 WHEN"G":b$="":REPEATb$=b$+FNgetpar(g1$,"."):IFg1$>""THENb$+="-" 47210 UNTILg1$="" 47220 WHEN"%":b$="%" 47230 ENDCASE 47240 a$=LEFT$(a$,n%-1)+b$+MID$(a$,n%+2):n%+=LENb$-1 47250 n%=INSTR(a$,"%",n%) 47260ENDWHILE 47270=a$ 47280 47290DEFFNsendmail(d$,u$) 47300LOCALr%,r$:PROCprint("",FNmsg0("Qsend")," "," ") 47310PROClog("Queuing mail sent by "+u$) 47320r%=FNruntransportfile(1,d$,u$,"") 47330IFr%<>0THENr$=FNvarval("Newsbase$ReturnInfo")ELSEPROCnbupdate(11,"",0,"",""):F%=FNdelfile(d$) 47340=r$ 47350 47360DEFFNcheckgrpsline(g$,RETURN l%) 47370LOCALg1$,r$,w%:g$=FNlower(g$) 47380REPEATg1$=FNclean(FNgetpar(g$,",")) 47390IFLEFT$(g1$,9)="newsbase."THENl%+=1ELSEw%+=1:REM l%=local groups, w%=worldwide 47400IFl%>0ANDw%>0THENr$=FNmsg0("Qxpost") 47410IFLEFT$(g1$,6)="email."ORLEFT$(g1$,7)="folder."ORLEFT$(g1$,4)="junk"ORLEFT$(g1$,7)="control"THENr$=FNmsg1("Qbadg",g1$) 47420UNTILg$=""ORr$>"" 47430=r$ 47440 47450DEFFNlocalnews(f$) 47460LOCALr$,d$ 47470d$=lindir$+".localnews" 47480f1%=FNopenout(d$):f2%=FNopenin(f$) 47490IFf1%>0ANDf2%>0THEN 47500 BPUT#f1%,"#! rnews "+STR$FNfilesize(f$) 47510 PROCfcopy(f2%,f1%):PROCsettype(d$,&FFF) 47520 ELSE 47530 r$=FNmsg0("Qbatch") 47540ENDIF 47550PROCcf(f1%):PROCcf(f2%) 47560=r$ 47570 47580DEFFNtmpfile 47590LOCALf$ 47600IFrw%THEN 47610 REPEATf$=tmpdir$+".tmp"+STR$RND(9999):UNTILFNobjtype(f$)=0 47620 ELSE 47630 f$="<Wimp$Scrap>" 47640ENDIF 47650=f$ 47660 47670DEFFNmoddest(g$) 47680LOCALg1$ 47690REPEATg1$=g1$+FNgetpar(g$,"."):IFg$>""THENg1$+="-" 47700UNTILg$="":g1$+="@"+modgw$ 47710PROCprint("","",FNmsg0("Qmod1"),g1$) 47720=g1$ 47730 47740DEFFNremail(to$,d$,u$) 47750LOCALA$,f$,a$:f$=FNtmpfile 47760f1%=FNopenin(d$) 47770IFf1%>0THEN 47780 f2%=FNopenout(f$) 47790 IFf2%>0THEN 47800 BPUT#f2%,"To: "+to$ 47810 REPEATA$=FNsget(f1%) 47820 IFLEFT$(A$,4)="To: "THENBPUT#f2%,"X-Originally-"; 47830 IFLEFT$(A$,5)<>"From "THENBPUT#f2%,A$ 47840 UNTILA$=""OREOF#f1% 47850 PROCfcopy(f1%,f2%):PROCcf(f2%):PROCsettype(f$,&FFF) 47860 ELSE 47870 PROCmessage0("Scrap",0) 47880 ENDIF 47890 PROCcf(f1%):F%=FNdelfile(d$) 47900ENDIF 47910=FNsendmail(f$,u$) 47920 47930DEFFNrepost(d$) 47940LOCALA$,B$,C$,f$,a$:f$=FNtmpfile 47950f1%=FNopenin(d$) 47960IFf1%>0THEN 47970 f2%=FNopenout(f$) 47980 IFf2%>0THEN 47990 REPEATA$=FNsget(f1%) 48000 IFLEFT$(A$,12)="Newsgroups: "THEN 48010 B$="Newsgroups: ":FORr3%=13TOLENA$:C$=MID$(A$,r3%,1):IFC$<>" "THENB$+=C$ 48020 NEXTr3%:A$=B$ 48030 ENDIF 48040 BPUT#f2%,A$ 48050 UNTILA$=""OREOF#f1% 48060 PROCfcopy(f1%,f2%):PROCcf(f2%):PROCsettype(f$,&FFF) 48070 ELSE 48080 f$=d$:REM couldn't open scratchfile 48090 ENDIF 48100 PROCcf(f1%):F%=FNdelfile(d$) 48110 ELSE 48120 f$=d$:REM couldn't open input file 48130ENDIF 48140=f$ 48150 48160DEFPROCfcopy(in%,out%) 48170LOCALnbuf%,nbr%,r3%,F%:IFEOF#in%THENENDPROC 48180nbr%=FNclaim(nbuf%,4096,"fcopy"):r3%=0 48190IFnbuf%>0THEN 48200 WHILEr3%=0AND(F%AND1)=0:SYS"XOS_GBPB",4,in%,nbuf%,4096TO,,,r3%;F% 48210 IFr3%<4096AND(F%AND1)=0THENSYS"XOS_GBPB",2,out%,nbuf%,4096-r3%TO;F% 48220 ENDWHILE 48230 ELSE 48240 WHILENOTEOF#in%:BPUT#out%,(BGET#in%):ENDWHILE 48250ENDIF 48260PROCrelease(nbr%) 48270ENDPROC 48280 48290DEFFNkeepfile(ty%,f$,RETURN u$) 48300LOCALp$,g$,g%,ret$,m$:m$=FNmsg0("Qkeep0") 48310LOCALto$,from$,subject$,messid$,newsgroup$,expires%,artdate%,supersede$,receipt$,lasth%,control$,precedence$,replyto$,approved$,reference$,cc$,origto$ 48320IFFNgetheaderinfo(f$)<>0ANDkeepoutg%<>0THEN 48330 from$=FNclean(from$):g$=from$:g%=INSTR(g$,"@"):IFg%>0THENg$=LEFT$(g$,g%-1) 48340 u$=g$:u%=FNuserno(g$):IFu%=0THENu%=0:g$="postmaster" 48350 IFapproved$>""THENnewsgroup$="!"+newsgroup$:REM flag approved arts for posting 48360 IF(ukn%(u%)<>0ANDty%=1)OR(ukm%(u%)<>0ANDty%=0)THEN 48370 IFg$>""THEN 48380 CASEty%OF 48390 WHEN0:g$="Email."+g$+".outgoing.mail":from$=to$ 48400 OTHERWISE:g$="Email."+g$+".outgoing.news":from$=newsgroup$ 48410 ENDCASE 48420 g%=FNnametono(g$,TRUE):IFg%>0THEN 48430 p$=FNnotopath(g%) 48440 IFp$>""THEN 48450 s%=FNseq(g%):F%=FNartcopy(g%,s%,f$) 48460 IFF%<>0PROCwriteindexbuf:ELSEPROCmessage(m$+FNmsg0("Qkeep1"),1) 48470 ELSE 48480 PROCmessage(m$+FNmsg0("Qkeep2"),1) 48490 ENDIF 48500 ELSE 48510 PROCmessage(m$+FNmsg0("Qkeep3"),1) 48520 ENDIF 48530 ELSE 48540 PROCmessage(m$+FNmsg0("Qkeep4"),1) 48550 ENDIF 48560 ENDIF 48570 ELSE 48580 IFkeepoutg%<>0THENPROCmessage(m$+FNmsg1("NoFile",f$),1) 48590ENDIF 48600IFty%=0THEN 48610 ret$=to$ 48620 PROClog("Sending mail from "+u$+" to "+LEFT$(ret$,200)) 48630 ELSE 48640 ret$=newsgroup$ 48650 PROClog("Posting news from "+u$+" to "+LEFT$(ret$,200)) 48660ENDIF 48670=ret$ 48680 48690DEFFNsget(h%) 48700REM return line from file without error if too long... 48710LOCALa$,C% 48720WHILEC%<>10ANDEOF#h%=0:C%=BGET#h%:IFLENa$<253ANDC%<>10ANDC%<>13:a$+=CHR$C% 48730ENDWHILE 48740=a$ 48750 48760DEFPROClistusers(com%,nbfrom%,nbref%,str$) 48770LOCALn%:n%=1 48780WHILEuser$(n%)>"" 48790 PROCnbreply(nbfrom%,nbref%,com%,ugrp%(n%),0,user$(n%),FNupath(user$(n%))):n%+=1 48800ENDWHILE 48810PROCnbreply(nbfrom%,nbref%,com%,0,0,"","") 48820ENDPROC 48830 48840DEFPROCadduser(com%,nbfrom%,nbref%,str$) 48850IFFNadduser(str$)THEN 48860 PROCnbreply(nbfrom%,nbref%,com%,0,0,"","") 48870ELSE 48880 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Unoadd")) 48890ENDIF 48900ENDPROC 48910 48920DEFPROCdeluser(com%,nbfrom%,nbref%,str$) 48930IFFNdeluser(str$)THEN 48940 PROCnbreply(nbfrom%,nbref%,com%,0,0,"","") 48950ELSE 48960 PROCnbcomfail(nbfrom%,nbref%,com%,1,FNmsg0("Unodel")) 48970ENDIF 48980ENDPROC 48990 49000DEFFNuplim(g%,n%) 49010IFn%=0ORn%>ABSgrpseq%(g%):=ABSgrpseq%(g%) 49020=n% 49030 49040DEFFNgmatch(g$,g%) 49050IFg%>maxgroup%THEN=0 49060=FNsmatch(g$,grp$(g%)) 49070 49080DEFFNdelok(g$) 49090IFrw%THENIFdelok%<>0ORFNspecialgrp(g$)>1THEN=TRUE 49100=FALSE 49110 49120DEFFNspecialgrp(g$) 49130g$=FNclean(g$):g$=FNlower(g$) 49140IFg$="junk"ORLEFT$(g$,7)="control"THEN=1 49150IFLEFT$(g$,6)="email."THEN=2 49160IFLEFT$(g$,7)="folder."THEN=3 49170IFLEFT$(g$,9)="newsbase."THEN=1 49180=0 49190 49200DEFFNpath(A$) 49210LOCALB$:B$="" 49220IFA$>""THENCALLgetpath%,A$,B$ 49230=dpath$+B$ 49240 49250DEFFNlower(A$) 49260IFA$>""CALLmklcase%,A$ 49270=A$ 49280 49290DEFFNstr(a%) 49300LOCALdummy%,B$ 49310CALLgetline%,dummy%,a%,B$ 49320=B$ 49330 49340DEFFNsmatch(A$,B$) 49350REM wild string match (case insensitive): pattern, string 49360LOCALok% 49370IFA$>""ANDB$>""THENCALLsmatch%,A$,B$,ok% 49380=ABSok% 49390 49400DEFPROCloadcode 49410LOCALl%,F% 49420l%=FNfilesize(resdir$+".code") 49430IFl%>0THEN 49440 DIMmcode% l% 49450 cpylcase%=mcode%+4:getpath%=mcode%+8:getline%=mcode%+12 49460 getlinez%=mcode%+16:getstr%=mcode%+20:mklcase%=mcode%+24 49470 trimstr%=mcode%+28:chkdelart%=mcode%+32:headerno%=mcode%+36 49480 smatch%=mcode%+40 49490 SYS"XOS_File",16,resdir$+".code",mcode%,0TO;F% 49500 IF(F%AND1)THENERROR0,"Code file not found!" 49510 ELSE 49520 ERROR0,"Code file not found!" 49530ENDIF 49540ENDPROC 49550 49560DEFPROCloadsysconf 49570LOCALt$,p$,v$,m%,v% 49580addgrp%=20:mingrp%=40:maxusr%=20:maxfilt%=10 49590maxcl%=15:mincpu%=7:maxcpu%=15:minrma%=0:inbufsize%=16*1024:dbg_exptime%=3 49600chktime%=1000 49610f1%=FNopenin(support$+".!nbsys"):IFf1%<>0THEN 49620 REPEATt$=GET$#f1%:p$="" 49630 m%=INSTR(t$," ") 49640 IFm%>0THENp$=FNlower(LEFT$(t$,m%-1)):v$=MID$(t$,m%+1):v%=VALv$ 49650 CASEp$OF 49660 WHEN"add_grp":IFv%>10THENaddgrp%=v% 49670 WHEN"min_grp":IFv%>10THENmingrp%=v% 49680 WHEN"max_usr":IFv%>5THENmaxusr%=v% 49690 WHEN"max_rdr":IFv%>4THENmaxcl%=v% 49700 WHEN"min_cpu":IFv%>5ANDv%<20THENmincpu%=v% 49710 WHEN"max_cpu":IFv%>5ANDv%<60THENmaxcpu%=v% 49720 WHEN"deb_buf":IFv%>3ANDv%<256THENinbufsize%=v%*1024 49730 WHEN"dbg_exp":IFv%>0THENdbg_exptime%=v% 49740 WHEN"min_flt":IFv%>10THENmaxfilt%=v% 49750 WHEN"chk_tim":IFv%>5THENchktime%=v%*100 49760 ENDCASE 49770 UNTILEOF#f1%:PROCcf(f1%) 49780ENDIF 49790DIM cl_id%(maxcl%),cl_user$(maxcl%) 49800ENDPROC 49810 49820DEFFNcpu(f%) 49830IFf%=0THEN=-mincpu% 49840=-maxcpu% 49850 49860DEFFNclaim(RETURN var%,size%,A$) 49870LOCALF%,ret% 49880IFdynarea% THEN 49890 REM changed size_limit (r5), and flag bit 7 set (non-draggable) 49900 SYS&20066,0,-1,size%,-1,128,size%,0,0,myname$+"_"+A$TO,ret%,,var%;F% 49910 IF(F%AND1)THENvar%=0:ret%=0 49920 ELSE 49930 SYS"XOS_Module",6,,,size%TO,,var%;F% 49940 IF(F%AND1)THENvar%=0 49950 ret%=var% 49960ENDIF 49970=ret% 49980 49990DEFPROCrelease(RETURN var%) 50000LOCALF%,s% 50010IFvar%>0THEN 50020 IFdynarea% THEN 50030 SYS&20066,2,var%TO,,s%;F% 50040 IFs%>0AND(F%AND1)=0THENSYS&20066,1,var%TO;F%:var%=0 50050 ELSE 50060 SYS"XOS_Module",7,,var%TO;F%:var%=0 50070 SYS"XOS_ChangeDynamicArea",1,(-16*1024*1024) 50080 ENDIF 50090ENDIF 50100ENDPROC 50110 50120DEFPROCtidydynareas 50130LOCALA%,N%,P% 50140IFdynarea% THEN 50150 SYS&66,3,-1TO,A% 50160 WHILEA%<>-1 50170 SYS&66,2,A%TO,,,,,,,,P% 50180 SYS&66,3,A%TO,N% 50190 IFLEFT$(FNstr(P%),1+LENmyname$)=myname$+"_"THENSYS&66,1,A% 50200 A%=N% 50210 ENDWHILE 50220ENDIF 50230ENDPROC 50240 50250DEFPROCstartmsgtrans 50260LOCALf$:f$=FNresfile("Messages") 50270SYS"XMessageTrans_FileInfo",,f$TO,,buf%;F% 50280IF(F%AND1)THENERROR0,"Couldn't find Messages file!" 50290DIMmsgdesc%16,msgbuf% buf% 50300SYS"MessageTrans_OpenFile",msgdesc%,f$,msgbuf% 50310ENDPROC 50320 50330DEFPROCendmsgtrans 50340IFmsgdesc%>0THENSYS"MessageTrans_CloseFile",msgdesc% 50350ENDPROC 50360 50370DEFFNmsg0(t$) 50380LOCALs%,F% 50390SYS"XMessageTrans_Lookup",msgdesc%,t$TO,,s%;F% 50400IF(F%AND1)THENs%=FNmsgfail(t$) 50410=FNstr(s%) 50420DEFFNmsg1(t$,a$) 50430LOCALs%,F% 50440SYS"XMessageTrans_Lookup",msgdesc%,t$,tmp%,255,a$TO,,s%;F% 50450IF(F%AND1)THENs%=FNmsgfail(t$) 50460=FNstr(s%) 50470DEFFNmsg2(t$,a$,b$) 50480LOCALs%,F% 50490SYS"XMessageTrans_Lookup",msgdesc%,t$,tmp%,255,a$,b$TO,,s%;F% 50500IF(F%AND1)THENs%=FNmsgfail(t$) 50510=FNstr(s%) 50520DEFFNmsg3(t$,a$,b$,c$) 50530LOCALs%,F% 50540SYS"XMessageTrans_Lookup",msgdesc%,t$,tmp%,255,a$,b$,c$TO,,s%;F% 50550IF(F%AND1)THENs%=FNmsgfail(t$) 50560=FNstr(s%) 50570 50580DEFFNmsgfail(t$) 50590PROCmessage("Failed to look up message token: "+t$,1) 50600$tmp%="notoken" 50610=tmp% 50620 50630DEFPROClocknewsdir 50640LOCALt% 50650IFrw%THEN 50660 t%=FNlockval 50670 IFt%>0THEN 50680 IFFNtaskexists(t%)THEN 50690 ERROR0,FNmsg1("LockFail1",STR$~t%) 50700 ELSE 50710 IFFNconfirm(FNmsg1("LockFail3",STR$~t%))=1THEN 50720 IFFNforcedelfile(lockfile$)=0THENt%=0ELSEERROR0,FNmsg0("LockFail4") 50730 ELSE 50740 PROCfinish:END 50750 ENDIF 50760 ENDIF 50770 ENDIF 50780 IFt%=0THEN 50790 IFFNdiskspace(basedir$)<1000THENERROR0,"No disk space!" 50800 f5%=FNopenout(lockfile$) 50810 IFf5%>0THEN 50820 BPUT#f5%,STR$task%:PROCcf(f5%) 50830 ELSE 50840 ERROR0,FNmsg0("LockFail2") 50850 ENDIF 50860 ENDIF 50870ENDIF 50880ENDPROC 50890 50900DEFFNlockval 50910LOCALr%:r%=0 50920f1%=FNopenin(lockfile$):IFf1%>0THENr%=VALGET$#f1%:PROCcf(f1%) 50930=r% 50940 50950DEFPROCchecklock 50960IFrw%THEN 50970 IFFNlockval<>task%THEN 50980 PROCmessage0("LockFail0",1):startupok%=0:PROCfinish:END 50990 ENDIF 51000ENDIF 51010ENDPROC 51020 51030DEFPROCunlocknewsdir 51040IFrw%THEN 51050 IFFNlockval=task%THENF%=FNforcedelfile(lockfile$) 51060ENDIF 51070ENDPROC 51080 51090DEFFNtaskexists(t%) 51100LOCALr%:r%=0 51110REPEAT 51120SYS"TaskManager_EnumerateTasks",r%,tmp%,255TOr% 51130UNTILr%<0OR!tmp%=t% 51140=(!tmp%=t%) 51150 51160DEFFNresfile(f$) 51170LOCALt%,t$,d$,r$ 51180SYS"Territory_Number"TOt% 51190SYS"Territory_NumberToName",t%,tmp%,250TO,tmp% 51200t$=FNstr(tmp%):d$=resdir$+"."+t$+"."+f$ 51210IFFNobjtype(d$)=1 THEN 51220 r$=d$ 51230 ELSE 51240 d$=resdir$+"."+t$ 51250 IFFNobjtype(d$)=1THEN 51260 f1%=FNopenin(d$):IFf1%<>0THENt$=GET$#f1%:PROCcf(f1%) 51270 r$=d$=resdir$+"."+t$+"."+f$ 51280 ELSE 51290 r$=d$=resdir$+".UK."+f$ 51300 ENDIF 51310ENDIF 51320IFFNobjtype(r$)=0THENERROR0,"Resource file "+f$+" for "+t$+" not found" 51330=r$
�:�" at ";�:� �init �duptask>0�� (�createdirs 2 �loadcode <�startmsgtrans F�startwimp PJ� claim all free memory, bar 64k, up to a maximum of 320k (free space) Z�=�+�freemem(-64) d �(�-�)>320*1024��=�+320*1024 n�loadsysconf x�checknewsdir ��gettransports ��locknewsdir ��initgrpdata ��initfilters ��=(�+&4000) ��readconfig ��inituserdata ��starttransport ��autoconfigure ��l1%=1�3:�poll(0):�l1% ��=(�+&4000) �"startupok%=1:�nbstartup(0,0,0) ��checkoutfiles �initconf(initconf%) �=�+�checkslot ��errorbox(�) "�startupcheckexpire ,� 6 �checkfiles%� @ � J start%=0 T& file$=�checkforfiles(start%) ^ �=�+�checkslot h5 �file$>""��checkdisk:�dobatch(file$,start%) r �file$="" | checkfiles%=autodebatch% � � � �sleep ��0 �� � ���initconf(i%) ��i%>0�rw%� �! �i%=2��message0("Sinfo2",1) �A �front(msetup%):�print(�msg0("Setup"),�msg0("Swait"),"","") �* �:�poll(50):�confopen%=�:�saveconfig �� �� � ��cron 4�(time%-cron0%)>600�cron0%=time%:�checkoutfiles 3�(time%-cron1%)>1200�cron1%=time%:�checktosend &:�(time%-cron2%)>6000�cron2%=time%:�checklock:�log("") 08�(time%-cron3%)>400�infoopen%��credits:cron3%=time% :D�(time%-cron4%)>30000�cron4%=time%:�blockexpire%=0��checkexpire D� N X��sleep b�m$ lm$="Idle2":�rw%�m$="Idle" v.�print(�msg0(m$)," "," "," "):sleep%=time% �6��poll(200):�forcebatch%��(time%-sleep%)>=chktime% �forcebatch%=0 �� � ���checknewsdir �ȕnewsroot$="" �< �rw%��message0("Snewsdir",1)��message0("Sronewsdir",1) �7 �createdirs:�newsroot$=""�rw%�cfront(savend%,0,0) �( ��poll(200):�ndopen%=0:�createdirs �� �'绤varval("NewsDir$Version")<1�rw%� �% �message0("Supdate",0):�poll(0) �2 �makenewsdir("<NewsDir$Dir>"):�message("",0) � � ݤcheckforfiles(� start%) *�t1%,l%,f$,pat$ 4�rw%��freemem(0)>32*1024� >3 �print(�msg0("Idle"),�msg0("Fcheck")," "," ") H* � first check for recovery record... R f$=�check_recfile(start%) \ �f$=""� f start%=0:t1%=0 pC �transi$(transport%,0)=""�l%=�runtransportfile(13,"","","") z � � l%=0 � �pat$=transi$(t1%,l%) �1 �pat$>""�f$=�checkinfiles(pat$):l%+=1 � �f$>""�pat$=""�l%=10 � t1%+=transport% �* �f$>""�t1%>transport%�transport%=0 � � �� �=f$ � ���startupcheckexpire ��checkexpiretime(�time)� �7 � check if expiry is wanted; mark as done if not. ? �confirm2(�msg0("Econfirm"))=2��stamp(newsroot$+".news") � �rw%�blockexpire%=0:cron4%=0 $� . 8��checkexpire B�t%,g%,t$,now% Lnow%=�time V�checkexpiretime(now%)� ` �nbupdate(10,"",0,"","") j' �log("Starting automatic expiry") t( �print("",�msg0("Echeck")," "," ") ~ �stamp(newsroot$+".news") � g%=0:�g%+=1 �% t%=�filetime(�path(grp$(g%))) �, �t%<now%��expiregroup(g%,0,autoexp%) � �g%�10=0��poll(slice%*2) � �cancel%� �? �confirm(�msg1("Ccancexp",g$))=2�cancel%=0�cancel%=� � � � �g%=groups%�cancel%<>0 � �log("Finished expiry") �= �runsupport("Trimlist "+�ngexp%):�expmiscdir(tmpdir$,1) �� �� ݤcheckexpiretime(now%) !�yes%,last%,now$,test$,etime% yes%=0 ( �rw%� 2( last%=�filetime(newsroot$+".news") <C � test$ is expiry trigger time as string, format CEYRMNDYHRMI F8 � FNfiletime returns file timestamp in same format P �postfetchready%<>0� Z postfetchready%=0 d7 t%=�runtransportfile(5,"","",""):� postfetch... n � x' etime%=exptime%:�expany%�etime%=0 � �autoexp%�indebatch%=0� �& test$=�now%+�"0000"+�etime%,4) � now$=�fulltime � yes%=(now$>test$) � �yes%� �3 � also check last expiry was yesterday... � �last%>now%-1�yes%=0 �M � and check transport not active... don't want expiry while online. �9 �yes%��runtransportfile(15,"","","")<>0�yes%=0 � � � � �� � =yes% ��checkoutfiles �l%,t%,f$,d$,p$,n%:l%=0 "� ,% f$=transo$(transport%,l%):l%+=1 6 d$=�dir(f$):p$=�leaf(f$) @3 ș"XOS_GBPB",9,d$,tmp%,1,0,255,p$ �,,,n%;err% J �(err%�1)=0�n%>0�t%+=1 T�f$=""�l%=11 ^9d$=defic$:�t%=0�defic$="newsbase1"�defic$="newsbase2" h!�d$<>defic$��changeic(defic$) r� | �ݤcheckinfiles(A$) �?�result$,n%,next%,f$,ff$,f%,F%,l%,source$,pat$,dirbuf%,dbr% �next%=0 �'dbr%=�claim(dirbuf%,dbsize%,"dbuf") �#source$=�dir(A$):pat$=�leaf(A$) �� �I ș"XOS_GBPB",9,source$,dirbuf%,1,next%,dbsize%,pat$ �,,,n%,next%;F% � �(F%�1)=0�n%>0� �+ f$=�str(dirbuf%):ff$=source$+"."+f$ �0 � attempt deletion of any empty files... �* �filesize(ff$)=0�F%=�delfile(ff$) �6 � see if file can be opened for read access... � F%=0:f1%=�openin(ff$) �f1%<>0� �cf(f1%) �source$<>workdir$� &- F%=�runtransportfile(4,ff$,"","") 0 �F%=0� :/ F%=�movefile(ff$,workdir$+"."+f$) D � NG �message1("Dnoprefetch",�varval("Newsbase$ReturnInfo"),1) X � b � l' �F%=0�result$=workdir$+"."+f$ v � � � � �poll(slice%*2) � � �!�result$>""�next%<0�(F%�1)<>0 ��release(dbr%) �=result$ � ���checktosend �0�n%,next%,f$,d$,F%,dirbuf%,dbr%,info$,u$,ty% � �rw%� �/ nf%=0:dbr%=�claim(dirbuf%,dbsize%,"dbuf") �+ �ty%=0�1:n%=transm%(transport%,ty%+1) � �freemem(0)>=n%*1024� next%=0:� R ș"XOS_GBPB",9,outdir$(ty%),dirbuf%,1,next%,dbsize%,"*"�,,,n%,next%;F% �(F%�1)=0�n%>0� A f$=outdir$(ty%)+"."+�str(dirbuf%):�settype(f$,&FFF) *- d$=�tmpfile:F%=�movefile(f$,d$) 4 �(F%�1)=0� >1 next%-=1:info$=�keepfile(ty%,d$,u$) H Ȏty%� R& �0:r$=�sendmail(d$,u$) \, �1:r$=�sendnews(d$,info$,u$) f � p/ �r$>""�message1("Qsendfail",d$,1) z �poll(slice%*2) � � � � � �next%<0�(F%�1)<>0 � � � �ty% � �release(dbr%) �� �� � � ݤdir(f$) ��l% �%l%=�f$:�l%-=1:��f$,l%,1)="."�l%<1 �=�f$,l%-1) ݤleaf(f$) �l% $%l%=�f$:�l%-=1:��f$,l%,1)="."�l%<1 .=�f$,l%+1) 8 B��dobatch(fullbf$,bstart%) L�bf$,ty$,F% Vbf$=�leaf(fullbf$) `�decompress(fullbf$) j�filetype(fullbf$)=&FCA � tJ �message0("CompFail4",1):�log("Batch decompression failed for "+bf$) ~9 �movetodebug(fullbf$)<>0�F%=�forcedelfile(fullbf$) � � � �startmemmgr:indebatch%=� �@ inbuf%=base%:�extend(inbufsize%):artbase%=base%+inbufsize% �) �print(�msg0("Dstart")," "," "," ") �! �openbatch(fullbf$,bstart%) � cancel%=� �D done%=0:del%=�:off%=0:ptr%=0:recpos%=0:lastpos%=0:batartlen%=0 �* type%=�identifyfile(fullbf$,bstart%) �2 �type%=0�ty$=�msg0("Mail")�ty$=�msg0("News") �% start%=�:total%=0:dstime%=time% � ȕeof%=� �& cancel%=�:�doarticle:�savelist + �print(�msg1("Dtype",ty$),"","","") �cancel%��cancelbatch � �extend(0):indebatch%=0 ( �endbatch(fullbf$) 2� <� F P��cancelbatch Z7eof%=�:del%=�:�cf(f00%):�write_recfile:indebatch%=0 d!�message0("Dcancel",0):�pause n� x ���endbatch(batchf$) �$�F%,n%,t%,debdir$,rate$:rate$="" ��writeindexbuf �$� write debatch stats to logfile �Bt%=�(dstime%-time%)�100:�t%>0�rate$=�((len%-bstart%)�t%)+"cps" �I�log("Finished batch "+bf$+" "+�done%+" arts "+�len%+" bytes "+rate$) �F�cf(f00%):� batch file should be closed already, but this ensures. ��changeic(defic$) ��cancel%=0� � �savegrpdata � �del_recfile � �keepb%<>0�del%=0� �; �movetodebug(batchf$)<>0�F%=�forcedelfile(batchf$) � ! F%=�forcedelfile(batchf$) � "( �F%<>0��message1("Ddelfail",bf$,1) , postfetchready%=1 6' �expmiscdir(baddir$,dbg_exptime%) @� J�arrive T� ^ hݤmovetodebug(f$) r�F%,n%,d$,bf$,b% |bf$=�leaf(f$) �%d$=baddir$+"."+bf$:�ensuredir(d$) ��objtype(d$)<2�d$=baddir$ � n%=1:� �! ?tmp%=3:ș"OS_Word",14,tmp% �O ș"Territory_ConvertDateAndTime",1,tmp%,tmp%+128,128,"%MN%DY%24%MI%SE"�b% �* n%+=1:F%=�rename(f$,d$+"."+�str(b%)) ��n%>9�F%=0 �=F% � ���arrive � �a$,a% �Ȏarrart%� � �0:a$=�msg0("Nonews") �1:a$=�msg0("Newnews1") $ :a$=�msg1("Newnews",�arrart%) � &#�updateiconstring(arrive%,1,a$) 0D�arrmail$>""�a$=�msg1("Newmail",�arrmail$,2))�a$=�msg0("Nomail") :(�updateiconstring(arrive%,2,�a$,36)) D�alert%� N- �arrmail$>""�(arrart%>0�alertnews%<>0)� X7 �arropen%=0�cfront(arrive%,0,0)��front(arrive%) b7 a%=1:�defclient$>""��objtype(defclient$)>0�a%=0 l �setshaded(arrive%,3,a%) v �alertbeep%�7 � � �� �� � ���savegrpdata ��startupok%<>0� � �writegrpdata � �writeindexbuf �� ��adddelbuf(0,0) �� � ���doarticle "�extend(inbufsize%+defartbuf%) �clearheader 0outg%()=0:ptr%=0:inhdr%=�:out$="":foundid%=0 1nextartpos%=pos%+thisartlen%:thisartpos%=pos% *� 4 �inhdr%� >3 �headerline(line$):start%=0:�poll(slice%*2) H0 �discard%=0�addtobuffer(line$):��discard R? �line$=""�inhdr%=�:�thisartlen%>0��blockmove:�batchpoll \ � f& �addtobuffer(line$):�batchpoll p � z line$=�getline �C �inhdr%=0�pos%>nextartpos%-100��line$,seplen%)=sep$�start%=� ��start%<>0 �eof%<>0 �<�line$,4)="#! r"�thisartlen%=��line$,10):�thisartlen%=0 �*done%+=1:total%+=1:�type%=1�arrart%+=1 �� � � ��discard ��tmp$:tmp$=line$ �ȕlong%:tmp$=�getline:� �� � ���batchpoll �>�poll(slice%):�(time%-stime%)>200��updatepos:stime%=time% � ��blockmove $�l%,F%,m%,a0%,a1%,a2%,a3% .#l%=thisartlen%-pos%+thisartpos% 8�bufptr%+l%+4>inbufsize%�� B;m%=inbuf%+bufptr%+l%:a0%=?m%:a1%=m%?1:a2%=m%?2:a3%=m%?3 LR� check for "#! r" without reading string (buffer overrun-possible data abort) V"�a0%=35�a1%=33�a2%=32�a3%=114� `< �ptr%+l%>bufsize%��extend(inbufsize%+bufsize%+l%+1024) jM ș"XWimp_TransferBlock",task%,inbuf%+bufptr%,task%,artbase%+ptr%,l%�;F% t- �(F%�1)=0�pos%+=l%:ptr%+=l%:bufptr%+=l% ~� �� � ���clearheader �Oto$="<blank>":from$="(no sender)":subject$="(no subject)":cc$="":origto$="" �Omessid$="<0>":newsgroup$="":expires%=0:artdate%=0:supersede$="":control$="" �Nreceipt$="":lasth%=0:precedence$="":replyto$="":approved$="":reference$="" �� � �!ݤidentifyfile(file$,offset%) �#�t%,lc%,clue%,a$:t%=-1:clue%=-1 �� � line$=�getline 1 lc%+=1:line$=�clean(line$):a$=�lower(line$) ( �(line$)=1�t%=0:sep$=�1:ident$="" 4 �line$,5)="From "�t%=0:sep$="From ":ident$="" R �line$,8)="#! rmail"�t%=0:sep$="#! rmail":ident$="":thisartlen%=��line$,10) (] �line$,8)="#! rnews"�t%=1:sep$="#! rnews":ident$="Newsgroups:":thisartlen%=��line$,10) 2B �a$,11)="newsgroups:"��a$,5)="xref:"��a$,5)="path:"�clue%=1 <5 �a$,4)="to: "��a$,14)="apparently-to:"�clue%=0 F�t%>=0�eof%<>0 P �t%<0� Z/ t%=1:sep$="#! rnews":ident$="Newsgroups:" d* �clue%=0�t%=0:sep$="From ":ident$="" n� x*�lc%>1��restartbatch(file$,t%,offset%) �seplen%=�sep$ �=t% � ���headerline(line$) ��A$ �4�sep$<>"From "��line$,seplen%)=sep$�discard%=�:� ��setheadervar(line$) �4�type%=1��line$,5)="Path:"��addustopath(line$):� ��foundid%>0�� ��type%=0�lasth%=11� � �type%=0� �= A$="Email."+bf$:�userok(bf$)=0�A$="Email.postmaster" � � A$=newsgroup$:outg%()=0 � E �addheadertobuffer(line$):�groupsline(A$):discard%=�:foundid%=1 " �type%=1��doxref ,� 6� @ J��setheadervar(A$) T�no%:�A$=""�� ^�headerno%,A$,no% h Ȏno%� r �1:subject$=�clean(�A$,9)) | �2:from$=�clean(�A$,6)) � �3:messid$=�clean(�A$,12)) �# �4:supersede$=�clean(�A$,12)) �% �5:expires%=�decodedate(�A$,9)) � �6:control$=�clean(�A$,9)) �% �7:artdate%=�decodedate(�A$,7)) � �8:discard%=� �$ �9:�to$=""�to$=�clean(�A$,15)) � �10:to$=�clean(�A$,4)) �$ �11:newsgroup$=�clean(�A$,12)) �" �12:receipt$=�clean(�A$,20)) �% �13:precedence$=�clean(�A$,12)) �" �14:replyto$=�clean(�A$,10)) �# �15:approved$=�clean(�A$,10)) B �16:�addtobuffer(A$):discard%=�:line$="":� "Message:" header $ �17:reference$=�clean(�A$,12)) �18:cc$=�clean(�A$,5)) &! �19:origto$=�clean(�A$,19)) 0 �20:� Errors-To: :2 :�A$,1)=" "��conthline(A$,lasth%)�lashh%=0 D� N�no%>0�lasth%=no% X� b l��conthline(a$,t%) v Ȏt%� � �10:�to$+�a$<250�to$+=a$ �- �17:�reference$+�a$<250�reference$+=a$ � �18:�cc$+�a$<250�cc$+=a$ �� �� � �ݤdecodedate(A$) �;�res%,d$,m$,y$,l%,m%:� attempt to decode header date... �"l%=�A$,","):�l%>0�A$=�A$,l%+1) �- A$=�clean(A$):A$=�lower(A$):l%=�A$," ") �" d$=�A$,l%-1):�l%=2�d$="0"+d$ �A m%=�"janfebmaraprmayjunjulaugsepoctnovdec",�A$,l%+1,3))�3+1 � m$=�"0"+�m%,2) y$=�A$,l%+5,4):l%=�y$," ") $ �l%>0�y$=�((�time)�1E6)+�y$,2) % �d$*�m$*�y$>0�res%=�(y$+m$+d$) =res% * 4��deleteid(g%,id$) >�a%,f$,id1$ H�id1$=�getpar(id$," ") RC �print("",�msg1("Acancel",id1$),"",""):a%=�findartid(g%,id1$) \ �a%>0� f> �delart(g%,a%):�log("Cancelled "+id1$+" in "+grp$(g%)) p � z' �print("",�msg0("Afail"),"","") � � ��id$="" �� � ���docontrol(g%,a$) ��c$ �c$=�clean(�getpar(a$," ")) ��c$="cancel"�docanc%<>0� �9 a$=�clean(a$):�a$,1)="<"��a$)=">"��deleteid(g%,a$) �� �� � ���doxref �xref$,c%,t% �outg%(0)>0� xref$="Xref: "+hostname$ $ c%=0:� .R �xref$+�grp$(outg%(c%))<200 �xref$=xref$+" "+grp$(outg%(c%))+":"+�outs%(c%) 8 c%+=1 B �outg%(c%)=0�c%=maxsave% L3 t%=long%:long%=0:�addtobuffer(xref$):long%=t% V� `� j t��addustopath(a$) ~�temp%,l%:l%=0 �#�hostname$>""��a$,hostname$)<1� � temp%=long%:long%=� �< �addheadertobuffer("Path: "+hostname$+"!"):long%=temp% � l%=�a$,":") �� �.�addtobuffer(�clean(�a$,l%+1))):discard%=� �� � � ݤgetline �/� if line incomplete, long% is set to TRUE. ��C%,P%,l%,loc%,A$ �)long%=�:P%=0:discard%=0:lastpos%=pos% � first try fast line fetch *�pos%+254<len%�bufptr%+254<inbufsize%� 1 loc%=bufptr%+inbuf%:�getline%,long%,loc%,A$ / P%=�A$-(long%=0):bufptr%+=P%:pos%+=P%:=A$ (� 2/� if that fails, use the slower smarter one < P%=0:� F( C%=bufptr%?inbuf%:bufptr%+=1:P%+=1 P' �P%<250�tmp%?P%=C% �C%=10:long%=� Z4 �pos%>=len% �eof%=� ��bufptr%=inbufsize% �fill d#�C%=10 �C%=13 �eof%<>0:pos%+=P% n7�tmp%?P%<32 �tmp%?P%<>1 �tmp%?P%=13 �tmp%?(P%+1)=13 x=$(tmp%+1) � ���updatepos � �stat$,t% � �len%>0 � �B stat$=�pos%+"/"+�len%+" bytes ("+�(�(100*(pos%/len%)))+"%) " �E t%=�(dstime%-time%)�100:�t%>0�stat$+=�((pos%-bstart%)�t%)+"cps" �2 �print("","",stat$,�msg1("Newnews",�total%)) �= �baric$=defic$��changeic("newsbased")��changeic(defic$) �� �� � ���addtobuffer(A$) �?� this automatically adds continuation lines to the buffer. ;�ptr%>cbufsize% �extend(inbufsize%+bufsize%+defartbuf%) 1$(artbase%+ptr%)=A$:ptr%+=�A$:�long%��addlong artbase%?ptr%=10:ptr%+=1 "� , 6 ��addlong @ȕlong% J A$=�getline T= �ptr%>cbufsize%��extend(inbufsize%+bufsize%+defartbuf%) ^# $(artbase%+ptr%)=A$:ptr%+=�A$ h� r� | ���addheadertobuffer(A$) �;�ptr%>cbufsize% �extend(inbufsize%+bufsize%+defartbuf%) �C$(artbase%+ptr%)=A$:ptr%+=�A$:�long%=0�artbase%?ptr%=10:ptr%+=1 �� �: ���extend(mem%) �� �- ș"Wimp_SlotSize",min_mem%+mem%,-1�new% �3 �(min_mem%+mem%)>new%��message0("Needmem1",1) ��(min_mem%+mem%)<=new% �<bufsize%=new%-min_mem%-inbufsize%:cbufsize%=bufsize%-300 �� � ��checkdisk �f%,F% � &f%=�diskspace(basedir$) 0.�f%<(mindsk%*1024)��message0("Needdisk",1) :�f%>=(mindsk%*1024) D� N Xݤdiskspace(a$) b �F%,f% l7ș"XOS_FSControl",49,basedir$�f%;F%:�(F%�1)<>0�f%=0 v=f% � �ݤclean(A$) �&� strips leading & trailing spaces ��B$:�A$>""��trimstr%,A$,B$ �=B$ � ���openbatch(f$,offset%) �f00%=�openin(f$) �(bufptr%=0:eof%=�:len%=0:pos%=offset% �'�f00%<>0�len%=�#f00%:�#f00%=offset% � �fill �� � !��restartbatch(f$,t%,offset%) /�a$:a$=�msg0("Mail"):�t%>0�a$=�msg0("News") �message1("Dbadhead",a$,0) 4�cf(f00%):line$="":del%=�:�openbatch(f$,offset%) *� 4 > ��fill H�r3%,F% R �f00%<>0� \5 ș"XOS_GBPB",4,f00%,inbuf%,inbufsize%�,,,r3%;F% f �(F%�1)<>0�r3%>0��cf(f00%) p� z bufptr%=0 �� � �ݤaddtosavelist(g$,c%) ��g% �g%=�nametono(�clean(g$),�) �<�g%>0�c%<=maxsave%�outg%(c%)=g%:outs%(c%)=�seq(g%):c%+=1 �=c% � ���defaultsavelist ��g% �Ȏtype%� �)�0:g%=�nametono("Email.postmaster",�) �:g%=�nametono("junk",�) � 1�g%>0�outg%()=0:outg%(0)=g%:outs%(0)=�seq(g%) � $ .��groupsline(list$) 8�ng%:ng%=0 B2�list$,",")=0�ng%=�addtosavelist(list$,ng%):� L#�long%��longgroupsline(list$):� V� `0 ng%=�addtosavelist(�getpar(list$,","),ng%) j �list$="" t� ~ ���longgroupsline(list$) �-�g$,p%,frag$,gfrag$,ng%,end%:ng%=0:end%=0 �� �frag$="" � �long%=0� � end%=� � � �- p%=�list$:�p%-=1:�p%=1��list$,p%,1)="," �= �list$,p%,1)=","�frag$=�list$,p%+1):list$=�list$,p%-1) �� �� �= g$=�getpar(list$,","):�gfrag$>""�g$=gfrag$+g$:gfrag$="" ng%=�addtosavelist(g$,ng%) �g$=""�list$="" gfrag$=frag$ 3�long%�list$=�getline:�addheadertobuffer(list$) ( �end% 2� < F��savelist P �c%,u$,g$ Z �outg%(0)=0��defaultsavelist d!�filt%(type%)>0��checkfilters n �type%=0� x$ g$=grp$(outg%(0)):u$=�gtou(g$) �- �log("New mail for "+u$+" from "+from$) �* �receipt$>""�returnreceipt(receipt$) � �checkforward(g$,u$)=1�� �� �recpos%=lastpos% �"c%=0:ȕoutg%(c%)>0�c%<maxsave% �) �artsave(outg%(c%),outs%(c%)):c%+=1 �� �� � ���checkfilters ��l%,t%:l%=0 �ȕl%<=nfilt%:t%=flt%(l%) C�t%=3�(t%=2�type%=0)�(t%=1�type%=1)��dofilter(l%)<>0�l%=nfilt% l%+=1 � "� , 6ݤdofilter(n%) @�n$,a$,l1%,ok%,last% J ok%=0 T�l1%=0�2:fl_ok%(l1%)=� ^ a$="*"+flc$(n%,l1%)+"*" h Ȏflc%(n%,l1%)� r- �1:�smatch(a$,from$)>0�fl_ok%(l1%)=� |S �2:�smatch(a$,to$)>0��smatch(a$,cc$)>0��smatch(a$,origto$)>0�fl_ok%(l1%)=� �0 �3:�smatch(a$,subject$)>0�fl_ok%(l1%)=� �2 �4:�smatch(a$,newsgroup$)>0�fl_ok%(l1%)=� �0 �5:�smatch(a$,replyto$)>0�fl_ok%(l1%)=� �3 �6:�smatch(a$,precedence$)>0�fl_ok%(l1%)=� �+ �7:�smatch(a$,bf$)>0�fl_ok%(l1%)=� � � �1 �fln%(n%,l1%)>0�fl_ok%(l1%)=(fl_ok%(l1%)=�) ��l1% �ok%=fl_ok%(0) ��flc%(n%,1)>0� �7 �flj%(n%,1)=0�ok%=ok%*fl_ok%(1)�ok%=ok%+fl_ok%(1) � �flc%(n%,2)>0� �9 �flj%(n%,2)=0�ok%=ok%*fl_ok%(2)�ok%=ok%+fl_ok%(2) � � �ok%� &. �print("",�msg1("Fapply",�(n%+1)),"","") 0 a$=�fsubst(fla$(n%)) : Ȏfla%(n%)� D# �1:�nosave:�defaultsavelist N �2:�nosave X2 �3:�a$,1)="+"�n$=�getpar(a$," "):��nosave b+ �log("Filter redirection to "+a$) l4 ok%=0:ȕoutg%(ok%)>0�ok%<maxsave%:ok%+=1:� v ȕa$>"" �( last%=ok%:n$=�getpar(a$," ") �. ok%=�addtosavelist(�clean(n$),ok%) �? �ok%=last%�n$>""��log("Invalid redirection to "+n$) � � � �4:�submit(a$) � � �� �=ok% � �ݤfsubst(a$) � �b$,l% �l%=�a$,"%") �ȕl%>0:b$="" Ȏ�a$,l%+1,1)� 6 �"u":�type%=1�b$="news"�b$=�gtou(grp$(outg%(0))) �"f":b$=from$ �"t":b$=to$ * �"c":b$=cc$ 4 �"r":b$=replyto$ > �"%":b$="%" H� R'a$=�a$,l%-1)+b$+�a$,l%+2):l%+=�b$-1 \l%=�a$,"%",l%) f� p=a$ z ���nosave �M�n%,g%:n%=0:�g%=outg%(n%):�g%>0�outg%(n%)=0:�grpseq%(g%)>0�grpseq%(g%)-=1 �n%+=1:�g%=0�n%>maxsave% �� � ���submit(a$) ��f$,b$,F%,m%,d%:f$=�tmpfile �7ș"XOS_File",10,f$,&FFF,,artbase%,artbase%+ptr%�;F% ��(F%�1)=0� � ȕ��clean(a$),1)="-" � b$=�getpar(a$," ") � Ȏ�b$,2)� � �"-M":m%=1024*��b$,3) �"-K":�nosave �"-D":d%=� & �"-J":�nosave:�defaultsavelist $ � . � 8* �freemem(0)<m%��message0("Fmem1",1) B �freemem(0)>=m%� L. �log("Submitting filter job: "+a$):�hgon VG ș"XWimp_StartTask",a$+" "+f$:�hgoff:�d%��poll(0):F%=�delfile(f$) ` � j �message0("Fmem2",0) t � ~� �� � �ݤcheckforward(g$,u$) ��u%,f$,F%,fto$,ret% �u%=�userno(u$):�u%>0� � f$=�upath(u$)+".vacation" � �objtype(f$)=1� �: �precedence$<>"bulk"�precedence$<>"junk"�from$>""� �+ �filesize(f$)>0��vacation(u$,f$) � � � � � �userf$(u%)>""� 6 fto$=userf$(u%):ȕ�fto$,1)="+":fto$=�fto$,2):� 3 �log("Forwarding mail for "+u$+" to "+fto$) L f$=�tmpfile:ș"XOS_File",10,f$,&FFF,,artbase%,artbase%+ptr% �err%;F% �(F%�1)=0� ( f$=�remail(fto$,f$,u$) 2+ �f$=""��userf$(u%),1)<>"+"�ret%=1 < � F � P� Z,�ret%=0��arrmail$,u$)=0�arrmail$+=","+u$ d =ret% n xݤgtou(g$) ��u$,u%:u$=g$ ��lower(g$),6)="email."� �. u$=�g$,7):u%=�u$,"."):�u%>0�u$=�u$,u%-1) �� �=u$ � ���vacation(u$,f2$) ��f$,d$,s$,F% �1f$=�tmpfile:d$=from$:�replyto$>""�d$=replyto$ �:s$=subject$:�lower(subject$),4)<>"re: "�s$="Re: "+s$ �f1%=�openout(f$) ��f1%>0�d$>""� � f2%=�openin(f2$) �f2%>0� �#f1%,"To: "+d$ ' �#f1%,"From: "+u$+"@"+mailname$ " �#f1%,"Subject: "+s$ ,) �autoheaders(f1%):�fcopy(f2%,f1%) 6+ �cf(f1%):�cf(f2%):�settype(f$,&FFF) @ a$=�sendmail(f$,u$) J � T �cf(f1%) ^ � h� rF%=�delfile(f$) |� � ���returnreceipt(d$) ��f$,a$,s$,F% �;�doreceipt%<>0�precedence$<>"bulk"�precedence$<>"junk"� � f$=�tmpfile �< s$=subject$:�lower(s$),4)<>"re: "�s$>""�s$="Re: "+s$ � f1%=�openout(f$) � �f1%>0� � �#f1%,"To: "+d$ �. �#f1%,"From: mailer-daemon@"+mailname$ �7 �#f1%,"Subject: Acknowledgement of receipt "+s$ � �autoheaders(f1%) �% �#f1%,"Your message "+messid$ 1 �subject$>""��#f1%,"concerning "+subject$ �#f1%,"to "+to$ * �#f1%,"was received at "+hostname$ &" �cf(f1%):�settype(f$,&FFF) 08 a$=�sendmail(f$,"mailer-daemon"):F%=�delfile(f$) : � D� N� X b��autoheaders(out%) l5�#out%,"Message-ID: <"+�id_date+"@"+hostname$+">" v�#out%,"Date: "+�rfc_date ��#out%,"Precedence: bulk" �-�#out%,"X-Mailer: RISC OS Newsbase "+ver$ � �#out%,"" �� � ���artsave(g%,s%) ��g$,s$,outd$,outf$ �7�supersede$>""�approved$>""�deleteid(g%,supersede$) �4�control$>""�approved$>""�docontrol(g%,control$) �=g$=grp$(g%):s$=�seqstr(s%):outf$=�articleop(g%,s$,0,"",0) ��outf$>""� �: �nbupdate(2,g$,s%,from$,subject$):�addtoindex(g%,s%) �6 �expires%>0�igexp%=0��setfileexp(outf$,expires%) !. �print("",g$+"."+s$,"",""):�poll(slice%) !) �total%�30=0�fast%=0��write_recfile ! � ! + �message(�msg2("Dsavefail",�s%,g$),1) !*0 �log("Debatch save failure: "+g$+" #"+�s%) !4� !>� !H !R��write_recfile !\)�recpos%=0��diskspace(basedir$)<200�� !f%f0%=�openout(basedir$+".recover") !p�f0%>0� !z �#f0%,bf$ !� �#f0%,�len% !� �#f0%,�recpos% !�1 �cf(f0%):�settype(basedir$+".recover",&FFF) !� �writegrpdata !�� !�� !� !���del_recfile !�(�F%:F%=�delfile(basedir$+".recover") !�� !� !�ݤcheck_recfile(� p%) !��f$,f2$,l%,m$ "$f0%=�openin(basedir$+".recover") "�f0%>0� " f$=�#f0% "$ l%=��#f0% ". p%=��#f0% "8 �cf(f0%) "B f2$=workdir$+"."+f$ "L/ �objtype(f2$)=1��filesize(f2$)=l%�p%<l%� "V# m$=�msg2("Drecover",f$,�p%) "`( �message(m$,0):�poll(0):�log(m$) "jB l%=�delfile(basedir$+".recover"):�poll(100):�message("",0) "t � "~ f2$="":p%=0 "� � "�� "�=f2$ "� "���setfileexp(f$,d%) "� �F%,e%,l% "�$ș"XOS_File",2,f$,&FFFFFFFF �;F% "�ș"XOS_File",3,f$,,d% �;F% "��(F%�1)� "� ș"XOS_File",9,f$ "� � "�# ș"XOS_File",17,f$�,,l%,e%;F% # 9 �(F%�1)=0��l%<>&FFFFFFFF �e%<>d% �ș"XOS_File",9,f$ # � #� # #(ݤartcopy(g%,s%,source$) #2 �dest$ #< �g%>0� #F2 dest$=�articleop(g%,�seqstr(s%),1,source$,0) #P �dest$>""� #Z/ �nbupdate(2,grp$(g%),s%,from$,subject$) #d �addtoindex(g%,s%) #n � #x� #�=(dest$>"") #� #�-ݤarticleop(g%,dest$,mode%,source$,pack%) #�%� save or move a file to a group. #�8� mode% = 0 to save from mem, 1 to copy, 2 to rename #�#� source$ = file to copy/rename #�1� returns resulting filename or null for fail #�0�p$,outd$,outf$,oldd$,a$,F%,try%,dfail%,err% #�&try%=0:dfail%=0:p$=�path(grp$(g%)) #��g%>0�p$>""� #�8 oldd$=p$+".~x":a$="~x":�pack%=0�a$=�artdir(�dest$) #�. outd$=oldd$+"."+a$:outf$=outd$+"."+dest$ #� � $ F%=0 $ Ȏmode%� $G �0:ș"XOS_File",10,outf$,&FFF,,artbase%,artbase%+ptr%�err%;F% $"7 �1:ș"XOS_FSControl",26,source$,outf$�err%;F% $,G �2:�source$<>outf$�ș"XOS_FSControl",25,source$,outf$�err%;F% $6 � $@ �(F%�1)� $J err%=(!err%�&FF) $T Ȏerr%� $^+ �&B3:�checkdisk:�fulldir(outd$) $h �&D6:�dfail%=0� $r dfail%=1 $|J �ensurenewstruct(oldd$)=0�F%=�ensuredir(outd$):�outd$=oldd$ $� � $� outd$=oldd$ $� � $� :�checkdisk $� � $� try%+=1 $� � $� err%=0 $� � $� �try%>3 �err%=0 $�� $��err%>0�outf$="" $� =outf$ % %ݤensurenewstruct(d$) %9�r3%,F%:ș"XOS_GBPB",11,d$,tmp%,1,0,250,"*"�,,,r3%;F% %&6�(F%�1)=0�r3%>0�t%=tmp%!16:�t%=1�F%=�insertdir(d$) %0=0 %: %Dݤartdir(n%) %N="~x"+�(((n%)�75)�75) %X %b��fulldir(p$) %lC�leaf(p$),2)="~x"�F%=�insertdir(p$)��message1("Fulldir",p$,1) %v� %� %�ݤinsertdir(p$) %��ex%,l$:l$=�leaf(p$) %�#ex%=�rename(p$,workdir$+"."+l$) %��ensuredir(p$) %�1�ex%=0�ex%=�rename(workdir$+"."+l$,p$+"."+l$) %�=(ex%�1) %� %� ݤseq(g%) %��grpseq%(g%)<>0 � %�" grpseq%(g%)=�(grpseq%(g%))+1 %� � %�1 grpseq%(g%)=�findhighest(�path(grp$(g%)),0) &" �grpseq%(g%)=0�grpseq%(g%)=1 &� &=�grpseq%(g%) & &*ݤseqstr(s%) &4=�"00000000"+�(�s%),8) &> &Hݤensuredir(path$) &R�p$,l%,lp$,F%,t%,ok% &\t%=�objtype(path$):ok%=t% &f�t%<2 � &p. path$=�canon(path$):l%=�path$,"$"):ok%=1 &z � &� l%=�path$+".",".",l%+1) &�' p$=�path$,l%-1):t%=�objtype(p$) &� Ȏt%� &�3 �0:�print("",�msg1("Dmakepath",p$),"","") &�3 ș"XOS_File",8,p$�err%;F%:�(F%�1)�ok%=0 &� �1:ok%=0 &� :lp$=p$ &� � &�* �ok%=0:�message1("Dpathfail",p$,1) &� �l%>=�path$�ok%=0 &�� &�=ok% &� 'ݤnametono(g$,add%) '#�low%,high%,mid%,found%,g1$,no% 'g1$=�lower(g$) '$�g1$=lgrp$� '. no%=lgrp% '8 � 'B �g$>""��g$,"*")<1� 'L% low%=1:high%=groups%:found%=0 'V ȕlow%<=high% '`2 mid%=(low%+high%)�2:tg$=�lower(grp$(mid%)) 'j �g1$<tg$� 't high%=mid%-1 '~ � '�7 �g1$>tg$�low%=mid%+1�found%=mid%:low%=high%+1 '� � '� � '� �found%>0� '�+ lgrp$=g1$:lgrp%=found%:no%=found% '� � '� �add%� '�H found%=0:�active(g$)��isachef(g$)=0�found%=�addnewgroup(g$) '�7 �found%>0�lgrp$=g1$:lgrp%=found%:no%=found% '� � '� � '� � ( � ( =no% ( (ݤnotopath(g%) ((=�path(grp$(g%)) (2 (<ݤcheckcase(g$) (F�g1$:g1$=�lower(g$) (P'�g1$,6)="email."�:="Email."+�g$,7) (Z)�g1$,7)="folder."�:="Folder."+�g$,8) (d=g1$ (n (xݤaddnewgroup(g$) (��p$,no%:g$=�checkcase(g$) (�p$=�path(g$):no%=0 (��p$>""�groups%<maxgroup%� (�$ �writeindexbuf:�adddelbuf(0,0) (� �ensuredir(p$)<>0� (�D �nbupdate(0,g$,0,"",""):�print("",�msg1("Gcreate",g$),"","") (�' no%=�addgrptolist(g$,�):�no%>0� (� �log(�msg1("Lcrgrp",g$)) (�- ș"XOS_File",11,p$+".~index",&FFD,0,0 (�! ș"XOS_File",8,p$+".~x",0 (� � (� � (�� )=no% ) )ݤaddgrptolist(g$,cmod%) )"C�l%,l1%,w%,g1$,low%,high%,mid%:g$=�checkcase(g$):g1$=�lower(g$) ),�g1$<�lower(grp$(groups%))� )63l%=1:ȕg1$>�lower(grp$(l%))�l%<=groups%:l%+=1:� )@� )Jl%=groups%+1 )T� )^�l%<maxgroup%� )h �w%=groups%�l%�-1 )rI grp$(w%+1)=grp$(w%):grpf%(w%+1)=grpf%(w%):grpseq%(w%+1)=grpseq%(w%) )| grpexp%(w%+1)=grpexp%(w%) )� grpmod%(w%+1)=grpmod%(w%) )� �w% )�, grp$(l%)=g$:grpf%(l%)=-1:grpseq%(l%)=0 )�! grpexp%(l%)=0:grpmod%(l%)=0 )� �cmod%<>0� )�4 �specialgrp(g$)=0�grpmod%(l%)=�isgrpmod(g$) )�* �specialgrp(g$)>1�grpexp%(l%)=1E6 )� � )� groups%+=1 )�B � now fix up the save list, to allow for group insertions... )� �l1%=0�maxsave% )�$ �outg%(l1%)>l%�outg%(l1%)+=1 )� �l1% * � * l%=0:�toomanyg *� *&=l% *0 *:��toomanyg *D�message0("Gfull",1) *N� *X *b��rmgrplist(g$) *l-�l%,w%:ȕgrp$(l%)<>g$�l%<=groups%:l%+=1:� *v�grp$(l%)=g$� *�$ �writeindexbuf:�adddelbuf(0,0) *� �w%=l%+1�groups% *�1 grp$(w%-1)=grp$(w%):grpf%(w%-1)=grpf%(w%) *�< grpseq%(w%-1)=grpseq%(w%):grpmod%(w%-1)=grpmod%(w%): *�! grpexp%(w%-1)=grpexp%(w%) *� �w% *�/ grp$(groups%)="":groups%-=1:lgrp$="BLANK" *�� *�� *� *�ݤobjtype(f$) *� �F%,t% *�ș"XOS_File",17,f$�t%;F% +�(F%�1)�=-1 +=t% + + ݤfiletype(f$) +*�F% +4"ș"XOS_File",23,f$�,,,,,,t%;F% +>�(F%�1)�=-1 +H=t% +R +\ ��expiregroup(ng%,pto%,exp%) +f(� pto% is a modifier to expiry time. +p �gdir%,n$,cnt%,prot%:prot%=0 +z'pt%=grpexp%(ng%):�pt%=0�pt%=defexp% +��pt%>1E4THENprot%=� +��grp$(ng%)>""� +� pt%+=pto%:�pt%<0�pt%=0 +� gdir$=�path(grp$(ng%)) +�2 �expmail%=0��specialgrp(grp$(ng%))>1�prot%=� +�C �exp%<>0�cnt%=�expiredir(gdir$,ng%,pt%,�,prot%):�stamp(gdir$) +�% �nbupdate(12,grp$(ng%),0,"","") +�� +�� +� +�*ݤexpiredir(p$,g%,pt%,force%,protect%) +��cnt%:cnt%=0 +��protect%� ,/�print(�msg1("Gcomp",grp$(g%))," "," "," ") ,� ,L�print(�msg1("Gexp",grp$(g%)),�msg1("Glast",""),�msg1("Gtime",�pt%)," ") ,$� ,.�objtype(p$)>1� ,8? cnt%=�delfile(p$+".~seq"):cnt%=�ensurenewstruct(p$+".~x") ,B= cancel%=�:cnt%=�expiresubdir(p$,g%,pt%,force%,protect%) ,L7 �adddelbuf(0,0):�print(�msg0("Done")," "," "," ") ,V� ,` �gact("") ,j =cnt% ,t ,~0ݤexpiresubdir(p$,expg%,pt%,force%,protect%) ,�J�dirptr%,f%,f$,now%,t$,t%,r3%,nread%,v%,attr%,ft%,cnt%,move$,testtime% ,�I�deltest%,dirbuf%,dbr%,addr%,floop%,trymove%,canmove%,mustmove%,date% ,��g$,pack%,flen%,nfiles% ,�g$=grp$(expg%) ,��force%� ,� �gact(�msg1("Gdel",g$)) ,� � ,�@ �protect%��gact(�msg1("Gcomp",g$))��gact(�msg1("Gexp",g$)) ,�� ,�mustmove%=(�p$,6)=".~x.~x") ,�-f$=�leaf(p$):canmove%=(¤dir(p$),�f$)=f$) ,�nfiles%=0:dirptr%=0 - Hnow%=�day(�time):testtime%=pt%:dbr%=�claim(dirbuf%,dbsize%,"expire") - � -addr%=dirbuf% -Vș"XOS_GBPB",11,p$,dirbuf%,20,dirptr%,dbsize%,"*"�,,,r3%,dirptr%;F%:nread%=dirptr% -(�r3%>0�(F%�1)=0� -21 nfiles%+=r3%:� number of files in directory -< �floop%=1�r3% -FO t%=addr%!16:attr%=addr%!12:f$=�str(addr%+29):date%=addr%+24:flen%=addr%!8 -PJ v%=�f$:deltest%=0:trymove%=mustmove%:pack%=((attr%�8)�(mustmove%=�)) -Z Ȏt%� -d �1: -n �v%>0� -x( �(addr%?28)<>&FF �force%<>0� -� � standard article -�Q ș"Territory_ConvertDateAndTime",1,date%,tmp%,128,"%CE%YR%MN%DY"�b% -� ft%=��str(b%) -�3 �day(ft%)<=now%-testtime%�deltest%=� -� � -� � has expiry time -� ft%=(addr%!24) -� �ft%<=�time � -� deltest%=� -� � -�D � pack all non-clarinet articles with expiry headers -�' �testtime%=0�trymove%=� -�E �smatch("clari*",g$)=0�mustmove%=0�nfiles%<6�pack%=� . � . � .* �protect%=0�(deltest%�force%)� ."- �force%��setattr(p$+"."+f$,"R") .,& �delfile(p$+"."+f$)=0 � .6D dirptr%-=1:cnt%+=1:�artdeleted(expg%,�f$):trymove%=0 .@ � .J' �objtype(p$+"."+f$)=0� .T3 �artdeleted(expg%,�f$):trymove%=0 .^ � .h# trymove%=canmove% .r � .| � .� � .�3 �compress%��compress(p$+"."+f$,flen%) .� � .�> � don't pack files if >5 files in the directory... .�F � ... just want to avoid scattered almost-single articles. .� �nfiles%>6�pack%=0 .� �trymove%�pack%� .�% �setattr(p$+"."+f$,"R") .�: move$=�articleop(expg%,f$,2,p$+"."+f$,pack%) .�M ș"XOS_File",4,move$,,,,attr%:ș"XOS_File",4,p$+"."+f$,,,,attr% .�" �move$>""�dirptr%-=1 .� � .� � /V �2,3:�f$,2)="~x"�cnt%=cnt%+�expiresubdir(p$+"."+f$,expg%,pt%,force%,protect%) / F%=�delfile(p$+"."+f$) / � /& �cancel%�floop%=r3% /0- �poll(slice%*2):addr%=addr%+(33+�f$)��3 /: �floop% /D� /N�nread%=-1�cancel% /X�release(dbr%) /b =cnt% /l /v��setattr(f$,a$) /�ș"XOS_FSControl",24,f$,a$ /�� /� /���artdeleted(g%,n%) /�4�adddelbuf(g%,n%):�nbupdate(3,grp$(g%),n%,"","") /�&�print("","","",�msg1("Adel",�n%)) /�� /� /���expmiscdir(p$,etime%) /�D�n%,f$,now%,t%,t$,r3%,nread%,a%,d%,ft%,dirbuf%,dbr%,floop%,addr% /�=n%=0:now%=�day(�time):dbr%=�claim(dirbuf%,dbsize%,"dbuf") /�� /�addr%=dirbuf% 0Gș"XOS_GBPB",11,p$,dirbuf%,20,n%,dbsize%,"*"�,,,r3%,n%;F%:nread%=n% 0�r3%>0�(F%�1)=0� 0 �floop%=1�r3% 0 / t%=addr%!16:a%=addr%!12:f$=�str(addr%+29) 0* Ȏt%� 04 �1: 0> �(a%�8)=0� 0HP ș"Territory_ConvertDateAndTime",1,addr%+24,tmp%,128,"%CE%YR%MN%DY"�b% 0RM ft%=��str(b%):�day(ft%)<=now%-etime%��delfile(p$+"."+f$)=0n%=n%-1 0\ � 0fA �2,3:�expmiscdir(p$+"."+f$,etime%):F%=�delfile(p$+"."+f$) 0p � 0z- �poll(slice%*2):addr%=addr%+(33+�f$)��3 0� �floop% 0�� 0��nread%=-1 0��release(dbr%) 0�� 0� 0� ݤtime 0��b% 0�?tmp%=3:ș"OS_Word",14,tmp% 0�Jș"Territory_ConvertDateAndTime",1,tmp%,tmp%+128,128,"%CE%YR%MN%DY"�b% 0�=��str(b%) 0� 0�ݤfulltime 1�b% 1?tmp%=3:ș"OS_Word",14,tmp% 1Pș"Territory_ConvertDateAndTime",1,tmp%,tmp%+128,128,"%CE%YR%MN%DY%24%MI"�b% 1$ =�str(b%) 1. 18ݤfiletime(f$) 1B�l%,e%,o%,r% 1L ș"XOS_File",23,f$�o%,,l%,e% 1V �o%>0� 1` !tmp%=e%:tmp%!4=l% 1jL ș"Territory_ConvertDateAndTime",1,tmp%,tmp%+128,128,"%CE%YR%MN%DY"�b% 1t r%=��str(b%) 1~� 1�=r% 1� 1� ݤday(t%) 1�8� convert date to no.of days since start of century. 1��day%,month%,year%,m%,d% 1�day%=t%�100 1�month%=(t%�100)�100 1�year%=(t%�10000) 1�d%=365*year%+day% 1� Ȏmonth%� 1��1:m%=0 1��2:m%=31 2 �3:m%=59 2 �4:m%=90 2 �5:m%=120 2 �6:m%=151 2( �7:m%=180 22 �8:m%=211 2< �9:m%=242 2F�10:m%=272 2P�11:m%=303 2Z�12:m%=333 2d� 2n =d%+m% 2x 2� ��log(A$) 2��l% 2� �rw%� 2� �A$>""�logptr%<20� 2�D log$(logptr%)=�ctime("# %YR%MN%DY %24%MI%SE ")+A$:logptr%+=1 2� � 2� �logptr%>0� 2�& f1%=�openup(basedir$+".log") 2� �f1%<>0� 2� �#f1%=�#f1% 2� �l%=0�logptr% 2�) �log$(l%)>""��#f1%,log$(l%) 2� � 3G log$()="":logptr%=0:�cf(f1%):�settype(basedir$+".log",&FFF) 3 � 3 � 3" � 3,� 36� 3@ 3J��settype(f$,t%) 3Tș"XOS_File",18,f$,t% 3^� 3h 3r��stamp(f$) 3|ș"XOS_File",9,f$ 3�� 3� 3� ݤduptask 3��found%,r0%,b%,a$:r0%=0 3�� 3�;tmp%!4=0:ș"TaskManager_EnumerateTasks",r0%,tmp%,20�r0% 3��r0%>=0�tmp%!4>0� 3�7 b%=tmp%!4:a$="":ȕ?b%>31��a$<255:a$+=�?b%:b%+=1:� 3� �a$,8)=myname$�found%=1 3�� 3��r0%<0�found%<>0 3�=found% 3� 4 ��init 4myname$="Newsbase" 48ș"OS_Byte",129,0,&FF �,osver%:dynarea%=(osver%>&A4) 4&�environment 400msgdesc%=0:defic$="":credit$="":transport%=0 4:5groups%=0:initgroups%=0:dragref%=0:autodebatch%=0 4D*thisartlen%=0:nextartpos%=0:logfile%=0 4N>postfetchready%=0:startupok%=0:indebatch%=0:blockexpire%=� 4Xnull$=�200," ") 4b<maxactive%=0:cancel%=0:nclient%=0:sleep%=0:forcebatch%=0 4l2inbufsize%=16*1024:defartbuf%=8192:dbsize%=512 4v� tmp% 256 4�#ibufsize%=8000:delbufsize%=2048 4�� ibuf% ibufsize% 4�� delbuf% delbufsize% 4�maxsave%=10:maxactive%=100 4�5� outp$(maxsave%),outs%(maxsave%),outg%(maxsave%) 4�� log$(20),outdir$(1) 4�%delbufptr%=0:delbufg%=0:logptr%=0 4�ibufptr%=0:ibufg%=0 4�type%=0:line$="":bf$="" 4�,len%=0:pos%=0:bstart%=0:recpos%=0:bf$="" 4�#total%=0:pause%=�:checkfiles%=1 4�T%=0::T1%=0:T2%=-1:open%=� 4�4f00%=0:f0%=0:f1%=0:f2%=0:f3%=0:f4%=0:f5%=0:f6%=0 5lgrp%=0:lgrp$="BLANK" 5!nopoll%=0:ngtime%=0:nglast%=0 5findg%=0:findp$="":long%=0 5 busy$="":sep$="":seplen%=0 5*slice%=-15 54nbcom%=&FEED10 5>nbrep%=&FEED11 5Hnbupd%=&FEED12 5R srflag%=0 5\-arrart%=0:arrmail$="":grpq%=0:ynchoice%=0 5f)artdate%=0:modgw$="moderators.uu.net" 5p&� now all config file variables... 5zDlogfile%=1:keepoutg%=1:fast%=1:alert%=1:alertbeep%=0:userctrl%=0 5�<alertnews%=1:defclient$="":autoexp%=1:defexp%=7:delok%=0 5�Alisttype%=0:remotehost$="":expmail%=0:autodebatch%=1:igexp%=0 5�Gkeepb%=1:docanc%=1:killc%=1:doreceipt%=1:cver%=0:ngexp%=7:thread%=1 5�7modgw$="":mngw$="":mngw%=0:userlist$="":initconf%=0 5�Acompress%=0:complimit%=2048:exptime%=0:expany%=0:mindsk%=1024 5�2hostname$="":org$="":mailname$="":timezone$="" 5�� 5� 5���environment 5� �p$,A$ 5�rw%=�:� read-write access 5�ș"OS_GetEnv"�A$ 5�� 6 p$=�getpar(A$," ") 6 Ȏp$� 63 �"-ro":rw%=�:� read-only access to !NewsDir 6$ � 6. �A$="" 68� 6B 6L��startmemmgr 6Vbase%=� 6`'ș "Wimp_SlotSize",-1,-1 � min_mem% 6j� 6t 6~ݤcheckslot 6��m%,f%,minfre% 6�minfre%=&4000 6�P� if more than 2Mbytes free, insist on 32k space in wimpslot (otherwise 16k) 6�;ș"Wimp_SlotSize",-1,-1�,,f%:�f%>&200000 �minfre%=&8000 6��(�-�)<minfre% � 6�. m%=minfre%:�ș"Wimp_SlotSize",-1,-1�,,f% 6�& �f%<m% �message0("Needmem1",1) 6� �f%>=m% 6� � 6� m%=0 6�� 6�=m% 7 7 ��startwimp 7'� taskid%4,wmsgs%30:$taskid%="TASK" 7>!wmsgs%=3:wmsgs%!4=&400C2:wmsgs%!8=&400C3:wmsgs%!12=nbcom% 7(;wmsgs%!16=2:wmsgs%!20=&400C9:wmsgs%!24=&502:wmsgs%!28=0 72Eș "Wimp_Initialise",310,!taskid%,myname$,wmsgs% � version%,task% 7<��errorbox(�) 7FNș"Territory_Exists",1�;F%:�(F%�4)=0��0,"UK Territory module not present!" 7P�q% &200,ibar% &100 7Z:menudata%=0:indmenubuf%=0:menudataref%=0:indmenuref%=0 7d%ș"OS_ReadModeVariable",-1,5�,,A% 7n=�A%<2��mergesprites("sprites22")��mergesprites("sprites") 7x0ș"Wimp_OpenTemplate",,�resfile("Templates") 7�status%=�loadtemp("status") 7�msgw%=�loadtemp("message") 7�!gsetup%=�loadtemp("gensetup") 7�gwin%=�loadtemp("groups") 7�yesno%=�loadtemp("confirm") 7�info%=�loadtemp("info") 7�arrive%=�loadtemp("arrive") 7�uwin%=�loadtemp("users") 7�sitewin%=�loadtemp("site") 7�fwin%=�loadtemp("filters") 7� savend%=�loadtemp("newsdir") 7�msetup%=�loadtemp("setup") 7�"trwin%=�loadtemp("transports") 8!ngwin%=�loadtemp("newgroups") 8ș"Wimp_CloseTemplate" 8�settime 8"'lastpoll%=0:lastupd%=0:stime%=time% 8,0cron0%=0:cron1%=0:cron2%=0:cron3%=0:cron4%=0 86Qconfopen%=0:statopen%=0:msgopen%=0:ndopen%=0:ngopen%=0:arropen%=0:infoopen%=0 8@+baric$="newsbase1":baricon%=�ic(baric$) 8J4ver$="0.53":rev$="c":ver%=100*�ver$:groupver%=47 8T@�updateiconstring(info%,4,ver$+rev$+" (23-Feb-95)"):�credits 8^6�print(�msg1("Sinfo1",ver$)," "," "," "):�gact("") 8h� 8r 8|ݤloadtemp(A$) 8��b%,i%,s%,scr%,icon%,h% 8�0ș"Wimp_LoadTemplate",,-1,0,0,-1,A$,0�,b%,i% 8�+s%=�claim(scr%,b%,"template"):�icon% i% 8�6ș"Wimp_LoadTemplate",,scr%,icon%,icon%+i%,-1,A$,0 8�Ascr%!64=sprites%:ș"Wimp_CreateWindow",,scr% �h%:�release(s%) 8�=h% 8� 8���mergesprites(A$) 8��s%,f%,n%:A$=resdir$+"."+A$ 8��objtype(A$)=1� 8�s%=�filesize(A$)+20 8�*�sprites% s%:!sprites%=s%:sprites%!8=0 8�"ș "OS_SpriteOp",&109,sprites% 9.ș"XOS_SpriteOp",&108,sprites%�,,s%,n%,,f% 90ș"XOS_SpriteOp",&10B+(n%=0),sprites%,A$�;F% 9� 9&�1,A$+" not found" 90� 9:� 9D 9Nݤic(A$) 9X:ș"OS_SpriteOp",&100+40,sprites%,A$�,,,w%,h%:!ibar%=-1 9bAibar%!4=0:ibar%!8=0:ibar%!12=w%*2:ibar%!16=100:ibar%!20=&3102 9l1�ibarname%12:$ibarname%=A$:ibar%!24=ibarname% 9v!ibar%!28=sprites%:ibar%!32=11 9�$ș "Wimp_CreateIcon",0,ibar%�ic% 9�=ic% 9� 9���changeic(new$) 9� �w%,F% 9��new$<>baric$� 9�4 ș "XOS_SpriteOp",&118,sprites%,new$�,,src%;F% 9� �(F%�1)=0� 9�; $ibarname%=new$:!q%=-1:q%!4=baricon%:q%!8=0:q%!12=0 9�! ș"Wimp_SetIconState",,q% 9� � 9� baric$=new$ 9�� :� : :��poll(idle%) : C�pol_ret%:� idle%>0 is pollidle time, <0 is time between polls. :*�settime:�nopoll%�� :4$�idle%>=0�lastpoll%-time%<idle%� :> lastpoll%=time% :H � :R8 ș "Wimp_PollIdle",6194,q%,time%+idle% �pol_ret% :\ Ȏ pol_ret% � :f � 0:�startupok%<>0��cron :pE � 2:�open_window(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,q%!28) :z � 3:�closew(!q%) :�$ � 6:�click(q%!8,q%!12,q%!16) :� � 7:�drag :� � 8:�keypress(!q%,q%!24) :�' � 9:�getpointer:�menuselect(q%) :� � 17,18:�receive(q%) :� � :� �pol_ret%=0 :�� :�� :� :� ��settime :�"ș"OS_ReadMonotonicTime"�time% :�� ; ; ��credits ;'�credit$=""�credit$=�msg0("Credit") ;$8�updateiconstring(info%,9,��getpar(credit$,";"),28)) ;.� ;8 ;B ��drag ;L�getpointer ;VJ!q%=52+8:q%!12=0:q%!16=1:q%!20=handle%:q%!24=icon%:q%!28=mx%:q%!32=my% ;`.q%!36=0:q%!40=&1000:$(q%+44)="!NewsDir"+�0 ;j:ș"Wimp_SendMessage",17,q%,handle%,icon%:dragref%=q%!8 ;t� ;~ ;���polloff:nopoll%=�:� ;���pollon:nopoll%=0:� ;� ;���keypress(h%,k%) ;��c% ;��k%=13� ;� Ȏh%� ;�" �gsetup%,sitewin%,gwin%:c%=� ;�) �fwin%:�setfilt(cfilt%):�closew(h%) ;�, �uwin%:�getuserinfo:�saveuserinfo:c%=� ;� :ș"Wimp_ProcessKey",k% ;�� <