line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MPE::CIvar; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
require 5.005_62; |
4
|
1
|
|
|
1
|
|
971
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4438
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
require DynaLoader; |
9
|
|
|
|
|
|
|
require Tie::Hash; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = qw(Exporter DynaLoader Tie::Hash); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our %CIVAR; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
tie %CIVAR, 'MPE::CIvar'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# This allows declaration use MPE::CIvar ':all'; |
20
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
21
|
|
|
|
|
|
|
hpcigetvar hpciputvar hpcideletevar |
22
|
|
|
|
|
|
|
%CIVAR |
23
|
|
|
|
|
|
|
hpcicommand hpcicmds |
24
|
|
|
|
|
|
|
findjcw getjcw putjcw setjcw |
25
|
|
|
|
|
|
|
) ], |
26
|
|
|
|
|
|
|
'varcalls' => [ qw(hpcigetvar hpciputvar hpcideletevar) ], |
27
|
|
|
|
|
|
|
'jcwcalls' => [ qw(findjcw getjcw putjcw setjcw) ], |
28
|
|
|
|
|
|
|
'cmdcalls' => [ qw(hpcicommand hpcicmds) ]); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
our @EXPORT = qw( ); |
33
|
|
|
|
|
|
|
our $VERSION = '1.11'; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
our $lastcmd; |
36
|
|
|
|
|
|
|
our $parmnum; |
37
|
|
|
|
|
|
|
our $cmderr; |
38
|
|
|
|
|
|
|
our $msglevel = 0; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
bootstrap MPE::CIvar $VERSION; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub hpcicmds { |
43
|
0
|
|
|
0
|
|
0
|
$cmderr=0; |
44
|
0
|
|
|
|
|
0
|
for my $cmd (@_) { |
45
|
0
|
|
|
|
|
0
|
$lastcmd = $cmd; |
46
|
0
|
0
|
|
|
|
0
|
last if hpcicommand($cmd, $cmderr, $parmnum, $msglevel)>0; |
47
|
|
|
|
|
|
|
} |
48
|
0
|
|
|
|
|
0
|
return !$cmderr; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub TIEHASH { |
52
|
1
|
|
|
1
|
|
2
|
my $class = shift; |
53
|
1
|
|
|
|
|
2
|
my $self; |
54
|
1
|
|
|
|
|
5
|
return bless \$self, $class; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
sub DELETE { |
57
|
0
|
|
|
0
|
|
|
my $self = shift; |
58
|
0
|
|
|
|
|
|
my $key = shift; |
59
|
0
|
|
|
|
|
|
hpcideletevar($key); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub STORE { |
63
|
0
|
|
|
0
|
|
|
my $self = shift; |
64
|
0
|
|
|
|
|
|
my $key = shift; |
65
|
0
|
|
|
|
|
|
my $value = shift; |
66
|
0
|
|
|
|
|
|
hpciputvar($key, $value); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub FETCH { |
70
|
0
|
|
|
0
|
|
|
my $self = shift; |
71
|
0
|
|
|
|
|
|
my $key = shift; |
72
|
0
|
|
|
|
|
|
return hpcigetvar($key); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# thanks to Ted Ashton for this: |
76
|
|
|
|
|
|
|
sub EXISTS { |
77
|
0
|
|
|
0
|
|
|
my $self = shift; |
78
|
0
|
|
|
|
|
|
my $key = shift; |
79
|
0
|
|
|
|
|
|
return defined(hpcigetvar($key)); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
__END__ |