home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / code / ras_squi.sit < prev    next >
Encoding:
Text File  |  1988-06-20  |  14.9 KB  |  768 lines

  1. 18-Jun-88 14:45:03-MDT,16024;000000000000
  2. Return-Path: <u-lchoqu%sunset@cs.utah.edu>
  3. Received: from cs.utah.edu by SIMTEL20.ARPA with TCP; Sat, 18 Jun 88 14:44:40 MDT
  4. Received: by cs.utah.edu (5.54/utah-2.0-cs)
  5.     id AA22664; Sat, 18 Jun 88 14:44:40 MDT
  6. Received: by sunset.utah.edu (5.54/utah-2.0-leaf)
  7.     id AA24800; Sat, 18 Jun 88 14:44:35 MDT
  8. Date: Sat, 18 Jun 88 14:44:35 MDT
  9. From: u-lchoqu%sunset@cs.utah.edu (Lee Choquette)
  10. Message-Id: <8806182044.AA24800@sunset.utah.edu>
  11. To: rthum@simtel20.arpa
  12. Subject: Squirmterm.Ras
  13.  
  14. ------------------------------------------------------------------------------
  15.  
  16. program squirmterm;
  17.  
  18. (*
  19.     SQUIRMTERM IS A TERMINAL EMULATOR WITH MANY OPTIONS, AND SOME
  20.     vi SPECIFIC FEATURES.  SEE THE FILE SquirmTerm.doc FOR DETAILS
  21.     OF OPERATION.
  22.  
  23.  
  24.     NEW     ..... 85.04.08.spg
  25.             ..... 85.10.21.spg  -- added Uses, and cleaned up the code.
  26.             ..... 85.12.18.spg  -- Settings are remembered from session
  27.                                    to session.
  28. *)
  29.  
  30. Uses    __QuickTraps, __ToolTraps, __OSTraps, __LPR,
  31. (*$U+*) uToolIntf, uOSIntf ;
  32.  
  33. Link   __IO , __EasyMenus,
  34.        __Uniform , __SFnames, __OSTraps, __LPR  : ;
  35.  
  36. Type
  37.   Settings = Record
  38.     Stops,
  39.     Parity,
  40.     Data,
  41.     Baud: Integer;
  42.   End;
  43.   SetHand = ^^Settings;
  44. var
  45.   lheight,charw,
  46.   baud,zbaud,
  47.   parity,zparity,
  48.   stops,zstops,
  49.   data, zdata,
  50.   nocurse,rcfile,print,laserprint,RRef,NewRFile: integer;
  51.   seencr,rcv: byte;
  52.   rateblock: block[8];
  53.   myreply: block[80];
  54.   sfbitmap: block[14];
  55.   sfmyport,sfbits: ptrL;
  56.   utilrgn: ptrL;
  57.   rcbuf: block[1025];
  58.   rcbptr,
  59.   rcbsize: integer;
  60.   dbltime,lastclick,lastdbl:longint;
  61.   xxsize: block[8];
  62.   myrect: integer[4];
  63.   xxport: ptrL;
  64.  
  65.  
  66. Function getvol(): Integer;     (* Get the current default volume *)
  67. var Param: ParamBlockRec;
  68.     err : OSErr;
  69.   {
  70.       Param.IOCompletion := 0;
  71.       Param.IONamePtr := 0;
  72.       err := PBGetVol(Param,False);
  73.       getvol := Param.IOVrefNum;
  74.   };
  75.  
  76. procedure setvol(vref: integer);    (* Set the current default volume *)
  77. var Param: ParamBlockRec;
  78.     err : OSErr;
  79. {
  80.       Param.IOCompletion := 0;
  81.       Param.IONamePtr := 0;
  82.       Param.IOVrefNum := vref;
  83.       err := PBSetVol(Param,False);
  84. };
  85.  
  86. Procedure InitSettings();  (* Get settings from resource file *)
  87. Var
  88.   Name: Block[64];
  89.   myvol,oldvol,err: Integer;
  90.   S: SetHand;
  91. {
  92.   stops:=1; parity:=5;  data:=9; baud:=5 ;  (* default settings *)
  93.   NewRFile := 0;
  94.   S := GetResource(PtrL(" SETT"+2)^,999); (* get the resource *)
  95.   If !S Then {          (* the resource isn't there *)
  96.     RsrcRef(@RRef);     (* get the reference number of squirmterm's file
  97. *)
  98.     If RRef = -1 Then { (* there isn't a resource file yet *)
  99.       oldvol := GetVol();
  100.       applvref(@myvol);
  101.       setvol(myvol);
  102.       getwtitle(xxport,@Name);
  103.       CreateResFile(Name);    (* create a resource file for squirmterm *)
  104.       RRef := OpenResFile(Name);
  105.       setvol(oldvol);
  106.                            (* if the disk is locked, the res file won't
  107. be
  108.                               created *)
  109.       If !(RRef=-1) Then
  110.         NewRFile := 1;
  111.       };
  112.     If !(RRef = -1) Then {
  113.       S := NewHandle(Longint(Sizeof(Settings)));  (* Make a new handle *)
  114.       S^^.Stops := Stops;
  115.       S^^.parity := parity;   (* initialize settings *)
  116.       S^^.data := data;
  117.       S^^.baud := baud;
  118.       AddResource(S,PtrL(" SETT"+2)^,999,"");  (* add the resource *)
  119.       WriteResource(S);
  120.       }
  121.     };
  122.  
  123.   If S Then {
  124.       Stops := S^^.Stops;
  125.       Parity := S^^.parity;
  126.       Data := S^^.data;
  127.       Baud := S^^.baud;
  128.       ReleaseResource(S);
  129.       };
  130.  
  131.   setstops(stops);
  132.   setparity(parity);
  133.   setdata(data);
  134.   setbaud(baud);
  135. };
  136.  
  137. proc HaltSettings();
  138. Var
  139.   S: SetHand;
  140. {
  141.       (* update the resource values which contain settings *)
  142.   S := GetResource(PtrL(" SETT"+2)^,999);
  143.   If !S Then Return;
  144.       S^^.Stops := Stops;
  145.       S^^.parity := parity;
  146.       S^^.data := data;
  147.       S^^.baud := baud;
  148.   ChangedResource(S);
  149.   WriteResource(S);
  150.   If NewRFile Then
  151.     CloseResFile(RREf);
  152. };
  153.  
  154.  
  155. procedure sfsavebits();
  156. var pl: ptrl;
  157.     pw: ptrw;
  158.     A0,A1,D0:longint;
  159.     x,y: integer;
  160. {
  161.   sfbits := NewPtr(7454L);
  162.   if (sfbits) then {
  163.  
  164.     getport(@sfmyport);
  165.     pl  := sfbitmap;
  166.     pl^ := sfbits;
  167.     pw  := sfbitmap+4;
  168.     pw^ := 46;
  169.  
  170.     x := 100; y:=70;
  171.     GlobalToLocal(@y);
  172.     setrect(@sfbitmap[6],x-8,y-8,x+353,y+151);
  173.     copybits(@sfmyport[2],sfbitmap,@sfbitmap[6],@sfbitmap[6],0,0L);
  174.     };
  175. };
  176.  
  177. procedure sfrestorbits();
  178. var A0,A1,D0: longint;
  179. {
  180.   if (sfbits<>0) then {
  181.     setport(sfmyport);
  182.     copybits(@sfbitmap,sfmyport+2,@sfbitmap[6],@sfbitmap[6],0,0L);
  183.     validrect(@sfbitmap[6]);
  184.     DisposPtr(sfbits);
  185.    };
  186.  
  187. };
  188.  
  189.  
  190. procedure allfiles(nameptr: ptrL; vref: ptrw; good: ptrw);
  191. var
  192.   pick: ptrw;
  193.   begin
  194.     Toolbox($A9EA,100,70," ",0L,-1," TEXT"+2L,0L,@myreply,2);
  195.     nameptr^ := @myreply+10;
  196.     pick := @myreply;
  197.     good^ := pick^ >> 8;
  198.     pick := pick+6;
  199.     vref^ := pick^;
  200.   end;
  201.  
  202. procedure hider();
  203. var w: ptrL;
  204. {
  205.  toolbox($A924,result w);
  206.  w := w + $90;
  207.  loop(w^<>0,w:=w^,w:=w+$90;w:=w^,w=0)
  208.    toolbox($A916, w);
  209. };
  210.  
  211. procedure setbaud(abaud: integer);
  212. {
  213.      checkEasy(500,baud,0);
  214.      baud := abaud;
  215.      zbaud := rateblock[baud];
  216.      if (baud=1) then zbaud:=zbaud+128;
  217.      checkEasy(500,baud,256);
  218.      setconfig(zbaud + zdata + zstops + zparity);
  219. };
  220.  
  221. procedure setparity(apar: integer);
  222. {
  223.     checkEasy(550,parity,0);
  224.     parity := apar;
  225.     Case Parity of
  226.       5: zparity:=0;
  227.       6: zparity:=12288;
  228.       7: zparity:=4096;
  229.     End;
  230.     checkEasy(550,parity,256);
  231.     setconfig(zbaud + zdata + zstops + zparity);
  232. };
  233.  
  234. procedure setdata(adat: integer);
  235. {
  236.     checkEasy(550,data,0);
  237.     data := adat;
  238.     Case Data of
  239.       9: zdata:=3072;
  240.      10: zdata:=1024;
  241.      11: zdata:=2048;
  242.      12: zdata:=0;
  243.     End;
  244.     checkEasy(550,data,256);
  245.     setconfig(zbaud + zdata + zstops + zparity);
  246. };
  247.  
  248. procedure setstops(astop: integer);
  249. {
  250.     checkEasy(550,stops,0);
  251.     stops := astop;
  252.     Case stops of
  253.       1: zstops:=-16384;
  254.       2: zstops:=-32768;
  255.       3: zstops:=16384;
  256.     End;
  257.     checkEasy(550,stops,256);
  258.     setconfig(zbaud + zdata + zstops + zparity);
  259. };
  260.  
  261. procedure delete();
  262. var param: block[94];
  263.     A0,A1,D0,pL: ptrL;
  264.     name,pb: ptrb;
  265.     vref,good: integer;
  266.     pw: ptrw;
  267. {
  268.   loop(,,,) {
  269.     sfsavebits();
  270.     allfiles(@name,@vref,@good);
  271.     sfrestorbits();
  272.     if (good=0) then break;
  273.     pL := @param[12]; pL^ := 0;
  274.     pL := @param[18]; pL^ := name;
  275.     pw := @param[22]; pw^ := vref;
  276.     pb := @param[26]; pb^ := 0;
  277.  
  278.     A0 := @param;
  279.     regcall(trap $A009,A0,A1,D0);
  280.     if (D0<>0) then writechar(7);
  281.     };
  282.  
  283. };
  284.  
  285. procedure sendfile();
  286. var
  287.   name: ptrb;
  288.   vref,good,fref,eof,c,mods: integer;
  289. {
  290.   sfsavebits();
  291.   getfile(@name,@vref,@good);
  292.   sfrestorbits();
  293.   if (good) then {
  294.     fopen(@fref,name,1,vref);
  295.     feof(fref,@eof);
  296.  
  297.     loop(not eof,,,eof) {
  298.       loop(,,,c=13) {
  299.         termtask();
  300.         fgetc(fref,@c);
  301.         putchar(c);
  302.         feof(fref,@eof);
  303.         if (eof) then break;
  304.         };
  305.  
  306.       seencr := 0;
  307.  
  308.       loop(eof=0,,,) {
  309.         termtask();
  310.         if (seencr<>0) then break ;
  311.         checkkey(@c,@mods);
  312.         keyconv(@c,@mods);
  313.         if (c=127) then {
  314.           if ((mods and 512)=0) then eof := 255;
  315.           break;
  316.           };
  317.         };
  318.       c := -1;
  319.       };
  320.     fclose(fref);
  321.     };
  322. };
  323.  
  324. procedure startrcv();
  325. var name: ptrb;
  326.     vref,good: integer;
  327. {
  328.   sfsavebits();
  329.   putfile(@name,@vref,@good);
  330.   sfrestorbits();
  331.   if (good) then {
  332.     mtoggle(600,5,@rcv);
  333.     fcreate(name," RCMP"+2," TEXT"+2,vref);
  334.     fopen(@rcfile,name,3,vref);
  335.     fseteof(rcfile,0L);
  336.     rcbptr := 0;
  337.     };
  338. };
  339.  
  340. procedure flushrcbuf();
  341. {
  342.   fwrite(rcfile,rcbuf,rcbptr);
  343.   rcbptr := 0;
  344. };
  345.  
  346. procedure endrcv();
  347. {
  348.   flushrcbuf();
  349.   fclose(rcfile);
  350.   mtoggle(600,5,@rcv);
  351. };
  352.  
  353. procedure startprint();
  354. Var t: longint;
  355. {
  356.   LaserPrint := IsLaser();
  357.   If LaserPrint Then {
  358.     LPRInit(Courier,10);
  359.     SelectWindow(xxport);
  360.     }
  361.   Else {
  362.     prinit();
  363.     t := TickCount() + 30;
  364.     Loop(,,,TickCount()>t);
  365.     prlmargin(6);
  366.     };
  367.   mtoggle(600,9,@print);
  368. };
  369.  
  370. procedure stopprint();
  371. {
  372.   If LaserPrint Then
  373.     LPRHalt()
  374.   Else
  375.     prputchar(13);
  376.   mtoggle(600,9,@print);
  377. };
  378.  
  379. procedure HardChar(x: integer);
  380. {
  381.   If LaserPrint Then
  382.     LPRChar(x)
  383.   Else
  384.     PRPutChar(x);
  385. };
  386.  
  387. procedure HardString(buf: ptrb);
  388. {
  389.   If LaserPrint then
  390.     LPRString(buf)
  391.   Else
  392.     PRPutString(buf)
  393. };
  394.  
  395. procedure filter(c: integer);
  396. var err: integer;
  397. {
  398.   if (c<>10) then {
  399.      rcbuf[rcbptr] := c;
  400.      rcbptr := rcbptr+1;
  401.      if (rcbptr>rcbsize) then {
  402.        flushrcbuf();
  403.        ferr(rcfile,@err);
  404.        if (err) then {
  405.          writechar(7);
  406.          writestring("File receive error");
  407.          endrcv()
  408.          };
  409.        };
  410.     };
  411. };
  412.  
  413. procedure mtoggle(menu,item:integer; value: ptrw);
  414. {
  415.   value^ := not value^;
  416.   checkEasy(menu,item,value^);
  417. };
  418.  
  419. procedure doerase();
  420. var p: integer[2]; {
  421.    getpen(p);
  422.    SetRect(myrect,p[1],p[0]-9,p[1]+6,p[0]+3);
  423.    EraseRect(myrect);
  424.    };
  425.  
  426. procedure docurse();
  427. {penmode(10);pensize(1,2);
  428.  move(-1,1);line(7,0);move(-6,-1);
  429.  pensize(1,1); penmode(8)};
  430.  
  431.  
  432. procedure getrect(rect: ptrL);
  433. var port,prect: ptrL;
  434. {
  435.   getport(@port); prect := port+16; rect^ := prect^;
  436.   prect := prect+4; rect := rect+4;  rect^ := prect^;
  437. };
  438.  
  439. procedure erasescr();
  440. var prect: block[8];
  441. {
  442.   getrect(prect);
  443.   eraserect(prect);
  444. };
  445.  
  446. procedure scrollscr(h,v: integer);
  447. var prect: block[8];
  448. {
  449.   getrect(prect);
  450.   scrollrect(prect,h,v,utilrgn);
  451. };
  452.  
  453. procedure rscroll(l,t,r,b,h,v: integer);
  454. var rect: block[8];
  455.     p: integer[2];
  456.     x,y: integer;
  457. {
  458.   getpen(p);
  459.   x:=p[1]; y:=p[0];
  460.   setrect(rect,x+l,y+t,x+r,y+b);
  461.   scrollrect(rect,h,v,utilrgn);
  462. };
  463.  
  464. procedure insertc();
  465. {
  466.   rscroll(0,-9,1000,3,charw,0);
  467. };
  468.  
  469. procedure deletec();
  470. {
  471.   rscroll(0,-9,1000,3,-charw,0);
  472. };
  473.  
  474. procedure insertl();
  475. {
  476.   rscroll(-1000,-9,1000,1000,0,lheight);
  477. };
  478.  
  479. procedure deletel();
  480. {
  481.   rscroll(-1000,-9,1000,1000,0,-lheight);
  482. };
  483.  
  484. procedure clrtol();
  485. {
  486.   rscroll(0,-9,5000,3,5000,0);
  487. };
  488.  
  489. procedure clrtop();
  490. {
  491.   clrtol();
  492.   rscroll(-1000,3,1000,1000,0,1000);
  493. };
  494.  
  495. procedure getnext(x: ptrw);
  496. var c,mods: integer;
  497. {
  498.   loop(,,,x^<>-1) {
  499.      nodwellchar(x);
  500.      checkkey(@c,@mods);
  501.      if (c<>-1) then {
  502.        keyconv(@c,@mods);
  503.        putchar(c);
  504.        if (c=127) then break
  505.        };
  506.      };
  507.    if (x^<>-1) then x^:=x^%128;
  508.  };
  509.  
  510. procedure direct();
  511. var x,y: integer;
  512. {
  513.   getnext(@y);
  514.   if (y<>-1) then {
  515.     getnext(@x);
  516.     if (x<>-1) then {
  517.       x := x-32;
  518.       y := y-32;
  519.       x := (x+1)*charw;
  520.       y := (y+1)*lheight;
  521.       moveto(x,y);
  522.       };
  523.     };
  524. };
  525.  
  526. procedure esc();
  527. var x,c,mods: integer;
  528. {
  529.  
  530.   getnext(@x);
  531.  
  532.   if (x<>-1) then
  533.     Case x of
  534.       12:{ erasescr(); moveto(charw,lheight) };
  535.       'U': scrollscr(0,-lheight);
  536.       'D': scrollscr(0,lheight);
  537.       'F': insertc();
  538.       'E': deletec();
  539.       'M': insertl();
  540.       'l': deletel();
  541.       'K': clrtol();
  542.       'k': clrtop();
  543.       'Y': direct();
  544.     End;
  545. };
  546.  
  547. procedure adjustb();
  548. {writechar(10)};
  549.  
  550. procedure control(c: integer);
  551. {
  552.   Case c of
  553.     10: adjustb();
  554.      8: { writechar(c); doerase() };
  555.     13: {seencr := 255; writechar(c)};
  556.     11: move(0,-lheight);
  557.     15: move(-charw,0);
  558.     14: move(charw,0);
  559.      1: moveto(charw,lheight);
  560.     27: esc();
  561.      7: sysbeep(1);
  562.  
  563.     OtherWise writechar(c);
  564.   End;
  565. };
  566.  
  567. procedure termtask();
  568. var x: Integer;
  569.     i,ctrl: byte;
  570.     buf: block[100];
  571.     rect: block[8];
  572.     h,v: integer;
  573.     p: integer[2];
  574. begin
  575.   nodwellchar(@x);
  576.   if (x<>-1) then {
  577.     if (nocurse) then nocurse:=0 else docurse();
  578.     loop(,i:=0;ctrl:=0,,x=-1) {
  579.       x:=x%128;
  580.       if (rcv) then filter(x);
  581.       if (x>31) then { i:=i+1; buf[i] := x; }
  582.         else {ctrl := 255; break };
  583.       if (i>98) then break;
  584.       nodwellchar(@x);
  585.       };
  586.     if (i>0) then { buf[0]:=i;
  587.                     getpen(p);
  588.                     h := p[1]; v:=p[0];
  589.                     setrect(rect,h,v-9,h+(i*charw)/1,v+3);
  590.                     eraserect(rect);
  591.                     DrawString(buf);
  592.                     if (print) then
  593.                       HardString(buf); }; (* drawstring *)
  594.     if (ctrl) then {
  595.       if (print) then
  596.         HardChar(x);
  597.       control(x);
  598.       };
  599.     docurse();
  600.     };
  601. end;
  602.  
  603.  
  604. procedure mactovi(px,py: ptrw);
  605. {
  606.   px^ := (px^-charw)/charw;
  607.   py^ := (py^-lheight)/lheight;
  608. };
  609.  
  610. procedure putdec(dec: integer);
  611. var t: integer;
  612. {
  613.   t := dec/10;
  614.   putchar(t+48);
  615.   t := dec-(t*10);
  616.   putchar(t+48);
  617. };
  618.  
  619. procedure vimove(x,y: integer);
  620. var
  621.   i: byte;
  622.   oldx,oldy: integer;
  623.   p: integer[2];
  624. {
  625.   y := y+6;
  626.   mactovi(@x,@y);
  627.   getpen(p); oldx := p[1]; oldy := p[0];
  628.   mactovi(@oldx,@oldy);
  629.   if (oldy>y) then { putdec(oldy-y); putchar('-') };
  630.   if (oldy<y) then { putdec(y-oldy); putchar('j') };
  631.   putdec(x+1);
  632.   putchar('|');
  633. };
  634.  
  635. procedure vichline();
  636. {
  637.   putchar(27);
  638.   putchar('u');
  639.   putchar('C');
  640. };
  641.  
  642. procedure vichword();
  643. {
  644.   putchar('c');
  645.   putchar('w');
  646. };
  647.  
  648. procedure _MOUSE(x,y: integer);
  649. var time: longint;
  650. {
  651.  time := TickCount();
  652.  if ((time-lastdbl)<dbltime) then { vichline(); lastdbl:=0 }
  653.   else if ((time-lastclick) < dbltime) then { vichword(); lastdbl:=time
  654. }
  655.   else  vimove(x,y);
  656.  lastclick:=time;
  657. };
  658.  
  659.  
  660. procedure _INIT();
  661. {
  662.   getport(@xxport);
  663.   movewindow(xxport, 4, 40, 0B);
  664.   sizewindow(xxport, 504, 296, 0B);
  665.  
  666.   hider();
  667.   initEasymenus();
  668.   stuffhex(rateblock,"00FCBD5E2E0A0401");  (* Baud rates for mac *)
  669.  
  670. addmenu(550,"Params");
  671.   additem(550,"2 Stops");
  672.   additem(550,"1.5 Stops");
  673.   additem(550,"1 Stop");
  674.   additem(550,"(-");
  675.   additem(550,"No Parity");
  676.   additem(550,"Even Parity");
  677.   additem(550,"Odd Parity");
  678.   additem(550,"(-");
  679.   additem(550,"8 Data");
  680.   additem(550,"7 Data");
  681.   additem(550,"6 Data");
  682.   additem(550,"5 Data");
  683.  
  684. addmenu(500,"Baud");
  685.   additem(500,"300");
  686.   additem(500,"600");
  687.   additem(500,"1200");
  688.   additem(500,"2400");
  689.   additem(500,"9600");
  690.   additem(500,"19.2k");
  691.   additem(500,"38.4k");
  692.  
  693. addmenu(600,"Options");
  694.   additem(600,"Send Break");
  695.   additem(600,"(-");
  696.   additem(600,"Send...");
  697.   additem(600,"(-");
  698.   additem(600,"Receive...");
  699.   additem(600,"(-");
  700.   additem(600,"Delete...");
  701.   additem(600,"(-");
  702.   additem(600,"Hard Copy");
  703.  
  704.   rcv := 0;
  705.   print := 0;
  706.   dbltime := 20;lastclick:=0;lastdbl:=0;
  707.  
  708.   InitSettings();
  709.  
  710.   nocurse := 1;
  711.  
  712.   lheight := 11;
  713.   charw := 6;
  714.  
  715.   utilrgn := newrgn();
  716.  
  717.   rcbsize := 1024;
  718.  
  719.   moveto(charw,lheight);
  720. end;
  721.  
  722. procedure _MENU(menuid,menuitem: integer);
  723.  
  724. begin
  725.   Case MenuId of
  726.     550:            (* params menu *)
  727.       Begin
  728.       if (menuitem<4) then setstops(menuitem) else
  729.       if (menuitem<8) then setparity(menuitem) else
  730.         setdata(menuitem)
  731.       End;
  732.     600:            (* Options Menu *)
  733.       Case MenuItem of
  734.         1: serbreak();
  735.         3: if !rcv then sendfile();
  736.         5: if rcv then endrcv() else startrcv();
  737.         7: delete();
  738.         9: if (print) then stopprint() else startprint();
  739.       end;
  740.     500: if (menuitem<>baud) then setbaud(menuitem);
  741.   End;
  742. end;
  743.  
  744. procedure _KEY(c, mods : Integer);
  745. var hit: integer;
  746. {
  747.   obscurecursor();
  748.   hit := -1;
  749.   if (c='`') then { c := 27; mods:= 0 } else
  750.   if (c='Y') then { c := '`'; mods:=0 };
  751.   keyconv(@c,@mods);
  752.   if (c=19) then
  753.     loop(,,,hit<>-1) checkkey(@hit,@mods) (* fake ctrl-s *)
  754.    else
  755.     putchar(c);
  756.   if (c=127) then serflush();
  757. };
  758.  
  759. procedure _HALT();
  760. {
  761.   haltEasymenus();
  762.   disposergn(utilrgn);
  763.   haltSettings();
  764. };
  765.  
  766. procedure _MAIN();
  767.   {  termtask()  };
  768.