package Yaala::Report::Core;

use strict;
use warnings;
use vars qw#$OUTPUTDIR#;

use Exporter;
use Yaala::Config qw#get_config#;

@Yaala::Report::Core::EXPORT_OK = qw#$OUTPUTDIR#;
@Yaala::Report::Core::ISA = ('Exporter');

my $VERSION = '$Id: Core.pm,v 1.5 2003/12/07 14:53:30 octo Exp $';
print STDERR $/, __FILE__, ": $VERSION" if ($::DEBUG);

$OUTPUTDIR = get_config ('directory');
if ($OUTPUTDIR)
{
	$OUTPUTDIR =~ s#/$##;
	if (!-d $OUTPUTDIR)
	{
		print STDERR $/, __FILE__, qq#: Directory "$OUTPUTDIR" does not exist.\n#;
		exit (1);
	}
	$OUTPUTDIR .= '/';
}
elsif (-d 'reports')
{
	$OUTPUTDIR = 'reports/';
}
else
{
	print STDERR $/, __FILE__, ": Unknown output directory. Using current ",
		"directory instead!",
		$/, __FILE__, ": To abort press CTRL+c within the next 10 secons";
	
	sleep 10;

	$OUTPUTDIR = './';
}

return (1);
