line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Constants.pm,v 1.5 2001/05/15 22:29:16 btrott Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Net::SFTP::Constants; |
4
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
66
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
15
|
use vars qw( %CONSTANTS ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
412
|
|
7
|
|
|
|
|
|
|
%CONSTANTS = ( |
8
|
|
|
|
|
|
|
'SSH2_FXP_INIT' => 1, |
9
|
|
|
|
|
|
|
'SSH2_FXP_VERSION' => 2, |
10
|
|
|
|
|
|
|
'SSH2_FXP_OPEN' => 3, |
11
|
|
|
|
|
|
|
'SSH2_FXP_CLOSE' => 4, |
12
|
|
|
|
|
|
|
'SSH2_FXP_READ' => 5, |
13
|
|
|
|
|
|
|
'SSH2_FXP_WRITE' => 6, |
14
|
|
|
|
|
|
|
'SSH2_FXP_LSTAT' => 7, |
15
|
|
|
|
|
|
|
'SSH2_FXP_FSTAT' => 8, |
16
|
|
|
|
|
|
|
'SSH2_FXP_SETSTAT' => 9, |
17
|
|
|
|
|
|
|
'SSH2_FXP_FSETSTAT' => 10, |
18
|
|
|
|
|
|
|
'SSH2_FXP_OPENDIR' => 11, |
19
|
|
|
|
|
|
|
'SSH2_FXP_READDIR' => 12, |
20
|
|
|
|
|
|
|
'SSH2_FXP_REMOVE' => 13, |
21
|
|
|
|
|
|
|
'SSH2_FXP_MKDIR' => 14, |
22
|
|
|
|
|
|
|
'SSH2_FXP_RMDIR' => 15, |
23
|
|
|
|
|
|
|
'SSH2_FXP_REALPATH' => 16, |
24
|
|
|
|
|
|
|
'SSH2_FXP_STAT' => 17, |
25
|
|
|
|
|
|
|
'SSH2_FXP_RENAME' => 18, |
26
|
|
|
|
|
|
|
'SSH2_FXP_STATUS' => 101, |
27
|
|
|
|
|
|
|
'SSH2_FXP_HANDLE' => 102, |
28
|
|
|
|
|
|
|
'SSH2_FXP_DATA' => 103, |
29
|
|
|
|
|
|
|
'SSH2_FXP_NAME' => 104, |
30
|
|
|
|
|
|
|
'SSH2_FXP_ATTRS' => 105, |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
'SSH2_FXF_READ' => 0x01, |
33
|
|
|
|
|
|
|
'SSH2_FXF_WRITE' => 0x02, |
34
|
|
|
|
|
|
|
'SSH2_FXF_APPEND' => 0x04, |
35
|
|
|
|
|
|
|
'SSH2_FXF_CREAT' => 0x08, |
36
|
|
|
|
|
|
|
'SSH2_FXF_TRUNC' => 0x10, |
37
|
|
|
|
|
|
|
'SSH2_FXF_EXCL' => 0x20, |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
'SSH2_FX_OK' => 0, |
40
|
|
|
|
|
|
|
'SSH2_FX_EOF' => 1, |
41
|
|
|
|
|
|
|
'SSH2_FX_NO_SUCH_FILE' => 2, |
42
|
|
|
|
|
|
|
'SSH2_FX_PERMISSION_DENIED' => 3, |
43
|
|
|
|
|
|
|
'SSH2_FX_FAILURE' => 4, |
44
|
|
|
|
|
|
|
'SSH2_FX_BAD_MESSAGE' => 5, |
45
|
|
|
|
|
|
|
'SSH2_FX_NO_CONNECTION' => 6, |
46
|
|
|
|
|
|
|
'SSH2_FX_CONNECTION_LOST' => 7, |
47
|
|
|
|
|
|
|
'SSH2_FX_OP_UNSUPPORTED' => 8, |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
'SSH2_FILEXFER_ATTR_SIZE' => 0x01, |
50
|
|
|
|
|
|
|
'SSH2_FILEXFER_ATTR_UIDGID' => 0x02, |
51
|
|
|
|
|
|
|
'SSH2_FILEXFER_ATTR_PERMISSIONS' => 0x04, |
52
|
|
|
|
|
|
|
'SSH2_FILEXFER_ATTR_ACMODTIME' => 0x08, |
53
|
|
|
|
|
|
|
'SSH2_FILEXFER_ATTR_EXTENDED' => 0x80000000, |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
'SSH2_FILEXFER_VERSION' => 3, |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
|
58
|
2
|
|
|
2
|
|
12
|
use vars qw( %TAGS ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
476
|
|
59
|
|
|
|
|
|
|
my %RULES = ( |
60
|
|
|
|
|
|
|
'^SSH2_FXP' => 'fxp', |
61
|
|
|
|
|
|
|
'^SSH2_FXF' => 'flags', |
62
|
|
|
|
|
|
|
'^SSH2_FILEXFER_ATTR' => 'att', |
63
|
|
|
|
|
|
|
'^SSH2_FX_' => 'status', |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
for my $re (keys %RULES) { |
67
|
|
|
|
|
|
|
@{ $TAGS{ $RULES{$re} } } = grep /$re/, keys %CONSTANTS; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub import { |
71
|
6
|
|
|
6
|
|
10
|
my $class = shift; |
72
|
|
|
|
|
|
|
|
73
|
6
|
|
|
|
|
8
|
my @to_export; |
74
|
6
|
|
|
|
|
14
|
my @args = @_; |
75
|
6
|
|
|
|
|
20
|
for my $item (@args) { |
76
|
12
|
|
|
|
|
53
|
push @to_export, |
77
|
14
|
100
|
|
|
|
60
|
$item =~ s/^:// ? @{ $TAGS{$item} } : $item; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
2
|
|
|
2
|
|
11
|
no strict 'refs'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
284
|
|
81
|
6
|
|
|
|
|
12
|
my $pkg = caller; |
82
|
6
|
|
|
|
|
11
|
for my $con (@to_export) { |
83
|
116
|
50
|
|
|
|
477
|
warn __PACKAGE__, " does not export the constant '$con'" |
84
|
|
|
|
|
|
|
unless exists $CONSTANTS{$con}; |
85
|
116
|
|
|
18
|
|
796
|
*{"${pkg}::$con"} = sub () { $CONSTANTS{$con} } |
|
18
|
|
|
|
|
57
|
|
86
|
116
|
|
|
|
|
421
|
} |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |
90
|
|
|
|
|
|
|
__END__ |