/[webpac2]/trunk/lib/WebPAC/Input/MARC.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 /trunk/lib/WebPAC/Input/MARC.pm

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

revision 497 by dpavlin, Sun May 14 19:45:36 2006 UTC revision 652 by dpavlin, Thu Sep 7 15:01:45 2006 UTC
# Line 55  sub open_db { Line 55  sub open_db {
55          my $db_size = $db->count - 1;   # FIXME          my $db_size = $db->count - 1;   # FIXME
56    
57          $self->{_marc_size} = $db_size;          $self->{_marc_size} = $db_size;
58            $self->{_marc_db} = $db;
59    
60          return ($db, $db_size);          return ($db, $db_size);
61  }  }
# Line 63  sub open_db { Line 64  sub open_db {
64    
65  Return record with ID C<$mfn> from database  Return record with ID C<$mfn> from database
66    
67    my $rec = $self->fetch_rec( $db, $mfn );    my $rec = $self->fetch_rec( $mfn );
68    
69  }  }
70    
# Line 72  Return record with ID C<$mfn> from datab Line 73  Return record with ID C<$mfn> from datab
73  sub fetch_rec {  sub fetch_rec {
74          my $self = shift;          my $self = shift;
75    
76          my ($db, $mfn) = @_;          my $mfn = shift;
77    
78          if ($mfn > $self->{_marc_size}) {          if ($mfn > $self->{_marc_size}) {
79                  $self->_get_logger()->warn("seek beyond database size $self->{_marc_size} to $mfn");                  $self->_get_logger()->warn("seek beyond database size $self->{_marc_size} to $mfn");
80          } else {          } else {
81                  my $row = $db->to_hash($mfn);                  my $row = $self->{_marc_db}->to_hash($mfn);
82                  push @{$row->{'000'}}, $mfn;                  push @{$row->{'000'}}, $mfn;
83                  return $row;                  return $row;
84          }          }

Legend:
Removed from v.497  
changed lines
  Added in v.652

  ViewVC Help
Powered by ViewVC 1.1.26