[BACK]Return to oxcommon.m2 CVS log [TXT][DIR] Up to [local] / OpenXM / src / Macaulay2 / m2

Diff for /OpenXM/src/Macaulay2/m2/oxcommon.m2 between version 1.1 and 1.2

version 1.1, 2000/09/21 09:20:53 version 1.2, 2006/12/07 00:07:06
Line 1 
Line 1 
 ID = "$OpenXM$"  ID = "$OpenXM: OpenXM/src/Macaulay2/m2/oxcommon.m2,v 1.1 2000/09/21 09:20:53 takayama Exp $"
 --- class INT32  --- class INT32
 INT32 = new SelfInitializingType of BasicList  INT32 = new SelfInitializingType of BasicList
 new INT32 from ZZ := (a,n) -> {n}  new INT32 from ZZ := (a,n) -> {n}
Line 142  makeOXINPUT = (F) -> (
Line 142  makeOXINPUT = (F) -> (
   
 readMoreData = (OX) -> (  readMoreData = (OX) -> (
      -- OX is an OXINPUT       -- OX is an OXINPUT
        --stderr <<"before read: "<<OX.loc << ascii OX.buffer <<endl << flush;
        --OX.buffer = copy(OX.buffer); --copy it because "read" distroy it.
        OX.buffer = ascii(ascii(OX.buffer)); --copy by a dirty trick. BUG
      newstring := read (OX.F);       newstring := read (OX.F);
      stderr << "Read " << #newstring << " bytes: " << ascii newstring       stderr << "Read " << #newstring << " bytes: " << ascii newstring
             << endl << flush;              << endl << flush;
      left := #OX.buffer - OX.loc;       left := #OX.buffer - OX.loc;
        --stderr <<"before: "<<OX.loc << ascii OX.buffer <<endl << flush;
      if left > 0 then       if left > 0 then
         OX.buffer = substring(OX.buffer, OX.loc, left)          OX.buffer = substring(OX.buffer, OX.loc, left)
                     | newstring                      | newstring
      else       else
         OX.buffer = newstring;          OX.buffer = newstring;
        --stderr <<"after: "<<ascii OX.buffer <<endl << flush;
      OX.loc = 0;       OX.loc = 0;
      )       )
   
 get32bits = (OX) -> (  get32bits = (OX) -> (
      -- OX is an OXINPUT       -- OX is an OXINPUT
      if #OX.buffer < OX.loc + 4       while  #OX.buffer < OX.loc + 4 do (
        then readMoreData OX;         readMoreData OX; );
      result := fromNetwork(substring(OX.buffer, OX.loc, 4));       result := fromNetwork(substring(OX.buffer, OX.loc, 4));
      OX.loc = OX.loc + 4;       OX.loc = OX.loc + 4;
        --debug: stderr << "get32bits" << ascii OX.buffer <<endl <<flush;
      result       result
      )       )
   
 getBytes = (OX,n) -> (  getBytes = (OX,n) -> (
      -- OX is an OXINPUT       -- OX is an OXINPUT
      if #OX.buffer < OX.loc + n       while #OX.buffer < OX.loc + n  do (
        then readMoreData OX;         readMoreData OX; );
      result := substring(OX.buffer, OX.loc, n);       result := substring(OX.buffer, OX.loc, n);
      OX.loc = OX.loc + n;       OX.loc = OX.loc + n;
      result)       result)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>