summaryrefslogtreecommitdiff
path: root/app/flint/0.4/src/offline.1
blob: 0e3e097a2ab9ae8b458555355125d9b404e16bd5 (plain)
1
2
3
4
5
PACKETofflinemanagerDEFINESbegin,deferredend,owntaskpassword,continuedfrom,continue,partnertask:LETb0=0,c0=1,d0=2,e0=5,f0=6,g0=4,h0=9,i0=100,j0=199;LETk0="Taskname ungültig",l0="Vater antwortet nicht",m0="Zieltask kann nicht direkt angekoppelt werden",n0="Passwort:",o0="Falsches Passwort",p0="Ankoppeln nur für Partnertasks",q0="Nur Partner können angekoppelt werden";BOOL VARr0:=FALSE,s0:=FALSE;TEXT VARt0:="";DATASPACE VARu0:=nilspace;INT VARv0,w0,x0,y0,z0;BOUND TEXT VARa1;BOUND STRUCT(TEXTb1,c1,TASKtask,PROCAd1)VARe1;TASK VARf1,g1:=niltask;ROW4TASK VARh1;INITFLAG VARi1;PROCbegin(TEXT CONSTj1,k1):enablestop;l1;IFj1="-"THENerrorstop(k0)END IF;m1;IFv0=h0THENe1:=u0;n1;call(task(k1),g0,u0,v0)END IF;IFv0=b0THEN TASK CONSTo1:=task(j1);forget(u0);p1ELIFv0=d0THENa1:=u0;disablestop;errorstop(CONCR(a1));forget(u0)ELSEforget(u0)END IF.m1:INT VARq1;forget(u0);u0:=nilspace;e1:=u0;CONCR(e1).b1:=j1;CONCR(e1).c1:="";FORq1FROM1UPTO5REPpingpong(task(k1),g0,u0,v0);IFv0=-2THENpause(5)END IF UNTILv0<>-2END 
REP;IFv0=-2THENerrorstop(l0)END IF.n1:dialog(n0);getsecretline(CONCR(e1).c1);covertracks.p1:WHILEstatus(o1)<>2REPpause(10)END REP.END PROCbegin;PROCdeferredend:s0:=TRUE END PROCdeferredend;PROCowntaskpassword(TEXT CONSTword):t0:=length(t0)*" ";t0:=word;covertracksEND PROCowntaskpassword;TASK PROCcontinuedfrom:g1END PROCcontinuedfrom;PROCr1(TASK CONSTs1,PROC(DATASPACE VAR,INT CONST,INT CONST,TASK CONST)t1):enablestop;IFisniltask(s1)THENbreak;disablestopELSEu1END IF;v1;WHILE NOTonlineREPw1;x1;y1END REP;z1.u1:INT CONSTa2:=channel;b2;break(quiet);c2.b2:INT VARq1;forget(u0);u0:=nilspace;FORq1FROM1UPTO5REPpingpong(s1,j0,u0,v0);IFv0=-2THENpause(5)END IF UNTILv0<>-2END REP;d2;IFv0=f0THENe2ELIFv0=b0THENf2ELSEerrorstop(m0)END IF.d2:forget(u0);u0:=nilspace;a1:=u0.e2:dialog(n0);getsecretline(CONCR(a1));covertracks.f2:CONCR(a1):="".c2:FORq1FROM1UPTO5REPpingpong(s1,i0+a2,u0,v0);IFv0=-2THENpause(5)END IF UNTILv0<>-2END REP;disablestop;forget(u0);IFv0<>b0THENcontinue(a2)END IF.v1:IFs0OR(r0CAND NOT
exists(h1(1)))THENend(myself)END IF.w1:TEXT VARg2;IFiserrorTHENg2:=errormessage;clearerrorELSEg2:=""END IF.x1:setautonom;commanddialogue(FALSE);INT VARh2:=heapsize;g1:=niltask.y1:DATASPACE VARi2:=nilspace;REPwait(i2,w0,f1);IFw0<>e0THENj2;k2ELIFf1=g1THENl2;t1(i2,w0,z0,f1)ELSEm2END IF;n2;o2END REP.j2:z0:=1;y0:=w0;g1:=f1.l2:z0INCR1;w0:=y0.m2:forget(i2);i2:=nilspace;send(f1,c0,i2).n2:IFiserrorTHENforget(i2);i2:=nilspace;a1:=i2;CONCR(a1):=errormessage;clearerror;send(f1,d0,i2)END IF.o2:IFheapsize>h2+8THENcollectheapgarbage;h2:=heapsizeEND IF.k2:IFw0=j0THENp2ELIFw0>i0ANDw0<i0+16THENq2ELSEt1(i2,w0,z0,f1)END IF.p2:IFr2THENsend(f1,f0,i2)ELSEsend(f1,b0,i2)END IF.r2:t0<>"".q2:s2;t2;call(supervisor,w0,i2,v0);IF NOT(f1=supervisor)THENsend(f1,v0,i2)END IF;IFv0=b0THENforget(i2);LEAVEy1END IF.s2:IFr0CAND NOTu2(f1)ORx0>0CANDw0-i0<>x0THENerrorstop(p0);LEAVEq2END IF.t2:IF NOT(f1=supervisor)THENa1:=i2;IF CONCR(a1)<>t0THENerrorstop(o0);LEAVEq2END IF END IF.z1:IFg2<>""THENerrorstop(g2)END IF;commanddialogue
(TRUE).END PROCr1;PROCcontinue(TASK CONSTs1,PROC(DATASPACE VAR,INT CONST,INT CONST,TASK CONST)t1):enablestop;l1;x0:=0;IFs1=myselfTHEN ELIFr0THEN IF NOTu2(s1)THENerrorstop(q0)END IF ELIFu2(s1)THENx0:=channelEND IF;r1(s1,PROC(DATASPACE VAR,INT CONST,INT CONST,TASK CONST)t1)END PROCcontinue;BOOL PROCu2(TASK CONSTs1):NOTisniltask(s1)CAND(s1=h1(1)ORs1=h1(2)ORs1=h1(3)ORs1=h1(4))END PROCu2;TASK PROCpartnertask(INT CONSTindex):l1;h1(index)END PROCpartnertask;PROCpartnertask(INT CONSTindex,TASK CONSTs1):l1;h1(index):=s1;IFindex=1CAND NOT(s1=myself)THENr0:=TRUE END IF END PROCpartnertask;PROCl1:IF NOTinitialized(i1)THENv2END IF.v2:h1(1):=niltask;h1(2):=niltask;h1(3):=niltask;h1(4):=niltask.END PROCl1;END PACKETofflinemanager;