/[Biblio-Isis]/trunk/IsisDB.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/IsisDB.pm

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

revision 33 by dpavlin, Wed Jan 5 21:23:04 2005 UTC revision 34 by dpavlin, Thu Jan 6 00:40:07 2005 UTC
# Line 192  sub new { Line 192  sub new {
192          # NXTMFB*       last block allocated to master file          # NXTMFB*       last block allocated to master file
193          # NXTMFP        offset to next available position in last block          # NXTMFP        offset to next available position in last block
194          # MFTYPE        always 0 for user db file (1 for system)          # MFTYPE        always 0 for user db file (1 for system)
195          seek($self->{'fileMST'},4,0) || carp "can't seek to offset 0 in MST: $!";          seek($self->{'fileMST'},4,0) || croak "can't seek to offset 0 in MST: $!";
196    
197          my $buff;          my $buff;
198    
199          read($self->{'fileMST'}, $buff, 4) || carp "can't read NXTMFN from MST: $!";          read($self->{'fileMST'}, $buff, 4) || croak "can't read NXTMFN from MST: $!";
200          $self->{'NXTMFN'}=unpack("V",$buff) || carp "NXTNFN is zero";          $self->{'NXTMFN'}=unpack("V",$buff) || croak "NXTNFN is zero";
201    
202          print STDERR Dumper($self),"\n" if ($self->{debug});          print STDERR Dumper($self),"\n" if ($self->{debug});
203    
# Line 240  sub read_cnt  { Line 240  sub read_cnt  {
240    
241          # Get the index information from $db.CNT          # Get the index information from $db.CNT
242        
243          open(my $fileCNT, $self->{cnt_file}) || carp "can't read '$self->{cnt_file}': $!";          open(my $fileCNT, $self->{cnt_file}) || croak "can't read '$self->{cnt_file}': $!";
244          binmode($fileCNT);          binmode($fileCNT);
245    
246          my $buff;          my $buff;
247    
248          read($fileCNT, $buff, 26) || carp "can't read first table from CNT: $!";          read($fileCNT, $buff, 26) || croak "can't read first table from CNT: $!";
249          $self->unpack_cnt($buff);          $self->unpack_cnt($buff);
250    
251          read($fileCNT, $buff, 26) || carp "can't read second table from CNT: $!";          read($fileCNT, $buff, 26) || croak "can't read second table from CNT: $!";
252          $self->unpack_cnt($buff);          $self->unpack_cnt($buff);
253    
254          close($fileCNT);          close($fileCNT);
# Line 335  sub fetch { Line 335  sub fetch {
335    
336          # read XRFMFB abd XRFMFP          # read XRFMFB abd XRFMFP
337          read($self->{'fileXRF'}, $buff, 4);          read($self->{'fileXRF'}, $buff, 4);
338          my $pointer=unpack("V",$buff) || carp "pointer is null";          my $pointer=unpack("V",$buff) || croak "pointer is null";
339    
340          # check for logically deleted record          # check for logically deleted record
341          if ($pointer & 0x80000000) {          if ($pointer & 0x80000000) {

Legend:
Removed from v.33  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26