/* * Scol Voyager * * Author : The Scol Team : http://www.scolring.org/ * * This file is a part of the Scol Voyager * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA, or go to * http://www.gnu.org/copyleft/lesser.txt * * For others informations, please contact us from http://www.scolring.org/ * */ /* * Update 2014 12, 16 : S.BISARO ($IRI) : new tree files * */ var index=0;; var incr=1024;; var typzip=1;; typeof lstp=[[S S S] r1];; var lastp="";; var state=0;; var indp=0;; var incrp=1024;; var flagreq=0;; var dead=0;; defcom need = need S I I;; defcom down = down S;; defcom enddown = enddown;; defcom endoflist = endlist;; defcom packlst=packlst S;; defcom require=require S;; defcom badversion=badversion;; defcom addscript = addscript S;; defcom endscript = endscript;; fun fillpack(l)= if l==nil then 0 else let l->[a n] in let a->[name _ _] in let _getpack _checkpack name -> s in (mutate a<-[_ if typzip==1 then mzip s else zip s _getlongname s "" "#"]; fillpack n);; fun _connected()= let packsusers->[[_ a _] _] in if (strlen a)==0 then fillpack packsusers else nil; set lstp=packsusers;; fun buildpack(l)= if l==nil then nil else let l->[[s cont sign] n] in (s::(itoa strlen cont)::"1"::nil)::buildpack n;; fun __getpack()= if flagreq then nil else _on _channel packlst [strbuild buildpack packsusers];; fun buildreq(l)= if l==nil then nil else let l->[[s cont sign] n] in (s::(itoa strlen cont)::sign::nil)::buildreq n;; fun __version(i)= set flagreq=1; if i [a nxt] in let a -> [s cont sign] in (set lstp=nxt; set lastp=cont; _on _channel need [s strlen cont typzip]);; fun __next()= let substr scriptuser index incr -> s in if (strlen s)==0 then (_on _channel endscript []; _setenv _channel _removepkg _envchannel _channel; _script scriptserver) else (set index=index+incr; _on _channel addscript [s]);; fun __skip()= _setenv _channel _removepkg _envchannel _channel; _script scriptserver;; fun __downl()= if state==0 then (set state=1; set indp=0) else 0; let substr lastp indp incrp -> s in if s==nil then nil else if (strlen s)==0 then (_on _channel enddown []; set lastp=nil; set state=0) else (set indp=indp+incrp; _on _channel down [s]);;