; -*- Midas -*- title H3GET - Get newer host tables from other machines a=:1 b=:2 c=:3 d=:4 e=:5 t=:6 tt=:7 x=:10 y=:11 z=:12 p=:17 ch==:0,,-1 chdsko==:1 chin==:2 nchin==:20-chin %fr==:0,,525252 %fl==:1,,525252 call=:pushj p, return=:popj p, save==:push p, rest==:pop p, flose=:.lose %lsfil slose=:.lose %lssys pause=:.break 16,100000 quit=:call . $quit: skipe debug pause .logout 1, define syscall name,args .call [setz ? .1stwd sixbit /name/ ? args(400000)] termin .vector pdl(lpdl==:50.) usrvar: sixbit /OPTION/ ? tlo %opint\%opopc sixbit /MASK/ ? move [%pipdl\%pirlt\%piioc] lusrvar==:.-usrvar go: move p,[-lpdl,,pdl-1] move t,[-lusrvar,,usrvar] syscall usrvar,[movei %jself ? move t] slose move t,[%rlfls\%rlset,,realt] .realt t, .vector its(lits==:nchin) .scalar nits move t,[-lits,,its] move tt,[sixbit /ITSNMS/] .getsys t, jrst [ jfcl ? .lose ] ; No P'ing movei t,-its(t) movnm t,nits syscall sstatu,[repeat 6,[ ? movem a]] slose move b,a hrlz t,nits go1: exch a,its(t) came a,b aobjn t,go1 skipl t .lose hrlz a,nits ; A: aobjn setoi c, ; C: best so far or -1 .scalar date,version,name2 loop: syscall open,[movsi %donrf\.bii ? movei chin(a) ? move its(a) move h3fn1 ? [sixbit />/] ? move h3dir] jrst next syscall filblk,[movei chin(a) movem z ; name1 movem z ; Z: name2 movem x ; random movem x] ; X: date jrst nextcl move tt,z setzi y, ; Y: version # vloop: setzi t, lshc t,6 cail t,'0 caile t,'9 jrst nextcl ; not a number... imuli y,10. addi y,-'0(t) jumpn tt,vloop camle x,date camg y,version jumpge c,nextcl jumpl c,newb syscall close,[movei chin(c)] slose newb: movei c,(a) movem x,date movem y,version movem z,name2 jrst next nextcl: syscall close,[movei chin(a)] slose next: aobjn a,loop jumple c,done ; Finished if no machine has a better one .core bufcor jrst done ; Oh well... syscall open,[movsi .bio ? movei chdsko ? move its+0 [sixbit /_H3GET/] ? [sixbit /OUTPUT/] ? move h3dir] jrst done ; Oh well... syscall sfdate,[movei chdsko ? move date] jrst abort copylp: move a,[-lbuffer,,buffer] syscall iot,[movei chin(c) ? move a] jrst abort hrloi b,-1-buffer(a) eqvi b,buffer syscall iot,[movei chdsko ? move b] jrst abort jumpge a,copylp syscall renmwo,[movei chdsko ? move h3fn1 ? move name2] jrst abort syscall rauth,[movei chin(c) ? movem t] jrst done ; Don't need it really... syscall sauth,[movei chdsko ? move t] jrst done ; Good enough... jrst done abort: syscall delewo,[movei chdsko] slose done: quit tsint: loc 42 -ltsint,,tsint loc tsint 400000,,p %pirlt ? 0 ? %pirlt ? 0 ? rltint %piioc ? 0 ? %piioc ? 0 ? abort ltsint==:.-tsint dismis: setz ? sixbit /DISMIS/ ? movsi 400000 ? setz p rltint: .call dismis ; Just to PCLSR MLDEV... slose cnst0: constants h3dir: sixbit /SYSBIN/ h3fn1: sixbit /HOSTS3/ variables debug: 0 realt: 10.*60. ; 10. seconds 0 ? 0 ? 0 ; for .REALT patch:: pat: block 100. epatch: -1 ; Make memory exist, end of patch area ffaddr: ffpage==:_-12 nbufpg==:25. ; copy 25 blocks at a time buffer=:ffpage_12 lbuffer==:nbufpg_12 bufcor==:ffpage+nbufpg ; .CORE BUFCOR to allocate the buffer end go