#!/opt/SUNWstade/bin/perl -I/opt/SUNWstade/lib
#<copyright>
# ----------------------------------------------------------
# Sun Proprietary/Confidential Code
# Copyright 2001, Sun Microsystems, Inc. All rights reserved.
# ----------------------------------------------------------
#</copyright>


use Ilist;
use Message;
use Util;

use Debug;

Debug->level(3);



$file= $ARGV[0];
if (!$file) {
  print "readToc <filename> \n\n";
  exit;
} 

open(O, $file);
while ($l = <O>) {
  $toC .= $l;
  if ($l =~ /^-E/) {
    $ed = Message->fromC($toC);
    print $ed->toString;
    $toC= "";
  }
}
close(O);


if ($toC) {
 $ed = Message->fromC($toC);
 print $ed->toString;
}

 #print $ed->toC();

