home *** CD-ROM | disk | FTP | other *** search
/ Treasure Hunt 2001 PRESSKIT / TH2001_PRESSKIT.iso / demo / scol_install / Partition / locked / lib / loc.pkg < prev    next >
Encoding:
Text File  |  2000-11-09  |  1.0 KB  |  1 lines

  1.  var defaultlang="english";; typeof tabloc = tab [[S S] r1];;  fun hachage(ref)= let ((nth_char ref 0)+(nth_char ref 1))&255 -> x in if x==nil then 0 else x;; fun rebuild(l)= if l==nil then nil else let l->[a b] in if b==nil then a::nil else a::" "::rebuild b;; fun loadloc2(l)= if l==nil then 0 else let l->[[a b] n] in (if (nth_char a 0)!='# then let hachage a -> i in set tabloc.i=[a strcatn rebuild b]::tabloc.i else nil; loadloc2 n);; fun loadloc(file,lang)= set tabloc=mktab 256 nil; let strextr _getpack _checkpack strcatn file::"."::lang::".lang"::nil -> l in if l==nil then loadloc2 strextr _getpack _checkpack strcatn file::"."::defaultlang::".lang"::nil else loadloc2 l;; fun findloc(l,s)= if l==nil then "*" else let l->[[a b] n] in if !strcmp a s then b else findloc n s;;  fun strloc(s,l)= if l==nil then s else let (strfind "##" s 0) -> i in if i==nil then s else strcat substr s 0 i strcat hd l strloc substr s i+2 strlen s tl l;;  fun loc(s)= let hachage s -> i in findloc tabloc.i s;;  fun startloc(file)=loadloc file _getress "DefaultLanguage";;