line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Net::SSLeay::OO::Constants; |
3
|
|
|
|
|
|
|
|
4
|
4
|
|
|
4
|
|
51983
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
154
|
|
5
|
4
|
|
|
4
|
|
24
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
127
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
3398
|
use Net::SSLeay; |
|
4
|
|
|
|
|
64024
|
|
|
4
|
|
|
|
|
545
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Net::SSLeay::OO::Constants - Importer interface to Net::SSLeay constants |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Net::SSLeay::OO::Constants qw(OP_ALL); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
print OP_ALL; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
This module allows L<Net::SSLeay> constants to be explicitly imported |
22
|
|
|
|
|
|
|
into your program. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
As well as avoiding using the verbose C<&Net::SSLeay::XXXX> syntax all |
25
|
|
|
|
|
|
|
the time, they can then be spelt as bare words. It also means that |
26
|
|
|
|
|
|
|
instead of waiting for run-time for your misspelt Net::SSLeay |
27
|
|
|
|
|
|
|
constants to crash your program, you find out at compile time. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Some extra constants are allowed to be imported by this module, which |
30
|
|
|
|
|
|
|
are hard-coded for the event that Net::SSLeay doesn't export them. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
our %FALLBACK; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
BEGIN { |
39
|
4
|
|
|
4
|
|
421
|
%FALLBACK = ( |
40
|
|
|
|
|
|
|
MODE_ENABLE_PARTIAL_WRITE => 1, |
41
|
|
|
|
|
|
|
MODE_ACCEPT_MOVING_WRITE_BUFFER => 2, |
42
|
|
|
|
|
|
|
MODE_AUTO_RETRY => 4, |
43
|
|
|
|
|
|
|
MODE_NO_AUTO_CHAIN => 8, |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub import { |
48
|
5
|
|
|
5
|
|
1271
|
my $class = shift; |
49
|
5
|
|
|
|
|
12
|
my $target = caller; |
50
|
5
|
|
|
|
|
29
|
while ( my $thingy = shift ) { |
51
|
10
|
50
|
|
|
|
46
|
if ( $thingy =~ m{^\d+} ) { |
52
|
4
|
|
|
4
|
|
43
|
no warnings "numeric"; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
392
|
|
53
|
0
|
0
|
|
|
|
0
|
die "insufficient version $thingy" |
54
|
|
|
|
|
|
|
if 0 + $thingy < 0 + $VERSION; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
else { |
57
|
4
|
|
|
4
|
|
22
|
no strict 'refs'; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
903
|
|
58
|
10
|
|
|
|
|
15
|
my $val = eval { &{"Net::SSLeay::$thingy"}() }; |
|
10
|
|
|
|
|
10
|
|
|
10
|
|
|
|
|
94
|
|
59
|
10
|
100
|
|
|
|
3371
|
if ( defined $val ) { |
|
|
50
|
|
|
|
|
|
60
|
9
|
|
|
0
|
|
111
|
*{ $target . "::" . $thingy } = sub() {$val}; |
|
9
|
|
|
|
|
594
|
|
|
0
|
|
|
|
|
0
|
|
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
elsif ( exists $FALLBACK{$thingy} ) { |
63
|
0
|
|
|
|
|
0
|
$val = $FALLBACK{$thingy}; |
64
|
0
|
|
|
|
|
0
|
*{ $target . "::" . $thingy } = sub() { |
65
|
0
|
|
|
0
|
|
0
|
$val; |
66
|
0
|
|
|
|
|
0
|
}; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
else { |
69
|
1
|
|
|
|
|
9
|
die |
70
|
|
|
|
|
|
|
"tried to import '$thingy', but SSLeay said: $@"; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 AUTHOR |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Sam Vilain, L<samv@cpan.org> |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 COPYRIGHT |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Copyright (C) 2009 NZ Registry Services |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify |
89
|
|
|
|
|
|
|
it under the terms of the Artistic License 2.0 or later. You should |
90
|
|
|
|
|
|
|
have received a copy of the Artistic License the file COPYING.txt. If |
91
|
|
|
|
|
|
|
not, see <http://www.perlfoundation.org/artistic_license_2_0> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 SEE ALSO |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
L<Net::SSLeay::OO> |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
# Local Variables: |
100
|
|
|
|
|
|
|
# mode:cperl |
101
|
|
|
|
|
|
|
# indent-tabs-mode: t |
102
|
|
|
|
|
|
|
# cperl-continued-statement-offset: 8 |
103
|
|
|
|
|
|
|
# cperl-brace-offset: 0 |
104
|
|
|
|
|
|
|
# cperl-close-paren-offset: 0 |
105
|
|
|
|
|
|
|
# cperl-continued-brace-offset: 0 |
106
|
|
|
|
|
|
|
# cperl-continued-statement-offset: 8 |
107
|
|
|
|
|
|
|
# cperl-extra-newline-before-brace: nil |
108
|
|
|
|
|
|
|
# cperl-indent-level: 8 |
109
|
|
|
|
|
|
|
# cperl-indent-parens-as-block: t |
110
|
|
|
|
|
|
|
# cperl-indent-wrt-brace: nil |
111
|
|
|
|
|
|
|
# cperl-label-offset: -8 |
112
|
|
|
|
|
|
|
# cperl-merge-trailing-else: t |
113
|
|
|
|
|
|
|
# End: |
114
|
|
|
|
|
|
|
# vim: filetype=perl:noexpandtab:ts=3:sw=3 |