DataMuseum.dk

Presents historical artifacts from the history of:

Bogika Butler

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Bogika Butler

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦7a5b4d9d0⟧ TextFile

    Length: 5632 (0x1600)
    Types: TextFile
    Names: »VERSACUT.SA«

Derivation

└─⟦909f4eb2b⟧ Bits:30009789/_.ft.Ibm2.50006622.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »VERSACUT.SA« 
└─⟦e12db5ad4⟧ Bits:30009789/_.ft.Ibm2.50007357.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »VERSACUT.SA« 

TextFile

 
æ*****************************************************************
                        Copyright 1984 by
                        NCR Corporation
                        Dayton, Ohio  U.S.A.
                        All Rights Reserved
******************************************************************
                        EOS Software produced by:
                        NCR Systems Engineering - Copenhagen
                        Copenhagen
                        DENMARK
*****************************************************************å
 
 
OBJECT PROGRAM VersaCut;
æ$H=0  no heap spaceå
 
CONST
  ProcId = 'VersaCut  vers.00.02  83-11-25';
 
 
æ
               V E R S A  -  C U T
 
 
CHANGES:
   vers. 00.00  83-11-14,  EAR   first version
   vers. 00.01  83-11-15,  EAR   assign & print error message
   vers. 00.02  83-11-25,  EAR   print error message
 
This EOS program reads the last 4 bytes of a VERSAdos created
contiguous file and inserts this value as DataSize in the file,
thus making it an EOS VersaFs file
 
å
 
æ$L-å
æ$F=FAMILY.UNIV.IDå
æ$F=FAMILY.KNEL.IDå
æ$F=FAMILY.IOSYS.IDå
æ$F=FAMILY.ALLOC.IDå
æ$F=FAMILY.SCHED.IDå
æ$F=FAMILY.OBJDIR.IDå
æ$F=FAMILY.APPLI.IDå
 
æ$L+å
æ$Eå
 
CONST
  ResultId = 'VERSACUT sNo OrgSy Au Ar OrgNo Fa Ma';
  OrgSys   = 7010;
  versaPageSize = 256;
 
æ$F=PASINCLU.CHKPROCS.SAå
 
æ$L-å
æ$F=PASINCLU.TERMTOOL.SAå
æ$L+å
 
 
æ*****   Local Pointers   *****å
 
TYPE
 
  cutLocals = RECORD
      code     : ^^;
      stubRef  : ^^ObjDir;
      stdIn    : faoRefType;
      stdOut   : faoRefType;
      stdError : faoRefType;
    END;  æcutLocalså
 
æ$Eå
 
PROGRAM iVersaCut OBJECT Application WITH cutLocals;
 
ENTRY Run  æ fileEnv, jobSys ; progId  Æ, text...Å å
  WITH RECORD
         t : ^^;
         fs  : ioSysRefType;
         fao : faoRefType;
       END;
 
  TYPE
    choice = (x,y);
 
    versaBlock = RECORD
      CASE choice OF
        x: ( b : arrayÆ1..256Å of byte );
        y: ( l : arrayÆ1..64Å  of long );
      END;
 
  VAR
    i, count, eofPos, pos, used : integer;
    line : array Æ1..100Å of char;
    res : resultType;
    size : long;
    fileName : fullId;
    buf : versaBlock;
 
BEGIN
æ*b*   PS ('Start of VERSA=CUT ');   *e*å
 
  IN
    res := OkResult;
    xCheck ( Copy (fileEnv^^Æ1Å, stdIn ));
    xCheck ( Copy (fileEnv^^Æ2Å, stdOut));
    xCheck ( Copy (fileEnv^^Æ3Å, stdError));
 
    æ Wellcome message on terminal å
    clearText (line);
    putText (line, procId);
    putNl (line);
    xCheck ( termIo (stdOut, WriteSeq, line));
 
    æ get fileName parameterå
    IF NOT NextValArg (fileName) THEN
      Exception ( makeRes (-ValueParamsMissing, Universal, -2, 0));
æ*b*   printVar ('fileName = ', fileName);   *e*å
 
    xCheck ( stubRef.GetRef (OUT fs ; IN fileName, OUT used, OUT i));
 
    æ Assign versafile and read size field å
    xCheck ( fs.Assign (OUT fao ;
                  IN fileNameÆused+1..elements(fileName)Å,
                  IN ReadWriteRight, IN OldFile ));
 
    xCheck ( fao.Seek ( ; IN FromEnd, 0, OUT eofPos ));
æ*b*   pss ('fao seek, eofPos = ', eofPos);   *e*å
    IF eofPos MOD versaPageSize <> 0 THEN
      Exception ( makeRes (1,-1,0,0));
 
    pos := eofPos - versaPageSize;
    xCheck ( fao.ReadRandom (VAR IN OUT buf ; OUT count, IN pos, OUT i ));
æ*b*   printVar ('fao read, buf = ', buf.bÆ1..countÅ);   *e*å
    IF count <> versaPageSize THEN
      Exception ( makeRes (2,-1,0,0));
 
    size := buf.lÆ64Å;   ælast 4 byteså
æ*b*   pss ('size = ', size);   *e*å
    IF (size > eofPos - 4) OR
       (size < eofPos - 4 - versaPageSize) THEN
          Exception ( makeRes (3,-1,0,0));
    FOR i := (size MOD versaPageSize) + 1 TO count - 4 DO
      IF buf.bÆiÅ <> 0 THEN
          Exception ( makeRes (4,-1,0,0));
 
    æ cut dataSize å
æ*b*   ps ('call set dataSize ');   *e*å
    xCheck ( fao.DataSize ( ; size ));
 
æ*b*   xCheck ( fao.Seek ( ; FromEnd, 0, OUT pos));
       pss ('eofpos after datasize = ', pos);          *e*å
 
    noCheck ( Dealloc (fao, fao));
  DO
    BEGIN
      res := GetException;
æ*b*   pss ('exception, orgSys = ', orgSys);
       pr (res);                                *e*å
 
      IF res.family <> -1 THEN
        putError (line, res, '', 0)
      ELSE
      BEGIN  æ own error codes å
        clearText (line);
        putText (line, '*** Value error in VERSA file : illegal ');
        CASE res.main OF
          1: BEGIN
               putText (line, 'eofPos = ');
               putInt  (line, eofPos, 12);
             END;
          2: BEGIN
               putText (line, 'byte count = ');
               putInt  (line, count, 12);
             END;
          3: BEGIN
               putText (line, 'size field = ');
               putInt  (line, size, 12);
             END;
          4: BEGIN
               putText (line, 'block fill in byte no = ');
               putInt  (line, i, 12);
             END;
        END;  æcaseå
        putNl (line);
        res.main := ok;
      END;  æfamily = -1, own error codeså
 
       NoCheck (termIo (stdError, writeSeq, line));
æ*b*   printVar ('error msg line = ', line);   *e*å
      ObjReturn (res);
    END;
 
END;  æRunå
 
 
OTHERWISE  unknownCall  WITH RECORD t : ^^; END;
BEGIN
  Exception (makeRes (-entryIllegal, Universal, 2, 0));
END;
 
END;  æVersaCutå
 
 
INITIALIZE
  iVersaCut 'versaCut' :
  stubRef 'objDir'
 
END.
 
 
 
«eof»