[Aimmath-commit] AIM/WEB-INF/maple SafeParse.mpl,1.9,1.9.2.1
Brought to you by:
gustav_delius,
npstrick
|
From: Neil S. <nps...@us...> - 2004-10-07 10:59:46
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14057/WEB-INF/maple Modified Files: Tag: aim-xml SafeParse.mpl Log Message: added `aim/SafeParse/WordsToString2` to fix endian problem Index: SafeParse.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/SafeParse.mpl,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** SafeParse.mpl 21 May 2004 14:12:27 -0000 1.9 --- SafeParse.mpl 7 Oct 2004 10:59:34 -0000 1.9.2.1 *************** *** 740,743 **** --- 740,775 ---- + `Package/Assign`( + `aim/SafeParse/WordsToString2`::string, + "Convert a list of 4-byte integers to a string. The bytes are + interpreted as ASCII characters, with less-significant bytes + referring to later characters. This is the internal coding + used by Maple for names on some systems.", + proc(d::list(integer)) + + local nam,blk,i,w,c; + + nam := NULL; + for i from 1 to nops(d) do + blk = NULL; + w := d[i]; + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + w := iquo(w,256); + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + w := iquo(w,256); + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + w := iquo(w,256); + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + nam := nam,blk; + od; + RETURN(convert([nam],'bytes')); + end + ): + + ###################################################################### |