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

⟦26e13783f⟧ TextFile

    Length: 24576 (0x6000)
    Types: TextFile
    Names: »JCL.SA«

Derivation

└─⟦2322e079b⟧ Bits:30009789/_.ft.Ibm2.50006594.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »JCL.SA« 
└─⟦311ba069f⟧ Bits:30009789/_.ft.Ibm2.50006625.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »JCL.SA« 
└─⟦49237ce80⟧ Bits:30009789/_.ft.Ibm2.50006627.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »JCL.SA« 
└─⟦8fc713706⟧ Bits:30009789/_.ft.Ibm2.50007356.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »JCL.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 JCL;
 
æ$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.JOBHA.IDå
æ$F=FAMILY.APPLI.IDå
æ$L+å
const orgSys=6;
æ$F=PASINCLU.MIKTYPES.SAå
æ$F=PASINCLU.TERMTOOL.SAå
æ$L+å
 
type comType=(emptyCom,loadCom,createCom,execCom,setCom,
              echoCom,speedCom,killCom,deleteCom,quitCom,syntaxCom);
const
   macroChar='$';
 
function equal
  (s1,s2: shortId)
  : boolean;
  var
    i : integer;
    b : boolean;
  begin
    b := elements(s1) = elements(s2);
    i := 1;
    while b and (i <= elements(s1)) do
    begin
      b := s1ÆiÅ = s2ÆiÅ;
      i := i+1;
    end;
    Equal := b;
  end;  æEqualå
 
function getName
  (line: shortId;
   var start,
       stop: integer)
  : boolean;
  æafter the call lineÆstart..stopÅ will contain the next name after
   the call value of start. If no name, stop=0 and getName returns falseå
  label 0;
  var pos, lineLength: integer;
begin
æprintVar('JCL *getname*, line= ', line);å
  getName:=true;
  stop:=0;
  lineLength:=getLength(line);
  if start>lineLength then begin
    getName:=false;
    goto 0;
  end;
  æskip leading spaceså
  while lineÆstartÅ=' ' do begin
    start:=start+1;
    if start>lineLength then begin
      getName:=false;
      goto 0;
    end;
  end;
  æ'start' is now fixedå
  stop:=start;
  while lineÆstopÅ<>' ' do begin
    if ord(lineÆstopÅ)<ord(' ') then begin
      getName:=false;
      goto 0;
    end;
    stop:=stop+1;
    if stop>lineLength then exit;
  end;
  stop:=stop-1;
0:
æprintVar('JCL *getName*, start= ',start);å
æprintVar('JCL *getName*, stop= ',stop);  å
end æ***getName***å;
 
function nextParam
  (line: shortId;
   var pos, start, stop: integer)
  : boolean;
  label 0;
  var linelength: integer;
begin
  start:=pos;
  nextParam:=true;
  stop:=0;
  lineLength:=elements(line);
  if start>lineLength then begin
    nextParam:=false;
    goto 0;
  end;
  æskip leading spaceså
  while lineÆstartÅ=' ' do begin
    start:=start+1;
    if start>lineLength then begin
      nextParam:=false;
      goto 0;
    end;
  end;
  æ'start' is now fixedå
  stop:=start;
  while lineÆstopÅ<>' ' do begin
    if ord(lineÆstopÅ)<ord(' ') then begin
      nextParam:=false;
      goto 0;
    end;
    stop:=stop+1;
    if stop>lineLength then exit;
  end;
  stop:=stop-1;
0:
  pos:=stop+1;
end æ***nextParam***å;
 
function interpret
  (line: shortId;
   var namestart,
       namestop: integer)
  : comType;
  ædetermines the type of the command line 'line' which is in text
   record format. An identifier may be returned in
   'lineÆnamestart..namestopÅ'å
  label 0;
  var
    lineLength: integer;
    c : char;
    com: comType;
i:integer;
begin
  lineLength := getLength(line);
  namestart:=3;
  if not getName(line,namestart,namestop) then begin
    com:=emptyCom;
    goto 0;
  end;
  if      equal('load'  ,lineÆnamestart..namestopÅ) then com:=loadCom
  else if equal('create',lineÆnamestart..namestopÅ) then com:=createCom
  else if equal('speed' ,lineÆnamestart..namestopÅ) then com:=speedCom
  else if equal('kill'  ,lineÆnamestart..namestopÅ) then com:=killCom
  else if equal('echo'  ,lineÆnamestart..namestopÅ) then com:=echoCom
  else if equal('delete',lineÆnamestart..namestopÅ) then com:=deleteCom
  else if equal('quit'  ,lineÆnamestart..namestopÅ) then com:=quitCom
  else if equal('set'   ,lineÆnamestart..namestopÅ) then com:=setCom
  else com:=execCom;
  case com of
    loadCom,
    createCom: æ <LOAD ! CREATE> <name> å
       begin
         namestart:=namestop+1;
         if not getName(line,namestart,namestop) then begin
           com:=syntaxCom;
         end;
       end;
    speedCom,
    killCom,
    deleteCom: æ <SPEED ! KILL ! DELETE> Æ<name>Å å
       begin
         namestart:=namestop+1;
         if not getName(line,namestart,namestop) then begin
           æname not mandatory in SPEED , KILL or DELETEå
         end;
       end;
    echoCom,
    setCom: æ SET <string> ! ECHO ÆY!NÅ å
       begin
         namestart:=namestop+2; æskip spaceå
         if namestart>lineLength then namestop:=0 else namestop:=lineLength;
       end;
    execCom: begin
         æname is ok as it iså
       end;
    otherwise æokå;
  end æcaseå;
0:
  interpret:=com;
i:=ord(com);
æprintVar('JCL .......interpret........., com= ',i);   å
end æ***interpret***å;
 
type
  jobData = record
    jobState: (notInit, progRunning, ProgRemoved);
    jobId,
    progrId: array Æ1..16Å of char;
    progrIdLength: integer;
  end;
  jobLocals = record
    code      : ^^;
    localdata : ^^ jobData;
    stubRef   : ^^ ObjDir;
    allocRef  : ^^ Allocate;
    schedRef  : ^^ Scheduler;
    stdio     : faoRefType;
    attProc   : ^^;
    jclProc   : ^^;
    jobProc   : ^^;
    progrObj  : ^^ Application;
    ego       : ^^ JobSys;
    eventGate : ^^ Gate;
    event     : ^^ Condition;
  end;  æjobLocalså
 
 
jclSysLocals = record
  code      : ^^;
  schedRef  : ^^ Scheduler;
  stubRef   : ^^ ObjDir;
  allocRef  : ^^ Allocate;
  jobOwnSet : ^^ Job;
  jobManSet : ^^ jobLocals;
end;  æjclSysLocalså
 
object Job;
  private jobInit;
end;
 
program JobImplement object Job with jobLocals;
 
  private runJob ;
  private runUser (in params: shortId) ;
  private attHandler;
 
procedure checkOk
  (res: resultType;
   text: shortId);
  var line: array Æ1..255Å of char; ætwo lines incl. nl'så
      i: integer;
begin
  if res.main<>ok then begin
æprintVar('***********checkOK(jcl)***********res= ',res); å
    putError(line,res,text,0);
    exception(termIo(stdio,WriteSeq,line));
  end;
end;
 
procedure writeStdio
  (text: shortId);
  var line: lineType;
      i: integer;
begin
  clearText(line);
  putText(line,text);  putNL(line);
  check(termIo(stdio,WriteSeq,line));
end æ***writeStdio***å;
 
procedure waitEvent;
begin
  check(eventGate.Lock);
  check(event.Wait);
  check(eventGate.Open);
end;
 
procedure signalEvent;
begin
  check(eventGate.Lock);
  check(event.Signal);
  check(eventGate.Open);
end;
 
private jobInit with record tt : ^^; end;
  var
    size, faoSize, schedSize, stubSize : sizeType;
    i : integer;
  begin
(*  æcompute size of Jcl Processå
    faoSize := GetCallStack (term);
    addCall (faoSize, 1, 1, 4);  æsize for call ReadSeqå
    schedSize := GetCallStack (schedRef);
    addCall (schedSize, 1, 1, 4);  æNewprocå
    stubSize := GetCallStack (stubRef);
    addCall (stubSize, 1, 2, 60);  æsize for call Createå
 
    size := maxSize (faoSize, schedSize);
    size := maxSize (size, stubSize);
*)
    ædeclare att processå
    check(schedRef.NewProc(out attProc; makeSize(13000,1000)));
    check(DeclProc(attProc,attHandler));
    ædeclare Jcl processå
    check(schedRef.NewProc(out jclProc; makeSize(29000,5000)));
    check(DeclProc(jclProc,runJob));
  end;  æJobInitå
 
private attHandler
  with record tt: ^^; end;
begin
  check(stdio.WaitReady);
  repeat
    in
      check(stdio.WaitBreak);
      check(stdio.WaitReady);
æprintText('++++++atthandler+++++++ att received ');    å
      signalEvent;
    do printText('fatal exception in att handler - ignored ');
  until false
end;
 
private runJob
  with record
    tt: ^^;
    temp: ^^;
  end;
  const
    sizeMacro=80;
  var
    buf: lineType;
    size: sizeType;
    res: resultType;
    count, namestart, namestop, i : integer;
    idstart, idstop: integer;
    quit: boolean;
    head: array Æ1..255Å of char;
    line: lineType;
    id: array Æ1..16Å of char;
    formFeed: array Æ1..1Å of char;
    crLf: array Æ1..2Å of char;
    echoMode: boolean;
    macro: array Æ1..sizeMacroÅ of char;
    macroLength: integer;
    curCom: comType;
 
procedure macroExpand
  (line: shortId);
  var oldLength, lineLength,
      fromPos, toPos, i: integer;
      oldLine: lineType;
begin
æprintVar('Begin expand, line= ',line);å
  oldLength:=getLength(line);
  if oldLength>85 then oldLength:=85;
  for i:=1 to oldLength do oldLineÆiÅ:=lineÆiÅ;
  lineLength:=elements(line);
  fromPos:=3;  toPos:=3; ætwo first bytes are length fieldå
  while (fromPos<=oldLength) and (toPos<=lineLength) do begin
    if (oldLineÆfromPosÅ<>macroChar) or (macroLength=0) then begin
      lineÆtoPosÅ:=oldLineÆfromPosÅ;
      toPos:=toPos+1;  fromPos:=fromPos+1;
    end else begin
      i:=1;
      while (toPos<=lineLength) and (i<=macroLength) do begin
        lineÆtoPosÅ:=macroÆiÅ;
        toPos:=toPos+1;  i:=i+1;
      end;
      fromPos:=fromPos+1;
    end;
  end æwhileå;
  putLength(line,toPos-1);
æprintVar('expand end, line= ',line);  å
end æ***macroExpand***å;
 
begin
    æprocedure RunJob executes an eternal loop reading one command
     line from the terminal and executing the command if allowed å
  formFeedÆ1Å:=chr(16#d8);  æfor Motorola's EXORterm 155å
  crLfÆ1Å:=chr(10);
  crLfÆ2Å:=chr(13);
in
  with localdata^^ do
  begin
    repeat ælog in/out loopå
      waitEvent;
      writeStdio(formFeed);
headÆ1Å:=chr(0); headÆ2Å:=chr(2);
putText(head,
        '           EEEEEEEEEEEEEEEE      OOOOOOOOOOOO        SSSSSSSSSSS   ');
putText(head,crLf); putText(head,
        '           EEEEEEEEEEEEEEEE    OOOOOOOOOOOOOOOO    SSSSSSSSSSSSSSS ');
putText(head,crLf); putText(head,
        '           EEEEE              OOOOOO      OOOOOO  SSSSS       SSSSS');
count:=getLength(head); headÆcount+1Å:=chr(0); headÆcount+2Å:=chr(0);
check(termIo(stdio,WriteSeq,head));
headÆ1Å:=chr(0); headÆ2Å:=chr(2);
putText(head,crLf); putText(head,
        '           EEEEE              OOOOO        OOOOO  SSSSS            ');
putText(head,crLf); putText(head,
        '           EEEEEEEEEEEEEEEE   OOOOO        OOOOO   SSSSSS          ');
putText(head,crLf); putText(head,
        '           EEEEEEEEEEEEEEEE   OOOOO        OOOOO     SSSSSSSSSSS   ');
count:=getLength(head); headÆcount+1Å:=chr(0); headÆcount+2Å:=chr(0);
check(termIo(stdio,WriteSeq,head));
headÆ1Å:=chr(0); headÆ2Å:=chr(2);
putText(head,crLf); putText(head,
        '           EEEEE              OOOOO        OOOOO            SSSSSSS');
putText(head,crLf); putText(head,
        '           EEEEE              OOOOOO      OOOOOO  SSSSS       SSSSS');
putText(head,crLf); putText(head,
        '           EEEEEEEEEEEEEEEE    OOOOOOOOOOOOOOOO    SSSSSSSSSSSSSSS ');
count:=getLength(head); headÆcount+1Å:=chr(0); headÆcount+2Å:=chr(0);
check(termIo(stdio,WriteSeq,head));
headÆ1Å:=chr(0); headÆ2Å:=chr(2);
putText(head,crLf); putText(head,
        '           EEEEEEEEEEEEEEEE      OOOOOOOOOOOO        SSSSSSSSSSS   ');
putText(head,crLf);
putText(head,crLf);
putText(head,crLf); putText(head,
        '                      J O B   C O N T R O L   S Y S T E M  ');
putText(head,crLf); putText(head,
        '                            Release  00.04/83-10-26 ');
putText(head,crLf);
putText(head,crLf);
count:=getLength(head); headÆcount+1Å:=chr(0); headÆcount+2Å:=chr(0);
check(termIo(stdio,WriteSeq,head));
 
      quit:=false;
      repeat
        clearText(line);
        putText(line,'Enter username:');
        check(termIo(stdio,WriteSeq,line));
        check(termIo(stdio,ReadSeq,buf));
        namestart:=3;
        quit:= getName(buf,namestart,namestop);
        quit:=quit and (namestop>0)
      until quit;
      if (namestop-namestart+1)>16 then namestop:=namestart+16-1;
      for i:=1 to 16 do jobIdÆiÅ:=' ';
      for i:= 1 to namestop-namestart+1 do jobIdÆiÅ:=bufÆnamestart+i-1Å;
      macroLength:=0;
      echoMode:=false;
      writeStdio(formFeed);
 
      quit:=false;
      repeat æinterpreter loopå
        if jobState=progRunning then waitEvent;
        if jobState=progRemoved then begin
          æremove old job process after is has terminated -ern-å
          checkOk(Dealloc(jobProc,jobProc),'old job process');
          jobState:=notInit;
        end;
        clearText(line);
        if jobState=progRunning then putText(line,crLf);
        putText(line,'?');
        check(termIo(stdio,WriteSeq,line));
        check(termIo(stdio,ReadSeq,buf));
        in
          macroExpand(buf);
          if echoMode then begin
            clearText(line);
            putText(line,'*');
            count:=getLength(buf);
            if count>2 then
              putText(line,bufÆ3..countÅ);
            putNL(line);
            check(termIo(stdio,WriteSeq,line));
          end;
          curCom:= interpret(buf,namestart,namestop);
 
          case curCom of
 
            emptyCom: ;
 
            quitCom: begin
                quit:=true;
                writeStdio(formFeed);
                writeStdio('--------- END  E O S  SESSION----------');
              end;
 
            echoCom: begin
                if namestop=0 then echoMode:=not echoMode
                else echoMode:=bufÆnamestartÅ='y';
              end;
 
            setCom: begin
                if namestop=0 then begin
                  clearText(line);
                  putText(line,'$="');
                  putText(line,macroÆ1..macroLengthÅ);
                  putText(line,'"');
                  putNL(line);
                  check(termIo(stdio,WriteSeq,line));
                end else begin
                  count:=namestop-namestart+1;
                  if (count=1) and (bufÆnamestartÅ=' ') then begin
                    macroLength:=0;  æclear macroå
                  end else begin
                    if count>sizeMacro then count:=sizeMacro;
                    for i:=1 to count do macroÆiÅ:=bufÆnamestart+i-1Å;
                    macroLength:=count;
                  end;
                end;
              end;
 
            loadCom: begin
                idstart:=namestop+1;
                if not getname(buf,idstart,idstop) then
                  idstop := idstart-1;
                for i:=1 to 16 do
                  if idstart+i-1 <= idstop then
                    idÆiÅ := bufÆidstart+i-1Å
                  else
                    idÆiÅ := ' ';
                checkOk(stubRef.Load(;in out id,
                               bufÆnamestart..namestopÅ),'');
                clearText(line);
                putText(line,id);
                putText(line,'loaded');
                putNL(line);
                check(termIo(stdio,WriteSeq,line));
              end; æloadComå
 
            createCom: begin
æØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØ
                idstart:=namestop+1;
                if (namestop=0) or
                   (not getname(buf,idstart,idstop)) then
                  writeStdio('***syntax')
                else begin
                  clearText(line);
                  if idstop=0 then begin
                    for i:=1 to 16 do idÆiÅ:=' ';
                    checkOk(stubRef.Create(out temp;in out id,
                               bufÆnamestart..namestopÅ),'');
                    putText(line,id);
                  end else begin
                    checkOk(stubRef.Create(out temp; bufÆidstart..idstopÅ,
                               bufÆnamestart..namestopÅ),'');
                    putText(line,bufÆidstart..idstopÅ);
                  end;
ØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØå
                idstart:=namestop+1;
                if not getname(buf,idstart,idstop) then
                  idstop := idstart-1;
                for i:=1 to 16 do
                  if idstart+i-1 <= idstop then
                    idÆiÅ := bufÆidstart+i-1Å
                  else
                    idÆiÅ := ' ';
                checkOk(stubRef.Create(out temp;in out id,
                               bufÆnamestart..namestopÅ),'');
                clearText(line);
                putText(line,id);
                  putText(line,'created');
                  putNL(line);
                  check(termIo(stdio,WriteSeq,line));
æØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØ
                end;
ØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØå
              end; æcreateComå
 
            deleteCom:
              begin
                if namestop=0 then begin
                  if jobState<>progRunning then writeStdio('***no job')
                  else begin
                    checkOk(stubRef.DeleteItem(;progrIdÆ1..progrIdLengthÅ),'');
                    clearText(line); putText(line,progrIdÆ1..progrIdLengthÅ);
                  end;
                end else begin
                  checkOk(stubRef.DeleteItem(;bufÆnamestart..namestopÅ),'');
                  clearText(line); putText(line,bufÆnamestart..namestopÅ);
                end;
                putText(line,' deleted');
                putNL(line);
                check(termIo(stdio,WriteSeq,line));
              end; ædeleteComå
 
            speedCom,
            killCom:
              begin
                if namestop=0 then begin
                  if jobState<>progRunning then writeStdio('***no job')
                  else begin
                    if curCom=speedCom
               then checkOk(stubRef.SpeedUpObj(; progrIdÆ1..progrIdLengthÅ),'')
               else checkOk(stubRef.AbortObj(; progrIdÆ1..progrIdLengthÅ),'');
                    clearText(line);
                    putText(line,crLf);
                    putText(line,progrIdÆ1..progrIdLengthÅ);
                    putText(line,' killed');
                    putText(line,crLf);
                    check(termIo(stdio,WriteSeq,line));
                  end;
                end else begin
                  if curCom=speedCom
             then checkOk(stubRef.SpeedUpObj(; bufÆnamestart..namestopÅ),'')
             else checkOk(stubRef.AbortObj(; bufÆnamestart..namestopÅ),'');
                  clearText(line);
                  putText(line,bufÆnamestart..namestopÅ);
                  putText(line,' killed');
                  putNL(line);
                  check(termIo(stdio,WriteSeq,line));
                end;
              end; ækillComå
 
            syntaxCom:
              begin
                clearText(line);
                putText(line,'***syntax');
                putNL(line);
                check(termIo(stdio,WriteSeq,line));
              end; æsyntaxComå
 
            execCom:
              begin
                if jobState=progRunning then begin
                  clearText(line);
                  putText(line,'***busy');
                  putNL(line);
                  check(termIo(stdio,WriteSeq,line));
                end else begin
                  checkOk(stubRef.Create(out progrObj; in jobId,
                                         bufÆnamestart..namestopÅ),
                                         bufÆnamestart..namestopÅ);
                  for i:=1 to 16 do progrIdÆiÅ:=jobIdÆiÅ;
                  progrIdLength:=16;
                  in æprogram createdå
                    æcreate job processå
                    checkOk(schedRef.NewProc(out jobProc;
æ 34000,5000 increased by vir å              makeSize(40000,6000)),'');
                    checkOk(DeclProc(jobProc,runUser;
                                  in bufÆnamestop+1..getLength(buf)Å),'');
                    jobState:=progRunning;
                  do begin
                    res:=stubRef.DeleteItem(;jobId);
                    res:=Dealloc(jobProc,jobProc);
                  end;
                end;
              end; æexecComå
 
            otherwise printText('////////////////////////unknown command////');
 
          end æcaseå;
        do begin æcheckOK has handled exceptionå
res:=getException;
æprintVar('_______interpreter loop exception__________res= ',res);   å
          check(stdio.WaitReady);
        end;
      until quit;  æread next command lineå
      if jobState=progRunning then
        res:=stubRef.AbortObj(;progrIdÆ1..progrIdLengthÅ);
    until false;
  end;  æwith localdata^^å
  do begin
      æsome error in reading command line,
       stop the process å
res:=getException;
æprintVar('__ _ _ _ _ _ _  _ J C L  E X C E P T I O N_ _ _ _ _ res= ',res); å
      objReturn (getException);
  end;  æerrorå
end;  æRunJobå
 
private runUser æparamså
  with record
    tt:^^;
    fileEnv: refPtrArray;
    tempOwn: ^^;
  end;
  var i: integer;
      pos, start, stop: integer;
      res: resultType;
begin
  with d=localdata^^ do begin
    in
      æcreate file envelopeå
      checkOk(allocRef.NewObj(out tempOwn; makeSize(0,500), out i),'');
      checkOk(DeclEnv(tempOwn,fileEnv,fileEnv,refs(ptrArray),0,
                         makeSize(0,0), makeSize(-1,-1)),'');
      checkOk(Copy(stdio,fileEnv^^Æ1Å),'');
      checkOk(Copy(stdio,fileEnv^^Æ2Å),'');
      checkOk(Copy(stdio,fileEnv^^Æ3Å),'');
      pos:=1;
      res:=progrObj.Run(fileEnv,ego; d.progrIdÆ1..d.progrIdLengthÅ,
           while nextParam(params,pos,start,stop) do (paramsÆstart..stopÅ) );
      if (res.main<>ok) and
         not ((res.family=Universal) and (res.main=GiveUp)) then
        checkOk(res,'');
    do ænothingå;
    res:=stubRef.DeleteItem(; d.progrIdÆ1..d.progrIdLengthÅ);
    d.jobState:=progRemoved;
    signalEvent; æstart interpreterå
  end; æwithå
end æ***private runUser***å;
 
otherwise unknJob with record tt:^^; end;
begin end;
 
end;  æJobImplementå
 
æ****************Implement JclSysObject******************å
 
program JclSysImplement object JobSys with jclSysLocals;
 
  private LogOutTerm (in obj : ownSet;
                      in env : refEnv ) ;
 
ENTRY NewTerm æfileNameå
    with record
      tt         : ^^;
      tempEnv    : ^^ jobLocals;
      fileSys    : ^^ IoSys;
    end;
  var
    i, kind, used : integer;
    size : sizeType;
    res : resultType;
begin
      check(stubRef.GetRef(out fileSys; in fileName, out used, out kind));
    æalloc Job Objectå
(*    Clear (size);
      AddEnv (size, refs(JobLocals));
      AddSeg (size, bytes(jobData));
*)
      check(allocRef.NewObj(out jobOwnSet; makeSize(2000,500), out i));
    æMake General Objectå
(*    Clear (size);  *)
      size:=makeSize(0,0);
      check(DeclGen(jobOwnSet,jobManSet,tempEnv,
                    refs(jobLocals), LogOutTerm, size, makeSize(-1,-1),
                    refs(JobImplement), bytes(JobImplement), 0,
                    addr(JobImplement),size, true));
    æInit Jobå
      check(Copy(code,tempEnv^^.code));
      check(Copy(stubRef,tempEnv^^.stubRef));
      check(Copy(allocRef,tempEnv^^.allocRef));
      check(Copy(schedRef,tempEnv^^.schedRef));
      check(NewSeg(tempEnv^^.localdata,bytes(jobData)));
      with d=tempEnv^^.localdata^^ do
      begin
        d.jobState := notInit;
      end;  æInit jobDataå
    æopen terminal driverå
      check(fileSys.Assign(out tempEnv^^.stdio;
                             fileNameÆused+1..elements(fileName)Å,ReadWrite));
      check(stubRef.InsertPointer(tempEnv^^.stdio;
                             fileNameÆused+1..elements(fileName)Å));
      check(schedRef.NewGate(out tempEnv^^.eventGate));
      check(tempEnv^^.eventGate.NewCond(out tempEnv^^.event));
      check(tempEnv.JobInit);
      res.main:=ok;
      ObjReturn (res);
end æ***Include***å;
 
private LogOutTerm with record tt:^^; end;
begin end;
 
entry GetParam
  with record tt:^^ end;
begin æexception(genRes(EntryIllegal,Universal,2));å end;
 
otherwise unknJclSys with record tt: ^^; end;
begin end;
 
end;  æJclSysImplementå
 
initialize JclSysImplement 'jobsys':
           stubRef 'objdir', allocRef 'allocate', schedRef 'scheduler'
end.  æJCLå
 
 
 
 
 
 
«eof»