1994-09-10 06:27:55 +00:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
require 'sizeof.ph';
|
|
|
|
|
1994-10-27 23:16:54 +00:00
|
|
|
$LIB = '/usr/share/perl';
|
1994-09-10 06:27:55 +00:00
|
|
|
|
|
|
|
foreach $include (@ARGV) {
|
|
|
|
printf STDERR "including %s\n", $include;
|
|
|
|
do $include;
|
|
|
|
warn "sourcing $include: $@\n" if ($@);
|
|
|
|
if (!open (INCLUDE,"$LIB/$include")) {
|
|
|
|
warn "can't open $LIB/$include: $!\n";
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
while (<INCLUDE>) {
|
|
|
|
chop;
|
|
|
|
if (/^\s*eval\s+'sub\s+(\w+)\s.*[^{]$/ || /^\s*sub\s+(\w+)\s.*[^{]$/) {
|
|
|
|
$var = $1;
|
|
|
|
$val = eval "&$var;";
|
|
|
|
if ($@) {
|
|
|
|
warn "$@: $_";
|
|
|
|
print <<EOT;
|
|
|
|
warn "\$$var isn't correctly set" if defined \$_main{'$var'};
|
|
|
|
EOT
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
( $nval = sprintf ("%x",$val ) ) =~ tr/a-z/A-Z/;
|
|
|
|
printf "\$%s = 0x%s;\n", $var, $nval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|