| 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 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 2 | ▶ | use vars qw( $VERSION ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | |||
| 19 | # One liner, to allow MakeMaker to work. | ||
| 20 | 2 | $VERSION = '1.400'; | |
| 21 | # This file is part of Palm 1.400 (March 14, 2015) | ||
| 22 | |||
| 23 | |||
| 24 | 2 | 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 | 0 | ▶ | sub palm2epoch { |
|
Subroutine
palm2epoch: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 31 | 0 | return $_[0] - $EPOCH_1904; | |
| 32 | } | ||
| 33 | |||
| 34 | |||
| 35 | 0 | ▶ | sub epoch2palm { |
|
Subroutine
epoch2palm: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 36 | 0 | return $_[0] + $EPOCH_1904; | |
| 37 | } | ||
| 38 | |||
| 39 | |||
| 40 | 4 | ▶ | sub mkpdbname { |
|
Subroutine
mkpdbname: called CC=1 SCAR=0.0
Pod
documented
| |||
| 41 | 4 | my $name = shift; | |
| 42 | 4 | $name =~ s![%/\x00-\x19\x7f-\xff]!sprintf("%%%02X",ord($&))!ge; | |
| 43 | 4 | return $name; | |
| 44 | } | ||
| 45 | |||
| 46 | |||
| 47 | 2 | 1; | |
| 48 | |||
| 49 | __END__ | ||