# perl functions for kplug library
# vim:ts=4:sw=4

sub cleanse_err($)
{
	my $err = $_[0];
	$err =~ s/$0 //;

	return $err;
}

sub fatal_fail(*$)
{
	my $cgi=$_[0];
	my $err=$_[1];

	print $$cgi->header,
		$$cgi->start_html('Sorry!'),
		$$cgi->h1('Not Available'),
		$$cgi->p('This service is momentarily down.'),
		$$cgi->p('Please try again later.'),
		$D?$$cgi->p("$err"):"",
		$$cgi->end_html;
	exit 0
}

sub S($)
{
	# makes a string for inclusion into a query.
	# for postgres, this is to encapsulate in single quotes.
	# i have no idea about MySQL, but all i need to do is change
	# this function!
	
	return "\'$_[0]\'";
}

# do not delete the following line!
1;
