Skip to content

Commit

Permalink
Add Device::Cdio::ISO9660::IFS::find_lsn. Had already same routine in…
Browse files Browse the repository at this point in the history
… Device::Cdio::FS.

IFS and FS should not assume Device::Cdio::ISO960 is used.
  • Loading branch information
R. Bernstein committed Jan 18, 2012
1 parent ea91ea5 commit 389ed6d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/Device/Cdio/ISO9660.pm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ use Device::Cdio::Util qw( _check_arg_count _extra_args _rearrange );

@ISA = qw(Exporter);
@EXPORT = qw( dirname_valid_p is_achar is_dchar pathame_valid_p
name_translate strncpy_pad %check );
name_translate strncpy_pad %check &stat_array_to_href);

%Device::Cdio::ISO9660::check = (
'nocheck' => $perliso9660::NOCHECK,
Expand Down
2 changes: 1 addition & 1 deletion lib/Device/Cdio/ISO9660/FS.pm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Device::Cdio::ISO9660::FS;
use Device::Cdio::ISO9660;
require 5.8.6;
#
# $Id$
# See end for copyright and license.

=pod
Expand Down
5 changes: 4 additions & 1 deletion lib/Device/Cdio/ISO9660/IFS.pm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Device::Cdio::ISO9660::IFS;
use Device::Cdio::ISO9660;
require 5.8.6;
#
# $Id$
# See end for copyright and license.

=pod
Expand Down Expand Up @@ -188,6 +188,9 @@ sub find_lsn {
return undef;
}
my @values = perliso9660::ifs_find_lsn($self->{iso9660}, $lsn);
# Remove the two input parameters
splice(@values, 0, 2) if @values > 2;

return Device::Cdio::ISO9660::stat_array_to_href(@values);
}

Expand Down
10 changes: 4 additions & 6 deletions swig/perliso9660.swg
Original file line number Diff line number Diff line change
Expand Up @@ -535,20 +535,18 @@ bool iso9660_pathname_valid_p (const char psz_path[]);
Returns stat_t of entry if we found lsn, or NULL otherwise.
*/
%rename iso9660_find_fs_lsn fs_find_lsn;
IsoStat_t *iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn);
%rename iso9660_fs_find_lsn fs_find_lsn;
IsoStat_t *iso9660_fs_find_lsn(CdIo_t *p_cdio, lsn_t i_lsn);


#if LIBCDIO_VERSION_NUM > 76
/*!
Given a directory pointer, find the filesystem entry that contains
lsn and return information about it.
Returns stat_t of entry if we found lsn, or NULL otherwise.
*/
%rename iso9660_find_ifs_lsn ifs_find_lsn;
IsoStat_t *iso9660_find_ifs_lsn(const iso9660_t *p_iso, lsn_t i_lsn);
#endif
%rename iso9660_ifs_find_lsn ifs_find_lsn;
IsoStat_t *iso9660_ifs_find_lsn(iso9660_t *p_iso, lsn_t i_lsn);


/*!
Expand Down
6 changes: 5 additions & 1 deletion t/07.iso1.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use Device::Cdio::ISO9660;
use Device::Cdio::ISO9660::IFS;
use File::Spec;

use Test::More tests => 5;
use Test::More tests => 6;
note 'Test ISO9660::IFS routines';

# The test ISO 9660 image
Expand Down Expand Up @@ -47,4 +47,8 @@ my @okay_stats = (
);

is_deeply(\@file_stats, \@okay_stats, 'ISO 9660 file stats');

my $copy_stat = $iso->find_lsn(24);
is_deeply($copy_stat, $okay_stats[2], "Finding stat for root (24)");

$iso->close();

0 comments on commit 389ed6d

Please sign in to comment.