From:	MERC::"uunet!WKUVX1.BITNET!FILESERV-Mgr" 14-JUL-1992 12:52:47.48
To:	galaxy::gleeve
CC:	
Subj:	UUCODE.005-OF-008

-+-+-+-+-+-+-+-+ START OF PART 5 -+-+-+-+-+-+-+-+
X          hunk`5B2`5D := (((chars`5B2`5D * 64) + chars`5B3`5D)MOD 256);
X
X(* 3-27-91  Included MOD 256 in previous three lines to prevent hunk`5Bi`5D
X            from being larger than a byte.   J. Snider*)
X
X          byteNum := 0;
X        end; `7BGetNextHunk`7D
X`20
X      begin `7BDecodeByte`7D
X        if byteNum = 3 then GetNextHunk;
X        writebin (chr(hunk`5BbyteNum`5D));
X        byteNum := succ(byteNum)
X      end; `7BDecodeByte`7D
X`20
X    begin `7BDecodeLine`7D
X      lineIndex := 0;
X      byteNum := 3;
X      count := (ord(nextch) - offset);
X      for i := 1 to count do DecodeByte;
X      size:=size+count;
X      if LineNum mod 10 = 0 then
X      smg$put_chars(display_id:=display,row:=11,column:=51,text:=dec(size,7,
V1));
X    end; `7BDecodeLine`7D
X`20
X  procedure terminate;
X`20
X    var trailer    : string80;
X        TERMINATOR : UNSIGNED_WORD;
X        keyboard   : integer;
X`20
X    begin `7Bterminate`7D
X     if eof(infile) and (line <> 'end')
X      then abort ('Abnormal end.')
X      else
X       begin
X        if eof(infile) then trailer := line
X                       else NextLine (trailer);
X        if (length(trailer)<3) or (substr(trailer,1,3)<>'end')
X         then abort ('Abnormal end.')
X         else
X          begin
X           if op_mode='VAXBIN'
X            then
X             begin
X              size:=size+dummy_count;
X              smg$put_chars(display_id:=display,row:=11,column:=51,
X                            text:=dec(size,7,1));
X              smg$put_chars(display_id:=display,row:=12,column:=51,
X                            text:=dec(LineNum,7,1));
X              write(outfile,dummy);
X             end
X           else
X            if op_mode='ATARI'
X             then
X              begin
X               size:=size+outidx;
X               smg$put_chars(display_id:=display,row:=11,column:=51,
X                             text:=dec(size,7,1));
X               smg$put_chars(display_id:=display,row:=12,column:=51,
X                             text:=dec(LineNum,7,1));
X               write(atariout,outbuf);
X              end;
X           if errors=0
X            then
X             smg$put_chars(display_id:=display,row:=16,column:=2,
X                           text:='Successful.')
X            else
X             smg$put_chars(display_id:=display,row:=16,column:=2,
X                           text:='Finished.');
X          end;
X       end;
X     if op_mode='ATARI'
X      then close(atariout)
X      else close (outfile);
X     if log_mode = 'YES'
X      then
X       begin
X        writeln(logout);
X        writeln(logout,'Filesize       : ',size);
X        writeln(logout,'decoded Lines  : ',LineNum);
X        writeln(logout,'Errors         : ',errors);
X        close(logout);
X       end;
X    end;
X`20
X  begin `7Buudecode`7D
X    init;
X    if not file_not_found
X     then
X      begin
X       NextLine(line);
X       while CheckLine and not file_not_found do
X        begin
X          DecodeLine;
X          NextLine(line)
X         end;
X       if not file_not_found then terminate;
X      end;
X    smg$set_cursor_abs(display_id:=maindisp,row:=22,column:=1);
X  end.
$ CALL UNPACK [.UUCODE.PASCAL]UUDECODE.PAS;1 1159510892
$ create 'f'
XDEFINE VERB UUENCODE
X IMAGE "WKU$ROOT:`5BEXE`5Duuencode.exe"
X PARAMETER P1, LABEL=INPUTFILE, PROMPT="Input_file?", VALUE(REQUIRED)
X PARAMETER P2, LABEL=OUTFILE, PROMPT="Output_file?", VALUE(REQUIRED)
X QUALIFIER MODE, VALUE(TYPE=MODES), DEFAULT
X QUALIFIER OUTPUT, VALUE(TYPE=$FILE)
X QUALIFIER SPLIT, VALUE(TYPE=$NUMBER)
X QUALIFIER TABLE, VALUE(TYPE=$FILE)
X QUALIFIER LOG, VALUE(TYPE=$FILE)
XDEFINE TYPE MODES
X KEYWORD ATARI
X KEYWORD VAX
X KEYWORD VAXBIN, DEFAULT
$ CALL UNPACK [.UUCODE.PASCAL]UUENCODE.CLD;1 624971966
$ create 'f'
X`5BINHERIT('SYS$LIBRARY:STARLET')`5D
Xprogram uuencode_vms (INPUT,output,tablein,logout,infile,OUTFILE);
X`20
X  CONST offset = 32;
X`20
X  TYPE string80      = varying`5B80`5D of char;
X       string65535   = varying`5B65535`5D of char;
X       string62      = varying`5B62`5D of char;
X       pack_128      = packed array`5B1..128`5D of char;
X       unsigned_word = `5Bword`5D 0..65535;
X       cells         = @box;
X       box           = record
X                        info : char;
X                        next : cells;
X                       end;
X`20
X  VAR infile     : text;
X      outfile    : text;
X      tablein    : text;
X      logout     : text;
X      lineNum    : integer;
X      line       : cells;
X      inidx      : integer;
X      inbuf      : pack_128;
X      outidx     : integer;
X      outbuf     : string62;
X      lines      : integer;
X      display    : integer;
X      maindisp   : integer;
X      pasteboard : integer;
X      keyboard   : integer;
X      errors     : integer;
X      size       : integer;
X      i          : integer;
X      l          : integer;
X      l_line     : integer;
X      op_mode    : packed array`5B1..20`5D of char;
X      log_mode   : string80;
X      e_o_f      : boolean;
X      go_on      : boolean;
X      table      : string80;
X      file_not_found : boolean;
X      split      : boolean;
X      outcount   : integer;
X      split_now  : boolean;
X      split_char : string80;
X      outfilename: string80;
X      split_count: integer;
X      amount     : integer;
X      header     : string80;
X`20
XFUNCTION SMG$CREATE_VIRTUAL_DISPLAY(
X    ROWS, COLUMNS : INTEGER;
X    VAR DISPLAY_ID : INTEGER;
X    DISPLAY_ATTRIBUTES, VIDEO_ATTRIBUTES, CHAR_SET : UNSIGNED
X        := %IMMED 0) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$CREATE_PASTEBOARD (
X    VAR PASTEBOARD_ID : INTEGER;
X    OUTPUT_DEVICE : PACKED ARRAY`5BA..B:INTEGER`5D OF CHAR:= %IMMED 0;
X    ROWS, COLUMNS : INTEGER := %IMMED 0;
X    PRESERVE_SCREEN_FLAG : BOOLEAN := %IMMED 0) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$CREATE_VIRTUAL_KEYBOARD (
X    VAR KEYBOARD_ID : INTEGER;
X    FILESPEC : PACKED ARRAY`5BA..B:INTEGER`5D OF CHAR := %IMMED 0;
X    DEFAULT_FILESPEC : PACKED ARRAY `5BC..D:INTEGER`5D OF CHAR := %IMMED 0;
X    RESULTANT_FILESPEC : PACKED ARRAY `5BE..F:INTEGER`5D OF CHAR := %IMMED 0
X    ) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$PASTE_VIRTUAL_DISPLAY (
X    DISPLAY_ID, PASTEBOARD_ID : INTEGER;
X    ROW, COLUMN : INTEGER) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$UNPASTE_VIRTUAL_DISPLAY (
X    DISPLAY_ID,PASTEBOARD_ID : INTEGER) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$PUT_CHARS (
X    DISPLAY_ID : INTEGER;
X    TEXT : PACKED ARRAY `5BA..B:INTEGER`5D OF CHAR;
X    ROW : INTEGER := %IMMED 0;
X    COLUMN : INTEGER := %IMMED 0;
X    ERASE_FLAG, RENDITION_SET, RENDITION_COMPLEMENT : UNSIGNED := %IMMED 0;
X    CHAR_SET : UNSIGNED := %IMMED 0) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$CREATE_VIRTUAL_KEYBOARD (
X    VAR KEYBOARD_ID : INTEGER;
X    FILESPEC : PACKED ARRAY`5BA..B:INTEGER`5D OF CHAR := %IMMED 0;
X    DEFAULT_FILESPEC : PACKED ARRAY `5BC..D:INTEGER`5D OF CHAR := %IMMED 0;
X    RESULTANT_FILESPEC : PACKED ARRAY `5BE..F:INTEGER`5D OF CHAR := %IMMED 0
X    ) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$READ_KEYSTROKE (
X    KEYBOARD_ID : INTEGER;
X    VAR TERMINATOR_CODE : UNSIGNED_WORD;
X    PROMPT : PACKED ARRAY`5BA..B:INTEGER`5D OF CHAR := %IMMED 0;
X    TIMEOUT, DISPLAY_ID : INTEGER := %IMMED 0) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$SET_CURSOR_ABS (
X    DISPLAY_ID : INTEGER;
X    ROW, COLUMN : INTEGER := %IMMED 0) : UNSIGNED; EXTERN;
X`20
XFUNCTION CLI$GET_VALUE (
X    ENTITY_DESC : PACKED ARRAY`5BA..B:INTEGER`5D OF CHAR;
X    VAR RETDESC : PACKED ARRAY`5BC..D:INTEGER`5D OF CHAR;
X    VAR RETLENGTH : UNSIGNED_WORD) : UNSIGNED; EXTERN;
X`20
XFUNCTION CLI$PRESENT (
X    ENTITY_DESC : PACKED ARRAY`5BA..B:INTEGER`5D OF CHAR)
X    : BOOLEAN; EXTERN;
X`20
X  procedure Abort(message: string80);
X  var line : string80;
X      blank: packed array`5B1..48`5D of char;
X    begin `7Babort`7D
X      if message<>'Finished.' then errors:=succ(errors);
X      blank:=' ';
X      if lineNum > 0
X        then line:='Line '+dec(lineNum,5,1)+': '+message
X        else line:=message;
X      smg$put_chars(display_id:=display,row:=14,column:=13,text:=blank);
X      smg$put_chars(display_id:=display,row:=13,column:=13,text:=blank);
X      smg$put_chars(display_id:=display,row:=13,column:=53,
X                    text:=dec(errors,5,1));
X      smg$put_chars(display_id:=display,row:=14,column:=59-length(line),
X                    text:=line);
X      if (log_mode='YES') and (message <> 'Finished.')
X       then writeln(logout,line);
X    end; `7BAbort`7D
X`20
X  Function nil_qu : cells;
X  begin nil_qu:=nil; end;
X`20
X  Function ismt_qu (stack : cells) : boolean;
X  begin ismt_qu:=stack=nil; end;
X`20
X  Procedure qu (ch : char; var stack : cells);
X  var new_member : cells;
X  begin
X   new(new_member);
X   new_member@.info:=ch;
X   new_member@.next:=stack;
X   stack:=new_member;
X  end;
X`20
X  Function Pull (var stack : cells) : char;
X  var help : cells;
X  begin
X   help:=stack;
X   stack:=stack@.next;
X   help@.next:=nil;
X   pull:=help@.info;
X   dispose(help);
X  end;
X`20
X  procedure change_file;
X  var sub_name  : string80;
X      sub_part1 : string80;
X      sub_part2 : string80;
X      i,j,k    : integer;
X  begin
X   split_char:=dec(split_count,5,1);
X   while index(split_char,' ') > 0 do
X    begin
X     j:=index(split_char,' ');
X     if j=1
X      then split_char:=substr(split_char,2,length(split_char)-1)
X      else split_char:=substr(split_char,1,j-1)+
X                       substr(split_char,j+1,length(split_char)-j);
X    end;
X   i:=index(outfilename,'`5D')+1;
X   sub_name:=substr(outfilename,i,length(outfilename)-i+1);
X   sub_part1:=substr(outfilename,1,i-1);
X   i:=index(sub_name,'.')-1;
X   sub_part2:=substr(sub_name,i+1,length(sub_name)-i);
X   sub_name:=sub_part1+substr(sub_name,1,i)+'_PART_'+split_char+sub_part2;
X   writeln(outfile,'include '+sub_name+' a');
X   close(outfile);
X   open(outfile,sub_name,history:=new);
X   rewrite(outfile);
X   writeln(outfile,'begin 666 ',sub_name);
X   smg$put_chars(display_id:=display,row:=7,column:=58-length(sub_name),
X                 text:=sub_name);
X   split_now:=false;
X   split_count:=succ(split_count);
X   outcount:=0;
X  end;
X`20
X  Procedure Writebin (ch: char);
X  begin
X   if outcount > amount
X    then split_now:=true
X    else outcount:=succ(outcount);
X   if ch=chr(32) then ch:=chr(96);
X   if ch=chr(94) then ch:=chr(126);
X   outbuf:=outbuf+ch;
X   if outidx =  l_line div 3 *4 +2
X    then
X     begin
X      if split_now and split then change_file;
X      writeln(outfile,outbuf);
X      outidx:=1;
X      outbuf:='';
X      size:=size+l_line;
X      smg$put_chars(display_id:=display,row:=11,column:=51,text:=dec(size,7,
V1));
X      lineNum:=succ(lineNum);
X      smg$put_chars(display_id:=display,row:=12,column:=53,
X                    text:=dec(lineNum,5,1));
X     end
X    else outidx:=outidx+1;
Xend;
X`20
X  procedure NextLine(var line : cells; var s_length : integer);
X  var i : integer;
X      l : integer;
X      ch : char;
X      s,help : string65535;
X    begin `7BNextLine`7D
X      l:=s_length;
X      help:='';
X      while not ismt_qu(line) do help:=help+pull(line);
X      while (l<=45) and not eof(infile)  do
X      begin
X       s:='';
X       readln(infile,s);
X       s_length:=length(s);
X       if op_mode = 'VAX'
X        then
X         begin
X          help:=help+chr(s_length div 256)+chr(s_length mod 256)+s;
X          l:=l+2;
X         end
X        else help:=help+s;
X       l:=l+s_length;
X      end;
X      if eof(infile)
X       then
X        while (l mod 3 <> 0) do begin help := help + chr(0); l:=l+1; end;
X      for i:=l downto 1 do qu(help`5Bi`5D,line);
X      s_length:=l;
X    end; `7BNextLine`7D
X`20
X  procedure Init;
X  var infile_name : packed array`5B1..80`5D of char;
X      infilename  : string80;
X      inf_length  : unsigned_word;
X`20
X  procedure init_table;
X  var i,ii: integer;
X      table_found : packed array`5B1..80`5D of char;
X      table_length : unsigned_word;
X      table_name  : string80;
X`20
X      procedure ParseTable;
X      var i : integer;
X      begin
X       table:='';
X       readln(tablein,header);
X       while (substr(header,1,5) <> 'begin') and
X             (length(table)<64) do
X        begin
X         table:=table+header;
X         readln(tablein,header,error:=continue);
X        end;
X       if length(table) < 64 then abort('Incomplete Encodingtable');
X      end;
X`20
X  begin
X   cli$get_value('TABLE',table_found,table_length);
X   if table_length <> 0
X    then
X     begin
X      open(tablein,table_found,history:=old,error:=continue);
X      if status(tablein) = 3
X       then
X        begin
X         file_not_found:=true;
X         abort('tablefile not found');
X        end
X       else
X        begin
X         reset(tablein);
X         ParseTable;
X         table_name:='';
X         for ii:=1 to table_length do
X          table_name:=table_name+table_found`5Bii`5D;
X         if log_mode = 'YES'
X          then writeln(logout,'Tablefile      : ',table_name);
X         close(tablein);
X        end;
X     end
X    else
X     begin
X      table:='';
X      for i:=32 to 95 do table:=table+chr(i);
X      table`5B1`5D:=chr(96);
X      table`5B63`5D:=chr(126);
X     end;
X  end;
X`20
X  procedure trailer;
X  BEGIN
X    smg$create_virtual_display (rows:=24,columns:=78,display_id:=maindisp);
X    SMG$CREATE_VIRTUAL_DISPLAY (ROWS:=15,COLUMNS:=60,display_id:=display,
X        DISPLAY_ATTRIBUTES:=SMG$M_BORDER);
X    SMG$CREATE_PASTEBOARD (PASTEBOARD_ID:=pasteboard);
X    SMG$CREATE_VIRTUAL_KEYBOARD(KEYBOARD_ID:=keyboard);
X    smg$paste_virtual_display(display_id:=maindisp,pasteboard_id:=pasteboard
V,
X                              row:=1,column:=1);
X    SMG$PASTE_VIRTUAL_DISPLAY(DISPLAY_ID:=DISPLAY,
X        PASTEBOARD_ID:=pasteboard,ROW:=5,COLUMN:=10);
X    smg$put_chars(display_id:=display,row:=2,column:=24,text:='UUENCODE V1.8
V');
X    smg$put_chars(display_id:=display,row:=3,column:=22,
X                  text:='by Christian Bode');
X    smg$put_chars(display_id:=display,row:=5,column:=2,text:='Encoding:');
X    smg$put_chars(display_id:=display,row:=7,column:=2,text:='as:');
X    smg$put_chars(display_id:=display,row:=9,column:=2,text:='Fileheadername
V:');
X    smg$put_chars(display_id:=display,row:=10,column:=2,text:='Mode:');
X    smg$put_chars(display_id:=display,row:=11,column:=2,text:='Filesize:');
X    smg$put_chars(display_id:=display,row:=12,column:=2,text:='Lines encoded
V:');
X    smg$put_chars(display_id:=display,row:=13,column:=2,text:='Errors:');
X    smg$put_chars(display_id:=display,row:=14,column:=2,text:='Last Error:')
V;
Xend;
X`20
X    procedure GetInFile;
X    var i : integer;
X    begin
X     cli$get_value('INPUTFILE',infile_name,inf_length);
X     infilename:='';
X     for i:=1 to inf_length do infilename:=infilename+infile_name`5Bi`5D;
X     open(infile,infilename,history:=old,error:=continue);
X     smg$put_chars(display_id:=display,row:=5,column:=58-length(infilename),
X                   text:=infilename);
X     if status(infile) = 3
X      then
X       begin
X        file_not_found:=true;
X        smg$put_chars(display_id:=display,row:=14,column:=43,
X                      text:='File not found.');
X       end
X      else
X       begin
X        reset(infile);
X        if log_mode ='YES'
X         then writeln(logout,'Inputfile      : ',infilename);
X       end;
X    end;
X`20
X    procedure GetOutFile;
X    var header, mode : string80;
X        outfile_name : packed array`5B1..80`5D of char;
X        outf_length : unsigned_word;
X        i,j : integer;
X`20
X      begin `7BGetOutFile`7D
X        cli$get_value('OUTPUT',infile_name,inf_length);
X        if inf_length > 0
X         then
X          begin
X           infilename:='';
X           for i:=1 to inf_length do
X            infilename:=infilename+infile_name`5Bi`5D;
X          end;
X        smg$put_chars(display_id:=display,row:=9,column:=58-length(infilenam
Ve),
X                      text:=infilename);
X        cli$get_value('OUTFILE',outfile_name,outf_length);
X        outfilename:='';
X        for i:=1 to outf_length do
X         outfilename:=outfilename+outfile_name`5Bi`5D;
X        i:=index(outfilename,'`5D')+1;
X        j:=index(substr(outfilename,i,length(outfilename)-i+1),'.');
X        if j=0 then outfilename:=outfilename+'.UUE';
X        if log_mode = 'YES'
X         then writeln(logout,'Outputfile     : ',outfilename);
X        open(outfile,outfilename,history:=new);
X        rewrite(outfile);
X        writeln(outfile,'table');
X        writeln(outfile,substr(table,1,16));
X        writeln(outfile,substr(table,17,16));
X        writeln(outfile,substr(table,33,16));
X        writeln(outfile,substr(table,49,16));
X        mode:='666 ';
X        header:='begin '+mode+infilename;
X        if log_mode = 'YES'
X         then writeln(logout,'Fileheadername : ',infilename);
X        writeln(outfile,header);
X        smg$put_chars(display_id:=display,row:=7,column:=58-length(outfilena
Vme),
X                      text:=outfilename);
X      end; `7BGetOutFile`7D
X`20
X    procedure GetOpMode;
X    var op_length : unsigned_word;
X        opmode    : string80;
X        i         : integer;
X        split_value : packed array`5B1..80`5D of char;
X        splitvalue : string80;
X        split_length : unsigned_word;
X        log_file  : packed array`5B1..80`5D of char;
X        log_length: unsigned_word;
X`20
X    begin `7BGetOpMode`7D
X     cli$get_value('MODE',op_mode,op_length);
X     cli$get_value('LOG',log_file,log_length);
X       if log_length > 0 then log_mode:='YES' else log_mode:='NO';
X       if log_mode='YES'
X        then
X         begin
X          open(logout,log_file,history:=new);
X          rewrite(logout);
X         end;
X     opmode:='';
X     split:=cli$present('SPLIT');
X     split_now:=false;
X     split_count:=2;
X     if split
X      then
X       begin
X        cli$get_value('SPLIT',split_value,split_length);
X        splitvalue:=split_value;
X        readv(splitvalue,amount);
X        amount:=amount*1024;
X        if log_mode = 'YES'
X         then writeln(logout,'SPLIT every    : ',amount,' Byte');
X       end;
X     for i:=1 to op_length do opmode:=opmode+op_mode`5Bi`5D;
X     smg$put_chars(display_id:=display,row:=10,column:=58-length(opmode),
X                      text:=opmode);
X     if log_mode = 'YES'
X      then writeln(logout,'MODE           : ',opmode);
X    end;
X`20
X    begin `7Binit`7D
X      lineNum := 0;
X      errors:=0;
X      file_not_found:=false;
X      init_table;
X      trailer;
X      GetOpMode;
X      GetinFile;
X      if not file_not_found
X       then
X         GetOutFile;
X    end; `7B init`7D
X`20
X`20
X  procedure EncodeLine (var line : cells; var l : integer; count : integer);
X`20
X    VAR lineIndex, CharNum, byteNum, i, act_length : integer;
X        chars: array `5B0..3`5D of integer;
X        hunk: array `5B0..2`5D of  integer;
X`20
X    function nextch: char;
X    var ch : char;
X`20
X      begin `7Bnextch`7D
X       ch:=pull(line);
X       nextch:=ch;
X      end; `7Bnextch`7D
X`20
X    procedure EncodeByte;
X`20
X      procedure GetNextHunk;
X`20
X        VAR i: integer;
X`20
X        begin `7BGetNextHunk`7D
X          for i := 0 to 2  do  hunk`5Bi`5D := ord(nextch);
X          chars`5B0`5D:= (hunk`5B0`5D div 4)+ 1;
X          chars`5B1`5D:= (hunk`5B0`5D mod 4) * 16 + (hunk`5B1`5D div 16) + 1
V;
X          chars`5B2`5D:= (hunk`5B1`5D mod 16) * 4 + (hunk`5B2`5D div 64) + 1
V;
X          chars`5B3`5D:= (hunk`5B2`5D mod 64) + 1;
X          byteNum := 0
X        end; `7BGetNextHunk`7D
X`20
X      begin `7BEncodeByte`7D
X        if byteNum = 3
X         then
X          begin
X           GetNextHunk;
X           for CharNum:=0 to 3 do writebin(table`5Bchars`5BCharNum`5D`5D);
X          end;
X        byteNum:= succ(byteNum)
X      end; `7BEncodeByte`7D
X`20
X    begin `7BEncodeLine`7D
X      outidx:=1;
X      byteNum:=3;
X      writebin(chr(count+offset));
X      for i := 1 to count do begin l:=l-1; EncodeByte; end;
X      writebin(chr(97));
X    end; `7BEncodeLine`7D
X`20
X  procedure terminate;
X`20
X    var trailer    : string80;
X        TERMINATOR : UNSIGNED_WORD;
X        keyboard   : integer;
X`20
X    begin `7Bterminate`7D
X     writeln(outfile,' a');
X     writeln(outfile,'end');
X     close (infile);
X     close(outfile);
X     if log_mode = 'YES'
X      then
X       begin
X        writeln(logout);
X        writeln(logout,'Filesize       : ',size,' Byte');
X        writeln(logout,'encoded Lines  : ',LineNum);
X        writeln(logout,'Errors         : ',errors);
X        close(logout);
X       end;
X     smg$put_chars(display_id:=display,row:=15,column:=2,
X                   text:='Finished.');
X    end;
X`20
X  begin `7Buuencode`7D
X    init;
X    if not file_not_found
X     then
X      begin
X       line:=nil_qu;
X       l:=0;
X       nextline(line,l);
X       l_line:=45;
X       while not eof(infile) do
X        begin
X         while l>45 do encodeline(line,l,l_line);
X         nextline(line,l);
X        end;
X       while l>45 do encodeline(line,l,l_line);
X       l_line:=l;
X       encodeline(line,l,l_line);
X       terminate;
X      end;
X     smg$set_cursor_abs(display_id:=maindisp,row:=22,column:=1);
X  end.
$ CALL UNPACK [.UUCODE.PASCAL]UUENCODE.PAS;1 1930738469
$ create 'f'
XEncoding of file DUA1:`5BHUNTER.FILESERV.UUCODE.SMARTEST`5DUUDECODE.EXE;1
X`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`
V7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E
X4@@QUETL:,ERU9DUEI%KF%DSEMUQRY%KUU5POQTQ.LUSAIEUEMEUfbUDU4POQTQ.TDVE-SLail@C
V@5af
X@mDP@@Dah@$af@2@HB@K"GBgCb@Dal@8IJc@B<??af@Tb@Hah@Hb@mPPM1ABA5DGan@H@*@@C@DA
V@Vah
X@L2@SMADb@<ak?af@mB@@D@)$%4Uah@Bb@Z_;?_@Pat@eak@Aap@HTUUDU4POQTQarb@PmU18BLa
Vp@0#
XSJYIff%@T@L44BL0ao@D@D@@Ac@(Hb@maf@P@m@@Haf@mc@Caf@A@B@@Ac@JPb@Taf@C@PA@,??O
V@0H@
X@4OH@Pah@DB@@Lag@Ab@D,mUA!5PRQES_ACL1<A@@Aag@!b@Cag@Y@@P@JX4SRIEUL=EL0D3G@HH
Vag@D
X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f@OmTQK5TY,g7T5-B;K0?$Kb@T=TT@JA<Cm0D8E4,R@TP3JBR!IXQ!7#>GEUXBVT8QPTU)<#Oc?W
VE&mF
XPT8=H?QE%2OBc?_THGUUXBZ@Q!'@QY%2ON<b?/UXB*@Q!7#:GUTJ?Haf?Q!eTV-8#@C*@Q!YTW5-
VTUS5
XDP,<#@c?S5T@C2TQe40@H0AUCU@Z>HXS5=Tg>OWBb@T-/@$5-TUW5DN,<#@c?W5T@C2TQTP@Z>HX
VS5=T
X;K@YfKU5VMQCK?H0c?VME0mLUDD(9#mMU7S-/@$5-TU_5DM,<#@c?_5T@C2TQPm&OB6TfO5>BPFA
Vanw@
XTg(@Ham@Dc@Pc@HHb@0Gc@"c@Faxb@Jc@Dc@mBc@4Pb@0ec@dDb@eCb@0%c@dc@LBb@0Gc@fak@#
VBb@K
XJb@Aaf@mA@@m@@4aab@Dawd@emUA!5PRQESacd@mAF=$TRQESaed@F0TRBIEULAadd@XPST!$TT1
VDadd
X@mAS54QS!$Tajb@LW$@Hal@Hc@Paf@4Yb@m'Aafdb@Xm$@H0C<B0Ac@HTUUE94POQTQK8K@@Pb@P
VPd!%
X&dF<K@!Db@4m/@DRA@@mA%96X/QVYF<K@,Ab@4m/@4XA@@mA/UGf$U6XF<K@fCb@$P.ImP@P@@A@
V@0R9
XBm@I8.>+d/@Ae_>;KmA9+O<BL0=*d/@De_6)7O=BD0:BDP=4_/@E0/@ET/@A@@;BD079KP@+WO?@
V@m@E
X</@DLO>_;==ZON9$;P@A4Kagt@ee&z
$ CALL UNPACK [.UUCODE.SMARTEST]EXES.MFTU;1 422204358
$ create 'f'
X/*
X * Copyright (c) 1983 Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley.  The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED `60`60AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
X/*
X * Modified 12 April 1990 by Mark Adler for use on MSDOS systems with
X * Microsoft C and Turbo C.
X *
X * Modifed 13 February 1991 by Greg Roelofs for use on VMS systems.  As
X * with the MS-DOS version, the setting of the file mode has been disabled.
X * Compile and link normally (but note that the shared-image link option
X * produces a binary only 6 blocks long, as opposed to the 137-block one
X * produced by an ordinary link).  To set up the VMS symbol to run the
X * program ("run uudecode filename" won't work), do:
X *`09`09uudecode :== "$disk:`5Bdirectory`5Duudecode.exe"
X * and don't forget the leading "$" or it still won't work.  The binaries
X * produced by this program are in VMS "stream-LF" format; this makes no
X * difference to VMS when running decoded executables, nor to VMS unzip,
X * but other programs such as zoo or arc may or may not require the file
X * to be "BILFed" (or "unBILFed" or whatever).  Also, unlike the other
X * flavors, VMS files don't get overwritten (a higher version is created).
X *`20
X * Modified 13 April 1991 by Gary Mussar to be forgiving of systems that
X * appear to be stripping trailing blanks.
X */
X
X#ifndef lint
Xstatic char sccsid`5B`5D = "@(#)uudecode.c`095.5 (Berkeley) 7/6/88";
X#endif /* not lint */
X
X#ifdef __MSDOS__        /* For Turbo C */
X#define MSDOS 1
X#endif
X
X/*
X * uudecode `5Binput`5D
X *
X * create the specified file, decoding as you go.
X * used with uuencode.
X */
X#include <stdio.h>
X
X#ifdef VMS
X#  include <types.h>
X#  include <stat.h>
X#else
X#  ifndef MSDOS            /* i.e., UNIX */
X#    include <pwd.h>
X#  endif
X#  include <sys/types.h>   /* MSDOS or UNIX */
X#  include <sys/stat.h>
X#endif
X
X/* single-character decode */
X#define DEC(c)`09(((c) - ' ') & 077)
X
Xmain(argc, argv)
Xchar **argv;
X`7B
X`09FILE *in, *out;
X`09int mode;
X`09char dest`5B128`5D;
X`09char buf`5B80`5D;
X
X`09/* optional input arg */
X`09if (argc > 1) `7B
X`09`09if ((in = fopen(argv`5B1`5D, "r")) == NULL) `7B
X`09`09`09perror(argv`5B1`5D);
X`09`09`09exit(1);
X`09`09`7D
+-+-+-+-+-+-+-+-  END  OF PART 5 +-+-+-+-+-+-+-+-
