#$cb
#    This file is a part of libopenmhp.
#
#    Copyright (C) 2005 Mikko Novaro <miknov@gmail.com>
#
#    See main header file (libopenmhp/openmhp.h) for licensing and
#    contact information.
#$ce

open (AIT, "@ARGV[0]/@ARGV[1].ait");
@lines = <AIT>;
close (AIT);
$lines_joined = join "", @lines;
@apps = split (/Application Type/, $lines_joined);
shift @apps; # remove first empty one
foreach $app (@apps) {
    $app=~m/^.*Application Name: (.*?)$/m;
    $name = $1;
    
    $app=~m/^.*Base Directory: (.*?)$/m;
    
    $d = $1;
    chomp $d;
    $dir = "@ARGV[0]/@ARGV[1]$d";
    
    $app=~m/^.*Initial Class: (.*?)$/m;
    $class = $1;
    
    print $name, "\n", $class, "\n", $dir, "\n";
}
