From: Claudio Sacerdoti Coen Date: Thu, 21 Dec 2000 14:19:38 +0000 (+0000) Subject: Autoconf used X-Git-Tag: nogzip~74 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=352196141500ca64f5a0d84218318ed78fdf830a;p=helm.git Autoconf used --- diff --git a/helm/configuration/lib/configuration.pl b/helm/configuration/lib/configuration.pl deleted file mode 100644 index e88d8fbe7..000000000 --- a/helm/configuration/lib/configuration.pl +++ /dev/null @@ -1,40 +0,0 @@ -use XML::Parser; - -use Env; -my $HELM_CONFIGURATION_PREFIX = $ENV{"HELM_CONFIGURATION_PREFIX"}; -# this should be the only fixed constant -if (defined ($HELM_CONFIGURATION_PREFIX) { - $configuration_file = - $HELM_CONFIGURATION_PREFIX."/etc/helm/configuration.xml"; -} - -$parser = new XML::Parser(Handlers => {Start => \&handle_start, - End => \&handle_end, - Char => \&handle_char}); - - -$parser->parsefile($configuration_file, ErrorContext => 3); - - -sub handle_start -{ - if ($_[1] eq "value-of") { - $$varname .= ${$_[3]}; - } elsif ($_[1] ne "configuration") { - $varname = $_[1]; - } -} - -sub handle_end -{ - if ($_[1] ne "value-of" && $_[1] ne "configuration") { - # Next line for debugging only: - # print "OK: #$_[1]# := #$$varname#\n"; - $varname = undef; - } -} - -sub handle_char -{ - $$varname .= $_[1]; -} diff --git a/helm/configuration/lib/configuration.pl.in b/helm/configuration/lib/configuration.pl.in new file mode 100644 index 000000000..e88d8fbe7 --- /dev/null +++ b/helm/configuration/lib/configuration.pl.in @@ -0,0 +1,40 @@ +use XML::Parser; + +use Env; +my $HELM_CONFIGURATION_PREFIX = $ENV{"HELM_CONFIGURATION_PREFIX"}; +# this should be the only fixed constant +if (defined ($HELM_CONFIGURATION_PREFIX) { + $configuration_file = + $HELM_CONFIGURATION_PREFIX."/etc/helm/configuration.xml"; +} + +$parser = new XML::Parser(Handlers => {Start => \&handle_start, + End => \&handle_end, + Char => \&handle_char}); + + +$parser->parsefile($configuration_file, ErrorContext => 3); + + +sub handle_start +{ + if ($_[1] eq "value-of") { + $$varname .= ${$_[3]}; + } elsif ($_[1] ne "configuration") { + $varname = $_[1]; + } +} + +sub handle_end +{ + if ($_[1] ne "value-of" && $_[1] ne "configuration") { + # Next line for debugging only: + # print "OK: #$_[1]# := #$$varname#\n"; + $varname = undef; + } +} + +sub handle_char +{ + $$varname .= $_[1]; +}