backport to Perl 5.005
This commit is contained in:
parent
f753b02aec
commit
35d40b01b0
|
@ -8,8 +8,9 @@ use Exporter;
|
||||||
use File::Path;
|
use File::Path;
|
||||||
use IO::File ();
|
use IO::File ();
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
use vars qw(@ISA @EXPORT);
|
||||||
our @EXPORT = qw(generate);
|
@ISA = qw(Exporter);
|
||||||
|
@EXPORT = qw(generate);
|
||||||
|
|
||||||
sub archname {
|
sub archname {
|
||||||
my $os = lc $^O;
|
my $os = lc $^O;
|
||||||
|
@ -226,7 +227,9 @@ my $nfs_v3 = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
our %classes = (
|
use vars qw(%classes %cmds);
|
||||||
|
|
||||||
|
%classes = (
|
||||||
Mem => [
|
Mem => [
|
||||||
{
|
{
|
||||||
name => 'total', type => 'Long',
|
name => 'total', type => 'Long',
|
||||||
|
@ -1410,7 +1413,7 @@ while (my($subclass, $superclass) = each %extends) {
|
||||||
push @{ $classes{$subclass} }, @{ $classes{$superclass} };
|
push @{ $classes{$subclass} }, @{ $classes{$superclass} };
|
||||||
}
|
}
|
||||||
|
|
||||||
our %cmds = (
|
%cmds = (
|
||||||
Mem => {
|
Mem => {
|
||||||
AIX => 'top',
|
AIX => 'top',
|
||||||
Darwin => 'top',
|
Darwin => 'top',
|
||||||
|
@ -1599,7 +1602,7 @@ sub generate {
|
||||||
my $package = __PACKAGE__ . "::$lang";
|
my $package = __PACKAGE__ . "::$lang";
|
||||||
eval "require $package";
|
eval "require $package";
|
||||||
|
|
||||||
unless (defined %{$package ."::"}) {
|
unless ($package->can('new')) {
|
||||||
die "unsupported language: $lang";
|
die "unsupported language: $lang";
|
||||||
}
|
}
|
||||||
$@ = '';
|
$@ = '';
|
||||||
|
@ -1732,7 +1735,8 @@ sub get_mappings {
|
||||||
|
|
||||||
package SigarWrapper::File;
|
package SigarWrapper::File;
|
||||||
|
|
||||||
our @ISA = qw(IO::File);
|
use vars qw(@ISA);
|
||||||
|
@ISA = qw(IO::File);
|
||||||
|
|
||||||
my $DEVNULL = '/dev/null';
|
my $DEVNULL = '/dev/null';
|
||||||
my $has_dev_null = -e $DEVNULL;
|
my $has_dev_null = -e $DEVNULL;
|
||||||
|
@ -1760,7 +1764,8 @@ sub devnull {
|
||||||
|
|
||||||
package SigarWrapper::Java;
|
package SigarWrapper::Java;
|
||||||
|
|
||||||
our @ISA = qw(SigarWrapper);
|
use vars qw(@ISA);
|
||||||
|
@ISA = qw(SigarWrapper);
|
||||||
|
|
||||||
my %field_types = (
|
my %field_types = (
|
||||||
Long => "J",
|
Long => "J",
|
||||||
|
@ -2158,7 +2163,8 @@ sub create_jfile {
|
||||||
|
|
||||||
package SigarWrapper::Perl;
|
package SigarWrapper::Perl;
|
||||||
|
|
||||||
our @ISA = qw(SigarWrapper);
|
use vars qw(@ISA);
|
||||||
|
@ISA = qw(SigarWrapper);
|
||||||
|
|
||||||
my %field_types = (
|
my %field_types = (
|
||||||
Long => "sigar_uint64_t",
|
Long => "sigar_uint64_t",
|
||||||
|
@ -2260,9 +2266,10 @@ sub finish {
|
||||||
|
|
||||||
package SigarWrapper::Ruby;
|
package SigarWrapper::Ruby;
|
||||||
|
|
||||||
our @ISA = qw(SigarWrapper);
|
use vars qw(@ISA);
|
||||||
|
@ISA = qw(SigarWrapper);
|
||||||
|
|
||||||
our %field_types = (
|
my %field_types = (
|
||||||
Long => "rb_ll2inum",
|
Long => "rb_ll2inum",
|
||||||
Double => "rb_float_new",
|
Double => "rb_float_new",
|
||||||
Int => "rb_int2inum",
|
Int => "rb_int2inum",
|
||||||
|
@ -2377,9 +2384,10 @@ sub finish {
|
||||||
|
|
||||||
package SigarWrapper::PHP;
|
package SigarWrapper::PHP;
|
||||||
|
|
||||||
our @ISA = qw(SigarWrapper);
|
use vars qw(@ISA);
|
||||||
|
@ISA = qw(SigarWrapper);
|
||||||
|
|
||||||
our %field_types = (
|
my %field_types = (
|
||||||
Long => "RETURN_LONG",
|
Long => "RETURN_LONG",
|
||||||
Double => "RETURN_DOUBLE",
|
Double => "RETURN_DOUBLE",
|
||||||
Int => "RETURN_LONG",
|
Int => "RETURN_LONG",
|
||||||
|
@ -2542,9 +2550,10 @@ sub finish {
|
||||||
|
|
||||||
package SigarWrapper::Python;
|
package SigarWrapper::Python;
|
||||||
|
|
||||||
our @ISA = qw(SigarWrapper);
|
use vars qw(@ISA);
|
||||||
|
@ISA = qw(SigarWrapper);
|
||||||
|
|
||||||
our %field_types = (
|
my %field_types = (
|
||||||
Long => "PyLong_FromUnsignedLongLong",
|
Long => "PyLong_FromUnsignedLongLong",
|
||||||
Double => "PyFloat_FromDouble",
|
Double => "PyFloat_FromDouble",
|
||||||
Int => "PyInt_FromLong",
|
Int => "PyInt_FromLong",
|
||||||
|
@ -2729,7 +2738,8 @@ sub finish {
|
||||||
#XXX not currently supporting netware
|
#XXX not currently supporting netware
|
||||||
package SigarWrapper::Netware;
|
package SigarWrapper::Netware;
|
||||||
|
|
||||||
our @ISA = qw(SigarWrapper);
|
use vars qw(@ISA);
|
||||||
|
@ISA = qw(SigarWrapper);
|
||||||
|
|
||||||
sub start {
|
sub start {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
Loading…
Reference in New Issue