{$Z63,S3,V+,E1,W-,F1,T0}
definition module sheltool(output);
(* copyright 1987, John J. Newlin *)
const
  main_color = 16#0E#;
  curs_color = 16#70#;
  maxfiles = 200;
  up     = 72;   f1 = 59;
  down   = 80;   f2 = 60;
  endkey = 79;   f3 = 61;
  home   = 71;   f4 = 62;
  retkey = 28;   f5 = 63;
  pgup   = 73;   f6 = 64;
  pgdn   = 81;   f7 = 65;
  spce   = 57;   f8 = 66;
  esc    = 1;    f9 = 67;
  tab    = 15;  f10 = 68;
  ins    = 82;
  del    = 83;
  ctrl_end =  117;
  ctrl_home = 119;
  ctrl_pgup = 132;
  horiz      = "Ä";
  vert       = "³";
  ul         = "Ú";
  ur         = "¿";
  ll         = "À";
  lr         = "Ù";
  space      = " ";
  windows    = 2;

type
  str8 = string[8];
  str12 = string[12];
  str64 = string[64];
  regtype = record
                ax,bx,cx,dx,di,si,ds,es,flags : integer;
            end;
  {$U0}
  buff_type = record
                dos_use : array[0..20] of char;
                attr : char;
                time,date,losize,hisize : integer;
                filename  : str12;
              end;

  file_type = record
                attr : char;
                time,date,losize,hisize : integer;
                name : str12;
                desig : integer;
              end;
  file_array = array[1..maxfiles] of file_type;
  dir_array = array[1..windows] of file_array;
  {$U1}

  longint = array[0..1] of integer;
  longstring = string[11];
  screenbuff_type = array[1..4000] of char;

var
{  files1,files2 : file_array; }
  files : dir_array;
  save_t_time,save_time,attr,seed : integer;
  entry_str : string;
  color : boolean;
  screenbuff : screenbuff_type;

function shiftl(target,bits : integer) : integer;

function upcase(ch : char) : char;

function shiftr(target,bits : integer) : integer;

function hi(target : integer) : integer;

function lo(target : integer) : integer;

procedure exec(var name : string);

procedure execute(var command : string);

function format_num(long : longint; width : integer) : string;

procedure get_files(var mask : string; var files : file_array;
                    var count : integer);

function filedate(code : integer) : str12;

procedure draw_box(col,row,width,depth : integer);

procedure save_cursor;

procedure hide_cursor;

procedure rest_cursor;

function filetime(code : integer) : str12;

function convert(var st : str12) : str12;

procedure sort_files(var files : file_array; var items : integer);

procedure longstr(var long : longint; var strng : longstring);

procedure addlong(var total,n1,n2 : longint);

function delete_file(addr : integer) : integer;

function keycode(var status,ascii,scan : integer) : boolean;

procedure scroll(ulx,uly,lrx,lry,lines,attr,dir : integer);

procedure savebox(col,row,width,depth,attr : integer);

procedure restbox(col,row,width,depth,attr : integer);

procedure set_dta(var buffer : buff_type);

procedure init_screen;

procedure msdos(var regs : regtype);

procedure setxy(col,row : integer);

procedure screenwrite(col,row,attr : integer; var str : string);

procedure fillstr(var str : string; num : integer; ch : char);

procedure move(v1addr,v2addr,bytes : integer);

function chdir(var dirname : string) : integer;

function mkdir(var dirname : string) : integer;

function rmdir(var dirname : string) : integer;

function findfirst(var pathname : string; attr : integer) : integer;

function findnext : integer;

procedure cls(attribute : integer);

procedure strng(num : integer; var numstr : string);

function abs_read(drive,sectors,start,buff_addr:integer):integer;

procedure getdir(var path : string);

function set_mem : integer;

function video_mode : integer;

procedure fx(barlen,battr,col,row,attr : integer; var str : string);

end.

