/[Time-Available]/Available.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Available.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by dpavlin, Sun Oct 12 19:17:29 2003 UTC revision 1.12 by dpavlin, Tue Dec 2 12:41:39 2003 UTC
# Line 33  our @EXPORT_OK = ( Line 33  our @EXPORT_OK = (
33    
34  our @EXPORT;    # don't export anything by default!  our @EXPORT;    # don't export anything by default!
35    
36  our $VERSION = '0.02';  our $VERSION = '0.03';
37    
38  # define some constants used later  # define some constants used later
39  use constant DAY_MONDAY    => 0x01;  use constant DAY_MONDAY    => 0x01;
# Line 61  sub new { Line 61  sub new {
61          $self->{ARGS} = {@_};          $self->{ARGS} = {@_};
62          $debug = $self->{ARGS}->{DEBUG};          $debug = $self->{ARGS}->{DEBUG};
63    
64          croak("need start time") if (! $self->{ARGS}->{start});          croak("need start time") if (! defined($self->{ARGS}->{start}));
65    
66          # calc start and stop seconds          # calc start and stop seconds
67          my ($hh,$mm,$ss) = split(/:/,$self->{ARGS}->{start},3);          my ($hh,$mm,$ss) = split(/:/,$self->{ARGS}->{start},3);
68          print STDERR "new: start time ",$hh||0,":",$mm||0,":",$ss||0,"\n" if ($debug);          print STDERR "new: start time ",$hh||0,":",$mm||0,":",$ss||0,"\n" if ($debug);
69          croak("need at least hour specified for start time") if (! $hh);          croak("need at least hour specified for start time") if (! defined($hh));
70          $mm |= 0;          $mm |= 0;
71          $ss |= 0;          $ss |= 0;
72          $self->{start_arr} = [$ss,$mm,$hh];          $self->{start_arr} = [$ss,$mm,$hh];
# Line 77  sub new { Line 77  sub new {
77          $start *= 60;          $start *= 60;
78          $start += $ss;          $start += $ss;
79    
80          croak("need end time") if (! $self->{ARGS}->{end});          croak("need end time") if (! defined($self->{ARGS}->{end}));
81    
82          ($hh,$mm,$ss) = split(/:/,$self->{ARGS}->{end},3);          ($hh,$mm,$ss) = split(/:/,$self->{ARGS}->{end},3);
83          print STDERR "new: end time ",$hh||0,":",$mm||0,":",$ss||0,"\n" if ($debug);          print STDERR "new: end time ",$hh||0,":",$mm||0,":",$ss||0,"\n" if ($debug);
84          croak("need at least hour specified for end time") if (! $hh);          croak("need at least hour specified for end time") if (! defined($hh));
85          $mm |= 0;          $mm |= 0;
86          $ss |= 0;          $ss |= 0;
87          $self->{end_arr} = [$ss,$mm,$hh];          $self->{end_arr} = [$ss,$mm,$hh];
# Line 92  sub new { Line 92  sub new {
92          $end *= 60;          $end *= 60;
93          $end += $ss;          $end += $ss;
94    
95          croak("need dayMask specified") if (! $self->{ARGS}->{dayMask});          croak("need dayMask specified") if (! defined($self->{ARGS}->{dayMask}));
96    
97          $self->{dayMask} = $self->{ARGS}->{dayMask};          $self->{dayMask} = $self->{ARGS}->{dayMask};
98    
# Line 111  sub new { Line 111  sub new {
111    
112  sub _dayOk($) {  sub _dayOk($) {
113          my $self = shift;          my $self = shift;
114          my $day = shift || return;          my $day = shift || 0;
115    
116          my $dayMask = $self->{dayMask};          my $dayMask = $self->{dayMask};
117    

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.26