home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / INTRFC.ZIP / INTRFC.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-05-07  |  1.4 KB  |  59 lines

  1. program intrfc;
  2. {  Prints out the information contained in a TPU file  }
  3.  
  4. uses
  5.   util,globals,objstuff,test1,hash;
  6.  
  7. var
  8.   i,j,t:word;
  9.   result : word;
  10.  
  11. begin
  12.   if paramcount > 0 then
  13.     uses_path := paramstr(1)
  14.   else
  15.     uses_path := '.\';
  16.  
  17.   if uses_path[length(uses_path)] <> '\' then
  18.     uses_path := uses_path + '\';
  19.  
  20.   tpl_size := read_file('turbo.tpl',pointer(tpl_buffer));
  21.   if tpl_buffer = nil then
  22.     tpl_size := read_file(uses_path+'turbo.tpl',pointer(tpl_buffer));
  23.   if tpl_buffer <> nil then
  24.     got_tpl := true
  25.   else
  26.   begin
  27.     got_tpl := false;
  28.     writeln('Warning:  TURBO.TPL not found.');
  29.   end;
  30.  
  31.   repeat
  32.     mark(just_tpl);
  33.     repeat
  34.       write('Enter filename (without .TPU): ');
  35.       readln(unitname);
  36.       unit_size := read_file(unitname+'.tpu',pointer(buffer));
  37.     until buffer <> nil;
  38.  
  39.     header := pointer(buffer);
  40.     heapptr := add_offset(buffer,header^.sym_size); { release all but symbols }
  41.     hash_table := add_offset(buffer,header^.ofs_hashtable);
  42.  
  43.     {Build main object list}
  44.  
  45.     build_list(obj_list,buffer,hash_table);
  46.  
  47.     new(unit_list[64]);
  48.     for i:=65 to 255 do
  49.       unit_list[i] := nil;
  50.  
  51.     unit_list[64]^.name := unitname;
  52.     unit_list[64]^.buffer := buffer;
  53.     unit_list[64]^.obj_list := obj_list;
  54.  
  55.     { Now print it }
  56.     print_obj_list;
  57.     release(just_tpl);
  58.   until false;
  59. end.