line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Palm; |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# ABSTRACT: Palm OS utility functions |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# Copyright (C) 1999, 2000, Andrew Arensburger. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify |
8
|
|
|
|
|
|
|
# it under the same terms as Perl itself. |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful, |
11
|
|
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
|
|
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the |
13
|
|
|
|
|
|
|
# GNU General Public License or the Artistic License for more details. |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
16416
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
97
|
|
16
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
77
|
|
17
|
2
|
|
|
2
|
|
8
|
use vars qw( $VERSION ); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
294
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# One liner, to allow MakeMaker to work. |
20
|
|
|
|
|
|
|
$VERSION = '1.015'; |
21
|
|
|
|
|
|
|
# This file is part of Palm 1.015 (February 14, 2015) |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $EPOCH_1904 = 2082844800; # Difference between Palm's |
25
|
|
|
|
|
|
|
# epoch (Jan. 1, 1904) and |
26
|
|
|
|
|
|
|
# Unix's epoch (Jan. 1, 1970), |
27
|
|
|
|
|
|
|
# in seconds. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub palm2epoch { |
31
|
0
|
|
|
0
|
1
|
0
|
return $_[0] - $EPOCH_1904; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub epoch2palm { |
36
|
0
|
|
|
0
|
1
|
0
|
return $_[0] + $EPOCH_1904; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub mkpdbname { |
41
|
4
|
|
|
4
|
1
|
1707
|
my $name = shift; |
42
|
4
|
|
|
|
|
19
|
$name =~ s![%/\x00-\x19\x7f-\xff]!sprintf("%%%02X",ord($&))!ge; |
|
3
|
|
|
|
|
24
|
|
43
|
4
|
|
|
|
|
11
|
return $name; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |