| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Embedix::ECD::Util; |
|
2
|
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
30
|
use Exporter; |
|
|
5
|
|
|
|
|
11
|
|
|
|
5
|
|
|
|
|
2192
|
|
|
4
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
|
5
|
|
|
|
|
|
|
@EXPORT_OK = qw(indent unindent_and_aggregate %default @attribute_order); |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#_______________________________________ |
|
8
|
|
|
|
|
|
|
sub indent { |
|
9
|
1
|
|
|
1
|
0
|
4
|
my $n = shift() - 1; |
|
10
|
1
|
|
|
|
|
2
|
my $sw = shift; |
|
11
|
1
|
50
|
|
|
|
4
|
if ($n < 0) { $n = 0 } |
|
|
0
|
|
|
|
|
0
|
|
|
12
|
1
|
50
|
|
|
|
4
|
if ($sw < 0) { $sw = 0 } |
|
|
0
|
|
|
|
|
0
|
|
|
13
|
1
|
|
|
|
|
10
|
return " " x ($n * $sw); |
|
14
|
|
|
|
|
|
|
} |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#_______________________________________ |
|
17
|
|
|
|
|
|
|
sub unindent_and_aggregate { |
|
18
|
43
|
|
|
43
|
0
|
419490
|
my $s; |
|
19
|
43
|
|
|
|
|
123
|
$s = shift; |
|
20
|
43
|
|
|
|
|
2064
|
$s =~ s/\s*$//; # the beginning is already trimmed |
|
21
|
|
|
|
|
|
|
return [ |
|
22
|
416
|
|
|
|
|
1174
|
map { s/^\s*//; s/\s*$//; $_ } |
|
|
416
|
|
|
|
|
4851
|
|
|
|
416
|
|
|
|
|
4657
|
|
|
|
416
|
|
|
|
|
2006
|
|
|
23
|
43
|
|
|
|
|
410
|
grep { $_ !~ /^\s*#/ } |
|
24
|
|
|
|
|
|
|
split ("\n", $s) |
|
25
|
|
|
|
|
|
|
]; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# misc configuration |
|
29
|
|
|
|
|
|
|
#_______________________________________ |
|
30
|
|
|
|
|
|
|
%Embedix::ECD::Util::default = ( |
|
31
|
|
|
|
|
|
|
shiftwidth => 2, |
|
32
|
|
|
|
|
|
|
indent => 0, |
|
33
|
|
|
|
|
|
|
); |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# write attributes in this order |
|
36
|
|
|
|
|
|
|
#_______________________________________ |
|
37
|
|
|
|
|
|
|
@Embedix::ECD::Util::attribute_order = qw( |
|
38
|
|
|
|
|
|
|
help |
|
39
|
|
|
|
|
|
|
prompt |
|
40
|
|
|
|
|
|
|
license |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
specpatch |
|
43
|
|
|
|
|
|
|
srpm |
|
44
|
|
|
|
|
|
|
build_vars |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
type |
|
47
|
|
|
|
|
|
|
default_value |
|
48
|
|
|
|
|
|
|
value |
|
49
|
|
|
|
|
|
|
range |
|
50
|
|
|
|
|
|
|
choicelist |
|
51
|
|
|
|
|
|
|
if |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
static_size |
|
54
|
|
|
|
|
|
|
min_dynamic_size |
|
55
|
|
|
|
|
|
|
storage_size |
|
56
|
|
|
|
|
|
|
startup_time |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
conflicts |
|
59
|
|
|
|
|
|
|
provides |
|
60
|
|
|
|
|
|
|
requires |
|
61
|
|
|
|
|
|
|
requiresexpr |
|
62
|
|
|
|
|
|
|
keeplist |
|
63
|
|
|
|
|
|
|
trideps |
|
64
|
|
|
|
|
|
|
); |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |