program LISTPACK (input, tty);
 
{ This program examines a file of concatenated sources.
  A list of module names is produced.  Each module
  must start with one line giving the file name and
  end with one line containing '****'.
  Such packing is performed by the program PACK.
}
 
var
    filnam:  packed array [0..20] of char;
    i, j, nstar:  integer;
    c:  char;
    eom:  boolean;
 
begin
write (tty, 'Name of packed file: ');   break;
readln (tty);
j := 0;
filnam := '                     ';
while not eoln(ttyin) do
    begin
    read (tty, filnam[j]);
    j := j + 1
    end;
reset (input, filnam);
if eof(input) then
    writeln (tty, filnam, 'not found')
else
    while not eof(input) do
	begin
	filnam := '                     ';
	i := 0;
	while not eoln(input) and (i<20) do
	    begin
	    read (filnam[i]);
	    i := i + 1
	    end;
	readln;
	eom := false;
	writeln (tty, filnam);
	while not eom do
	    begin
	    nstar := 0;
	    for i := 1 to 4 do
		if input^ = '*' then
		    begin
		    nstar := nstar + 1;
		    get (input)
		    end;
	    eom := nstar = 4;
	    readln;
	    end; { while }
        end { while }
end.
