line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MPE::Suprtool; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
require 5.005_62; |
4
|
1
|
|
|
1
|
|
587
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
578
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
require DynaLoader; |
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter DynaLoader); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = ( ); |
12
|
|
|
|
|
|
|
our @EXPORT = ( ); |
13
|
|
|
|
|
|
|
our $VERSION = '0.51'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
bootstrap MPE::Suprtool $VERSION; |
17
|
|
|
|
|
|
|
my $plabel; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
0
|
|
|
0
|
|
|
my $class = shift; |
21
|
0
|
|
|
|
|
|
my %defaults = ( |
22
|
|
|
|
|
|
|
pri => ' ', |
23
|
|
|
|
|
|
|
printstate => 'ER', |
24
|
|
|
|
|
|
|
xl => configst2loc() |
25
|
|
|
|
|
|
|
); |
26
|
0
|
|
|
|
|
|
my %opt = (%defaults, @_); |
27
|
0
|
|
|
|
|
|
my $self; |
28
|
0
|
0
|
|
|
|
|
$plabel = getsuprcall("\0$opt{xl}\0") unless defined($plabel); |
29
|
0
|
0
|
|
|
|
|
if (!$plabel) { |
30
|
0
|
|
|
|
|
|
return undef; |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
$self = pack("nnA256A2NA2A2A18A270NA20", |
33
|
|
|
|
|
|
|
4, 0, " ", $opt{pri}, 0, $opt{printstate}, "AS", " ", " ", 0, " "); |
34
|
|
|
|
|
|
|
# n n A256 A2 N A2 A2 A18 A270 N A20 |
35
|
0
|
|
|
|
|
|
return bless \$self, $class; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub cmd { |
39
|
0
|
|
|
0
|
|
|
my $self = shift; |
40
|
0
|
|
|
|
|
|
my $cmdstr; |
41
|
|
|
|
|
|
|
my $result; |
42
|
0
|
|
|
|
|
|
for $cmdstr (@_) { |
43
|
0
|
|
|
|
|
|
substr($$self, 4, 256) = pack("A256", $cmdstr); |
44
|
0
|
0
|
|
|
|
|
last unless $result=suprcall($$self); |
45
|
|
|
|
|
|
|
} |
46
|
0
|
|
|
|
|
|
return $result; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub status { |
50
|
0
|
|
|
0
|
|
|
my $self = shift; |
51
|
0
|
|
|
|
|
|
unpack("n",substr($$self, 2,2)); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub lastcmd { |
55
|
0
|
|
|
0
|
|
|
my $self = shift; |
56
|
0
|
|
|
|
|
|
unpack("A256",substr($$self, 4, 256)); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub count { |
60
|
0
|
|
|
0
|
|
|
my $self = shift; |
61
|
0
|
|
|
|
|
|
unpack("N",substr($$self, 558,4)); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub totals { |
65
|
0
|
|
|
0
|
|
|
my $self = shift; |
66
|
0
|
|
|
|
|
|
my $totalstr = substr($$self, 288, 270); |
67
|
0
|
|
|
|
|
|
my @j; |
68
|
|
|
|
|
|
|
my @k; |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
$totalstr =~ s/( {18})+$//; |
71
|
0
|
|
|
|
|
|
unpack "A18"x(length($totalstr)/18), $totalstr; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
__END__ |