Archive-Libarchive-XS

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

t/common_list_contents_of_archive.t
t/common_match2.t
t/common_match_owner.t
t/common_memory_write.t
t/common_read_data_into_fh.t
t/common_read_disk.t
t/common_read_open_error.t
t/common_signature.t
t/common_sparse.t
t/common_stat.t
t/common_uid_gid_lookup.t
t/common_unicode.t
t/common_universal_decompressor.t
t/common_user_group_lookup.t
t/foo.tar
t/foo.tar.Z
t/foo.tar.bz2
t/foo.tar.gz
t/foo.txt.Z.uu
t/foo.xar
t/foo.zip

inc/functions.txt  view on Meta::CPAN

archive_entry_ctime_is_set
archive_entry_ctime_nsec
archive_entry_dev
archive_entry_dev_is_set
archive_entry_devmajor
archive_entry_devminor
archive_entry_fflags
archive_entry_fflags_text
archive_entry_filetype
archive_entry_free
archive_entry_gid
archive_entry_gname
archive_entry_hardlink
archive_entry_ino
archive_entry_ino_is_set
archive_entry_linkify
archive_entry_linkresolver_free
archive_entry_linkresolver_new
archive_entry_linkresolver_set_strategy
archive_entry_mac_metadata
archive_entry_mode

inc/functions.txt  view on Meta::CPAN

archive_entry_rdevminor
archive_entry_set_atime
archive_entry_set_birthtime
archive_entry_set_ctime
archive_entry_set_dev
archive_entry_set_devmajor
archive_entry_set_devminor
archive_entry_set_fflags
archive_entry_set_fflags_text
archive_entry_set_filetype
archive_entry_set_gid
archive_entry_set_gname
archive_entry_set_hardlink
archive_entry_set_ino
archive_entry_set_link
archive_entry_set_mac_metadata
archive_entry_set_mode
archive_entry_set_mtime
archive_entry_set_nlink
archive_entry_set_pathname
archive_entry_set_perm

inc/functions.txt  view on Meta::CPAN

archive_filter_name
archive_format
archive_format_name
archive_match_exclude_entry
archive_match_exclude_pattern
archive_match_exclude_pattern_from_file
archive_match_excluded
archive_match_free
archive_match_include_date
archive_match_include_file_time
archive_match_include_gid
archive_match_include_gname
archive_match_include_pattern
archive_match_include_pattern_from_file
archive_match_include_time
archive_match_include_uid
archive_match_include_uname
archive_match_new
archive_match_owner_excluded
archive_match_path_excluded
archive_match_path_unmatched_inclusions

inc/functions.txt  view on Meta::CPAN

archive_write_add_filter_lzip
archive_write_add_filter_lzma
archive_write_add_filter_lzop
archive_write_add_filter_none
archive_write_add_filter_program
archive_write_add_filter_uuencode
archive_write_add_filter_xz
archive_write_close
archive_write_data
archive_write_data_block
archive_write_disk_gid
archive_write_disk_new
archive_write_disk_set_group_lookup
archive_write_disk_set_options
archive_write_disk_set_skip_file
archive_write_disk_set_standard_lookup
archive_write_disk_set_user_lookup
archive_write_disk_uid
archive_write_fail
archive_write_finish_entry
archive_write_free

inc/symbols.txt  view on Meta::CPAN

archive_entry_ctime_is_set
archive_entry_ctime_nsec
archive_entry_dev
archive_entry_dev_is_set
archive_entry_devmajor
archive_entry_devminor
archive_entry_fflags
archive_entry_fflags_text
archive_entry_filetype
archive_entry_free
archive_entry_gid
archive_entry_gname
archive_entry_gname_w
archive_entry_hardlink
archive_entry_hardlink_w
archive_entry_ino
archive_entry_ino_is_set
archive_entry_linkify
archive_entry_linkresolver_free
archive_entry_linkresolver_new
archive_entry_linkresolver_set_strategy

inc/symbols.txt  view on Meta::CPAN

archive_entry_rdevmajor
archive_entry_rdevminor
archive_entry_set_atime
archive_entry_set_birthtime
archive_entry_set_ctime
archive_entry_set_dev
archive_entry_set_devmajor
archive_entry_set_devminor
archive_entry_set_fflags
archive_entry_set_filetype
archive_entry_set_gid
archive_entry_set_gname
archive_entry_set_hardlink
archive_entry_set_ino
archive_entry_set_link
archive_entry_set_mode
archive_entry_set_mtime
archive_entry_set_nlink
archive_entry_set_pathname
archive_entry_set_perm
archive_entry_set_rdev

inc/symbols.txt  view on Meta::CPAN

archive_match_exclude_pattern
archive_match_exclude_pattern_from_file
archive_match_exclude_pattern_from_file_w
archive_match_exclude_pattern_w
archive_match_excluded
archive_match_free
archive_match_include_date
archive_match_include_date_w
archive_match_include_file_time
archive_match_include_file_time_w
archive_match_include_gid
archive_match_include_gname
archive_match_include_gname_w
archive_match_include_pattern
archive_match_include_pattern_from_file
archive_match_include_pattern_from_file_w
archive_match_include_pattern_w
archive_match_include_time
archive_match_include_uid
archive_match_include_uname
archive_match_include_uname_w

inc/symbols.txt  view on Meta::CPAN

archive_write_add_filter_lzip
archive_write_add_filter_lzma
archive_write_add_filter_lzop
archive_write_add_filter_none
archive_write_add_filter_program
archive_write_add_filter_uuencode
archive_write_add_filter_xz
archive_write_close
archive_write_data
archive_write_data_block
archive_write_disk_gid
archive_write_disk_new
archive_write_disk_set_group_lookup
archive_write_disk_set_options
archive_write_disk_set_skip_file
archive_write_disk_set_standard_lookup
archive_write_disk_set_user_lookup
archive_write_disk_uid
archive_write_fail
archive_write_finish_entry
archive_write_free

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN

      RETVAL = archive_write_disk_set_user_lookup(archive, new_lookup_callback(data,lookup_callback,cleanup_callback), &mylookup_write_lookup, &mylookup_cleanup);
    else
      RETVAL = archive_write_disk_set_user_lookup(archive, NULL, NULL, NULL);
  OUTPUT:
    RETVAL

#endif

=head2 archive_entry_stat

 my($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $atime, $mtime, $ctime) = archive_entry_stat($entry);

Converts the various fields stored in the archive entry to the format used by L<stat|perlfunc#stat>.

The fields C<$blksize>, C<$blocks> supported by L<stat|perlfunc#stat>, are not supported by this function.

=head2 archive_entry_set_stat

 my $status = archive_entry_stat($entry, $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $atime, $mtime, $ctime);

Converts the various fields in the format used by L<stat|perlfunc#stat> to the fields store in the archive entry.

The fields C<$blksize>, C<$blocks> supported by L<stat|perlfunc#stat>, are not supported by this function.

=head2 archive_entry_copy_stat

 my $status = archive_entry_stat($entry, $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $atime, $mtime, $ctime);

Converts the various fields in the format used by L<stat|perlfunc#stat> to the fields store in the archive entry.

The fields C<$blksize>, C<$blocks> supported by L<stat|perlfunc#stat>, are not supported by this function.

This is an alias for L<#archive_entry_set_stat>.

=head2 archive_read_open_fh

 my $status = archive_read_open_fh($archive, $fh, $block_size);

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN

    struct archive *archive
    const char *a2
    __LA_INT64_T a3
  CODE:
    RETVAL = archive_write_disk_uid(archive, a2, a3);
  OUTPUT:
    RETVAL

#endif

=head2 archive_write_disk_gid

 my $int64 = archive_write_disk_gid($archive, $string, $int64);

Undocumented libarchive function.

=cut

#if HAS_archive_write_disk_gid

__LA_INT64_T
_archive_write_disk_gid(archive, a2, a3)
    struct archive *archive
    const char *a2
    __LA_INT64_T a3
  CODE:
    RETVAL = archive_write_disk_gid(archive, a2, a3);
  OUTPUT:
    RETVAL

#endif

=head2 archive_write_disk_set_skip_file

 my $status = archive_write_disk_set_skip_file($archive, $device, $inode);

Records the device and inode numbers of a file that should not be

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN

    struct archive_entry *entry
    string_or_null string
  CODE:
    archive_entry_copy_fflags_text(entry, string);
    RETVAL = ARCHIVE_OK;
  OUTPUT:
    RETVAL

#endif

=head2 archive_entry_gid

 my $gid = archive_entry_gid($entry);

Returns the group id property for the archive entry.

=cut

#if HAS_archive_entry_gid

__LA_INT64_T
archive_entry_gid(entry)
    struct archive_entry *entry

#endif

=head2 archive_entry_set_gid

 my $status = archive_entry_set_gid($gid).

Sets the group id property for the archive entry.

=cut

#if HAS_archive_entry_set_gid

int
archive_entry_set_gid(entry, gid)
    struct archive_entry *entry
    __LA_INT64_T gid
  CODE:
    archive_entry_set_gid(entry, gid);
    RETVAL = ARCHIVE_OK;
  OUTPUT:
    RETVAL

#endif

=head2 archive_read_disk_descend

 my $status = archive_read_disk_descend($archive);

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN

    const char *name
  CODE:
    RETVAL = archive_read_disk_open(archive, name);
  OUTPUT:
    RETVAL

#endif

=head2 archive_read_disk_gname

 my $string = archive_read_disk_gname($archive, $gid);

Returns a group name given a gid value.  By default always
returns C<undef>.

=cut

#if HAS_archive_read_disk_gname

string_or_null
_archive_read_disk_gname(archive, gid)
    struct archive *archive
    __LA_INT64_T gid
  CODE:
    RETVAL = archive_read_disk_gname(archive, gid);
  OUTPUT:
    RETVAL

#endif

=head2 archive_read_disk_uname

 my $string = archive_read_disk_uname($archive, $gid);

Returns a user name given a uid value.  By default always
returns C<undef>.

=cut

#if HAS_archive_read_disk_uname

string_or_null
_archive_read_disk_uname(archive, gid)
    struct archive *archive
    __LA_INT64_T gid
  CODE:
    RETVAL = archive_read_disk_uname(archive, gid);
  OUTPUT:
    RETVAL

#endif

=head2 archive_read_disk_new

 my $archive = archive_read_disk_new();

Allocates and initializes an archive object suitable for reading object information

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN

    struct archive *archive
    int flags

#endif

=head2 archive_read_disk_set_standard_lookup

 my $status = archive_read_disk_set_standard_lookup($archive);

This convenience function installs a standard set of user and group name lookup functions.
These functions use C<getpwuid> and C<getgrgid> to convert ids to names, defaulting to C<undef>.
if the names cannot be looked up.  These functions also implement a simple memory cache to
reduce the number of calls to C<getpwuid> and C<getgrgid>.

=cut

#if HAS_archive_read_disk_set_standard_lookup

int
archive_read_disk_set_standard_lookup(archive)
    struct archive *archive

#endif

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN

archive_match_time_excluded(archive, entry)
    struct archive *archive
    struct archive_entry *entry

#endif

=head2 archive_match_owner_excluded

 my $bool = archive_match_owner_excluded($archive, $entry);

Test if a file is excluded by its uid, gid, user name or group name.

=cut

#if HAS_archive_match_owner_excluded

int
archive_match_owner_excluded(archive, entry)
    struct archive *archive
    struct archive_entry *entry

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN


#if HAS_archive_match_include_uid

int
archive_match_include_uid(archive, uid)
    struct archive *archive
    __LA_INT64_T uid

#endif

=head2 archive_match_include_gid

 my $status = archive_match_include_gid($archive, $gid);

The match object $archive should match entries with the given $gid

=cut

#if HAS_archive_match_include_gid

int
archive_match_include_gid(archive, gid)
    struct archive *archive
    __LA_INT64_T gid

#endif

=head2 archive_match_include_uname

 my $status = archive_match_include_uname($archive, $uname);

The match object $archive should match entries with the given user name

=cut

lib/Archive/Libarchive/XS/Callback.pm  view on Meta::CPAN

 my $status = archive_write_disk_set_user_lookup($archive, $data, sub {
   my($data, $name, $uid) = @_;
   ... # should return the UID for $name or $uid if it can't be found
 }, undef);

Called by archive_write_disk_uid to determine appropriate UID.

=head2 group id lookup

 my $status = archive_write_disk_set_group_lookup($archive, $data, sub {
   my($data, $name, $gid) = @_;
   ... # should return the GID for $name or $gid if it can't be found
 }, undef);

Called by archive_write_disk_gid to determine appropriate GID.

=head2 user name lookup

 my $status = archive_read_disk_set_uname_lookup($archive, $data, sub
   my($data, $uid) = @_;
   ... # should return the name for $uid, or undef
 }, undef);

Called by archive_read_disk_uname to determine appropriate user name.

=head2 group name lookup

 my $status = archive_read_disk_set_gname_lookup($archive, $data, sub
   my($data, $gid) = @_;
   ... # should return the name for $gid, or undef
 }, undef);

Called by archive_read_disk_gname to determine appropriate group name.

=head2 lookup cleanup

 sub mycleanup
 {
   my($data) = @_;
   ... # any cleanup necessary

lib/Archive/Libarchive/XS/Common.pm  view on Meta::CPAN

    warn 'write error';
    return ARCHIVE_FATAL();
  }
}

# TODO: for XS version, implement this in XS
sub archive_entry_stat ($)
{
  my($entry) = @_;
  no strict 'refs';
  map { &{"archive_entry_$_"}($entry) } qw ( dev ino mode nlink uid gid rdev atime mtime ctime );
}

# TODO: for XS version, implement this in XS
sub archive_entry_set_stat
{
  my $entry = shift;
  my $status = ARCHIVE_OK();
  no strict 'refs';
  foreach my $prop (qw( dev ino mode nlink uid gid rdev ))
  {
    my $status2 = &{"archive_entry_set_$prop"}($entry, shift);
    $status = $status2 if $status2 < $status;
  }
  foreach my $prop (qw( atime mtime ctime ))
  {
    my $value = shift;
    my $status2 = &{"archive_entry_set_$prop"}($entry, $value, $value);
    $status = $status2 if $status2 < $status;
  }

lib/Archive/Libarchive/XS/Common.pm  view on Meta::CPAN

});
_sub_if_can( archive_write_set_format_option => sub {
  _archive_write_set_format_option($_[0], _encode($_[1]), _encode($_[2]), _encode($_[3]));
});
_sub_if_can( archive_write_set_option => sub {
  _archive_write_set_option($_[0], _encode($_[1]), _encode($_[2]), _encode($_[3]));
});
_sub_if_can( archive_write_set_options => sub {
  _archive_write_set_options($_[0], _encode($_[1]));
});
_sub_if_can( archive_write_disk_gid => sub {
  _archive_write_disk_gid($_[0], _encode($_[1]), $_[2]);
});
_sub_if_can( archive_write_disk_uid => sub {
  _archive_write_disk_uid($_[0], _encode($_[1]), $_[2]);
});
_sub_if_can( archive_entry_fflags_text => sub {
  _decode(_archive_entry_fflags_text($_[0]));
});
_sub_if_can( archive_read_disk_open => sub {
  _archive_read_disk_open($_[0], _encode($_[1]));
});

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN

=head2 archive_entry_copy_sourcepath

 my $status = archive_entry_set_sourcepath($entry, $sourcepath);

Sets the sourcepath property for the archive entry object.

This is an alias for archive_entry_set_sourcepath.

=head2 archive_entry_copy_stat

 my $status = archive_entry_stat($entry, $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $atime, $mtime, $ctime);

Converts the various fields in the format used by L<stat|perlfunc#stat> to the fields store in the archive entry.

The fields C<$blksize>, C<$blocks> supported by L<stat|perlfunc#stat>, are not supported by this function.

This is an alias for L<archive_entry_set_stat|Archive::Libarchive::XS::Function#archive_entry_set_stat>.

=head2 archive_entry_ctime

 my $ctime = archive_entry_ctime($entry);

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN

=item AE_IFIFO

=back

=head2 archive_entry_free

 my $status = archive_entry_free($entry);

Releases the struct archive_entry object.

=head2 archive_entry_gid

 my $gid = archive_entry_gid($entry);

Returns the group id property for the archive entry.

=head2 archive_entry_gname

 my $string = archive_entry_gname($entry);

Retrieve the gname for the archive entry object.

=head2 archive_entry_hardlink

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN

=item AE_IFCHR

=item AE_IFBLK

=item AE_IFDIR

=item AE_IFIFO

=back

=head2 archive_entry_set_gid

 my $status = archive_entry_set_gid($gid).

Sets the group id property for the archive entry.

=head2 archive_entry_set_gname

 my $status = archive_entry_set_gname($entry, $string)

Sets the gname for the archive entry object.

=head2 archive_entry_set_hardlink

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN

Sets the size property for the archive entry.

=head2 archive_entry_set_sourcepath

 my $status = archive_entry_set_sourcepath($entry, $sourcepath);

Sets the sourcepath property for the archive entry object.

=head2 archive_entry_set_stat

 my $status = archive_entry_stat($entry, $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $atime, $mtime, $ctime);

Converts the various fields in the format used by L<stat|perlfunc#stat> to the fields store in the archive entry.

The fields C<$blksize>, C<$blocks> supported by L<stat|perlfunc#stat>, are not supported by this function.

=head2 archive_entry_set_symlink

 my $status = archive_entry_set_symlink($entry, $string)

Sets the symlink for the archive entry object.

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN

 }

=head2 archive_entry_sparse_reset

 my $count = archive_entry_sparse_reset($entry);

Reset the internal sparse region iterator for the entry (see L<archive_entry_sparse_next|Archive::Libarchive::XS::Function#archive_entry_sparse_next> for an example).

=head2 archive_entry_stat

 my($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $atime, $mtime, $ctime) = archive_entry_stat($entry);

Converts the various fields stored in the archive entry to the format used by L<stat|perlfunc#stat>.

The fields C<$blksize>, C<$blocks> supported by L<stat|perlfunc#stat>, are not supported by this function.

=head2 archive_entry_strmode

 my $strmode = archive_entry_strmode($entry);

Returns a string representation of the archive entry's permission mode,

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN

 my $status = archive_match_include_date($archive, $flag, $date_string);

Set inclusion time by a date string

=head2 archive_match_include_file_time

 my $status = archive_match_include_file_time($archive, $flag, $pathname);

Set inclusion time by a particular file

=head2 archive_match_include_gid

 my $status = archive_match_include_gid($archive, $gid);

The match object $archive should match entries with the given $gid

=head2 archive_match_include_gname

 my $status = archive_match_include_gname($archive, $gname);

The match object $archive should match entries with the given group name

=head2 archive_match_include_pattern

 my $status = archive_match_include_pattern_from_file($archive, $pattern);

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN

=head2 archive_match_new

 my $archive = archive_match_new();

Allocates and initializes a archive object suitable for reading and matching with an archive.

=head2 archive_match_owner_excluded

 my $bool = archive_match_owner_excluded($archive, $entry);

Test if a file is excluded by its uid, gid, user name or group name.

=head2 archive_match_path_excluded

 my $bool = archive_match_path_excluded($archive, $entry);

Test if pathname is excluded.

=head2 archive_match_path_unmatched_inclusions

 my $count = archive_match_path_unmatched_inclusions($archive);

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN

platforms that support the appropriate system calls.

Note: The C API supports passing in a stat structure for some performance benefits.  Currently this is unsupported in the Perl version, and you must pass undef in as the forth argument,
for possible future compatibility.

Where necessary, user and group ids are converted to user and group names using the currently registered lookup functions above.  This affects the file ownership fields and ACL values in the
struct archive_entry object.

=head2 archive_read_disk_gname

 my $string = archive_read_disk_gname($archive, $gid);

Returns a group name given a gid value.  By default always
returns C<undef>.

=head2 archive_read_disk_new

 my $archive = archive_read_disk_new();

Allocates and initializes an archive object suitable for reading object information
from disk.

=head2 archive_read_disk_open

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN

Register a callback for the lookup of GID from group names.  In order to deregister call
C<archive_read_disk_set_gname_lookup> with both callback functions set to C<undef>.

See L<Archive::Libarchive::XS::Callback> for calling conventions for the lookup and cleanup callbacks.

=head2 archive_read_disk_set_standard_lookup

 my $status = archive_read_disk_set_standard_lookup($archive);

This convenience function installs a standard set of user and group name lookup functions.
These functions use C<getpwuid> and C<getgrgid> to convert ids to names, defaulting to C<undef>.
if the names cannot be looked up.  These functions also implement a simple memory cache to
reduce the number of calls to C<getpwuid> and C<getgrgid>.

=head2 archive_read_disk_set_symlink_hybrid

 my $status = archive_read_disk_set_symlink_hybrid($archive);

This sets the mode used for handling symbolic links.  The "hybrid" mode currently
behaves identically to the "logical" mode.

=head2 archive_read_disk_set_symlink_logical

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN


 my $status = archive_read_disk_set_uname_lookup($archive, $data, $lookup_callback, $cleanup_callback);

Register a callback for the lookup of UID from user names.  In order to deregister call
C<archive_read_disk_setugname_lookup> with both callback functions set to C<undef>.

See L<Archive::Libarchive::XS::Callback> for calling conventions for the lookup and cleanup callbacks.

=head2 archive_read_disk_uname

 my $string = archive_read_disk_uname($archive, $gid);

Returns a user name given a uid value.  By default always
returns C<undef>.

=head2 archive_read_extract

 my $status = archive_read_extract($archive, $entry, $flags);

A convenience function that wraps the corresponding archive_write_disk interfaces.  The first call to L<archive_read_extract|Archive::Libarchive::XS::Function#archive_read_extract> creates a restore object using L<archive_write_disk_new|Archive::Liba...
L<archive_write_disk_set_standard_lookup|Archive::Libarchive::XS::Function#archive_write_disk_set_standard_lookup>, then transparently invokes L<archive_write_disk_set_options|Archive::Libarchive::XS::Function#archive_write_disk_set_options>, L<archi...

lib/Archive/Libarchive/XS/Function.pod  view on Meta::CPAN


This function returns the number of bytes actually written, or -1 on error.

=head2 archive_write_data_block

 my $count_or_status = archive_write_data_block($archive, $buffer, $offset);

Writes the buffer to the current entry in the given archive
starting at the given offset.

=head2 archive_write_disk_gid

 my $int64 = archive_write_disk_gid($archive, $string, $int64);

Undocumented libarchive function.

=head2 archive_write_disk_new

 my $archive = archive_write_disk_new();

Allocates and initializes a struct archive object suitable for
writing objects to disk.

t/common_entry.t  view on Meta::CPAN

diag $@ if $@;

is eval { archive_entry_strmode($e) }, '-rw-r--r-- ', 'archive_entry_strmode';
diag $@ if $@;

is archive_entry_uid($e), 0, 'archive_entry_uid = 0';
$r = archive_entry_set_uid($e, 101);
is $r, ARCHIVE_OK, 'archive_entry_set_uid';
is archive_entry_uid($e), 101, 'archive_entry_uid = 101';

is eval { archive_entry_gid($e) }, 0, 'archive_entry_gid = 0';
diag $@ if $@;
$r = eval { archive_entry_set_gid($e, 201) };
diag $@ if $@;
is $r, ARCHIVE_OK, 'archive_entry_set_gid';
is eval { archive_entry_gid($e) }, 201, 'archive_entry_gid = 201';
diag $@ if $@;

$r = archive_entry_set_nlink($e, 5);
is $r, ARCHIVE_OK, 'archive_entry_set_nlink';

is eval { archive_entry_nlink($e) }, 5, 'archive_entry_nlink';
diag $@ if $@;

SKIP: {
  skip 'requires archive_entry_dev_is_set', 1 unless Archive::Libarchive::XS->can('archive_entry_dev_is_set');

t/common_match_owner.t  view on Meta::CPAN

  ok archive_match_owner_excluded($m, $e), 'archive_match_owner_excluded (1003)';
  ok archive_match_excluded($m,$e),        'archive_match_excluded (1003)';

  $r = archive_match_free($m);
  is $r, ARCHIVE_OK, 'archive_match_free';

  $r = archive_entry_free($e);
  is $r, ARCHIVE_OK, 'archive_entry_free';
};

subtest gid => sub {
  plan tests => 21;
  my $m = archive_match_new();
  ok $m, 'archive_match_new';

  my $e = archive_entry_new();
  ok $e, 'archive_entry_new';

  $r = archive_match_include_gid($m, 1000);
  is $r, ARCHIVE_OK, 'archive_match_include_gid 1000';

  $r = archive_match_include_gid($m, 1002);
  is $r, ARCHIVE_OK, 'archive_match_include_gid 1002';

  $r = archive_entry_set_gid($e, 0);
  is $r, ARCHIVE_OK, 'archive_entry_set_gid 0';
  ok archive_match_owner_excluded($m, $e), 'archive_match_owner_excluded (0)';
  ok archive_match_excluded($m,$e),        'archive_match_excluded (0)';

  $r = archive_entry_set_gid($e, 1000);
  is $r, ARCHIVE_OK, 'archive_entry_set_gid 1000';
  ok !archive_match_owner_excluded($m, $e), 'archive_match_owner_excluded (1000)';
  ok !archive_match_excluded($m,$e),        'archive_match_excluded (1000)';

  $r = archive_entry_set_gid($e, 1001);
  is $r, ARCHIVE_OK, 'archive_entry_set_gid 1001';
  ok archive_match_owner_excluded($m, $e), 'archive_match_owner_excluded (1001)';
  ok archive_match_excluded($m,$e),        'archive_match_excluded (1001)';

  $r = archive_entry_set_gid($e, 1002);
  is $r, ARCHIVE_OK, 'archive_entry_set_gid 1002';
  ok !archive_match_owner_excluded($m, $e), 'archive_match_owner_excluded (1002)';
  ok !archive_match_excluded($m,$e),        'archive_match_excluded (1002)';

  $r = archive_entry_set_gid($e, 1003);
  is $r, ARCHIVE_OK, 'archive_entry_set_gid 1002';
  ok archive_match_owner_excluded($m, $e), 'archive_match_owner_excluded (1003)';
  ok archive_match_excluded($m,$e),        'archive_match_excluded (1003)';

  $r = archive_match_free($m);
  is $r, ARCHIVE_OK, 'archive_match_free';

  $r = archive_entry_free($e);
  is $r, ARCHIVE_OK, 'archive_entry_free';
};

t/common_stat.t  view on Meta::CPAN

subtest 'archive_entry_stat' => sub {
  plan tests => 10;

  my $entry = archive_entry_new();

  archive_entry_set_dev($entry, 0x1234);
  archive_entry_set_ino($entry, 0x5678);
  archive_entry_set_mode($entry, 0400);
  archive_entry_set_nlink($entry, 1);
  archive_entry_set_uid($entry, 500);
  archive_entry_set_gid($entry, 501);
  archive_entry_set_rdev($entry, 0x1357);
  archive_entry_set_atime($entry, 123456789, 123456789);
  archive_entry_set_mtime($entry, 123456779, 123456779);
  archive_entry_set_ctime($entry, 123456769, 123456769);

  my($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $atime, $mtime, $ctime) = eval { archive_entry_stat($entry) };
  diag $@ if $@;

  is $dev,   0x1234,    'dev';
  is $ino,   0x5678,    'ino';
  is $mode,  0400,      'mode';
  is $nlink, 1,         'nlink';
  is $uid,   500,       'uid';
  is $gid,   501,       'gid';
  is $rdev,  0x1357,    'rdev';
  is $atime, 123456789, 'atime';
  is $mtime, 123456779, 'mtime';
  is $ctime, 123456769, 'ctime';

  archive_entry_free($entry);

};

subtest 'archive_entry_set_stat' => sub {

t/common_stat.t  view on Meta::CPAN

  my $entry = archive_entry_new();

  eval { archive_entry_set_stat($entry,0x1234,0x5678,0400,1,500,501,0x1357,123456789,123456779,123456769) };
  diag $@ if $@;

  my $dev   = archive_entry_dev($entry);
  my $ino   = archive_entry_ino($entry);
  my $mode  = archive_entry_mode($entry);
  my $nlink = archive_entry_nlink($entry);
  my $uid   = archive_entry_uid($entry);
  my $gid   = archive_entry_gid($entry);
  my $rdev  = archive_entry_rdev($entry);
  my $atime = archive_entry_atime($entry);
  my $mtime = archive_entry_mtime($entry);
  my $ctime = archive_entry_ctime($entry);

  is $dev,   0x1234,    'dev';
  is $ino,   0x5678,    'ino';
  is $mode,  0400,      'mode';
  is $nlink, 1,         'nlink';
  is $uid,   500,       'uid';
  is $gid,   501,       'gid';
  is $rdev,  0x1357,    'rdev';
  is $atime, 123456789, 'atime';
  is $mtime, 123456779, 'mtime';
  is $ctime, 123456769, 'ctime';

  archive_entry_free($entry);

};

t/common_uid_gid_lookup.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use Archive::Libarchive::XS qw( :all );

plan skip_all => 'requires archive_write_disk_gid' unless Archive::Libarchive::XS->can('archive_write_disk_gid');
plan tests => 7;

# based on test_write_disk_lookup.c

my $gmagic = 0x13579;
my $umagic = 0x1234;

my $a = archive_write_disk_new();
ok $a, 'archive_write_disk_new';

subtest 'Default uname/gname lookup always return ID.' => sub {
  plan tests => 5;
  is archive_write_disk_gid($a, '', 0), 0, 'gid "",0 = 0';
  is archive_write_disk_gid($a, 'root', 12), 12, 'gid root,12 = 12';
  is archive_write_disk_gid($a, 'wheel', 12), 12, 'gid wheel,12 = 12';
  is archive_write_disk_uid($a, '', 0), 0, 'uid "",0 = 0';
  is archive_write_disk_uid($a, 'root', 18), 18, 'uid root,18 = 18';
};

subtest 'Register some weird lookup functions' => sub {
  plan tests => 1;
  my $r = eval { archive_write_disk_set_group_lookup($a, \$gmagic, \&group_lookup, \&group_cleanup) };
  diag $@ if $@;
  is $r, ARCHIVE_OK, 'archive_write_disk_set_group_lookup';
};

subtest 'Verify that our new function got called.' => sub {
  plan tests => 2;
  is archive_write_disk_gid($a, "FOOGROUP",    8), 73, 'gid FOOGROUP    8 = 73';
  is archive_write_disk_gid($a, "NOTFOOGROUP", 8),  1, 'gid NOTFOOGROUP 8 = 1';
};

subtest 'De-register.' => sub {
  plan tests => 2;
  my $r = eval { archive_write_disk_set_group_lookup($a, undef, undef, undef) };
  diag $@ if $@;
  is $r, ARCHIVE_OK, 'archive_write_disk_set_group_lookup';
  is $gmagic, 0x2468, 'Ensure our cleanup function got called.';
};

t/common_uid_gid_lookup.t  view on Meta::CPAN


sub group_cleanup
{
  my($data) = @_;
  die unless $$data == 0x13579;
  $$data = 0x2468;
}

sub group_lookup
{
  my($data, $name, $gid) = @_;
  die unless $$data == 0x13579;
  return 1 if $name ne 'FOOGROUP';
  return 73;
}

sub user_cleanup
{
  my($data) = @_;
  die unless $$data == 0x1234;
  $$data = 0x2345;

t/common_user_group_lookup.t  view on Meta::CPAN


sub gname_cleanup
{
  my($data) = @_;
  die unless $$data == 0x13579;
  $$data = 0x2468;
}

sub gname_lookup
{
  my($data, $gid) = @_;
  return "FOOGROUP" if $gid == 1;
  return "NOTFOOGROUP";
}

sub uname_cleanup
{
  my($data) = @_;
  die unless $$data == 0x1234;
  $$data = 0x2345;
}

xs/ppport.h  view on Meta::CPAN

get_c_backtrace_dump|5.021001||V
get_context|5.006000|5.006000|nu
getc_unlocked|5.003007||Viu
get_cv|5.006000|5.003007|p
get_cvn_flags|5.009005|5.003007|p
get_cvs|5.011000|5.003007|p
getcwd_sv|5.007002|5.007002|
get_db_sub|||iu
get_debug_opts|5.008001||Viu
get_deprecated_property_msg|5.031010||cVniu
getegid|5.005000||Viu
getenv|5.005000||Viu
getenv_len|5.006000||Viu
geteuid|5.005000||Viu
getgid|5.005000||Viu
getgrent|5.009000||Viu
GETGRENT_R_HAS_BUFFER|5.008000||Viu
GETGRENT_R_HAS_FPTR|5.008000||Viu
GETGRENT_R_HAS_PTR|5.008000||Viu
GETGRENT_R_PROTO|5.008000|5.008000|Vn
getgrgid|5.009000||Viu
GETGRGID_R_HAS_BUFFER|5.008000||Viu
GETGRGID_R_HAS_PTR|5.008000||Viu
GETGRGID_R_PROTO|5.008000|5.008000|Vn
getgrnam|5.009000||Viu
GETGRNAM_R_HAS_BUFFER|5.008000||Viu
GETGRNAM_R_HAS_PTR|5.008000||Viu
GETGRNAM_R_PROTO|5.008000|5.008000|Vn
get_hash_seed|5.008001||Viu
gethostbyaddr|5.005000||Viu
GETHOSTBYADDR_R_HAS_BUFFER|5.008000||Viu

xs/ppport.h  view on Meta::CPAN

KEY_fileno|5.003007||Viu
KEY_flock|5.003007||Viu
KEY_for|5.003007||Viu
KEY_foreach|5.003007||Viu
KEY_fork|5.003007||Viu
KEY_format|5.003007||Viu
KEY_formline|5.003007||Viu
KEY_ge|5.003007||Viu
KEY_getc|5.003007||Viu
KEY_getgrent|5.003007||Viu
KEY_getgrgid|5.003007||Viu
KEY_getgrnam|5.003007||Viu
KEY_gethostbyaddr|5.003007||Viu
KEY_gethostbyname|5.003007||Viu
KEY_gethostent|5.003007||Viu
KEY_getlogin|5.003007||Viu
KEY_getnetbyaddr|5.003007||Viu
KEY_getnetbyname|5.003007||Viu
KEY_getnetent|5.003007||Viu
KEY_getpeername|5.003007||Viu
KEY_getpgrp|5.003007||Viu

xs/ppport.h  view on Meta::CPAN

Perl_pp_ftdir|5.013009||Viu
Perl_pp_fteexec|5.013009||Viu
Perl_pp_fteowned|5.013009||Viu
Perl_pp_fteread|5.013009||Viu
Perl_pp_ftewrite|5.013009||Viu
Perl_pp_ftfile|5.013009||Viu
Perl_pp_ftmtime|5.013009||Viu
Perl_pp_ftpipe|5.013009||Viu
Perl_pp_ftrexec|5.013009||Viu
Perl_pp_ftrwrite|5.013009||Viu
Perl_pp_ftsgid|5.013009||Viu
Perl_pp_ftsize|5.013009||Viu
Perl_pp_ftsock|5.013009||Viu
Perl_pp_ftsuid|5.013009||Viu
Perl_pp_ftsvtx|5.013009||Viu
Perl_pp_ftzero|5.013009||Viu
Perl_pp_getpeername|5.013009||Viu
Perl_pp_getsockname|5.013009||Viu
Perl_pp_ggrgid|5.013009||Viu
Perl_pp_ggrnam|5.013009||Viu
Perl_pp_ghbyaddr|5.013009||Viu
Perl_pp_ghbyname|5.013009||Viu
Perl_pp_gnbyaddr|5.013009||Viu
Perl_pp_gnbyname|5.013009||Viu
Perl_pp_gpbyname|5.013009||Viu
Perl_pp_gpbynumber|5.013009||Viu
Perl_pp_gpwnam|5.013009||Viu
Perl_pp_gpwuid|5.013009||Viu
Perl_pp_gsbyname|5.013009||Viu

xs/ppport.h  view on Meta::CPAN

PERL_PRIgldbl|5.006000|5.006000|Vn
PerlProc_abort|5.005000||Viu
PerlProc_crypt|5.005000||Viu
PerlProc_DynaLoad|5.006000||Viu
PerlProc_execl|5.005000||Viu
PerlProc_execv|5.005000||Viu
PerlProc_execvp|5.005000||Viu
PerlProc__exit|5.005000||Viu
PerlProc_exit|5.005000||Viu
PerlProc_fork|5.006000||Viu
PerlProc_getegid|5.005000||Viu
PerlProc_geteuid|5.005000||Viu
PerlProc_getgid|5.005000||Viu
PerlProc_getlogin|5.005000||Viu
PerlProc_GetOSError|5.006000||Viu
PerlProc_getpid|5.006000||Viu
PerlProc_gettimeofday|5.008000||Viu
PerlProc_getuid|5.005000||Viu
PerlProc_kill|5.005000||Viu
PerlProc_killpg|5.005000||Viu
PerlProc_lasthost|5.007001||Viu
PerlProc_longjmp|5.005000||Viu
PerlProc_pause|5.005000||Viu
PerlProc_pclose|5.005000||Viu
PerlProc_pipe|5.005000||Viu
PerlProc_pipe_cloexec|5.027008||Viu
PerlProc_popen|5.005000||Viu
PerlProc_popen_list|5.007001||Viu
PerlProc_setgid|5.005000||Viu
PerlProc_setjmp|5.005000||Viu
PerlProc_setuid|5.005000||Viu
PerlProc_signal|5.005000||Viu
PerlProc_sleep|5.005000||Viu
PerlProc_spawnvp|5.008000||Viu
PerlProc_times|5.005000||Viu
PerlProc_wait|5.005000||Viu
PerlProc_waitpid|5.005000||Viu
perl_pthread_mutex_lock|5.023006||Viu
perl_pthread_mutex_unlock|5.023006||Viu

xs/ppport.h  view on Meta::CPAN

PL_DBtrace|5.005000|5.003007|poV
PL_DBtrace_iv|5.021005||Viu
PL_debstash|5.005000|5.003007|poVnu
PL_debug|5.005000||Viu
PL_debug_pad|5.007003||Viu
PL_defgv|5.004005|5.003007|p
PL_def_layerlist|5.007003||Viu
PL_defoutgv|5.005000||Viu
PL_defstash|5.005000||Viu
PL_delaymagic|5.005000||Viu
PL_delaymagic_egid|5.015008||Viu
PL_delaymagic_euid|5.015008||Viu
PL_delaymagic_gid|5.015008||Viu
PL_delaymagic_uid|5.015008||Viu
PL_destroyhook|5.010000||Viu
PL_diehook|5.005000|5.003007|poVnu
PL_Dir|5.006000||Viu
PL_dirty|5.005000|5.003007|poVnu
PL_doswitches|5.005000||Viu
PL_dowarn|5.005000|5.003007|poV
PL_dumper_fd|5.009003||Viu
PL_dumpindent|5.006000||Viu
PL_dump_re_max_len|5.023008||Viu

xs/ppport.h  view on Meta::CPAN

setbuf|5.003007||Viu
set_caret_X|5.019006||Viu
set_context|5.006000|5.006000|nu
setdefout|5.003007|5.003007|
SETERRNO|5.003007||Vi
setfd_cloexec|5.027008||Vniu
setfd_cloexec_for_nonsysfd|5.027008||Viu
setfd_cloexec_or_inhexec_by_sysfdness|5.027008||Viu
setfd_inhexec|5.027008||Vniu
setfd_inhexec_for_sysfd|5.027008||Viu
setgid|5.005000||Viu
setgrent|5.009000||Viu
SETGRENT_R_HAS_FPTR|5.008000||Viu
SETGRENT_R_PROTO|5.008000|5.008000|Vn
sethostent|5.005000||Viu
SETHOSTENT_R_PROTO|5.008000|5.008000|Vn
SETi|5.003007||Viu
setjmp|5.005000||Viu
setlinebuf|5.005000||Viu
setlocale|5.009000||Viu
setlocale_debug_string|5.027002||Vniu

xs/ppport.h  view on Meta::CPAN

SET_NUMERIC_UNDERLYING|5.021010||Viu
set_numeric_underlying|5.027006||cViu
SETp|5.003007||Viu
set_padlist|5.021006||cVniu
setprotoent|5.005000||Viu
SETPROTOENT_R_PROTO|5.008000|5.008000|Vn
setpwent|5.009000||Viu
SETPWENT_R_HAS_FPTR|5.008000||Viu
SETPWENT_R_PROTO|5.008000|5.008000|Vn
set_regex_pv|5.029004||Viu
setregid|5.003007||Viu
setreuid|5.003007||Viu
SETs|5.003007||Viu
setservent|5.005000||Viu
SETSERVENT_R_PROTO|5.008000|5.008000|Vn
setsockopt|5.005000||Viu
setSTR_LEN|5.031005||Viu
SET_SVANY_FOR_BODYLESS_IV|5.023008||Viu
SET_SVANY_FOR_BODYLESS_NV|5.023008||Viu
SETTARG|5.003007||Viu
SET_THR|5.005000||Viu

xs/ppport.h  view on Meta::CPAN

SvRV_set|5.009003|5.003007|p
sv_rvunweaken|5.027004|5.027004|
sv_rvweaken|5.006000|5.006000|
SvRVx|5.003007||Viu
SvRX|5.009005|5.003007|p
SvRXOK|5.009005|5.003007|p
SV_SAVED_COPY|5.009005||Viu
SvSCREAM|5.003007||Viu
SvSCREAM_off|5.003007||Viu
SvSCREAM_on|5.003007||Viu
sv_setgid|5.019001||Viu
sv_sethek|5.015004||cViu
sv_setiv|5.003007|5.003007|
sv_setiv_mg|5.004005|5.003007|p
SvSETMAGIC|5.003007|5.003007|
SvSetMagicSV|5.004000|5.004000|
SvSetMagicSV_nosteal|5.004000|5.004000|
sv_setnv|5.006000|5.003007|
sv_setnv_mg|5.006000|5.003007|p
sv_setpv|5.003007|5.003007|
sv_setpv_bufsize|5.025006|5.025006|



( run in 1.019 second using v1.01-cache-2.11-cpan-ceb78f64989 )